Skip to content

Commit 7c82708

Browse files
authored
Merge pull request #82 from Layr-Labs/ethenotethan--feat-disable-tx-size-checks
feat: add sequencer dangerous flag to disable tx size checks
2 parents e9a327c + 5aaae29 commit 7c82708

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cmd/nitro/nitro.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,15 @@ func mainImpl() int {
600600
return 1
601601
}
602602
}
603-
// If sequencer is enabled, validate MaxTxDataSize to be at least 5kB below the batch poster's MaxSize to allow space for headers and such.
604-
// And since batchposter's MaxSize is to be at least 10kB below the sequencer inbox’s maxDataSize, this leads to another condition of atlest 15kB below the sequencer inbox’s maxDataSize.
605603
if nodeConfig.Execution.Sequencer.Enable {
606-
if nodeConfig.Execution.Sequencer.MaxTxDataSize > nodeConfig.Node.BatchPoster.MaxSize-5000 ||
607-
nodeConfig.Execution.Sequencer.MaxTxDataSize > seqInboxMaxDataSize-15000 {
608-
log.Error("sequencer's MaxTxDataSize too large")
604+
// Validate MaxTxDataSize to be at least 5kB below the batch poster's MaxSize to allow space for headers and such.
605+
if nodeConfig.Execution.Sequencer.MaxTxDataSize > nodeConfig.Node.BatchPoster.MaxSize-5000 {
606+
log.Error("sequencer's MaxTxDataSize too large compared to the batchPoster's MaxSize")
607+
return 1
608+
}
609+
// Since the batchposter's MaxSize must be at least 10kB below the sequencer inbox’s maxDataSize, then MaxTxDataSize must also be 15kB below the sequencer inbox’s maxDataSize.
610+
if nodeConfig.Execution.Sequencer.MaxTxDataSize > seqInboxMaxDataSize-15000 && !nodeConfig.Execution.Sequencer.Dangerous.DisableSeqInboxMaxDataSizeCheck {
611+
log.Error("sequencer's MaxTxDataSize too large compared to the sequencer inbox's MaxDataSize")
609612
return 1
610613
}
611614
}

execution/gethexec/sequencer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ type SequencerConfig struct {
8686

8787
type DangerousConfig struct {
8888
Timeboost TimeboostConfig `koanf:"timeboost"`
89+
DisableSeqInboxMaxDataSizeCheck bool `koanf:"disable-seq-inbox-max-data-size-check"`
8990
}
9091

9192
type TimeboostConfig struct {
@@ -185,6 +186,7 @@ var DefaultSequencerConfig = SequencerConfig{
185186

186187
var DefaultDangerousConfig = DangerousConfig{
187188
Timeboost: DefaultTimeboostConfig,
189+
DisableSeqInboxMaxDataSizeCheck: false,
188190
}
189191

190192
func SequencerConfigAddOptions(prefix string, f *flag.FlagSet) {
@@ -221,6 +223,7 @@ func TimeboostAddOptions(prefix string, f *flag.FlagSet) {
221223

222224
func DangerousAddOptions(prefix string, f *flag.FlagSet) {
223225
TimeboostAddOptions(prefix+".timeboost", f)
226+
f.Bool(prefix+".disable-seq-inbox-max-data-size-check", DefaultDangerousConfig.DisableSeqInboxMaxDataSizeCheck, "DANGEROUS! disables nitro checks on sequencer MaxTxDataSize against the sequencer inbox MaxDataSize")
224227
}
225228

226229
type txQueueItem struct {

0 commit comments

Comments
 (0)