From dc66bddaa395b9945a46881b85e6be24e83a7b89 Mon Sep 17 00:00:00 2001 From: jonastheis <4181434+jonastheis@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:53:17 +0200 Subject: [PATCH 01/17] add flags to disable broadcast and receiving of tx gossip respectively --- cmd/geth/main.go | 2 ++ cmd/geth/usage.go | 2 ++ cmd/utils/flags.go | 18 ++++++++++++++++++ eth/backend.go | 22 ++++++++++++---------- eth/ethconfig/config.go | 3 +++ eth/handler.go | 39 ++++++++++++++++++++++++--------------- eth/handler_eth.go | 3 +++ 7 files changed, 64 insertions(+), 25 deletions(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index c1fbb08746a5..efffc9480ace 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -176,6 +176,8 @@ var ( utils.CircuitCapacityCheckWorkersFlag, utils.RollupVerifyEnabledFlag, utils.ShadowforkPeersFlag, + utils.TxGossipBroadcastDisabledFlag, + utils.TxGossipReceivingDisabledFlag, utils.DASyncEnabledFlag, utils.DABlockNativeAPIEndpointFlag, utils.DABlobScanAPIEndpointFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 1d299d339fe8..60b7e5416b01 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -248,6 +248,8 @@ var AppHelpFlagGroups = []flags.FlagGroup{ utils.DARecoveryProduceBlocksFlag, utils.CircuitCapacityCheckEnabledFlag, utils.CircuitCapacityCheckWorkersFlag, + utils.TxGossipBroadcastDisabledFlag, + utils.TxGossipReceivingDisabledFlag, }, }, { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 7371a3770074..a2a1655502d7 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -893,6 +893,16 @@ var ( Usage: "peer ids of shadow fork peers", } + // Tx gossip settings + TxGossipBroadcastDisabledFlag = cli.BoolFlag{ + Name: "txgossip.disablebroadcast", + Usage: "Disable gossip broadcast transactions to other peers", + } + TxGossipReceivingDisabledFlag = cli.BoolFlag{ + Name: "txgossip.disablereceiving", + Usage: "Disable gossip receiving transactions from other peers", + } + // DA syncing settings DASyncEnabledFlag = cli.BoolFlag{ Name: "da.sync", @@ -1790,6 +1800,14 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.ShadowForkPeerIDs = ctx.GlobalStringSlice(ShadowforkPeersFlag.Name) log.Info("Shadow fork peers", "ids", cfg.ShadowForkPeerIDs) } + if ctx.GlobalIsSet(TxGossipBroadcastDisabledFlag.Name) { + cfg.TxGossipBroadcastDisabled = ctx.GlobalBool(TxGossipBroadcastDisabledFlag.Name) + log.Info("Transaction gossip broadcast disabled", "disabled", cfg.TxGossipBroadcastDisabled) + } + if ctx.GlobalIsSet(TxGossipReceivingDisabledFlag.Name) { + cfg.TxGossipReceivingDisabled = ctx.GlobalBool(TxGossipReceivingDisabledFlag.Name) + log.Info("Transaction gossip receiving disabled", "disabled", cfg.TxGossipReceivingDisabled) + } // Cap the cache allowance and tune the garbage collector mem, err := gopsutil.VirtualMemory() diff --git a/eth/backend.go b/eth/backend.go index ad765b835b0a..0050d3853b65 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -273,16 +273,18 @@ func New(stack *node.Node, config *ethconfig.Config, l1Client l1.Client) (*Ether checkpoint = params.TrustedCheckpoints[genesisHash] } if eth.handler, err = newHandler(&handlerConfig{ - Database: chainDb, - Chain: eth.blockchain, - TxPool: eth.txPool, - Network: config.NetworkId, - Sync: config.SyncMode, - BloomCache: uint64(cacheLimit), - EventMux: eth.eventMux, - Checkpoint: checkpoint, - Whitelist: config.Whitelist, - ShadowForkPeerIDs: config.ShadowForkPeerIDs, + Database: chainDb, + Chain: eth.blockchain, + TxPool: eth.txPool, + Network: config.NetworkId, + Sync: config.SyncMode, + BloomCache: uint64(cacheLimit), + EventMux: eth.eventMux, + Checkpoint: checkpoint, + Whitelist: config.Whitelist, + ShadowForkPeerIDs: config.ShadowForkPeerIDs, + DisableTxBroadcast: config.TxGossipBroadcastDisabled, + DisableTxReceiving: config.TxGossipReceivingDisabled, }); err != nil { return nil, err } diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 94fa46c34c31..0f70eb2ed6c9 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -230,6 +230,9 @@ type Config struct { // DA syncer options DA da_syncer.Config + + TxGossipBroadcastDisabled bool + TxGossipReceivingDisabled bool } // CreateConsensusEngine creates a consensus engine for the given chain configuration. diff --git a/eth/handler.go b/eth/handler.go index 4755a0c7b704..520723f18af2 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -93,6 +93,9 @@ type handlerConfig struct { Checkpoint *params.TrustedCheckpoint // Hard coded checkpoint for sync challenges Whitelist map[uint64]common.Hash // Hard coded whitelist for sync challenged ShadowForkPeerIDs []string // List of peer ids that take part in the shadow-fork + + DisableTxBroadcast bool + DisableTxReceiving bool } type handler struct { @@ -131,7 +134,9 @@ type handler struct { wg sync.WaitGroup peerWG sync.WaitGroup - shadowForkPeerIDs []string + shadowForkPeerIDs []string + disableTxBroadcast bool + disableTxReceiving bool } // newHandler returns a handler for all Ethereum chain management protocol. @@ -141,16 +146,18 @@ func newHandler(config *handlerConfig) (*handler, error) { config.EventMux = new(event.TypeMux) // Nicety initialization for tests } h := &handler{ - networkID: config.Network, - forkFilter: forkid.NewFilter(config.Chain), - eventMux: config.EventMux, - database: config.Database, - txpool: config.TxPool, - chain: config.Chain, - peers: newPeerSet(), - whitelist: config.Whitelist, - quitSync: make(chan struct{}), - shadowForkPeerIDs: config.ShadowForkPeerIDs, + networkID: config.Network, + forkFilter: forkid.NewFilter(config.Chain), + eventMux: config.EventMux, + database: config.Database, + txpool: config.TxPool, + chain: config.Chain, + peers: newPeerSet(), + whitelist: config.Whitelist, + quitSync: make(chan struct{}), + shadowForkPeerIDs: config.ShadowForkPeerIDs, + disableTxBroadcast: config.DisableTxBroadcast, + disableTxReceiving: config.DisableTxReceiving, } if config.Sync == downloader.FullSync { // The database seems empty as the current block is the genesis. Yet the fast @@ -415,10 +422,12 @@ func (h *handler) Start(maxPeers int) { h.maxPeers = maxPeers // broadcast transactions - h.wg.Add(1) - h.txsCh = make(chan core.NewTxsEvent, txChanSize) - h.txsSub = h.txpool.SubscribeNewTxsEvent(h.txsCh) - go h.txBroadcastLoop() + if !h.disableTxBroadcast { + h.wg.Add(1) + h.txsCh = make(chan core.NewTxsEvent, txChanSize) + h.txsSub = h.txpool.SubscribeNewTxsEvent(h.txsCh) + go h.txBroadcastLoop() + } // broadcast mined blocks h.wg.Add(1) diff --git a/eth/handler_eth.go b/eth/handler_eth.go index 1a3aff8aa097..9fc494711f76 100644 --- a/eth/handler_eth.go +++ b/eth/handler_eth.go @@ -56,6 +56,9 @@ func (h *ethHandler) PeerInfo(id enode.ID) interface{} { // AcceptTxs retrieves whether transaction processing is enabled on the node // or if inbound transactions should simply be dropped. func (h *ethHandler) AcceptTxs() bool { + if h.disableTxReceiving { + return false + } return atomic.LoadUint32(&h.acceptTxs) == 1 } From 7f3ae1d19b9a2b5d6622a5c0057236eb72dc158e Mon Sep 17 00:00:00 2001 From: Morty Date: Fri, 20 Jun 2025 00:27:31 +0800 Subject: [PATCH 02/17] feat: support forward txs to sequencer --- cmd/geth/main.go | 1 + cmd/utils/flags.go | 7 +++++++ eth/api_backend.go | 31 +++++++++++++++++++++++++++++++ eth/backend.go | 18 +++++++++++++++++- eth/ethconfig/config.go | 1 + 5 files changed, 57 insertions(+), 1 deletion(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index efffc9480ace..6a31b7be11bc 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -178,6 +178,7 @@ var ( utils.ShadowforkPeersFlag, utils.TxGossipBroadcastDisabledFlag, utils.TxGossipReceivingDisabledFlag, + utils.TxGossipSequencerHTTPFlag, utils.DASyncEnabledFlag, utils.DABlockNativeAPIEndpointFlag, utils.DABlobScanAPIEndpointFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index a2a1655502d7..c755cc84d8ac 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -902,6 +902,10 @@ var ( Name: "txgossip.disablereceiving", Usage: "Disable gossip receiving transactions from other peers", } + TxGossipSequencerHTTPFlag = &cli.StringFlag{ + Name: "txgossip.sequencerhttp", + Usage: "Sequencer mempool HTTP endpoint", + } // DA syncing settings DASyncEnabledFlag = cli.BoolFlag{ @@ -1808,6 +1812,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.TxGossipReceivingDisabled = ctx.GlobalBool(TxGossipReceivingDisabledFlag.Name) log.Info("Transaction gossip receiving disabled", "disabled", cfg.TxGossipReceivingDisabled) } + if ctx.IsSet(TxGossipReceivingDisabledFlag.Name) && !ctx.IsSet(MiningEnabledFlag.Name) { + cfg.TxGossipSequencerHTTP = ctx.String(TxGossipReceivingDisabledFlag.Name) + } // Cap the cache allowance and tune the garbage collector mem, err := gopsutil.VirtualMemory() diff --git a/eth/api_backend.go b/eth/api_backend.go index 5aee374c3c66..9c4ba20d90c5 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -25,6 +25,7 @@ import ( "github.com/scroll-tech/go-ethereum" "github.com/scroll-tech/go-ethereum/accounts" "github.com/scroll-tech/go-ethereum/common" + "github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/consensus" "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/core/bloombits" @@ -35,6 +36,7 @@ import ( "github.com/scroll-tech/go-ethereum/eth/gasprice" "github.com/scroll-tech/go-ethereum/ethdb" "github.com/scroll-tech/go-ethereum/event" + "github.com/scroll-tech/go-ethereum/log" "github.com/scroll-tech/go-ethereum/miner" "github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/rpc" @@ -44,6 +46,7 @@ import ( type EthAPIBackend struct { extRPCEnabled bool allowUnprotectedTxs bool + disableTxPool bool eth *Ethereum gpo *gasprice.Oracle } @@ -262,6 +265,34 @@ func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscri } func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error { + if signedTx.Type() == types.BlobTxType { + return types.ErrTxTypeNotSupported + } + + // OP-Stack: forward to remote sequencer RPC + if b.eth.seqRPCService != nil { + data, err := signedTx.MarshalBinary() + if err != nil { + return err + } + if err := b.eth.seqRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data)); err != nil { + return err + } + } + if b.disableTxPool { + return nil + } + + // Retain tx in local tx pool after forwarding, for local RPC usage. + err := b.sendTx(signedTx) + if err != nil && b.eth.seqRPCService != nil { + log.Warn("successfully sent tx to sequencer, but failed to persist in local tx pool", "err", err, "tx", signedTx.Hash()) + return nil + } + return err +} + +func (b *EthAPIBackend) sendTx(signedTx *types.Transaction) error { // will `VerifyFee` & `validateTx` in txPool.AddLocal return b.eth.txPool.AddLocal(signedTx) } diff --git a/eth/backend.go b/eth/backend.go index 0050d3853b65..2c2fe807b59f 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -109,6 +109,9 @@ type Ethereum struct { p2pServer *p2p.Server lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase) + + // Scroll additions + seqRPCService *rpc.Client } // New creates a new Ethereum object (including the @@ -294,7 +297,7 @@ func New(stack *node.Node, config *ethconfig.Config, l1Client l1.Client) (*Ether // Some of the extraData is used with Clique consensus (before EuclidV2). After EuclidV2 we use SystemContract consensus where this is overridden when creating a block. eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData)) - eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil} + eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, config.TxGossipReceivingDisabled, eth, nil} if eth.APIBackend.allowUnprotectedTxs { log.Info("Unprotected transactions allowed") } @@ -305,6 +308,16 @@ func New(stack *node.Node, config *ethconfig.Config, l1Client l1.Client) (*Ether gpoParams.DefaultBasePrice = new(big.Int).SetUint64(config.TxPool.PriceLimit) eth.APIBackend.gpo = gasprice.NewOracle(eth.APIBackend, gpoParams) + if config.TxGossipSequencerHTTP != "" { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + client, err := rpc.DialContext(ctx, config.TxGossipSequencerHTTP) + cancel() + if err != nil { + return nil, fmt.Errorf("cannot initialize rollup sequencer client: %w", err) + } + eth.seqRPCService = client + } + // Setup DNS discovery iterators. dnsclient := dnsdisc.NewClient(dnsdisc.Config{}) eth.ethDialCandidates, err = dnsclient.NewIterator(eth.config.EthDiscoveryURLs...) @@ -677,6 +690,9 @@ func (s *Ethereum) Stop() error { } s.blockchain.Stop() s.engine.Close() + if s.seqRPCService != nil { + s.seqRPCService.Close() + } rawdb.PopUncleanShutdownMarker(s.chainDb) s.chainDb.Close() s.eventMux.Stop() diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 0f70eb2ed6c9..4009ca6000e7 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -233,6 +233,7 @@ type Config struct { TxGossipBroadcastDisabled bool TxGossipReceivingDisabled bool + TxGossipSequencerHTTP string } // CreateConsensusEngine creates a consensus engine for the given chain configuration. From c5464eb629a05bba28ce258d85a223bf7d778138 Mon Sep 17 00:00:00 2001 From: Morty Date: Fri, 20 Jun 2025 04:41:58 +0800 Subject: [PATCH 03/17] fix: config --- cmd/geth/usage.go | 1 + cmd/utils/flags.go | 4 ++-- eth/api_backend.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 60b7e5416b01..767baeb97cb5 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -250,6 +250,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{ utils.CircuitCapacityCheckWorkersFlag, utils.TxGossipBroadcastDisabledFlag, utils.TxGossipReceivingDisabledFlag, + utils.TxGossipSequencerHTTPFlag, }, }, { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index c755cc84d8ac..9f980c8032fc 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1812,8 +1812,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.TxGossipReceivingDisabled = ctx.GlobalBool(TxGossipReceivingDisabledFlag.Name) log.Info("Transaction gossip receiving disabled", "disabled", cfg.TxGossipReceivingDisabled) } - if ctx.IsSet(TxGossipReceivingDisabledFlag.Name) && !ctx.IsSet(MiningEnabledFlag.Name) { - cfg.TxGossipSequencerHTTP = ctx.String(TxGossipReceivingDisabledFlag.Name) + if ctx.IsSet(TxGossipSequencerHTTPFlag.Name) && !ctx.IsSet(MiningEnabledFlag.Name) { + cfg.TxGossipSequencerHTTP = ctx.String(TxGossipSequencerHTTPFlag.Name) } // Cap the cache allowance and tune the garbage collector diff --git a/eth/api_backend.go b/eth/api_backend.go index 9c4ba20d90c5..9131a22cad68 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -276,6 +276,7 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) return err } if err := b.eth.seqRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data)); err != nil { + log.Warn("failed to send tx to sequencer", "tx", signedTx.Hash()) return err } } From 731a439b18d08b59378b4f503369633e596a7205 Mon Sep 17 00:00:00 2001 From: yiweichi <70688412+yiweichi@users.noreply.github.com> Date: Thu, 19 Jun 2025 20:51:50 +0000 Subject: [PATCH 04/17] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[b?= =?UTF-8?q?ot]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index 0a9f4e2b00b5..f8f2cbeb11ba 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 56 // Patch version component of the current release + VersionPatch = 57 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) From 5d085f18870ba2a491fa6523c0d2ab4e340116ed Mon Sep 17 00:00:00 2001 From: yiweichi <70688412+yiweichi@users.noreply.github.com> Date: Fri, 20 Jun 2025 10:56:14 +0000 Subject: [PATCH 05/17] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[b?= =?UTF-8?q?ot]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index f8f2cbeb11ba..13fa655ad50b 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 57 // Patch version component of the current release + VersionPatch = 58 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) From a57f640876fe952b3bb24543e17e31932e2568ee Mon Sep 17 00:00:00 2001 From: Morty Date: Sun, 22 Jun 2025 04:50:05 +0800 Subject: [PATCH 06/17] add comments --- cmd/utils/flags.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 9f980c8032fc..452908b0b832 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1812,6 +1812,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.TxGossipReceivingDisabled = ctx.GlobalBool(TxGossipReceivingDisabledFlag.Name) log.Info("Transaction gossip receiving disabled", "disabled", cfg.TxGossipReceivingDisabled) } + // Only configure sequencer http flag if we're running in verifier mode i.e. --mine is disabled. if ctx.IsSet(TxGossipSequencerHTTPFlag.Name) && !ctx.IsSet(MiningEnabledFlag.Name) { cfg.TxGossipSequencerHTTP = ctx.String(TxGossipSequencerHTTPFlag.Name) } From 39ba2a420aa6897c86ec8e18513c7d0095ab6438 Mon Sep 17 00:00:00 2001 From: Morty Date: Tue, 24 Jun 2025 17:10:13 +0800 Subject: [PATCH 07/17] fix: forward tx logic --- eth/api_backend.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/eth/api_backend.go b/eth/api_backend.go index 9131a22cad68..d38fda095252 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -270,14 +270,17 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) } // OP-Stack: forward to remote sequencer RPC + var seqRPCErr error if b.eth.seqRPCService != nil { - data, err := signedTx.MarshalBinary() + signedTxData, err := signedTx.MarshalBinary() if err != nil { return err } - if err := b.eth.seqRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data)); err != nil { + if seqRPCErr = b.eth.seqRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(signedTxData)); seqRPCErr != nil { log.Warn("failed to send tx to sequencer", "tx", signedTx.Hash()) - return err + if b.disableTxPool { + return seqRPCErr + } } } if b.disableTxPool { @@ -286,7 +289,7 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) // Retain tx in local tx pool after forwarding, for local RPC usage. err := b.sendTx(signedTx) - if err != nil && b.eth.seqRPCService != nil { + if err != nil && b.eth.seqRPCService != nil && seqRPCErr == nil { log.Warn("successfully sent tx to sequencer, but failed to persist in local tx pool", "err", err, "tx", signedTx.Hash()) return nil } From 7d6f953c16240dd0c3104649b737f59011a714a6 Mon Sep 17 00:00:00 2001 From: yiweichi <70688412+yiweichi@users.noreply.github.com> Date: Mon, 30 Jun 2025 09:07:15 +0000 Subject: [PATCH 08/17] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[b?= =?UTF-8?q?ot]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index 9a15803210bc..d6b46fa23177 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 63 // Patch version component of the current release + VersionPatch = 64 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) From dfd7dc21a949aa3be652adc4c51a41715c14c583 Mon Sep 17 00:00:00 2001 From: Morty Date: Mon, 7 Jul 2025 02:05:30 +0800 Subject: [PATCH 09/17] fix: comment typo --- eth/api_backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/api_backend.go b/eth/api_backend.go index d38fda095252..e1ff8a5bedb6 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -269,7 +269,7 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) return types.ErrTxTypeNotSupported } - // OP-Stack: forward to remote sequencer RPC + // Forward to remote sequencer RPC var seqRPCErr error if b.eth.seqRPCService != nil { signedTxData, err := signedTx.MarshalBinary() From d23b71f6acb9fc11ed3535b6f33e2178f8b639ad Mon Sep 17 00:00:00 2001 From: yiweichi <70688412+yiweichi@users.noreply.github.com> Date: Sun, 6 Jul 2025 18:06:08 +0000 Subject: [PATCH 10/17] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[b?= =?UTF-8?q?ot]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index d6b46fa23177..523d5ca47c51 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 64 // Patch version component of the current release + VersionPatch = 65 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) From dc1cc27e5573701632aae44ae8923416a78199fc Mon Sep 17 00:00:00 2001 From: yiweichi <70688412+yiweichi@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:12:01 +0000 Subject: [PATCH 11/17] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[b?= =?UTF-8?q?ot]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index 523d5ca47c51..555a1e557b27 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 65 // Patch version component of the current release + VersionPatch = 66 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) From ae97f0dc26ec2a08a18f1329ca186c144ecf863c Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Tue, 8 Jul 2025 17:52:34 +0800 Subject: [PATCH 12/17] run goimport --- eth/api_backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/api_backend.go b/eth/api_backend.go index e1ff8a5bedb6..00332a3a785b 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -46,7 +46,7 @@ import ( type EthAPIBackend struct { extRPCEnabled bool allowUnprotectedTxs bool - disableTxPool bool + disableTxPool bool eth *Ethereum gpo *gasprice.Oracle } From 8711560f3c42559e4aa95e3c03f5ed6d12654613 Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Tue, 8 Jul 2025 17:57:12 +0800 Subject: [PATCH 13/17] fix another file --- eth/backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/backend.go b/eth/backend.go index 2c2fe807b59f..c590474cb393 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -111,7 +111,7 @@ type Ethereum struct { lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase) // Scroll additions - seqRPCService *rpc.Client + seqRPCService *rpc.Client } // New creates a new Ethereum object (including the From 1210a69fa9930bd6cbd685f14c77dc9a91507bde Mon Sep 17 00:00:00 2001 From: Morty Date: Wed, 9 Jul 2025 23:57:02 +0800 Subject: [PATCH 14/17] fix: comments --- cmd/utils/flags.go | 6 +++--- eth/api_backend.go | 6 +++--- eth/backend.go | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 76447d267aca..d891d3dd050c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -895,15 +895,15 @@ var ( // Tx gossip settings TxGossipBroadcastDisabledFlag = cli.BoolFlag{ - Name: "txgossip.disablebroadcast", + Name: "gossip.disablebroadcast", Usage: "Disable gossip broadcast transactions to other peers", } TxGossipReceivingDisabledFlag = cli.BoolFlag{ - Name: "txgossip.disablereceiving", + Name: "gossip.disablereceiving", Usage: "Disable gossip receiving transactions from other peers", } TxGossipSequencerHTTPFlag = &cli.StringFlag{ - Name: "txgossip.sequencerhttp", + Name: "gossip.sequencerhttp", Usage: "Sequencer mempool HTTP endpoint", } diff --git a/eth/api_backend.go b/eth/api_backend.go index 00332a3a785b..909fff3caccd 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -271,12 +271,12 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) // Forward to remote sequencer RPC var seqRPCErr error - if b.eth.seqRPCService != nil { + if b.eth.sequencerRPCService != nil { signedTxData, err := signedTx.MarshalBinary() if err != nil { return err } - if seqRPCErr = b.eth.seqRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(signedTxData)); seqRPCErr != nil { + if seqRPCErr = b.eth.sequencerRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(signedTxData)); seqRPCErr != nil { log.Warn("failed to send tx to sequencer", "tx", signedTx.Hash()) if b.disableTxPool { return seqRPCErr @@ -289,7 +289,7 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) // Retain tx in local tx pool after forwarding, for local RPC usage. err := b.sendTx(signedTx) - if err != nil && b.eth.seqRPCService != nil && seqRPCErr == nil { + if err != nil && b.eth.sequencerRPCService != nil && seqRPCErr == nil { log.Warn("successfully sent tx to sequencer, but failed to persist in local tx pool", "err", err, "tx", signedTx.Hash()) return nil } diff --git a/eth/backend.go b/eth/backend.go index c590474cb393..93c8d6b250f2 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -111,7 +111,7 @@ type Ethereum struct { lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase) // Scroll additions - seqRPCService *rpc.Client + sequencerRPCService *rpc.Client } // New creates a new Ethereum object (including the @@ -315,7 +315,7 @@ func New(stack *node.Node, config *ethconfig.Config, l1Client l1.Client) (*Ether if err != nil { return nil, fmt.Errorf("cannot initialize rollup sequencer client: %w", err) } - eth.seqRPCService = client + eth.sequencerRPCService = client } // Setup DNS discovery iterators. @@ -690,8 +690,8 @@ func (s *Ethereum) Stop() error { } s.blockchain.Stop() s.engine.Close() - if s.seqRPCService != nil { - s.seqRPCService.Close() + if s.sequencerRPCService != nil { + s.sequencerRPCService.Close() } rawdb.PopUncleanShutdownMarker(s.chainDb) s.chainDb.Close() From 035a10f94e322c960d69a78e580ad618d86e7360 Mon Sep 17 00:00:00 2001 From: yiweichi <70688412+yiweichi@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:57:41 +0000 Subject: [PATCH 15/17] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[b?= =?UTF-8?q?ot]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index 555a1e557b27..2163ecabbe06 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 66 // Patch version component of the current release + VersionPatch = 67 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) From c0a2adc417d7aa45ee21d5c858cfa8e698cfe94b Mon Sep 17 00:00:00 2001 From: Morty Date: Thu, 10 Jul 2025 01:14:44 +0800 Subject: [PATCH 16/17] feat: retain transaction before forwording --- eth/api_backend.go | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/eth/api_backend.go b/eth/api_backend.go index 909fff3caccd..f7151383f5e9 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -269,31 +269,27 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) return types.ErrTxTypeNotSupported } + // Retain tx in local tx pool before forwarding to sequencer rpc, for local RPC usage. + err := b.sendTx(signedTx) + if err != nil { + return err + } + // Forward to remote sequencer RPC - var seqRPCErr error if b.eth.sequencerRPCService != nil { signedTxData, err := signedTx.MarshalBinary() if err != nil { return err } - if seqRPCErr = b.eth.sequencerRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(signedTxData)); seqRPCErr != nil { - log.Warn("failed to send tx to sequencer", "tx", signedTx.Hash()) + if err = b.eth.sequencerRPCService.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(signedTxData)); err != nil { + log.Warn("failed to forward tx to sequencer", "tx", signedTx.Hash(), "err", err) if b.disableTxPool { - return seqRPCErr + return err } } } - if b.disableTxPool { - return nil - } - // Retain tx in local tx pool after forwarding, for local RPC usage. - err := b.sendTx(signedTx) - if err != nil && b.eth.sequencerRPCService != nil && seqRPCErr == nil { - log.Warn("successfully sent tx to sequencer, but failed to persist in local tx pool", "err", err, "tx", signedTx.Hash()) - return nil - } - return err + return nil } func (b *EthAPIBackend) sendTx(signedTx *types.Transaction) error { From 5261fb298a942badfe20f76ba36928231fe6f776 Mon Sep 17 00:00:00 2001 From: yiweichi <70688412+yiweichi@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:16:04 +0000 Subject: [PATCH 17/17] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[b?= =?UTF-8?q?ot]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index 555a1e557b27..2163ecabbe06 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 8 // Minor version component of the current release - VersionPatch = 66 // Patch version component of the current release + VersionPatch = 67 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )