iron-fish / ironfish

A novel cryptocurrency focused on privacy and accessibility.
https://ironfish.network
Mozilla Public License 2.0
964 stars 579 forks source link

Add lint rule to not use Promise.race #5103

Closed dguenther closed 3 days ago

dguenther commented 3 days ago

Summary

@andiflabs did some great investigation to discover that Promise.race leaks memory, and the TL;DR is it'll be easiest to generally avoid using Promise.race. I added a lint rule to catch uses of this in the future, and added workarounds for our current use.

Testing Plan

Run status -f and watch the memory usage while rescanning to observe it doesn't rapidly increase.

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API Reference)? If yes, link a related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes