diff --git a/go.mod b/go.mod index 79a8ad9fcc542..bb25b0644b7e8 100644 --- a/go.mod +++ b/go.mod @@ -310,7 +310,7 @@ require ( lukechampine.com/blake3 v1.3.0 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101603.6-rc.1 +replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101604.1-0.20260109132258-733bb5b623f7 // replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index 746881d66211f..df1eebcbd2516 100644 --- a/go.sum +++ b/go.sum @@ -240,8 +240,8 @@ github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.4-0.20251001155152-4eb15ccedf7e h1:iy1vBIzACYUyOVyoADUwvAiq2eOPC0yVsDUdolPwQjk= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.4-0.20251001155152-4eb15ccedf7e/go.mod h1:DYj7+vYJ4cIB7zera9mv4LcAynCL5u4YVfoeUu6Wa+w= -github.com/ethereum-optimism/op-geth v1.101603.6-rc.1 h1:C4MAM29WbeXeNELMLpX1xU6c6OIwBRNposAcl1NHvVk= -github.com/ethereum-optimism/op-geth v1.101603.6-rc.1/go.mod h1:fCNAwDynfAP6EKsmLqwSDUDgi+GtJIir74Ui3fXXMps= +github.com/ethereum-optimism/op-geth v1.101604.1-0.20260109132258-733bb5b623f7 h1:VQM98S1gNqKAFGlsqwr1TvHtYgNPM+RUkSH4ia1TG0c= +github.com/ethereum-optimism/op-geth v1.101604.1-0.20260109132258-733bb5b623f7/go.mod h1:fCNAwDynfAP6EKsmLqwSDUDgi+GtJIir74Ui3fXXMps= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20251121143344-5ac16e0fbb00 h1:TR5Y7B+5m63V0Dno7MHcFqv/XZByQzx/4THV1T1A7+U= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20251121143344-5ac16e0fbb00/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= diff --git a/op-node/rollup/attributes/engine_consolidate_test.go b/op-node/rollup/attributes/engine_consolidate_test.go index 7c57ef3cb6dc9..cc5c0c6522b77 100644 --- a/op-node/rollup/attributes/engine_consolidate_test.go +++ b/op-node/rollup/attributes/engine_consolidate_test.go @@ -214,7 +214,8 @@ func createMismatchedFeeRecipient() matchArgs { func createMismatchedEIP1559Params() matchArgs { args := holoceneArgs() - args.attrs.EIP1559Params[0]++ // so denominator is != 0 + // Create valid but mismatched EIP-1559 params (both denominator and elasticity must be non-zero or both zero) + copy((*args.attrs.EIP1559Params)[:], eip1559.EncodeHolocene1559Params(999, 999)) return args } @@ -575,7 +576,7 @@ func TestCheckEIP1559ParamsMatch(t *testing.T) { desc: "err-both-zero", attrParams: new(eth.Bytes8), blockExtraData: make(eth.BytesMax32, 9), - err: "eip1559 parameters do not match, attributes: 250, 6 (translated from 0,0), block: 0, 0", + err: "invalid block extraData: holocene extraData must encode a non-zero denominator", }, { desc: "err-invalid-params", @@ -609,7 +610,8 @@ func TestCheckEIP1559ParamsMatch(t *testing.T) { HoloceneTime: &pastTime, IsthmusTime: &pastTime, JovianTime: &futureTime, - ChainOpConfig: defaultOpConfig} + ChainOpConfig: defaultOpConfig, + } err := checkExtraDataParamsMatch(cfg, uint64(2), test.attrParams, nil, test.blockExtraData) if test.err == "" { require.NoError(t, err) diff --git a/op-node/rollup/derive/system_config.go b/op-node/rollup/derive/system_config.go index 773a1c6f51772..8e145d144ffae 100644 --- a/op-node/rollup/derive/system_config.go +++ b/op-node/rollup/derive/system_config.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/misc/eip1559" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/hashicorp/go-multierror" @@ -33,8 +34,9 @@ var ( ) var ( - ErrUnknownEventVersion = errors.New("unknown SystemConfig event version") - ErrUnknownEventType = errors.New("unknown SystemConfig event type") + ErrUnknownEventVersion = errors.New("unknown SystemConfig event version") + ErrUnknownEventType = errors.New("unknown SystemConfig event type") + ErrInvalidEIP1559Params = errors.New("invalid EIP-1559 parameters") ) // UpdateSystemConfigWithL1Receipts filters all L1 receipts to find config updates and applies the config updates to the given sysCfg @@ -234,6 +236,10 @@ func parseSystemConfigUpdateEIP1559Params(data []byte) (eth.Bytes32, error) { if !solabi.EmptyReader(reader) { return eth.Bytes32{}, fmt.Errorf("%w: too many bytes", ErrParsingSystemConfig) } + // Validate the EIP-1559 params (last 8 bytes of the 32-byte value) + if err := eip1559.ValidateHolocene1559Params(params[24:32]); err != nil { + return eth.Bytes32{}, fmt.Errorf("%w: %w", ErrInvalidEIP1559Params, err) + } return params, nil } diff --git a/op-node/rollup/derive/system_config_test.go b/op-node/rollup/derive/system_config_test.go index 8317587543a8e..f4c3f2c18b3e8 100644 --- a/op-node/rollup/derive/system_config_test.go +++ b/op-node/rollup/derive/system_config_test.go @@ -214,6 +214,74 @@ func TestProcessSystemConfigUpdateLogEvent(t *testing.T) { }, err: false, }, + { + name: "EIP1559Params_ZeroDenominatorNonZeroElasticity", + log: &types.Log{ + Topics: []common.Hash{ + ConfigUpdateEventABIHash, + ConfigUpdateEventVersion0, + SystemConfigUpdateEIP1559Params, + }, + }, + hook: func(t *testing.T, log *types.Log) *types.Log { + // denominator = 0, elasticity = 1 (invalid combination) + params := []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1} + numberData, err := oneUint256.Pack(new(big.Int).SetBytes(params)) + require.NoError(t, err) + data, err := bytesArgs.Pack(numberData) + require.NoError(t, err) + log.Data = data + return log + }, + config: eth.SystemConfig{}, + err: true, + }, + { + name: "EIP1559Params_NonZeroDenominatorZeroElasticity", + log: &types.Log{ + Topics: []common.Hash{ + ConfigUpdateEventABIHash, + ConfigUpdateEventVersion0, + SystemConfigUpdateEIP1559Params, + }, + }, + hook: func(t *testing.T, log *types.Log) *types.Log { + // denominator = 1, elasticity = 0 (invalid combination) + params := []byte{0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0} + numberData, err := oneUint256.Pack(new(big.Int).SetBytes(params)) + require.NoError(t, err) + data, err := bytesArgs.Pack(numberData) + require.NoError(t, err) + log.Data = data + return log + }, + config: eth.SystemConfig{}, + err: true, + }, + { + name: "EIP1559Params_BothZero", + log: &types.Log{ + Topics: []common.Hash{ + ConfigUpdateEventABIHash, + ConfigUpdateEventVersion0, + SystemConfigUpdateEIP1559Params, + }, + }, + hook: func(t *testing.T, log *types.Log) *types.Log { + // denominator = 0, elasticity = 0 (valid - uses pre-Holocene constants) + params := []byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} + numberData, err := oneUint256.Pack(new(big.Int).SetBytes(params)) + require.NoError(t, err) + data, err := bytesArgs.Pack(numberData) + require.NoError(t, err) + log.Data = data + return log + }, + config: eth.SystemConfig{ + EIP1559Params: eth.Bytes8{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + }, + err: false, + }, { name: "OperatorFeeParams", log: &types.Log{