Skip to content

Commit 34561dd

Browse files
Backport remove misleading blob-related dataposter config to v3.8.x-release (#3833)
* Hide blob-related DataPoster config in some contexts The DataPoster component is reused for the BatchPoster and the Staker, but not all of its configuration options are applicable in both contexts. The Staker should never be configured to post its assertions as blobs, so this change prevents that, and also removes blob tuning related options. On a properly configured parent chain the Staker probably never would have decided to post a blob even if configured to do so since they are small and it would waste most of the space in the blob. On the outside chance that a blob was posted, Nitro doesn't have code for reading it. This change prevents operator confusion, increases safety and also means the DataPoster in the Staker can skip any 4844 related checks. Removed Staker config: ``` --node.staker.data-poster.post-4844-blobs --node.staker.data-poster.blob-tx-replacement-times --node.staker.data-poster.min-blob-tx-tip-cap-gwei --node.staker.data-poster.max-blob-tx-tip-cap-gwei --node.staker.data-poster.enable-cell-proofs ``` The BatchPoster's DataPoster also used to have a redundant configuration that has been removed since the BatchPoster's configuration overrides it (see dataPosterConfigFetcher in batch_poster.go). This configuration option was never actually used by the code so it's better to remove it. Removed BatchPoster config: ``` --node.batch-poster.data-poster.post-4844-blobs ``` The existing config option that should be used is: ``` --node.batch-poster.post-4844-blobs ``` NOTE: Nitro will fail to start if the removed flags are used so operators may need to update their configuration files if they were using the old incorrect flags. * Remove dead code * Set empty defaults for blob fields on validator default config --------- Co-authored-by: Tristan Wilson <[email protected]>
1 parent 6fc695a commit 34561dd

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

arbnode/batch_poster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func BatchPosterConfigAddOptions(prefix string, f *pflag.FlagSet) {
244244
f.String(prefix+".parent-chain-eip7623", DefaultBatchPosterConfig.ParentChainEip7623, "if parent chain uses EIP7623 (\"yes\", \"no\", \"auto\")")
245245
f.Bool(prefix+".delay-buffer-always-updatable", DefaultBatchPosterConfig.DelayBufferAlwaysUpdatable, "always treat delay buffer as updatable")
246246
redislock.AddConfigOptions(prefix+".redis-lock", f)
247-
dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f, dataposter.DefaultDataPosterConfig)
247+
dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f, dataposter.DefaultDataPosterConfig, dataposter.DataPosterUsageBatchPoster)
248248
genericconf.WalletConfigAddOptions(prefix+".parent-chain-wallet", f, DefaultBatchPosterConfig.ParentChainWallet.Pathname)
249249
DangerousBatchPosterConfigAddOptions(prefix+".dangerous", f)
250250
}

