Skip to content

Commit 9a9db3d

Browse files
authored
eth/catalyst: fix engine API (#28135)
1 parent 16cd1a7 commit 9a9db3d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

eth/catalyst/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,21 @@ func (api *ConsensusAPI) verifyPayloadAttributes(attr *engine.PayloadAttributes)
207207
c := api.eth.BlockChain().Config()
208208

209209
// 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 {
211211
return fmt.Errorf("invalid withdrawals: %w", err)
212212
}
213213
// 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 {
215215
return fmt.Errorf("invalid parent beacon block root: %w", err)
216216
}
217217
return nil
218218
}
219219

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 {
222222
return errors.New("fork active, missing expected attribute")
223223
}
224-
if !active(common.Big0, time) && exists {
224+
if !active(block, time) && exists {
225225
return errors.New("fork inactive, unexpected attribute set")
226226
}
227227
return nil

0 commit comments

Comments
 (0)