Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rachit77 committed Jan 24, 2025
1 parent d2f4050 commit 33de034
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 0 additions & 5 deletions aggoracle/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,3 @@ type Config struct {
WaitPeriodNextGER types.Duration `mapstructure:"WaitPeriodNextGER"`
EVMSender chaingersender.EVMConfig `mapstructure:"EVMSender"`
}

// ApplyL2ChainID copies L2ChainID to the L1ChainID in the Etherman config
func (c *Config) ApplyL2ChainID(l2ChainID uint64) {
c.EVMSender.EthTxManager.Etherman.L1ChainID = l2ChainID
}
11 changes: 9 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,16 @@ func createAggoracle(
}
l2ChainID, err := ethermanClient.GetL2ChainID()
if err != nil {
logger.Fatal(err)
logger.Errorf("Failed to retrieve L2ChainID: %v", err)
}

// sanity check for the aggOracle ChainID
if cfg.AggOracle.EVMSender.EthTxManager.Etherman.L1ChainID != l2ChainID {
logger.Warnf("Incorrect ChainID in aggOracle provided: %d expected: %d",
cfg.AggOracle.EVMSender.EthTxManager.Etherman.L1ChainID,
l2ChainID,
)
}
cfg.AggOracle.ApplyL2ChainID(l2ChainID)

var sender aggoracle.ChainSender
switch cfg.AggOracle.TargetChainType {
Expand Down
3 changes: 3 additions & 0 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ WaitPeriodNextGER="100ms"
[AggOracle.EVMSender.EthTxManager.Etherman]
URL = "{{L2URL}}"
MultiGasProvider = false
# L1ChainID = 0 indicates it will be set at runtime
# This field should be populated with L2ChainID
L1ChainID = 0
HTTPHeaders = []
[RPC]
Expand Down

0 comments on commit 33de034

Please sign in to comment.