-
Notifications
You must be signed in to change notification settings - Fork 265
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
add Capella support to Forked* #4276
Conversation
@@ -36,7 +39,7 @@ proc addResolvedHeadBlock( | |||
trustedBlock: ForkyTrustedSignedBeaconBlock, | |||
blockVerified: bool, | |||
parent: BlockRef, cache: var StateCache, | |||
onBlockAdded: OnPhase0BlockAdded | OnAltairBlockAdded | OnBellatrixBlockAdded, | |||
onBlockAdded: OnPhase0BlockAdded | OnAltairBlockAdded | OnBellatrixBlockAdded | OnCapellaBlockAdded, |
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.
time for OnForkyBlockAdded
I think
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.
This isn't something I do routinely now, since nim-lang/Nim#18095 still isn't fixed and it's a gamble each time whether attempting to do so will have been a waste of time, but in this case, bf785d6 seems to work on both Nim 1.2 and Nim 1.6.
@@ -120,6 +124,9 @@ proc loadForkedState*( | |||
# prevent temporaries created by case objects | |||
let forkedState = new ForkedHashedBeaconState | |||
case fork | |||
of BeaconStateFork.Capella: | |||
doAssert capellaImplementationMissing |
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.
cruft
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.
This commit adds the EIP-4844 spec types, and fills in scaffolding/boilerplate for the use of these types across the repo. None of the actual EIP-4844 logic is introduced yet. This follows the pattern used by @tersec when introducing Capella (status-im#4276).
* Types and scaffolding for EIP-4844 This commit adds the EIP-4844 spec types, and fills in scaffolding/boilerplate for the use of these types across the repo. None of the actual EIP-4844 logic is introduced yet. This follows the pattern used by @tersec when introducing Capella (#4276). * use eth2-networks fork * review feedback: add static check EIP4844_FORK_EPOCH == FAR_FUTURE_EPOCH * review feedback: remove EIP4844 from /eth/v1/config/spec response * Cleanup / review feedback * Fix REST test
unstable
branchspec/forks
to its almost Capella-final form, but the rest to stub where feasible, to preserve the no-op aspect in a PR which already in an essentially minimal form adds 500 lines and changes 42 filescapellaImplementationMissing
serves both as agrep
(rg
,ag
, etc) anchor, but also as a compile-time anchor. Once thecapellaImplementationMissing
s in an area of the codebase is complete, and it compiles without it, it implies that the Capella aspects should be done thereraiseAssert $capellaImplementationMissing
to be as visible as possible, because after all,checkForkConsistency()
ensures thatnimbus_beacon_node
can't run yet with a Capella network:nimbus-eth2/beacon_chain/spec/datatypes/base.nim
Lines 955 to 958 in 3ef09ff
However,
beacon_chain/spec/eth2_apis/eth2_rest_serialization
has places where otherwise, this would allow random unauthenticated external input to crash Nimbus at will, obviously suboptimal -- therefore it returns as a more controlled parsing error, but still both greppable and dependent on this symbol that allows compile-time checking. When writing, it stays with theraiseAssert
, because that is under internal control and if that happens, that's a logic error.changes from an error around the unreachable
echo
statement in Nim 1.2 to a warning. Therefore, in several places, for compatibility between Nim 1.2 and 1.6, this PR uses: