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

Cleaner bitfields #1019

Closed
wants to merge 7 commits into from
Closed

Cleaner bitfields #1019

wants to merge 7 commits into from

Commits on May 1, 2019

  1. Cleaner bitfields

    This draft PR try to fix a longstanding wart (see #196, #371, #667) regarding bitfields. We define bitfields as lists or vectors of `bool`s, as opposed to `bytes`. Benefits:
    
    * Remove ugly-as-hell helper function `verify_bitfield`
    * No more bit manipulation with `justification_bitfield`
    * Merkleisation-friendly `justification_bitfield` (i.e. `justification_bitfield` does not change unless a new epoch is justified).
    * Easy parametrisation of the number of bits in `justification_bitfield` (can be more or fewer than 64—more may be useful for dApps and light clients)
    * Semantically cleaner typing
    
    This requires a minor SSZ change (Merkleisation not affected) where lists and vectors of `bool`s should be packed, similar to packing of `uintN`. We could alias `bool` to `uint1` so that the packing logic only needs to be defined once for `uintN`.
    JustinDrake committed May 1, 2019
    Configuration menu
    Copy the full SHA
    8e62927 View commit details
    Browse the repository at this point in the history
  2. Update 0_beacon-chain.md

    JustinDrake committed May 1, 2019
    Configuration menu
    Copy the full SHA
    10d38a2 View commit details
    Browse the repository at this point in the history
  3. Update 0_beacon-chain.md

    JustinDrake committed May 1, 2019
    Configuration menu
    Copy the full SHA
    c26983e View commit details
    Browse the repository at this point in the history
  4. Update 0_beacon-chain.md

    JustinDrake committed May 1, 2019
    Configuration menu
    Copy the full SHA
    df8c41d View commit details
    Browse the repository at this point in the history
  5. Update 0_beacon-chain.md

    JustinDrake committed May 1, 2019
    Configuration menu
    Copy the full SHA
    c789a42 View commit details
    Browse the repository at this point in the history
  6. Update 0_beacon-chain.md

    JustinDrake committed May 1, 2019
    Configuration menu
    Copy the full SHA
    a012dcf View commit details
    Browse the repository at this point in the history
  7. Update 0_beacon-chain.md

    JustinDrake committed May 1, 2019
    Configuration menu
    Copy the full SHA
    5d7f9e4 View commit details
    Browse the repository at this point in the history