Commit db21f4aa authored by Sam Stokes's avatar Sam Stokes Committed by GitHub

op-node: remove MaxSequencerDrift hardcode (#11459)

* go: update superchain import

* op-node: read MaxSequencerDrift from superchain configs

* go: update superchain import to point to main commit
parent ec8fc7e4
...@@ -11,7 +11,7 @@ require ( ...@@ -11,7 +11,7 @@ require (
github.com/crate-crypto/go-kzg-4844 v1.0.0 github.com/crate-crypto/go-kzg-4844 v1.0.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.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/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240812010938-34a43d577f74 github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813170044-d5be5587e58f
github.com/ethereum/go-ethereum v1.14.7 github.com/ethereum/go-ethereum v1.14.7
github.com/fsnotify/fsnotify v1.7.0 github.com/fsnotify/fsnotify v1.7.0
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb
......
...@@ -176,8 +176,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z ...@@ -176,8 +176,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/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a h1:OK3wB7HbdhCneSowC1XZusHaLIVdXoRLuCWgXp5Tjuc= github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a h1:OK3wB7HbdhCneSowC1XZusHaLIVdXoRLuCWgXp5Tjuc=
github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a/go.mod h1:9pT+bF20XwCBE7WkjfRSsCg6RN6Njdbr924DtQ3+geY= github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a/go.mod h1:9pT+bF20XwCBE7WkjfRSsCg6RN6Njdbr924DtQ3+geY=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240812010938-34a43d577f74 h1:HQZQalpPUXs9qnJgDmEDzpPO70Z1p8Le2l0bZ9eJjCk= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813170044-d5be5587e58f h1:JTnVOiaYVQcXc+zgsSjnTQ18k3uOLOpch8SiPjO1eTo=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240812010938-34a43d577f74/go.mod h1:zy9f3TNPS7pwW4msMitF83fp0Wf452tZ6+Fg6d4JyXM= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813170044-d5be5587e58f/go.mod h1:zy9f3TNPS7pwW4msMitF83fp0Wf452tZ6+Fg6d4JyXM=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= 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/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= github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4=
......
...@@ -14,10 +14,6 @@ import ( ...@@ -14,10 +14,6 @@ import (
var OPStackSupport = params.ProtocolVersionV0{Build: [8]byte{}, Major: 7, Minor: 0, Patch: 0, PreRelease: 0}.Encode() var OPStackSupport = params.ProtocolVersionV0{Build: [8]byte{}, Major: 7, Minor: 0, Patch: 0, PreRelease: 0}.Encode()
const (
pgnSepolia = 58008
)
// LoadOPStackRollupConfig loads the rollup configuration of the requested chain ID from the superchain-registry. // LoadOPStackRollupConfig loads the rollup configuration of the requested chain ID from the superchain-registry.
// Some chains may require a SystemConfigProvider to retrieve any values not part of the registry. // Some chains may require a SystemConfigProvider to retrieve any values not part of the registry.
func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
...@@ -76,7 +72,7 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { ...@@ -76,7 +72,7 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
// Note: hardcoded values are not yet represented in the registry but should be // Note: hardcoded values are not yet represented in the registry but should be
// soon, then will be read and set in the same fashion. // soon, then will be read and set in the same fashion.
BlockTime: chConfig.BlockTime, BlockTime: chConfig.BlockTime,
MaxSequencerDrift: 600, MaxSequencerDrift: chConfig.MaxSequencerDrift,
SeqWindowSize: chConfig.SequencerWindowSize, SeqWindowSize: chConfig.SequencerWindowSize,
ChannelTimeoutBedrock: 300, ChannelTimeoutBedrock: 300,
ChannelTimeoutGranite: 50, ChannelTimeoutGranite: 50,
...@@ -97,9 +93,5 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { ...@@ -97,9 +93,5 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
if superChain.Config.ProtocolVersionsAddr != nil { // Set optional protocol versions address if superChain.Config.ProtocolVersionsAddr != nil { // Set optional protocol versions address
cfg.ProtocolVersionsAddress = common.Address(*superChain.Config.ProtocolVersionsAddr) cfg.ProtocolVersionsAddress = common.Address(*superChain.Config.ProtocolVersionsAddr)
} }
if chainID == pgnSepolia {
cfg.MaxSequencerDrift = 1000
cfg.SeqWindowSize = 7200
}
return cfg, nil return cfg, nil
} }
...@@ -21,6 +21,7 @@ var ( ...@@ -21,6 +21,7 @@ var (
ErrMissingChannelTimeout = errors.New("channel timeout must be set, this should cover at least a L1 block time") ErrMissingChannelTimeout = errors.New("channel timeout must be set, this should cover at least a L1 block time")
ErrInvalidGraniteChannelTimeout = errors.New("channel timeout granite must be less than channel timeout") ErrInvalidGraniteChannelTimeout = errors.New("channel timeout granite must be less than channel timeout")
ErrInvalidSeqWindowSize = errors.New("sequencing window size must at least be 2") ErrInvalidSeqWindowSize = errors.New("sequencing window size must at least be 2")
ErrInvalidMaxSeqDrift = errors.New("maximum sequencer drift must be greater than 0")
ErrMissingGenesisL1Hash = errors.New("genesis L1 hash cannot be empty") ErrMissingGenesisL1Hash = errors.New("genesis L1 hash cannot be empty")
ErrMissingGenesisL2Hash = errors.New("genesis L2 hash cannot be empty") ErrMissingGenesisL2Hash = errors.New("genesis L2 hash cannot be empty")
ErrGenesisHashesSame = errors.New("achievement get! rollup inception: L1 and L2 genesis cannot be the same") ErrGenesisHashesSame = errors.New("achievement get! rollup inception: L1 and L2 genesis cannot be the same")
...@@ -282,6 +283,9 @@ func (cfg *Config) Check() error { ...@@ -282,6 +283,9 @@ func (cfg *Config) Check() error {
if cfg.SeqWindowSize < 2 { if cfg.SeqWindowSize < 2 {
return ErrInvalidSeqWindowSize return ErrInvalidSeqWindowSize
} }
if cfg.MaxSequencerDrift == 0 {
return ErrInvalidMaxSeqDrift
}
if cfg.Genesis.L1.Hash == (common.Hash{}) { if cfg.Genesis.L1.Hash == (common.Hash{}) {
return ErrMissingGenesisL1Hash return ErrMissingGenesisL1Hash
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment