From efb4084f051d5b9a9363802999c46302cf33a2b2 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 14 Mar 2024 11:57:01 -0500 Subject: [PATCH 1/2] Set a maximum multiple of the current tx fees to bid in the data poster --- arbnode/dataposter/data_poster.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arbnode/dataposter/data_poster.go b/arbnode/dataposter/data_poster.go index c106df08fa..c26e7ab3b6 100644 --- a/arbnode/dataposter/data_poster.go +++ b/arbnode/dataposter/data_poster.go @@ -583,8 +583,13 @@ func (p *DataPoster) feeAndTipCaps(ctx context.Context, nonce uint64, gasLimit u blobGasUsed := params.BlobTxBlobGasPerBlob * numBlobs currentBlobCost := arbmath.BigMulByUint(currentBlobFee, blobGasUsed) currentNonBlobCost := arbmath.BigMulByUint(currentNonBlobFee, gasLimit) + currentTotalCost := arbmath.BigAdd(currentBlobCost, currentNonBlobCost) + if config.MaxFeeBidMultipleBips > 0 { + targetMaxCost = arbmath.BigMin(targetMaxCost, arbmath.BigMulByBips(currentTotalCost, config.MaxFeeBidMultipleBips)) + } + newBlobFeeCap := arbmath.BigMul(targetMaxCost, currentBlobFee) - newBlobFeeCap.Div(newBlobFeeCap, arbmath.BigAdd(currentBlobCost, currentNonBlobCost)) + newBlobFeeCap.Div(newBlobFeeCap, currentTotalCost) if lastTx != nil && lastTx.BlobGasFeeCap() != nil { newBlobFeeCap = arbmath.BigMax(newBlobFeeCap, arbmath.BigMulByBips(lastTx.BlobGasFeeCap(), minRbfIncrease)) } @@ -1117,6 +1122,7 @@ type DataPosterConfig struct { MinBlobTxTipCapGwei float64 `koanf:"min-blob-tx-tip-cap-gwei" reload:"hot"` MaxTipCapGwei float64 `koanf:"max-tip-cap-gwei" reload:"hot"` MaxBlobTxTipCapGwei float64 `koanf:"max-blob-tx-tip-cap-gwei" reload:"hot"` + MaxFeeBidMultipleBips arbmath.Bips `koanf:"max-fee-bid-multiple-bips" reload:"hot"` NonceRbfSoftConfs uint64 `koanf:"nonce-rbf-soft-confs" reload:"hot"` AllocateMempoolBalance bool `koanf:"allocate-mempool-balance" reload:"hot"` UseDBStorage bool `koanf:"use-db-storage"` @@ -1171,6 +1177,7 @@ func DataPosterConfigAddOptions(prefix string, f *pflag.FlagSet, defaultDataPost f.Float64(prefix+".min-blob-tx-tip-cap-gwei", defaultDataPosterConfig.MinBlobTxTipCapGwei, "the minimum tip cap to post EIP-4844 blob carrying transactions at") f.Float64(prefix+".max-tip-cap-gwei", defaultDataPosterConfig.MaxTipCapGwei, "the maximum tip cap to post transactions at") f.Float64(prefix+".max-blob-tx-tip-cap-gwei", defaultDataPosterConfig.MaxBlobTxTipCapGwei, "the maximum tip cap to post EIP-4844 blob carrying transactions at") + 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)") 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") 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") f.Bool(prefix+".use-db-storage", defaultDataPosterConfig.UseDBStorage, "uses database storage when enabled") @@ -1212,6 +1219,7 @@ var DefaultDataPosterConfig = DataPosterConfig{ MinBlobTxTipCapGwei: 1, // default geth minimum, and relays aren't likely to accept lower values given propagation time MaxTipCapGwei: 5, MaxBlobTxTipCapGwei: 1, // lower than normal because 4844 rbf is a minimum of a 2x + MaxFeeBidMultipleBips: arbmath.OneInBips * 10, NonceRbfSoftConfs: 1, AllocateMempoolBalance: true, UseDBStorage: true, @@ -1245,6 +1253,7 @@ var TestDataPosterConfig = DataPosterConfig{ MinBlobTxTipCapGwei: 1, MaxTipCapGwei: 5, MaxBlobTxTipCapGwei: 1, + MaxFeeBidMultipleBips: arbmath.OneInBips * 10, NonceRbfSoftConfs: 1, AllocateMempoolBalance: true, UseDBStorage: false, From dbf70fdb1b3156d7340cca6f1b189ac620c14d90 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 14 Mar 2024 11:58:55 -0500 Subject: [PATCH 2/2] Bump go-ethereum submodule to latest master --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index 088149d73d..09ec05c142 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 088149d73d7b39c844050e63f8a9c988ed8bdb2d +Subproject commit 09ec05c142b0430fa7b0d270f80ef423f1bb8a93