Bellatrix sync changes#10097
Conversation
| // [REJECT] The block's execution payload timestamp is correct with respect to the slot -- | ||
| // i.e. execution_payload.timestamp == compute_timestamp_at_slot(state, block.slot). | ||
| func validateBellatrixBeaconBlock(parentState state.BeaconState, blk block.BeaconBlock) error { | ||
| if parentState.Version() != version.Bellatrix || blk.Version() != version.Bellatrix { |
There was a problem hiding this comment.
This doesn't look correct, how will gossip handle the first bellatrix block ? The parent state will be an altair state, so this block will skip all the relevant execution payload checks.
Also this will allow a non bellatrix block that references a bellatrix parent state to be valid. It won't return an error and is passed on towards the subscriber.
There was a problem hiding this comment.
The parent state will be an altair state, so this block will skip all the relevant execution payload checks.
I don't think this is true. The parent state should already be upgraded to Bellatrix state via:
if features.Get().EnableNextSlotStateCache {
parentState, err = transition.ProcessSlotsUsingNextSlotCache(ctx, parentState, blk.Block().ParentRoot(), blk.Block().Slot())
if err != nil {
return err
}
} else {
parentState, err = transition.ProcessSlots(ctx, parentState, blk.Block().Slot())
if err != nil {
return err
}
}this will allow a non bellatrix block that references a bellatrix parent state to be valid. It won't return an error and is passed on towards the subscriber.
true, although unlikely, we certainly can add checks around it
| return wrapper.WrappedPhase0SignedBeaconBlock(t), nil | ||
| case *ethpb.SignedBeaconBlockAltair: | ||
| return wrapper.WrappedAltairSignedBeaconBlock(t) | ||
| case *ethpb.SignedBeaconBlockMerge: |
There was a problem hiding this comment.
SignedBeaconBlockBellatrix ?
|
LGTM |
Review and merge #10072 first
This PR adds the Bellatrix condition to p2p gossipsub:
https://github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/p2p-interface.md