From 1958945c9a1e7d4e30129f8d4fb97c463189476c Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Thu, 9 May 2024 14:45:17 +0200 Subject: [PATCH] op-node/rollup: Showcase feature/fork separation pattern with seq drift change --- op-node/rollup/chain_spec.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/op-node/rollup/chain_spec.go b/op-node/rollup/chain_spec.go index c16ce71b651b..8797f9a71baa 100644 --- a/op-node/rollup/chain_spec.go +++ b/op-node/rollup/chain_spec.go @@ -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