mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-06 20:13:59 -05:00
**Review after #16033 is merged** **What type of PR is this?** Other **What does this PR do? Why is it needed?** This PR refactors the code to find the corresponding slot of a given block root using state summary or the block itself, into its own function `SlotByBlockRoot(ctx, blockroot)`. Note that there exists a function `slotByBlockRoot(ctx context.Context, tx *bolt.Tx, blockRoot []byte)` immediately below the new function. Also note that this function has two drawbacks, which led to creation of the new function: - the old function requires a boltdb tx, which is not necessarily available to the caller. - the old function does NOT make use of the state summary cache. edit: - the old function also uses the state bucket to retrieve the state and it's slot. this is not something we want in the state diff feature, since there is no state bucket.
101 B
101 B
Ignored
- Refactor finding slot by block root using state summary and block to its own function.