@@ -207,21 +207,21 @@ func (api *ConsensusAPI) verifyPayloadAttributes(attr *engine.PayloadAttributes)
207
207
c := api .eth .BlockChain ().Config ()
208
208
209
209
// Verify withdrawals attribute for Shanghai.
210
- if err := checkAttribute (c .IsShanghai , attr .Withdrawals != nil , attr .Timestamp ); err != nil {
210
+ if err := checkAttribute (c .IsShanghai , attr .Withdrawals != nil , c . LondonBlock , attr .Timestamp ); err != nil {
211
211
return fmt .Errorf ("invalid withdrawals: %w" , err )
212
212
}
213
213
// Verify beacon root attribute for Cancun.
214
- if err := checkAttribute (c .IsCancun , attr .BeaconRoot != nil , attr .Timestamp ); err != nil {
214
+ if err := checkAttribute (c .IsCancun , attr .BeaconRoot != nil , c . LondonBlock , attr .Timestamp ); err != nil {
215
215
return fmt .Errorf ("invalid parent beacon block root: %w" , err )
216
216
}
217
217
return nil
218
218
}
219
219
220
- func checkAttribute (active func (* big.Int , uint64 ) bool , exists bool , time uint64 ) error {
221
- if active (common . Big0 , time ) && ! exists {
220
+ func checkAttribute (active func (* big.Int , uint64 ) bool , exists bool , block * big. Int , time uint64 ) error {
221
+ if active (block , time ) && ! exists {
222
222
return errors .New ("fork active, missing expected attribute" )
223
223
}
224
- if ! active (common . Big0 , time ) && exists {
224
+ if ! active (block , time ) && exists {
225
225
return errors .New ("fork inactive, unexpected attribute set" )
226
226
}
227
227
return nil
0 commit comments