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

op-node: remove MaxSequencerDrift hardcode #11459

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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-20240812010938-34a43d577f74
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813151825-611c7cfcd07b
github.com/ethereum/go-ethereum v1.14.7
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 @@ -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/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/superchain-registry/superchain v0.0.0-20240812010938-34a43d577f74 h1:HQZQalpPUXs9qnJgDmEDzpPO70Z1p8Le2l0bZ9eJjCk=
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-20240813151825-611c7cfcd07b h1:n2gakehKiQ+msUkYbB5DahiSliwgdN2I7SrGlxbbxbE=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813151825-611c7cfcd07b/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/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4=
Expand Down
10 changes: 1 addition & 9 deletions op-node/rollup/superchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import (

var OPStackSupport = params.ProtocolVersionV0{Build: [8]byte{}, Major: 7, Minor: 0, Patch: 0, PreRelease: 0}.Encode()

const (
pgnSepolia = 58008
)

bitwiseguy marked this conversation as resolved.
Show resolved Hide resolved
// 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.
func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
Expand Down Expand Up @@ -76,7 +72,7 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
// Note: hardcoded values are not yet represented in the registry but should be
// soon, then will be read and set in the same fashion.
BlockTime: chConfig.BlockTime,
MaxSequencerDrift: 600,
MaxSequencerDrift: chConfig.MaxSequencerDrift,
SeqWindowSize: chConfig.SequencerWindowSize,
ChannelTimeoutBedrock: 300,
ChannelTimeoutGranite: 50,
Expand All @@ -97,9 +93,5 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
if superChain.Config.ProtocolVersionsAddr != nil { // Set optional protocol versions address
cfg.ProtocolVersionsAddress = common.Address(*superChain.Config.ProtocolVersionsAddr)
}
if chainID == pgnSepolia {
cfg.MaxSequencerDrift = 1000
cfg.SeqWindowSize = 7200
}
return cfg, nil
}
4 changes: 4 additions & 0 deletions op-node/rollup/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
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")
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")
ErrMissingGenesisL2Hash = errors.New("genesis L2 hash cannot be empty")
ErrGenesisHashesSame = errors.New("achievement get! rollup inception: L1 and L2 genesis cannot be the same")
Expand Down Expand Up @@ -282,6 +283,9 @@ func (cfg *Config) Check() error {
if cfg.SeqWindowSize < 2 {
return ErrInvalidSeqWindowSize
}
if cfg.MaxSequencerDrift == 0 {
return ErrInvalidMaxSeqDrift
}
if cfg.Genesis.L1.Hash == (common.Hash{}) {
return ErrMissingGenesisL1Hash
}
Expand Down