-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: fix algorithm overflow issues (#2173)
## Linked Issues/PRs Closes #2164 Closes #2147 ## Description The main change with this code is "normalizaing" the costs and rewards instead of keeping a total over all time. i.e. every time we receive a DA block, we see if the reward is greater than the costs, or vice versa. If the reward is higher, we set the reward to the difference and set the the last known cost to `0` and adjust the projected cost accordingly. In addition, we were using a random set of types for the algorithm and also used casts in many places. This PR should fix a lot of those problems. Bonus: This fix prompted me to run the optimization again. Since the set is much bigger now, I decided to enable running the simulation in parallel tasks to speed up the code. ## Checklist - [x] New behavior is reflected in tests ### Before requesting review - [x] I have reviewed the code myself --------- Co-authored-by: green <xgreenx9999@gmail.com> Co-authored-by: Aaryamann Challani <43716372+rymnc@users.noreply.github.com>
- Loading branch information
1 parent
ce857cf
commit f308bae
Showing
13 changed files
with
342 additions
and
133 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file modified
BIN
-15 Bytes
(100%)
bin/fuel-core/chainspec/local-testnet/state_transition_bytecode.wasm
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.