fix(fee): bump priority fee + gas budget to clear gravity-reth promote threshold#48
Merged
Merged
Conversation
3 tasks
…e threshold Empirically, gravity-reth's txpool keeps transactions in the `queued` bucket and never promotes them to `pending` when the priority fee is below ~hundreds of Gwei, even when the max_fee_per_gas is well above the base fee. Transactions sit there indefinitely and the bench run makes no progress (Pool Pending stays 0 while Pool Queued grows). Aligning bench's defaults so they actually land: * `BENCH_MAX_PRIORITY_FEE_PER_GAS` 1 → 500 Gwei This is the user-visible knob that decides whether txs promote. * `BENCH_MAX_FEE_PER_GAS` 100 → 5000 Gwei Headroom = 10× priority, same ratio as before. * `GAS_COST_PER_TXN_BUDGET` 1e16 → 5e17 wei (lockstep) Per the existing comment "Bumping max_fee_per_gas requires bumping this in lockstep". Without this bump, `faucet_balance - total_cost` underflows U256 in the cascade-faucet planner and `amount_per_recipient` comes out astronomical, causing every faucet tx to fail with `insufficient funds`. * `scripts/deploy.py` legacy gasPrice → 800 Gwei (new constant) Same reason: contract deploys / approves / addLiquidity were stuck in `queued` because `w3.eth.gas_price` returns ~baseFee + 1 Gwei. 800 Gwei clears the threshold and stays under the 1 ETH RPC `txfeecap` for the gas limits used here. Reproduced against gravity testnet (`chainId=127001`, baseFee 50 Gwei, 1 ETH txfeecap). Before: 0 confirmed transfers, all txs stuck in `queued`. After: ~5k TPS sustained, ERC20 conservation verified (sum of balanceOf across all 111111 holders == totalSupply, exact).
7b42f23 to
ff6495c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bench's default fee parameters are below gravity-reth's txpool promotion threshold under load: transactions land in the
queuedbucket and are never promoted topending, so they stay in the mempool indefinitely and never get mined. Aligning bench's defaults so transactions actually land on a freshly-deployed gravity testnet.Changes
BENCH_MAX_PRIORITY_FEE_PER_GASBENCH_MAX_FEE_PER_GASGAS_COST_PER_TXN_BUDGET(faucet planner)BENCH_MAX_FEE_PER_GASper the existing comment. Without this bumpfaucet_balance - total_costunderflows U256 andamount_per_recipientbecomes astronomical → every faucet tx fails withinsufficient fundsscripts/deploy.pylegacy gasPricew3.eth.gas_price(~baseFee + 1 Gwei)DEPLOY_GAS_PRICE_WEI = 800 Gwei(new constant)txfeecapfor the gas limits used hereSymptom this fixes
On a fresh gravity testnet (chainId 127001, baseFee 50 Gwei, 1 ETH txfeecap):
Before:
Pool Pending: 0/Pool Queued: N, growing without boundtxpool_contentshows transactions inqueuedwith the right nonces but they sit there foreverAfter:
sum(balanceOf)across all 111111 holders ==totalSupply()exactly, on both TKN1 and TKN2Success%is now bounded by RPC receipt latency rather than by mempool stucknessTest plan
cargo checkpasses.totalSupply()andΣ balanceOfover all 111111 holders for both TKN1 and TKN2.Notes for reviewers
These constants make sense to live as configurable values eventually, but a one-off constant bump is the smaller change and matches the existing precedent (#46 "align bench fees with Gravity 50 Gwei min base fee"). Happy to follow up with a config-driven version if preferred.
The lockstep coupling between
BENCH_MAX_FEE_PER_GASandGAS_COST_PER_TXN_BUDGETwas already documented in the existing comment but only checked manually; this PR keeps that contract intact.🤖 Generated with Claude Code