Bump consensus spec to v1.7.0-beta.0 - #17382
Conversation
| return executionPayloadAvail == committeeIndex, nil | ||
| } | ||
|
|
||
| func ParentSlotFromBid(beaconState state.ReadOnlyBeaconState) (primitives.Slot, error) { |
There was a problem hiding this comment.
We are going with the header, this PR needs to change a bit
| } | ||
| f.RecordBlockForEquivocation(roblock.Block().Slot(), roblock.Block().ProposerIndex(), roblock.Root()) | ||
| if features.Get().TrackEquivocations { | ||
| f.RecordBlockForEquivocation(roblock.Block().Slot(), roblock.Block().ProposerIndex(), roblock.Root()) |
There was a problem hiding this comment.
is this the right spot for this check?
maybe i'm missing something but updating some tests seem to fail for early cutoff tests
func TestForkChoice_InsertNode_RecordsFirstSeen(t *testing.T) {
resetFn := features.InitWithReset(&features.Flags{TrackEquivocations: true})
defer resetFn()
slotSecs := time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second
insertAtSlotOne := func(t *testing.T, genesis time.Time) ([][32]byte, [32]byte) {
f := setup(0, 0)
f.SetGenesisTime(genesis)
blockRoot := indexToHash(1)
st, roblock, err := prepareForkchoiceState(t.Context(), 1, blockRoot, params.BeaconConfig().ZeroHash, params.BeaconConfig().ZeroHash, 0, 0)
require.NoError(t, err)
require.NoError(t, f.InsertNode(t.Context(), st, roblock))
key := proposerSlotKey{slot: 1, proposer: roblock.Block().ProposerIndex()}
return f.store.blockRootsBySlotProposer[key], blockRoot
}
t.Run("records block processed early in its slot", func(t *testing.T) {
roots, blockRoot := insertAtSlotOne(t, time.Now().Add(-slotSecs))
require.Equal(t, 1, len(roots))
require.Equal(t, blockRoot, roots[0])
})
t.Run("skips block processed past the early cutoff", func(t *testing.T) {
roots, _ := insertAtSlotOne(t, time.Now().Add(-2*slotSecs+time.Second))
require.Equal(t, 0, len(roots))
})
t.Run("skips block processed after its slot", func(t *testing.T) {
roots, _ := insertAtSlotOne(t, time.Now().Add(-10*slotSecs))
require.Equal(t, 0, len(roots))
})
t.Run("skips recording when tracking is disabled", func(t *testing.T) {
resetFn := features.InitWithReset(&features.Flags{})
defer resetFn()
roots, _ := insertAtSlotOne(t, time.Now().Add(-slotSecs))
require.Equal(t, 0, len(roots))
})
}
There was a problem hiding this comment.
would be good to add a small test for the receivedTime.Before(slotStart)
|
for recordEarlyEquivocation( which i don't think is touched in this pr, should we add the before slotStart check |
also fixed in fabc3c9. |
The alpha.14 parent_execution_payload vectors set latest_execution_payload_bid.slot without latest_block_header.slot, so the header slot only becomes usable here with the alpha.15 vectors (consensus-specs#5554).
|
with ethereum/consensus-specs#5294 |
syjn99
left a comment
There was a problem hiding this comment.
A couple of cosmetic comments (regarding ethspecify..) and all the core changes look good to me.
There was a problem hiding this comment.
I think changes in this file should be reverted with ethereum/consensus-specs#5554
| @@ -448,11 +452,11 @@ func ProcessBlockForStateRoot( | |||
| // # [Modified in Gloas:EIP7732] | |||
| // # Removed `process_execution_payload` | |||
| // # [New in Gloas:EIP7732] | |||
| // process_execution_payload_bid(state, block.body.signed_execution_payload_bid) | |||
| // parent_slot = process_execution_payload_bid(state, block.body.signed_execution_payload_bid) | |||
| // process_randao(state, block.body) | |||
| // process_eth1_data(state, block.body) | |||
| // # [Modified in Gloas:EIP7732] | |||
| // process_operations(state, block.body) | |||
| // process_operations(state, block.body, parent_slot) | |||
| // process_sync_aggregate(state, block.body.sync_aggregate) | |||
| // </spec> | |||
There was a problem hiding this comment.
def process_block(state: BeaconState, block: BeaconBlock) -> None:
# [New in Gloas:EIP7732]
parent_slot = state.latest_block_header.slot
# [New in Gloas:EIP7732]
process_parent_execution_payload(state, block)
process_block_header(state, block)
# [Modified in Gloas:EIP7732]
process_withdrawals(state)
# [Modified in Gloas:EIP7732]
# Removed `process_execution_payload`
# [New in Gloas:EIP7732]
process_execution_payload_bid(state, block.body.signed_execution_payload_bid)
process_randao(state, block.body)
process_eth1_data(state, block.body)
# [Modified in Gloas:EIP7732]
process_operations(state, block.body, parent_slot)
process_sync_aggregate(state, block.body.sync_aggregate)Same comment as above
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
should_apply_proposer_boostfork-choice tests (consensus-specs#5441)PayloadTimelinessCommittee*in ethspecify references (consensus-specs#5558)minimal.tar.gzis not published yet, so the WORKSPACE minimal hash still points at alpha.14 and will be updated once the asset lands