Skip to content

Commit 9462f05

Browse files
authored
eth/catalyst: Check that extraData is empty in newPayload pre-Holocene (#492)
1 parent 06f3281 commit 9462f05

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

eth/catalyst/api.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,11 +871,15 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
871871
// Hence, we use a lock here, to be sure that the previous call has finished before we
872872
// check whether we already have the block locally.
873873

874-
// Payload must have eip-1559 params in ExtraData after Holocene
875-
if api.eth.BlockChain().Config().IsHolocene(params.Timestamp) {
874+
// OP-Stack diff: payload must have empty extraData before Holocene and hold eip-1559 params after Holocene.
875+
if cfg := api.eth.BlockChain().Config(); cfg.IsHolocene(params.Timestamp) {
876876
if err := eip1559.ValidateHoloceneExtraData(params.ExtraData); err != nil {
877877
return api.invalid(err, nil), nil
878878
}
879+
} else if cfg.IsOptimism() {
880+
if len(params.ExtraData) > 0 {
881+
return api.invalid(errors.New("extraData must be empty before Holocene"), nil), nil
882+
}
879883
}
880884

881885
api.newPayloadLock.Lock()

0 commit comments

Comments
 (0)