From e20dc3442bc0fc85a720f61891684a6fb9f197b7 Mon Sep 17 00:00:00 2001 From: corey Date: Wed, 16 Sep 2026 15:39:39 +0800 Subject: [PATCH 1/2] feat: integrate MorphTx v2 into genesis, batch, and node Pin go-ethereum to the MorphTx v2 commit, activate morphTxV2Time in devnet genesis, and keep v2 envelopes intact through batch decode and derivation so empty authorization lists remain on the wire. Co-authored-by: Cursor --- Makefile | 4 +- bindings/go.mod | 2 +- bindings/go.sum | 4 +- common/batch/blob.go | 9 ++- common/batch/blob_test.go | 57 ++++++++++++++++++ common/go.mod | 2 +- common/go.sum | 4 +- contracts/go.mod | 2 +- contracts/go.sum | 4 +- go-ethereum | 2 +- go.work.sum | 2 + node/derivation/batch_info_test.go | 59 +++++++++++++++++++ node/go.mod | 4 +- node/go.sum | 4 +- .../deploy-config/devnet-deploy-config.json | 1 + ops/l2-genesis/go.mod | 2 +- ops/l2-genesis/go.sum | 4 +- .../morph-chain-ops/genesis/config.go | 7 ++- .../morph-chain-ops/genesis/genesis.go | 6 ++ .../morph-chain-ops/genesis/layer_two_test.go | 4 ++ ops/tools/go.mod | 2 +- ops/tools/go.sum | 4 +- token-price-oracle/go.mod | 2 +- token-price-oracle/go.sum | 4 +- tx-submitter/go.mod | 2 +- tx-submitter/go.sum | 4 +- 26 files changed, 167 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index baa590a39..3a0306c27 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################## update dependencies #################### -ETHEREUM_SUBMODULE_COMMIT_OR_TAG := 4012f174b967153a31926f370d77af389b2968c8 -ETHEREUM_TARGET_VERSION := v1.10.14-0.20260908092055-4012f174b967 +ETHEREUM_SUBMODULE_COMMIT_OR_TAG := 2548caac16b2d5a2021a6eba0aa23d7506230439 +ETHEREUM_TARGET_VERSION := v1.10.14-0.20260916065048-2548caac16b2 TENDERMINT_TARGET_VERSION := v0.3.10-0.20260916055518-560fb469b16d diff --git a/bindings/go.mod b/bindings/go.mod index e5751d4a4..d1a206383 100644 --- a/bindings/go.mod +++ b/bindings/go.mod @@ -4,7 +4,7 @@ go 1.24.0 replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.10-0.20260916055518-560fb469b16d -require github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 +require github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 require ( github.com/VictoriaMetrics/fastcache v1.12.2 // indirect diff --git a/bindings/go.sum b/bindings/go.sum index 4b0fb2573..4c26939b3 100644 --- a/bindings/go.sum +++ b/bindings/go.sum @@ -109,8 +109,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= diff --git a/common/batch/blob.go b/common/batch/blob.go index 74d977341..0ab2ce1e4 100644 --- a/common/batch/blob.go +++ b/common/batch/blob.go @@ -188,9 +188,12 @@ func decodeTypedTx(typeByte byte, reader io.Reader) (*eth.Transaction, error) { } // decodeMorphTx decodes a MorphTx from the reader. The type byte (0x7f) has already -// been consumed. MorphTx has two wire formats: -// - V0: type(0x7f) || RLP(fields) — next byte is RLP prefix (>= 0xC0) -// - V1: type(0x7f) || version(0x01) || RLP(fields) — next byte is version, then RLP prefix +// been consumed. MorphTx has two envelope forms: +// - V0: type(0x7f) || RLP(fields) — next byte is RLP prefix (>= 0xC0) +// - V1+: type(0x7f) || version(0x01, 0x02, ...) || RLP(fields) +// +// The batch layer preserves the version byte and delegates version-specific +// field decoding to core/types.Transaction. func decodeMorphTx(reader io.Reader) (*eth.Transaction, error) { var nextByte byte if err := binary.Read(reader, binary.BigEndian, &nextByte); err != nil { diff --git a/common/batch/blob_test.go b/common/batch/blob_test.go index 31ada97ed..d0333e612 100644 --- a/common/batch/blob_test.go +++ b/common/batch/blob_test.go @@ -2,8 +2,12 @@ package batch import ( "bytes" + "math/big" "testing" + "github.com/holiman/uint256" + "github.com/morph-l2/go-ethereum/common" + eth "github.com/morph-l2/go-ethereum/core/types" "github.com/stretchr/testify/require" ) @@ -23,3 +27,56 @@ func TestExtractInnerTxFullBytesAcceptsAvailablePayload(t *testing.T) { require.NoError(t, err) require.Equal(t, []byte{0xf8, 3, 1, 2, 3}, got) } + +func TestMorphTxV2BatchRoundTrip(t *testing.T) { + to := common.HexToAddress("0x1234") + tests := []struct { + name string + authList []eth.SetCodeAuthorization + }{ + {name: "empty authorization list", authList: []eth.SetCodeAuthorization{}}, + { + name: "non-empty authorization list", + authList: []eth.SetCodeAuthorization{{ + ChainID: *uint256.NewInt(53077), + Address: common.HexToAddress("0x5678"), + Nonce: 7, + V: 1, + R: *uint256.NewInt(2), + S: *uint256.NewInt(3), + }}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tx := eth.NewTx(ð.MorphTx{ + ChainID: big.NewInt(53077), + Nonce: 1, + GasTipCap: big.NewInt(1), + GasFeeCap: big.NewInt(2), + Gas: 100000, + To: &to, + Value: new(big.Int), + FeeTokenID: 1, + FeeLimit: big.NewInt(1000), + Version: eth.MorphTxVersion2, + AuthList: tt.authList, + V: new(big.Int), + R: new(big.Int).Lsh(big.NewInt(1), 255), + S: new(big.Int).Lsh(big.NewInt(1), 254), + }) + encoded, err := tx.MarshalBinary() + require.NoError(t, err) + require.Equal(t, []byte{eth.MorphTxType, eth.MorphTxVersion2}, encoded[:2]) + + decoded, err := DecodeTxsFromBytes(encoded) + require.NoError(t, err) + require.Len(t, decoded, 1) + require.Equal(t, tx.Hash(), decoded[0].Hash()) + reencoded, err := decoded[0].MarshalBinary() + require.NoError(t, err) + require.Equal(t, encoded, reencoded) + require.Equal(t, len(tt.authList), len(decoded[0].AsMorphTx().AuthList)) + }) + } +} diff --git a/common/go.mod b/common/go.mod index ab44dd85f..42e0b31e1 100644 --- a/common/go.mod +++ b/common/go.mod @@ -6,7 +6,7 @@ replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3. require ( github.com/holiman/uint256 v1.2.4 - github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 + github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 github.com/morph-l2/morph-da-codec/bindings/codec v0.0.0-20260727095527-681727561e38 github.com/stretchr/testify v1.10.0 github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a diff --git a/common/go.sum b/common/go.sum index 4c0a02f8e..02d67a267 100644 --- a/common/go.sum +++ b/common/go.sum @@ -148,8 +148,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/morph-l2/morph-da-codec/bindings/codec v0.0.0-20260727095527-681727561e38 h1:2OIgRP51TPMlpw9E82toxu/SQzN1hlYcxpJKC9jB0cs= github.com/morph-l2/morph-da-codec/bindings/codec v0.0.0-20260727095527-681727561e38/go.mod h1:f6+BHrrHbRmEYplC1nmNjGdatQtMSa2CIK7CX8T1Nfc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/contracts/go.mod b/contracts/go.mod index 3d3da7cce..e6580685e 100644 --- a/contracts/go.mod +++ b/contracts/go.mod @@ -6,7 +6,7 @@ replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3. require ( github.com/iden3/go-iden3-crypto v0.0.16 - github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 + github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 github.com/stretchr/testify v1.10.0 ) diff --git a/contracts/go.sum b/contracts/go.sum index 8a0917f3c..b62400348 100644 --- a/contracts/go.sum +++ b/contracts/go.sum @@ -136,8 +136,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= diff --git a/go-ethereum b/go-ethereum index 4012f174b..2548caac1 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 4012f174b967153a31926f370d77af389b2968c8 +Subproject commit 2548caac16b2d5a2021a6eba0aa23d7506230439 diff --git a/go.work.sum b/go.work.sum index feb69c4bf..22d274257 100644 --- a/go.work.sum +++ b/go.work.sum @@ -991,6 +991,8 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P github.com/morph-l2/go-ethereum v0.0.0-20260529141627-eb5fbf8f9748 h1:xxYv3ZbhCsdtgwC81wU3eRm0xNrc2oTx7PGYLPY92xU= github.com/morph-l2/go-ethereum v0.0.0-20260529141627-eb5fbf8f9748/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/morph-l2/go-ethereum v1.10.14-0.20251125061742-69718a9dcab9/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/morph-l2/tendermint v0.0.0-20260529095305-b1b3a3a1d806 h1:gJmofzJ0PnCCObETUH02AsSVS1YY4tLpUWYFhEggCmk= github.com/morph-l2/tendermint v0.0.0-20260529095305-b1b3a3a1d806/go.mod h1:qpiwqfcCB89dBYfqVJOc/HjGxDp3OdDlthgttJJYyRs= github.com/morph-l2/tendermint v0.3.4/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= diff --git a/node/derivation/batch_info_test.go b/node/derivation/batch_info_test.go index 38e9eec82..bbac303cf 100644 --- a/node/derivation/batch_info_test.go +++ b/node/derivation/batch_info_test.go @@ -6,6 +6,7 @@ import ( "math/big" "testing" + "github.com/holiman/uint256" "github.com/morph-l2/go-ethereum/common" eth "github.com/morph-l2/go-ethereum/core/types" "github.com/morph-l2/go-ethereum/crypto/kzg4844" @@ -48,6 +49,64 @@ func buildV1ParentHeader(parentIndex, nextStartBlock uint64) []byte { }.Bytes() } +func TestParseBatchPreservesMorphTxV2(t *testing.T) { + const startBlock = uint64(1000) + to := common.HexToAddress("0x1234") + tx := eth.NewTx(ð.MorphTx{ + ChainID: big.NewInt(53077), + Nonce: 1, + GasTipCap: big.NewInt(1), + GasFeeCap: big.NewInt(2), + Gas: 100000, + To: &to, + Value: new(big.Int), + FeeTokenID: 1, + FeeLimit: big.NewInt(1000), + Version: eth.MorphTxVersion2, + AuthList: []eth.SetCodeAuthorization{{ + ChainID: *uint256.NewInt(53077), + Address: common.HexToAddress("0x5678"), + Nonce: 7, + V: 1, + R: *uint256.NewInt(2), + S: *uint256.NewInt(3), + }}, + V: new(big.Int), + R: new(big.Int).Lsh(big.NewInt(1), 255), + S: new(big.Int).Lsh(big.NewInt(1), 254), + }) + txBytes, err := tx.MarshalBinary() + require.NoError(t, err) + blockContext := (&types.WrappedBlock{ + Number: startBlock, + Timestamp: 1_700_000_000, + BaseFee: big.NewInt(1_000_000_000), + GasLimit: 30_000_000, + }).BlockContextBytes(1, 0) + payload := append(blockContext, txBytes...) + compressed, err := zstd.CompressBatchBytes(payload) + require.NoError(t, err) + blobs := splitCompressedIntoBlobs(t, compressed) + + batch := geth.RPCRollupBatch{ + Version: 2, + ParentBatchHeader: buildV1ParentHeader(99, startBlock), + LastBlockNumber: startBlock, + Sidecar: eth.BlobTxSidecar{Blobs: blobs}, + } + var bi BatchInfo + require.NoError(t, bi.ParseBatch(batch)) + require.Len(t, bi.blockContexts, 1) + require.Len(t, bi.blockContexts[0].SafeL2Data.Transactions, 1) + require.Equal(t, txBytes, bi.blockContexts[0].SafeL2Data.Transactions[0]) + + var decoded eth.Transaction + require.NoError(t, decoded.UnmarshalBinary(bi.blockContexts[0].SafeL2Data.Transactions[0])) + require.Equal(t, uint8(eth.MorphTxType), decoded.Type()) + require.Equal(t, uint8(eth.MorphTxVersion2), decoded.Version()) + require.Len(t, decoded.SetCodeAuthorizations(), 1) +} + // splitCompressedIntoBlobs mirrors the tx-submitter strategy of compressing // the entire payload as a single zstd stream and then slicing the compressed // bytes into MaxBlobBytesSize chunks, each packed into a canonical blob. diff --git a/node/go.mod b/node/go.mod index c0e8107b4..9c01d8089 100644 --- a/node/go.mod +++ b/node/go.mod @@ -12,8 +12,9 @@ require ( github.com/hashicorp/golang-lru v1.0.2 github.com/hashicorp/raft v1.7.3 github.com/hashicorp/raft-boltdb/v2 v2.3.1 + github.com/holiman/uint256 v1.2.4 github.com/mdlayher/vsock v1.2.1 - github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 + github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.17.0 github.com/spf13/viper v1.13.0 @@ -73,7 +74,6 @@ require ( github.com/hashicorp/go-uuid v1.0.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.4 // indirect github.com/huin/goupnp v1.3.0 // indirect github.com/iden3/go-iden3-crypto v0.0.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/node/go.sum b/node/go.sum index a607b5d06..080b04f66 100644 --- a/node/go.sum +++ b/node/go.sum @@ -414,8 +414,8 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/morph-l2/tendermint v0.3.10-0.20260916055518-560fb469b16d h1:7vfVAK5eeHgdLxXG/1hMJLvgvE5QiYIfRA2nNYj6jPU= github.com/morph-l2/tendermint v0.3.10-0.20260916055518-560fb469b16d/go.mod h1:qpiwqfcCB89dBYfqVJOc/HjGxDp3OdDlthgttJJYyRs= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/ops/l2-genesis/deploy-config/devnet-deploy-config.json b/ops/l2-genesis/deploy-config/devnet-deploy-config.json index 9a16a5369..9056faaeb 100644 --- a/ops/l2-genesis/deploy-config/devnet-deploy-config.json +++ b/ops/l2-genesis/deploy-config/devnet-deploy-config.json @@ -29,6 +29,7 @@ "morph203Time": 0, "viridianTime": 0, "emeraldTime": 0, + "morphTxV2Time": 0, "l2StakingSequencerMaxSize": 4, "l2StakingUnDelegatedLockEpochs": 2, "l2StakingRewardStartTime": 1728000000, diff --git a/ops/l2-genesis/go.mod b/ops/l2-genesis/go.mod index 02a705444..0e929d49a 100644 --- a/ops/l2-genesis/go.mod +++ b/ops/l2-genesis/go.mod @@ -6,7 +6,7 @@ replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3. require ( github.com/holiman/uint256 v1.2.4 - github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 + github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 github.com/stretchr/testify v1.10.0 github.com/urfave/cli v1.22.17 ) diff --git a/ops/l2-genesis/go.sum b/ops/l2-genesis/go.sum index 6d3f57e8c..635fb2a8d 100644 --- a/ops/l2-genesis/go.sum +++ b/ops/l2-genesis/go.sum @@ -139,8 +139,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= diff --git a/ops/l2-genesis/morph-chain-ops/genesis/config.go b/ops/l2-genesis/morph-chain-ops/genesis/config.go index a87f38c04..dfe20bf53 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/config.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/config.go @@ -127,9 +127,10 @@ type DeployConfig struct { FundDevAccounts bool `json:"fundDevAccounts"` // Upgrade configs - Morph203Time *uint64 `json:"morph203Time,omitempty"` - ViridianTime *uint64 `json:"viridianTime,omitempty"` - EmeraldTime *uint64 `json:"emeraldTime,omitempty"` + Morph203Time *uint64 `json:"morph203Time,omitempty"` + ViridianTime *uint64 `json:"viridianTime,omitempty"` + EmeraldTime *uint64 `json:"emeraldTime,omitempty"` + MorphTxV2Time *uint64 `json:"morphTxV2Time,omitempty"` } // GetDeployedAddresses will get the deployed addresses of deployed L1 contracts diff --git a/ops/l2-genesis/morph-chain-ops/genesis/genesis.go b/ops/l2-genesis/morph-chain-ops/genesis/genesis.go index 4a5cf3b42..1fcebdb71 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/genesis.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/genesis.go @@ -50,6 +50,11 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro emeraldTime = config.EmeraldTime } + var morphTxV2Time *uint64 + if config.MorphTxV2Time != nil { + morphTxV2Time = config.MorphTxV2Time + } + morphChainConfig := params.ChainConfig{ ChainID: new(big.Int).SetUint64(config.L2ChainID), HomesteadBlock: big.NewInt(0), @@ -73,6 +78,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro Morph203Time: morph203Time, ViridianTime: viridianTime, EmeraldTime: emeraldTime, + MorphTxV2Time: morphTxV2Time, TerminalTotalDifficulty: big.NewInt(0), Morph: params.MorphConfig{ UseZktrie: false, diff --git a/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go b/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go index 4c507f96c..a521aa450 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go @@ -14,6 +14,7 @@ import ( func Test_BuildL2DeveloperGenesis(t *testing.T) { address1 := common.BigToAddress(common.Big1) startTime := uint64((time.Now().Unix()/86400 + 1) * 86400) + morphTxV2Time := uint64(0) config := &DeployConfig{ L1ChainID: 900, L2ChainID: 53077, @@ -69,11 +70,14 @@ func Test_BuildL2DeveloperGenesis(t *testing.T) { //MorphTokenDailyInflationRate: 1, FundDevAccounts: true, + MorphTxV2Time: &morphTxV2Time, } curHeader := &types.Header{} curHeader.BaseFee = new(big.Int).SetUint64(1) l2Genesis, _, err := BuildL2DeveloperGenesis(config, nil, curHeader) require.NoError(t, err) + require.Equal(t, &morphTxV2Time, l2Genesis.Config.MorphTxV2Time) + require.True(t, l2Genesis.Config.IsMorphTxV2(l2Genesis.Timestamp)) l2GenesisBlock := l2Genesis.ToBlock(nil) genesisBatchHeaderBytes, err := GenesisBatchHeader(l2GenesisBlock.Header()) diff --git a/ops/tools/go.mod b/ops/tools/go.mod index bc36026e2..73cfa640a 100644 --- a/ops/tools/go.mod +++ b/ops/tools/go.mod @@ -5,7 +5,7 @@ go 1.24.0 replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.10-0.20260916055518-560fb469b16d require ( - github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 + github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 github.com/tendermint/tendermint v0.35.9 ) diff --git a/ops/tools/go.sum b/ops/tools/go.sum index 6bde6fe22..0fba59abf 100644 --- a/ops/tools/go.sum +++ b/ops/tools/go.sum @@ -161,8 +161,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/morph-l2/tendermint v0.3.10-0.20260916055518-560fb469b16d h1:7vfVAK5eeHgdLxXG/1hMJLvgvE5QiYIfRA2nNYj6jPU= github.com/morph-l2/tendermint v0.3.10-0.20260916055518-560fb469b16d/go.mod h1:qpiwqfcCB89dBYfqVJOc/HjGxDp3OdDlthgttJJYyRs= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/token-price-oracle/go.mod b/token-price-oracle/go.mod index 66cf834a7..10ba61aeb 100644 --- a/token-price-oracle/go.mod +++ b/token-price-oracle/go.mod @@ -8,7 +8,7 @@ replace ( ) require ( - github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 + github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 github.com/morph-l2/remote-signer-client/go v0.0.0-20260312080033-d078d86ddbe9 github.com/prometheus/client_golang v1.17.0 github.com/sirupsen/logrus v1.9.3 diff --git a/token-price-oracle/go.sum b/token-price-oracle/go.sum index e21579afc..be3343fb4 100644 --- a/token-price-oracle/go.sum +++ b/token-price-oracle/go.sum @@ -143,8 +143,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/morph-l2/remote-signer-client/go v0.0.0-20260312080033-d078d86ddbe9 h1:d2nKLUgiEJsQmpSWEiGbsC+sZXQCM4y/3EzyXkoMM60= github.com/morph-l2/remote-signer-client/go v0.0.0-20260312080033-d078d86ddbe9/go.mod h1:slD6GmYEwLHn4Yj/kO8/1QF3iaYlVVAXg2ZnGr8SW/8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/tx-submitter/go.mod b/tx-submitter/go.mod index 57fbe4d7b..5cadfa585 100644 --- a/tx-submitter/go.mod +++ b/tx-submitter/go.mod @@ -9,7 +9,7 @@ require ( github.com/crate-crypto/go-eth-kzg v1.4.0 github.com/holiman/uint256 v1.2.4 github.com/morph-l2/externalsign v0.3.1 - github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 + github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 github.com/prometheus/client_golang v1.17.0 github.com/stretchr/testify v1.10.0 github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a diff --git a/tx-submitter/go.sum b/tx-submitter/go.sum index f96d02b4b..5d9f2d731 100644 --- a/tx-submitter/go.sum +++ b/tx-submitter/go.sum @@ -161,8 +161,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morph-l2/externalsign v0.3.1 h1:UYFDZFB0L85A4rDvuwLNBiGEi0kSmg9AZ2v8Q5O4dQo= github.com/morph-l2/externalsign v0.3.1/go.mod h1:b6NJ4GUiiG/gcSJsp3p8ExsIs4ZdphlrVALASnVoGJE= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967 h1:lgAgQYT34XY/l7+auFRHdqt7HsnCcAMNBGxd5DKiiHw= -github.com/morph-l2/go-ethereum v1.10.14-0.20260908092055-4012f174b967/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2 h1:0+xVWkiRkZc5CX/gxKUuyAjBumopmzVdzv56krs6eoE= +github.com/morph-l2/go-ethereum v1.10.14-0.20260916065048-2548caac16b2/go.mod h1:nkVzHjQWCOjvukQW8ittlwX+Xz9gmVHrP7mUi7zoHTs= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= From 1548dcc177cb88dad7e0427b8c543ef27f7cceb2 Mon Sep 17 00:00:00 2001 From: corey Date: Wed, 16 Sep 2026 16:47:31 +0800 Subject: [PATCH 2/2] fix(derivation): drop redundant uint8 conversion flagged by unconvert Co-authored-by: Cursor --- node/derivation/batch_info_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/derivation/batch_info_test.go b/node/derivation/batch_info_test.go index bbac303cf..e3d4904ed 100644 --- a/node/derivation/batch_info_test.go +++ b/node/derivation/batch_info_test.go @@ -103,7 +103,7 @@ func TestParseBatchPreservesMorphTxV2(t *testing.T) { var decoded eth.Transaction require.NoError(t, decoded.UnmarshalBinary(bi.blockContexts[0].SafeL2Data.Transactions[0])) require.Equal(t, uint8(eth.MorphTxType), decoded.Type()) - require.Equal(t, uint8(eth.MorphTxVersion2), decoded.Version()) + require.Equal(t, eth.MorphTxVersion2, decoded.Version()) require.Len(t, decoded.SetCodeAuthorizations(), 1) }