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

PeriodToAllowPostingBatchWithOnlyBatchPostingReport config #2657

Merged
merged 6 commits into from
Oct 25, 2024
5 changes: 4 additions & 1 deletion arbnode/batch_poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
Dangerous BatchPosterDangerousConfig `koanf:"dangerous"`
ReorgResistanceMargin time.Duration `koanf:"reorg-resistance-margin" reload:"hot"`
CheckBatchCorrectness bool `koanf:"check-batch-correctness"`
MaxEmptyBatchDelay time.Duration `koanf:"max-empty-batch-delay"`

gasRefunder common.Address
l1BlockBound l1BlockBound
Expand Down Expand Up @@ -224,6 +225,7 @@
f.Uint64(prefix+".gas-estimate-base-fee-multiple-bips", uint64(DefaultBatchPosterConfig.GasEstimateBaseFeeMultipleBips), "for gas estimation, use this multiple of the basefee (measured in basis points) as the max fee per gas")
f.Duration(prefix+".reorg-resistance-margin", DefaultBatchPosterConfig.ReorgResistanceMargin, "do not post batch if its within this duration from layer 1 minimum bounds. Requires l1-block-bound option not be set to \"ignore\"")
f.Bool(prefix+".check-batch-correctness", DefaultBatchPosterConfig.CheckBatchCorrectness, "setting this to true will run the batch against an inbox multiplexer and verifies that it produces the correct set of messages")
f.Duration(prefix+".max-empty-batch-delay", DefaultBatchPosterConfig.MaxEmptyBatchDelay, "maximum empty batch posting delay, batch poster will only be able to post an empty batch if this time period building a batch has passed")
redislock.AddConfigOptions(prefix+".redis-lock", f)
dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f, dataposter.DefaultDataPosterConfig)
genericconf.WalletConfigAddOptions(prefix+".parent-chain-wallet", f, DefaultBatchPosterConfig.ParentChainWallet.Pathname)
Expand Down Expand Up @@ -255,6 +257,7 @@
GasEstimateBaseFeeMultipleBips: arbmath.OneInUBips * 3 / 2,
ReorgResistanceMargin: 10 * time.Minute,
CheckBatchCorrectness: true,
MaxEmptyBatchDelay: 3 * 24 * time.Hour,
}

var DefaultBatchPosterL1WalletConfig = genericconf.WalletConfig{
Expand Down Expand Up @@ -1303,7 +1306,7 @@
b.building.muxBackend.delayedInbox = append(b.building.muxBackend.delayedInbox, msg)
}
}
if msg.Message.Header.Kind != arbostypes.L1MessageType_BatchPostingReport {
if (msg.Message.Header.Kind != arbostypes.L1MessageType_BatchPostingReport) || (time.Since(firstMsgTime) >= config.MaxEmptyBatchDelay) {

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (defaults)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (race)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (challenge)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (stylus)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

undefined: firstMsgTime

Check failure on line 1309 in arbnode/batch_poster.go

View workflow job for this annotation

GitHub Actions / Go Tests (long)

undefined: firstMsgTime
b.building.haveUsefulMessage = true
if b.building.firstUsefulMsg == nil {
b.building.firstUsefulMsg = msg
Expand Down
Loading