Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ var (
utils.MinerNotifyFullFlag,
utils.IgnoreLegacyReceiptsFlag,
utils.RollupSequencerHTTPFlag,
utils.RollupHistoricalRPCFlag,
utils.RollupDisableTxPoolGossipFlag,
configFileFlag,
}, utils.NetworkFlags, utils.DatabasePathFlags)
Expand Down
9 changes: 9 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,12 @@ var (
Category: flags.RollupCategory,
}

RollupHistoricalRPCFlag = &cli.StringFlag{
Name: "rollup.historicalrpc",
Usage: "RPC endpoint for historical data.",
Category: flags.RollupCategory,
}

RollupDisableTxPoolGossipFlag = &cli.BoolFlag{
Name: "rollup.disabletxpoolgossip",
Usage: "Disable transaction pool gossip.",
Expand Down Expand Up @@ -1876,6 +1882,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.IsSet(RollupSequencerHTTPFlag.Name) && !ctx.IsSet(MiningEnabledFlag.Name) {
cfg.RollupSequencerHTTP = ctx.String(RollupSequencerHTTPFlag.Name)
}
if ctx.IsSet(RollupHistoricalRPCFlag.Name) {
cfg.RollupHistoricalRPC = ctx.String(RollupHistoricalRPCFlag.Name)
}
cfg.RollupDisableTxPoolGossip = ctx.Bool(RollupDisableTxPoolGossipFlag.Name)
// Override any default configs for hard coded networks.
switch {
Expand Down
28 changes: 21 additions & 7 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ type Ethereum struct {
config *ethconfig.Config

// Handlers
txPool *core.TxPool
blockchain *core.BlockChain
handler *handler
ethDialCandidates enode.Iterator
snapDialCandidates enode.Iterator
merger *consensus.Merger
seqRPCService *rpc.Client
txPool *core.TxPool
blockchain *core.BlockChain
handler *handler
ethDialCandidates enode.Iterator
snapDialCandidates enode.Iterator
merger *consensus.Merger
seqRPCService *rpc.Client
historicalRPCService *rpc.Client

// DB interfaces
chainDb ethdb.Database // Block chain database
Expand Down Expand Up @@ -270,6 +271,16 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
eth.seqRPCService = client
}

if config.RollupHistoricalRPC != "" {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
client, err := rpc.DialContext(ctx, config.RollupHistoricalRPC)
cancel()
if err != nil {
return nil, err
}
eth.historicalRPCService = client
}

// Start the RPC service
eth.netRPCService = ethapi.NewNetAPI(eth.p2pServer, config.NetworkId)

Expand Down Expand Up @@ -564,6 +575,9 @@ func (s *Ethereum) Stop() error {
if s.seqRPCService != nil {
s.seqRPCService.Close()
}
if s.historicalRPCService != nil {
s.historicalRPCService.Close()
}

// Clean shutdown marker as the last thing before closing db
s.shutdownTracker.Stop()
Expand Down
1 change: 1 addition & 0 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ type Config struct {
OverrideTerminalTotalDifficultyPassed *bool `toml:",omitempty"`

RollupSequencerHTTP string
RollupHistoricalRPC string

RollupDisableTxPoolGossip bool
}
Expand Down