-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mempool): fix off-by-one nonces on commit (#1753)
We assumed nonces in `commit_block` would be the last accepted, but in reality they are the next nonces after the last accepted. In other words, we don't need to increment nonces in `commit_block`, they are already incremented. Style: renamed nonces to `address_to_nonce` for readability, it's a map. Fix: in tests mostly just bumped the nonces before running `commit_block`. `test_commit_block_includes_proposed_txs_subset` was somewhat rewritten, the distribution of nonces was too arbitrary. Now fixed the test to check 3 separate states for accounts during commit, complete rewound, rewound 1 and rewound 2 (perhaps rewind 2 is sufficient?). Co-Authored-By: Gilad Chase <gilad@starkware.com>
- Loading branch information
1 parent
0b906af
commit 0fc3b23
Showing
3 changed files
with
52 additions
and
30 deletions.
There are no files selected for viewing
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