Skip to content
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

Historical block/state roots #2428

Closed
wants to merge 11 commits into from

Commits on May 20, 2021

  1. Historical block roots

    This PR simplifies and replaces `historical_roots` with
    `historical_block_roots`.
    
    By keeping an accumulator of historical block roots in the state, it
    becomes possible to validate the entire block history that led up to a
    particular state without executing the transitions.
    
    This is interesting for archival purposes as well as when implementing
    sync protocols that can then proceed to verify chunks of blocks quickly
    - it's also useful as it provides a canonical hash by which such chunks
    of blocks can be named, with a direct reference in the state.
    
    In order not to grow the state size further, the `historical_roots`
    field is removed - the blocks already contain state roots, so the value
    of repeating the state root in the historical accumulator is limited to
    empty slots, and even then, the historical block root accumulator
    differentiates states that differ by empty slots.
    
    This is a sketch of the full PR - there are a few key decisions to make:
    
    * should the historical block roots be backfilled with phase0 data on
    the transition? This simplifies future logic but could be omitted for
    simplicity. It's easy to precalculate what the values should be, so it's
    not a computational issue.
    * should historical roots remain?
    
    As far as naming goes, it's convenient to talk about an "era" being 8192
    epoch = 256k slots ~= 36.4 days.
    arnetheduck committed May 20, 2021
    Configuration menu
    Copy the full SHA
    658e92a View commit details
    Browse the repository at this point in the history

Commits on May 24, 2021

  1. Configuration menu
    Copy the full SHA
    ce928cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d711a79 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bf23f92 View commit details
    Browse the repository at this point in the history
  4. one more constant

    arnetheduck committed May 24, 2021
    Configuration menu
    Copy the full SHA
    a3ff34c View commit details
    Browse the repository at this point in the history
  5. fixup

    arnetheduck committed May 24, 2021
    Configuration menu
    Copy the full SHA
    7854b27 View commit details
    Browse the repository at this point in the history
  6. fixup

    arnetheduck committed May 24, 2021
    Configuration menu
    Copy the full SHA
    6b20da3 View commit details
    Browse the repository at this point in the history
  7. add historical_state_roots

    * enables proving the state for empty slots
    * allows verifying the backfilled fields against the previous
    `historical_roots` field
    * allows trivially computing `historical_roots`, for any existing use
    cases
    arnetheduck committed May 24, 2021
    Configuration menu
    Copy the full SHA
    96dc7f6 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3ea0b90 View commit details
    Browse the repository at this point in the history
  9. fixes

    arnetheduck committed May 24, 2021
    Configuration menu
    Copy the full SHA
    d1b46e2 View commit details
    Browse the repository at this point in the history
  10. return List, not list

    arnetheduck committed May 24, 2021
    Configuration menu
    Copy the full SHA
    67012a2 View commit details
    Browse the repository at this point in the history