Skip to content

Commit

Permalink
op-node/rollup: Showcase feature/fork separation pattern with seq dri…
Browse files Browse the repository at this point in the history
…ft change
  • Loading branch information
sebastianst committed May 9, 2024
1 parent bdf6bd5 commit 1958945
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion op-node/rollup/chain_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@ func (s *ChainSpec) MaxRLPBytesPerChannel(t uint64) uint64 {
return maxRLPBytesPerChannelBedrock
}

// IsFeatMaxSequencerDriftConstant specifies in which fork the max sequencer drift change to a
// constant will be performed.
func (s *ChainSpec) IsFeatMaxSequencerDriftConstant(t uint64) bool {
return s.config.IsFjord(t)
}

// MaxSequencerDrift returns the maximum sequencer drift for the given block timestamp. Until Fjord,
// this was a rollup configuration parameter. Since Fjord, it is a constant, so its effective value
// should always be queried via the ChainSpec.
func (s *ChainSpec) MaxSequencerDrift(t uint64) uint64 {
if s.config.IsFjord(t) {
if s.IsFeatMaxSequencerDriftConstant(t) {
return maxSequencerDriftFjord
}
return s.config.MaxSequencerDrift
Expand Down

0 comments on commit 1958945

Please sign in to comment.