-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Epoch boundary cache to retrieve balances #12083
Use Epoch boundary cache to retrieve balances #12083
Conversation
db1d346
to
01aa9d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some rationale to this. Given fork choice store needs the balances for the justified checkpoint. Prysm uses StateByRoot
and we want the state to be in the epoch boundary cache as often as we can for a better hit ratio.
This PR accomplishes the following
- uses epoch boundary cache inStateByRoot
- saves the states on batches before sending them to fork choices store
if err := s.cfg.StateGen.SaveState(ctx, r, st); err != nil { | ||
return err | ||
} | ||
} | ||
// Also saves the last post state which to be used as pre state for the next batch. | ||
lastB := blks[len(blks)-1] | ||
if err := s.cfg.StateGen.SaveState(ctx, lastBR, preState); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can shift this up too
* Use Epoch boundary cache to retrieve balances * save boundary states before inserting to forkchoice * move up last block save * remove boundary checks on balances * fix ordering --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Use Epoch boundary cache to retrieve balances * save boundary states before inserting to forkchoice * move up last block save * remove boundary checks on balances * fix ordering --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Use Epoch boundary cache to retrieve balances * save boundary states before inserting to forkchoice * move up last block save * remove boundary checks on balances * fix ordering --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
…12675) * Remove Feature Flag From Prater (#12082) * Use Epoch boundary cache to retrieve balances (#12083) * Use Epoch boundary cache to retrieve balances * save boundary states before inserting to forkchoice * move up last block save * remove boundary checks on balances * fix ordering --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> * create the log file along with its parent directory if not present * only give ReadWritePermissions to the log file * use io/file package to create the parent directories * fix ci related issues * add regression tests * run gazelle * fix tests * remove print statements * gazelle * Remove failing test for MkdirAll, this failure is not expected --------- Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: Potuz <potuz@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Remove Feature Flag From Prater (#12082) * Use Epoch boundary cache to retrieve balances (#12083) * Use Epoch boundary cache to retrieve balances * save boundary states before inserting to forkchoice * move up last block save * remove boundary checks on balances * fix ordering --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> * chore: fix unfound image * fix link --------- Co-authored-by: Nishant Das <nishdas93@gmail.com> Co-authored-by: Potuz <potuz@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com> Co-authored-by: Radosław Kapka <rkapka@wp.pl>
When retrieving balances by Root for forkchoice, use the epoch boundary cache to retrieve the justified checkpoint balances