Skip to content

Commit 851d333

Browse files
committed
move restrictedaddr service to execution node 2
1 parent f0ee6c2 commit 851d333

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

arbnode/node.go

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import (
4242
"github.com/offchainlabs/nitro/daprovider/data_streaming"
4343
"github.com/offchainlabs/nitro/execution"
4444
executionrpcclient "github.com/offchainlabs/nitro/execution/rpcclient"
45-
"github.com/offchainlabs/nitro/restrictedaddr"
4645
"github.com/offchainlabs/nitro/solgen/go/bridgegen"
4746
"github.com/offchainlabs/nitro/solgen/go/precompilesgen"
4847
"github.com/offchainlabs/nitro/staker"
@@ -84,7 +83,6 @@ type Config struct {
8483
ConsensusExecutionSyncer ConsensusExecutionSyncerConfig `koanf:"consensus-execution-syncer"`
8584
RPCServer rpcserver.Config `koanf:"rpc-server"`
8685
ExecutionRPCClient rpcclient.ClientConfig `koanf:"execution-rpc-client" reload:"hot"`
87-
RestrictedAddr restrictedaddr.Config `koanf:"restricted-addr" reload:"hot"`
8886
// SnapSyncConfig is only used for testing purposes, these should not be configured in production.
8987
SnapSyncTest SnapSyncConfig
9088
}
@@ -130,9 +128,6 @@ func (c *Config) Validate() error {
130128
if err := c.ExecutionRPCClient.Validate(); err != nil {
131129
return fmt.Errorf("error validating Client config: %w", err)
132130
}
133-
if err := c.RestrictedAddr.Validate(); err != nil {
134-
return fmt.Errorf("error validating RestrictedAddr config: %w", err)
135-
}
136131
// Check that sync-interval is not more than msg-lag / 2
137132
if c.ConsensusExecutionSyncer.SyncInterval > c.SyncMonitor.MsgLag/2 {
138133
log.Warn("consensus-execution-syncer.sync-interval is more than half of sync-monitor.msg-lag, which may cause sync issues",
@@ -186,7 +181,6 @@ func ConfigAddOptions(prefix string, f *pflag.FlagSet, feedInputEnable bool, fee
186181
ConsensusExecutionSyncerConfigAddOptions(prefix+".consensus-execution-syncer", f)
187182
rpcserver.ConfigAddOptions(prefix+".rpc-server", "consensus", f)
188183
rpcclient.RPCClientAddOptions(prefix+".execution-rpc-client", f, &ConfigDefault.ExecutionRPCClient)
189-
restrictedaddr.ConfigAddOptions(prefix+".restricted-addr", f)
190184
}
191185

192186
var ConfigDefault = Config{
@@ -220,7 +214,6 @@ var ConfigDefault = Config{
220214
ArgLogLimit: 2048,
221215
WebsocketMessageSizeLimit: 256 * 1024 * 1024,
222216
},
223-
RestrictedAddr: restrictedaddr.DefaultConfig,
224217
}
225218

226219
func ConfigDefaultL1Test() *Config {
@@ -327,7 +320,6 @@ type Node struct {
327320
configFetcher ConfigFetcher
328321
ctx context.Context
329322
ConsensusExecutionSyncer *ConsensusExecutionSyncer
330-
RestrictedAddrService *restrictedaddr.Service
331323
}
332324

333325
type SnapSyncConfig struct {
@@ -1097,7 +1089,6 @@ func getNodeParentChainReaderDisabled(
10971089
syncMonitor *SyncMonitor,
10981090
configFetcher ConfigFetcher,
10991091
blockMetadataFetcher *BlockMetadataFetcher,
1100-
restrictedAddrService *restrictedaddr.Service,
11011092
) *Node {
11021093
// Create ConsensusExecutionSyncer even in L2-only mode to push sync data
11031094
consensusExecutionSyncerConfigFetcher := func() *ConsensusExecutionSyncerConfig {
@@ -1139,7 +1130,6 @@ func getNodeParentChainReaderDisabled(
11391130
ctx: ctx,
11401131
blockMetadataFetcher: blockMetadataFetcher,
11411132
ConsensusExecutionSyncer: consensusExecutionSyncer,
1142-
RestrictedAddrService: restrictedAddrService,
11431133
}
11441134
}
11451135

@@ -1212,16 +1202,8 @@ func createNodeImpl(
12121202
return nil, err
12131203
}
12141204

1215-
var restrictedAddrService *restrictedaddr.Service
1216-
if config.RestrictedAddr.Enable {
1217-
restrictedAddrService, err = restrictedaddr.NewService(ctx, &config.RestrictedAddr)
1218-
if err != nil {
1219-
return nil, fmt.Errorf("failed to create restricted addr service: %w", err)
1220-
}
1221-
}
1222-
12231205
if !config.ParentChainReader.Enable {
1224-
return getNodeParentChainReaderDisabled(ctx, consensusDB, stack, executionClient, executionSequencer, executionRecorder, txStreamer, blobReader, broadcastServer, broadcastClients, coordinator, maintenanceRunner, syncMonitor, configFetcher, blockMetadataFetcher, restrictedAddrService), nil
1206+
return getNodeParentChainReaderDisabled(ctx, consensusDB, stack, executionClient, executionSequencer, executionRecorder, txStreamer, blobReader, broadcastServer, broadcastClients, coordinator, maintenanceRunner, syncMonitor, configFetcher, blockMetadataFetcher), nil
12251207
}
12261208

12271209
delayedBridge, sequencerInbox, err := getDelayedBridgeAndSequencerInbox(deployInfo, l1client)
@@ -1297,7 +1279,6 @@ func createNodeImpl(
12971279
configFetcher: configFetcher,
12981280
ctx: ctx,
12991281
ConsensusExecutionSyncer: consensusExecutionSyncer,
1300-
RestrictedAddrService: restrictedAddrService,
13011282
}, nil
13021283
}
13031284

@@ -1460,13 +1441,6 @@ func (n *Node) Start(ctx context.Context) error {
14601441
return fmt.Errorf("error starting exec rpc client: %w", err)
14611442
}
14621443
}
1463-
// Initialize and start restricted address service early to ensure filtering is ready
1464-
if n.RestrictedAddrService != nil {
1465-
if err = n.RestrictedAddrService.Initialize(ctx); err != nil {
1466-
return fmt.Errorf("error initializing restricted addr service: %w", err)
1467-
}
1468-
n.RestrictedAddrService.Start(ctx)
1469-
}
14701444
if n.BlobReader != nil {
14711445
err = n.BlobReader.Initialize(ctx)
14721446
if err != nil {
@@ -1597,9 +1571,6 @@ func (n *Node) StopAndWait() {
15971571
if n.ConsensusExecutionSyncer != nil {
15981572
n.ConsensusExecutionSyncer.StopAndWait()
15991573
}
1600-
if n.RestrictedAddrService != nil && n.RestrictedAddrService.Started() {
1601-
n.RestrictedAddrService.StopAndWait()
1602-
}
16031574
if n.MaintenanceRunner != nil && n.MaintenanceRunner.Started() {
16041575
n.MaintenanceRunner.StopAndWait()
16051576
}

execution/gethexec/node.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,9 @@ func (n *ExecutionNode) Start(ctxIn context.Context) error {
514514
}
515515
n.bulkBlockMetadataFetcher.Start(ctx)
516516

517-
n.RestrictedAddrService.Start(ctx)
517+
if n.RestrictedAddrService != nil {
518+
n.RestrictedAddrService.Start(ctx)
519+
}
518520
return nil
519521
}
520522

0 commit comments

Comments
 (0)