Skip to content

Commit 28ae8ba

Browse files
Fix out of bounds config access in dataposter (#3839)
1 parent 2bfbe14 commit 28ae8ba

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

arbnode/dataposter/data_poster.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,10 @@ func (p *DataPoster) Start(ctxIn context.Context) {
12131213
log.Warn("failed to update tx poster nonce", "err", err)
12141214
}
12151215
now := time.Now()
1216-
nextCheck := now.Add(arbmath.MinInt(p.config().ReplacementTimes[0], p.config().BlobTxReplacementTimes[0]))
1216+
nextCheck := now.Add(p.config().ReplacementTimes[0])
1217+
if len(p.config().BlobTxReplacementTimes) > 0 {
1218+
nextCheck = now.Add(arbmath.MinInt(p.config().ReplacementTimes[0], p.config().BlobTxReplacementTimes[0]))
1219+
}
12171220
maxTxsToRbf := p.config().MaxMempoolTransactions
12181221
if maxTxsToRbf == 0 {
12191222
maxTxsToRbf = 512
@@ -1400,6 +1403,12 @@ func (c *DataPosterConfig) Validate() error {
14001403
default:
14011404
return fmt.Errorf("invalid enable-cell-proofs value %q (valid: \"\", \"auto\", \"force-enable\", \"force-disable\")", c.EnableCellProofs)
14021405
}
1406+
if len(c.ReplacementTimes) == 0 {
1407+
return fmt.Errorf("replacement-times must have at least one value")
1408+
}
1409+
if c.Post4844Blobs && len(c.BlobTxReplacementTimes) == 0 {
1410+
return fmt.Errorf("blob-tx-replacement-times must have at least one value when post-4844-blobs is enabled")
1411+
}
14031412
return nil
14041413
}
14051414

0 commit comments

Comments
 (0)