Skip to content
Open
Show file tree
Hide file tree
Changes from 10 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
5 changes: 5 additions & 0 deletions changelog/bragaigor-nit-4241.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Changed
- enable execution only mode

### Configuration
- Add `--chain.genesis-block-num` genesis block number for the L2 chain
Comment thread
bragaigor marked this conversation as resolved.
Outdated
23 changes: 13 additions & 10 deletions cmd/conf/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,27 @@ func (c *ParentChainConfig) Validate() error {
}

type L2Config struct {
ID uint64 `koanf:"id"`
Name string `koanf:"name"`
InfoFiles []string `koanf:"info-files"`
InfoJson string `koanf:"info-json"`
DevWallet genericconf.WalletConfig `koanf:"dev-wallet"`
ID uint64 `koanf:"id"`
Name string `koanf:"name"`
GenesisBlockNum uint64 `koanf:"genesis-block-num"`
InfoFiles []string `koanf:"info-files"`
InfoJson string `koanf:"info-json"`
DevWallet genericconf.WalletConfig `koanf:"dev-wallet"`
}

var L2ConfigDefault = L2Config{
ID: 0,
Name: "",
InfoFiles: []string{}, // Default file used is chaininfo/arbitrum_chain_info.json, stored in DefaultChainInfo in chain_info.go
InfoJson: "",
DevWallet: genericconf.WalletConfigDefault,
ID: 0,
Name: "",
GenesisBlockNum: 0,
InfoFiles: []string{}, // Default file used is chaininfo/arbitrum_chain_info.json, stored in DefaultChainInfo in chain_info.go
InfoJson: "",
DevWallet: genericconf.WalletConfigDefault,
}

func L2ConfigAddOptions(prefix string, f *pflag.FlagSet) {
f.Uint64(prefix+".id", L2ConfigDefault.ID, "L2 chain ID (determines Arbitrum network)")
f.String(prefix+".name", L2ConfigDefault.Name, "L2 chain name (determines Arbitrum network)")
f.Uint64(prefix+".genesis-block-num", L2ConfigDefault.GenesisBlockNum, "genesis block number for the L2 chain")
f.StringSlice(prefix+".info-files", L2ConfigDefault.InfoFiles, "L2 chain info json files")
f.String(prefix+".info-json", L2ConfigDefault.InfoJson, "L2 chain info in json string format")

Expand Down
10 changes: 8 additions & 2 deletions cmd/nitro/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ func (c *NodeConfig) Validate() error {
if err := c.ParentChain.Validate(); err != nil {
return err
}

if c.Execution.RPCServer.Enable && c.Node.RPCServer.Enable {
return errors.New("when on rpc mode a node can either be consensus or execution, not both")
Comment thread
bragaigor marked this conversation as resolved.
Outdated
}
if err := c.Node.Validate(); err != nil {
return err
}
Expand All @@ -169,8 +173,10 @@ func (c *NodeConfig) Validate() error {
if c.Node.Sequencer || c.Node.BatchPoster.Enable {
return errors.New("sequencing and batch-posting are currently not supported when connecting to an execution client over RPC")
}
} else if c.Execution.ConsensusRPCClient.URL != "" {
return errors.New("consensus is connecting directly to execution but execution is connecting to consensus over an rpc- invalid case")
} else if c.Execution.RPCServer.Enable && c.Execution.ConsensusRPCClient.URL == "" {
return errors.New("communication over rpc is enabled on execution but consensus RPC client is not set")
} else if c.Node.RPCServer.Enable && c.Node.ExecutionRPCClient.URL == "" {
return errors.New("communication over rpc is enabled on consensus but execution RPC client is not set")
}
if err := c.BlocksReExecutor.Validate(); err != nil {
return err
Expand Down
Loading
Loading