Skip to content

Commit fa2307f

Browse files
author
corey
committed
update
1 parent d5f2d8d commit fa2307f

File tree

24 files changed

+253
-67
lines changed

24 files changed

+253
-67
lines changed

bindings/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.0
44

55
replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.2
66

7-
require github.com/morph-l2/go-ethereum v1.10.14-0.20251203083507-49fa27bcab24
7+
require github.com/morph-l2/go-ethereum v1.10.14-0.20251211075654-796834acba86
88

99
require (
1010
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect

bindings/go.sum

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky
111111
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
112112
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
113113
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
114-
github.com/morph-l2/go-ethereum v1.10.14-0.20251203083507-49fa27bcab24 h1:r9eaQDNgjAxsuUchmoCFaAjL1TmUfjAmIlJjAtgUk8U=
115-
github.com/morph-l2/go-ethereum v1.10.14-0.20251203083507-49fa27bcab24/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M=
114+
github.com/morph-l2/go-ethereum v1.10.14-0.20251211075654-796834acba86 h1:4BgRnW5lZcgtVvK/WuDTNAfi5F5/VEb7FbDEvCksPHk=
116115
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
117116
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
118117
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=

contracts/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.
66

77
require (
88
github.com/iden3/go-iden3-crypto v0.0.16
9-
github.com/morph-l2/go-ethereum v1.10.14-0.20251203083507-49fa27bcab24
9+
github.com/morph-l2/go-ethereum v1.10.14-0.20251211075654-796834acba86
1010
github.com/stretchr/testify v1.10.0
1111
)
1212

contracts/go.sum

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky
138138
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
139139
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
140140
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
141-
github.com/morph-l2/go-ethereum v1.10.14-0.20251203083507-49fa27bcab24 h1:r9eaQDNgjAxsuUchmoCFaAjL1TmUfjAmIlJjAtgUk8U=
142-
github.com/morph-l2/go-ethereum v1.10.14-0.20251203083507-49fa27bcab24/go.mod h1:tiFPeidxjoCmLj18ne9H3KQdIGTCvRC30qlef06Fd9M=
141+
github.com/morph-l2/go-ethereum v1.10.14-0.20251211075654-796834acba86 h1:4BgRnW5lZcgtVvK/WuDTNAfi5F5/VEb7FbDEvCksPHk=
143142
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
144143
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
145144
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=

node/core/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ var (
3030
type Config struct {
3131
L2Legacy *types.L2Config `json:"l_2_legacy"`
3232
L2 *types.L2Config `json:"l2"`
33-
MptTime uint64 `json:"mpt_time"`
3433
L2CrossDomainMessengerAddress common.Address `json:"cross_domain_messenger_address"`
3534
SequencerAddress common.Address `json:"sequencer_address"`
3635
GovAddress common.Address `json:"gov_address"`
@@ -130,7 +129,6 @@ func (c *Config) SetCliContext(ctx *cli.Context) error {
130129
c.L2Legacy.EthAddr = l2LegacyEthAddr
131130
c.L2Legacy.EngineAddr = l2LegacyEngineAddr
132131
c.L2Legacy.JwtSecret = secret // same secret
133-
c.MptTime = ctx.GlobalUint64(flags.MptTime.Name)
134132
if ctx.GlobalIsSet(flags.MaxL1MessageNumPerBlock.Name) {
135133
c.MaxL1MessageNumPerBlock = ctx.GlobalUint64(flags.MaxL1MessageNumPerBlock.Name)
136134
if c.MaxL1MessageNumPerBlock == 0 {

node/core/executor.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func NewExecutor(newSyncFunc NewSyncerFunc, config *Config, tmPubKey crypto.PubK
8888
return nil, err
8989
}
9090

91-
l2Client := types.NewRetryableClient(laClient, leClient, aClient, eClient, config.MptTime, config.Logger)
91+
l2Client := types.NewRetryableClient(laClient, leClient, aClient, eClient, config.L2Legacy.EthAddr, config.Logger)
9292
index, err := getNextL1MsgIndex(l2Client)
9393
if err != nil {
9494
return nil, err
@@ -289,10 +289,26 @@ func (e *Executor) DeliverBlock(txs [][]byte, metaData []byte, consensusData l2n
289289
// Even if block was already delivered (e.g., synced via P2P), we still need to check
290290
// if MPT switch should happen, otherwise sentry nodes won't switch to the correct geth.
291291
e.l2Client.EnsureSwitched(context.Background(), wrappedBlock.Timestamp, wrappedBlock.Number)
292-
if e.devSequencer {
293-
return nil, consensusData.ValidatorSet, nil
292+
293+
// After switch, re-check height from the new geth client
294+
// The block might exist in legacy geth but not in target geth after switch
295+
newHeight, err := e.l2Client.BlockNumber(context.Background())
296+
if err != nil {
297+
return nil, nil, err
298+
}
299+
if wrappedBlock.Number > newHeight {
300+
e.logger.Info("block not in target geth after switch, need to deliver",
301+
"block_number", wrappedBlock.Number,
302+
"old_height", height,
303+
"new_height", newHeight)
304+
// Update height and continue to deliver the block
305+
height = newHeight
306+
} else {
307+
if e.devSequencer {
308+
return nil, consensusData.ValidatorSet, nil
309+
}
310+
return e.getParamsAndValsAtHeight(int64(wrappedBlock.Number))
294311
}
295-
return e.getParamsAndValsAtHeight(int64(wrappedBlock.Number))
296312
}
297313

298314
// We only accept the continuous blocks for now.

node/derivation/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ type Config struct {
3535
L1 *types.L1Config `json:"l1"`
3636
L2Legacy *types.L2Config `json:"l2_legacy"`
3737
L2 *types.L2Config `json:"l2"`
38-
MptTime uint64 `json:"mpt_time"`
3938
BeaconRpc string `json:"beacon_rpc"`
4039
RollupContractAddress common.Address `json:"rollup_contract_address"`
4140
StartHeight uint64 `json:"start_height"`
@@ -142,7 +141,6 @@ func (c *Config) SetCliContext(ctx *cli.Context) error {
142141
c.L2Legacy.EthAddr = l2LegacyEthAddr
143142
c.L2Legacy.EngineAddr = l2LegacyEngineAddr
144143
c.L2Legacy.JwtSecret = secret // same secret
145-
c.MptTime = ctx.GlobalUint64(flags.L2LegacyEthAddr.Name)
146144
c.MetricsServerEnable = ctx.GlobalBool(flags.MetricsServerEnable.Name)
147145
c.MetricsHostname = ctx.GlobalString(flags.MetricsHostname.Name)
148146
c.MetricsPort = ctx.GlobalUint64(flags.MetricsPort.Name)

node/derivation/derivation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func NewDerivationClient(ctx context.Context, cfg *Config, syncer *sync.Syncer,
138138
logger: logger,
139139
RollupContractAddress: cfg.RollupContractAddress,
140140
confirmations: cfg.L1.Confirmations,
141-
l2Client: types.NewRetryableClient(laClient, leClient, aClient, eClient, cfg.MptTime, tmlog.NewTMLogger(tmlog.NewSyncWriter(os.Stdout))),
141+
l2Client: types.NewRetryableClient(laClient, leClient, aClient, eClient, cfg.L2Legacy.EthAddr, tmlog.NewTMLogger(tmlog.NewSyncWriter(os.Stdout))),
142142
cancel: cancel,
143143
stop: make(chan struct{}),
144144
startHeight: cfg.StartHeight,

node/flags/flags.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ var (
4040
EnvVar: prefixEnvVar("L2_LEGACY_ENGINE_RPC"),
4141
}
4242

43-
MptTime = cli.Uint64Flag{
44-
Name: "upgrade.mptTime",
45-
Usage: "Batch index at which the sequencers start to upgrade the batch format",
46-
EnvVar: prefixEnvVar("MPT_TIME"),
47-
}
48-
4943
L2EngineJWTSecret = cli.StringFlag{
5044
Name: "l2.jwt-secret",
5145
Usage: "Path to JWT secret key. Keys are 32 bytes, hex encoded in a file. A new key will be generated if left empty.",
@@ -324,7 +318,6 @@ var Flags = []cli.Flag{
324318
L2EngineJWTSecret,
325319
L2LegacyEthAddr,
326320
L2LegacyEngineAddr,
327-
MptTime,
328321
MaxL1MessageNumPerBlock,
329322
L2CrossDomainMessengerContractAddr,
330323
L2SequencerAddr,

0 commit comments

Comments
 (0)