arbnode/dataposter/data_poster.go

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,26 +1407,36 @@ func (c *DataPosterConfig) Validate() error {
14071407
// that flags can be reloaded dynamically.
14081408
type ConfigFetcher func() *DataPosterConfig
14091409

1410-
func DataPosterConfigAddOptions(prefix string, f *pflag.FlagSet, defaultDataPosterConfig DataPosterConfig) {
1410+
// DataPosterUsageContext indicates what component is using the DataPoster to determine
1411+
// which config options to expose.
1412+
type DataPosterUsageContext int
1413+
1414+
const (
1415+
// DataPosterUsageStaker indicates the DataPoster is being used by the staker/validator.
1416+
// Staker posts small (~250 byte) assertions, so blob options don't make sense.
1417+
// Blob reading is also not supported with assertions.
1418+
DataPosterUsageStaker DataPosterUsageContext = iota
1419+
// DataPosterUsageBatchPoster indicates the DataPoster is being used by the batch poster.
1420+
// Note: The enable flag (post-4844-blobs) is NOT exposed here because batch poster
1421+
// controls that at its own configuration level.
1422+
DataPosterUsageBatchPoster
1423+
)
1424+
1425+
func DataPosterConfigAddOptions(prefix string, f *pflag.FlagSet, defaultDataPosterConfig DataPosterConfig, usageContext DataPosterUsageContext) {
14111426
f.DurationSlice(prefix+".replacement-times", defaultDataPosterConfig.ReplacementTimes, "comma-separated list of durations since first posting to attempt a replace-by-fee")
1412-
f.DurationSlice(prefix+".blob-tx-replacement-times", defaultDataPosterConfig.BlobTxReplacementTimes, "comma-separated list of durations since first posting a blob transaction to attempt a replace-by-fee")
14131427
f.Bool(prefix+".wait-for-l1-finality", defaultDataPosterConfig.WaitForL1Finality, "only treat a transaction as confirmed after L1 finality has been achieved (recommended)")
14141428
f.Uint64(prefix+".max-mempool-transactions", defaultDataPosterConfig.MaxMempoolTransactions, "the maximum number of transactions to have queued in the mempool at once (0 = unlimited)")
14151429
f.Uint64(prefix+".max-mempool-weight", defaultDataPosterConfig.MaxMempoolWeight, "the maximum number of weight (weight = min(1, tx.blobs)) to have queued in the mempool at once (0 = unlimited)")
14161430
f.Int(prefix+".max-queued-transactions", defaultDataPosterConfig.MaxQueuedTransactions, "the maximum number of unconfirmed transactions to track at once (0 = unlimited)")
14171431
f.Float64(prefix+".target-price-gwei", defaultDataPosterConfig.TargetPriceGwei, "the target price to use for maximum fee cap calculation")
14181432
f.Float64(prefix+".urgency-gwei", defaultDataPosterConfig.UrgencyGwei, "the urgency to use for maximum fee cap calculation")
14191433
f.Float64(prefix+".min-tip-cap-gwei", defaultDataPosterConfig.MinTipCapGwei, "the minimum tip cap to post transactions at")
1420-
f.Float64(prefix+".min-blob-tx-tip-cap-gwei", defaultDataPosterConfig.MinBlobTxTipCapGwei, "the minimum tip cap to post EIP-4844 blob carrying transactions at")
14211434
f.Float64(prefix+".max-tip-cap-gwei", defaultDataPosterConfig.MaxTipCapGwei, "the maximum tip cap to post transactions at")
1422-
f.Float64(prefix+".max-blob-tx-tip-cap-gwei", defaultDataPosterConfig.MaxBlobTxTipCapGwei, "the maximum tip cap to post EIP-4844 blob carrying transactions at")
14231435
f.Uint64(prefix+".max-fee-bid-multiple-bips", uint64(defaultDataPosterConfig.MaxFeeBidMultipleBips), "the maximum multiple of the current price to bid for a transaction's fees (may be exceeded due to min rbf increase, 0 = unlimited)")
14241436
f.Uint64(prefix+".nonce-rbf-soft-confs", defaultDataPosterConfig.NonceRbfSoftConfs, "the maximum probable reorg depth, used to determine when a transaction will no longer likely need replaced-by-fee")
14251437
f.Bool(prefix+".allocate-mempool-balance", defaultDataPosterConfig.AllocateMempoolBalance, "if true, don't put transactions in the mempool that spend a total greater than the batch poster's balance")
14261438
f.Bool(prefix+".use-db-storage", defaultDataPosterConfig.UseDBStorage, "uses database storage when enabled")
14271439
f.Bool(prefix+".use-noop-storage", defaultDataPosterConfig.UseNoOpStorage, "uses noop storage, it doesn't store anything")
1428-
f.Bool(prefix+".post-4844-blobs", defaultDataPosterConfig.Post4844Blobs, "if the parent chain supports 4844 blobs and they're well priced, post EIP-4844 blobs")
1429-
f.String(prefix+".enable-cell-proofs", defaultDataPosterConfig.EnableCellProofs, "enable cell proofs in blob transactions for Fusaka compatibility. Valid values: \"\" or \"auto\" (auto-detect based on L1 Osaka fork), \"force-enable\", \"force-disable\"")
14301440
f.Bool(prefix+".legacy-storage-encoding", defaultDataPosterConfig.LegacyStorageEncoding, "encodes items in a legacy way (as it was before dropping generics)")
14311441
f.String(prefix+".max-fee-cap-formula", defaultDataPosterConfig.MaxFeeCapFormula, "mathematical formula to calculate maximum fee cap gwei the result of which would be float64.\n"+
14321442
"This expression is expected to be evaluated please refer https://github.com/Knetic/govaluate/blob/master/MANUAL.md to find all available mathematical operators.\n"+
@@ -1438,6 +1448,17 @@ func DataPosterConfigAddOptions(prefix string, f *pflag.FlagSet, defaultDataPost
14381448
addDangerousOptions(prefix+".dangerous", f)
14391449
addExternalSignerOptions(prefix+".external-signer", f)
14401450
f.Bool(prefix+".disable-new-tx", defaultDataPosterConfig.DisableNewTx, "disable posting new transactions, data poster will still keep confirming existing batches")
1451+
1452+
includeBlobTuning := usageContext != DataPosterUsageStaker
1453+
if includeBlobTuning {
1454+
f.DurationSlice(prefix+".blob-tx-replacement-times", defaultDataPosterConfig.BlobTxReplacementTimes, "comma-separated list of durations since first posting a blob transaction to attempt a replace-by-fee")
1455+
f.Float64(prefix+".min-blob-tx-tip-cap-gwei", defaultDataPosterConfig.MinBlobTxTipCapGwei, "the minimum tip cap to post EIP-4844 blob carrying transactions at")
1456+
f.Float64(prefix+".max-blob-tx-tip-cap-gwei", defaultDataPosterConfig.MaxBlobTxTipCapGwei, "the maximum tip cap to post EIP-4844 blob carrying transactions at")
1457+
f.String(prefix+".enable-cell-proofs", defaultDataPosterConfig.EnableCellProofs, "enable cell proofs in blob transactions for Fusaka compatibility. Valid values: \"\" or \"auto\" (auto-detect based on L1 Osaka fork), \"force-enable\", \"force-disable\"")
1458+
}
1459+
1460+
// We intentionally don't expose an option to configure Post4844Blobs.
1461+
// Components using DataPoster should set it on DataPoster's config themselves.
14411462
}
14421463

14431464
func addDangerousOptions(prefix string, f *pflag.FlagSet) {
@@ -1487,6 +1508,11 @@ var DefaultDataPosterConfigForValidator = func() DataPosterConfig {
14871508
// the validator cannot queue transactions
14881509
config.MaxMempoolTransactions = 1
14891510
config.MaxMempoolWeight = 1
1511+
// Clear blob-related fields since they're not applicable to validator
1512+
config.BlobTxReplacementTimes = nil
1513+
config.MinBlobTxTipCapGwei = 0
1514+
config.MaxBlobTxTipCapGwei = 0
1515+
config.EnableCellProofs = ""
14901516
return config
14911517
}()
14921518

staker/legacy/staker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func L1ValidatorConfigAddOptions(prefix string, f *pflag.FlagSet) {
236236
f.String(prefix+".redis-url", DefaultL1ValidatorConfig.RedisUrl, "redis url for L1 validator")
237237
f.Uint64(prefix+".extra-gas", DefaultL1ValidatorConfig.ExtraGas, "use this much more gas than estimation says is necessary to post transactions")
238238
f.Uint64(prefix+".log-query-batch-size", DefaultL1ValidatorConfig.LogQueryBatchSize, "range ro query from eth_getLogs")
239-
dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f, dataposter.DefaultDataPosterConfigForValidator)
239+
dataposter.DataPosterConfigAddOptions(prefix+".data-poster", f, dataposter.DefaultDataPosterConfigForValidator, dataposter.DataPosterUsageStaker)
240240
DangerousConfigAddOptions(prefix+".dangerous", f)
241241
genericconf.WalletConfigAddOptions(prefix+".parent-chain-wallet", f, DefaultL1ValidatorConfig.ParentChainWallet.Pathname)
242242
f.Bool(prefix+".enable-fast-confirmation", DefaultL1ValidatorConfig.EnableFastConfirmation, "enable fast confirmation")

0 commit comments

Comments
 (0)