Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCIP-3552 refactor OP oracle to accept generic DA oracle config #14599

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fall back to check chainType when creating the L1 oracle
  • Loading branch information
ogtownsend committed Oct 10, 2024
commit c50b9400a12701a2ce983d6a4387486053185d77
20 changes: 19 additions & 1 deletion core/chains/evm/gas/rollups/l1_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,25 @@ func NewL1GasOracle(lggr logger.Logger, ethClient l1OracleClient, chainType chai
case toml.ZKSyncOracle:
l1Oracle = NewZkSyncL1GasOracle(lggr, ethClient)
default:
return nil, fmt.Errorf("unsupported DA oracle type %s", daOracle.OracleType())
lggr.Warnf("Unsupported DA oracle type %s. Going forward all chain configs should specify an oracle type", daOracle.OracleType())
}
if err != nil {
return nil, fmt.Errorf("failed to initialize L1 oracle for chaintype %s: %w", chainType, err)
}
if l1Oracle == nil {
return l1Oracle, nil
}

// Fall back to checking the chainType since DAOracle config may not be set for all chain configs yet.
switch chainType {
case chaintype.ChainOptimismBedrock, chaintype.ChainKroma, chaintype.ChainScroll, chaintype.ChainMantle, chaintype.ChainZircuit:
l1Oracle, err = NewOpStackL1GasOracle(lggr, ethClient, chainType, daOracle)
case chaintype.ChainArbitrum:
l1Oracle, err = NewArbitrumL1GasOracle(lggr, ethClient)
case chaintype.ChainZkSync:
l1Oracle = NewZkSyncL1GasOracle(lggr, ethClient)
default:
return nil, fmt.Errorf("received unsupported chaintype %s", chainType)
}
if err != nil {
return nil, fmt.Errorf("failed to initialize L1 oracle for chaintype %s: %w", chainType, err)
Expand Down