Skip to content

Commit

Permalink
op-node: read DACommitmentType from scr in LoadOPStackRollupConfig (e…
Browse files Browse the repository at this point in the history
…thereum-optimism#11830)

* op-node: read DACommitmentType from scr in LoadOPStackRollupConfig

* op-node: check for altda nil pointers before dereferencing

* op-node: leave altDA config nil if not existent in scr config
  • Loading branch information
bitwiseguy authored and samlaf committed Nov 10, 2024
1 parent 761ee4d commit f49349f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/crate-crypto/go-kzg-4844 v1.0.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240821192748-42bd03ba8313
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac
github.com/ethereum/go-ethereum v1.14.8
github.com/fsnotify/fsnotify v1.7.0
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240827042333-110c433a2469 h1:sGqlBjx0+z/ExU6VNo5OHSXS/5nc6BfkEQJvSdVbWp0=
github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240827042333-110c433a2469/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240821192748-42bd03ba8313 h1:SVSFg8ccdRBJxOdRS1pK8oIHvMufiPAQz1gkQsEPnZc=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240821192748-42bd03ba8313/go.mod h1:XaVXL9jg8BcyOeugECgIUGa9Y3DjYJj71RHmb5qon6M=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac h1:hCIrLuOPV3FJfMDvXeOhCC3uQNvFoMIIlkT2mN2cfeg=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240910145426-b3905c89e8ac/go.mod h1:XaVXL9jg8BcyOeugECgIUGa9Y3DjYJj71RHmb5qon6M=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4=
Expand Down
16 changes: 12 additions & 4 deletions op-node/rollup/superchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {

var altDA *AltDAConfig
if chConfig.AltDA != nil {
altDA = &AltDAConfig{
DAChallengeAddress: common.Address(*chConfig.AltDA.DAChallengeAddress),
DAChallengeWindow: *chConfig.AltDA.DAChallengeWindow,
DAResolveWindow: *chConfig.AltDA.DAResolveWindow,
altDA = &AltDAConfig{}
if chConfig.AltDA.DAChallengeAddress != nil {
altDA.DAChallengeAddress = common.Address(*chConfig.AltDA.DAChallengeAddress)
}
if chConfig.AltDA.DAChallengeWindow != nil {
altDA.DAChallengeWindow = *chConfig.AltDA.DAChallengeWindow
}
if chConfig.AltDA.DAResolveWindow != nil {
altDA.DAResolveWindow = *chConfig.AltDA.DAResolveWindow
}
if chConfig.AltDA.DACommitmentType != nil {
altDA.CommitmentType = *chConfig.AltDA.DACommitmentType
}
}

Expand Down

0 comments on commit f49349f

Please sign in to comment.