-
Notifications
You must be signed in to change notification settings - Fork 83
Implement base_meterPriorityFeePerGas so transactions can outbid resource constraints #201
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
Draft
niran
wants to merge
13
commits into
main
Choose a base branch
from
node-reth-metered-priority-fee
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Contributor
niran
commented
Nov 14, 2025
- keep a 12-block in-memory cache of metered transactions (gas, DA size, execution timing) and percentile estimator to drive base_meteredPriorityFeePerGas
- stream accepted bundles from Kafka and flashblock updates into that cache, emitting only freshness/error metrics and tracing for diagnostics
- update the metering RPC to meter incoming bundles once, derive their resource demand, and return per-resource priority-fee recommendations based on recent flashblocks
Collaborator
🟡 Heimdall Review Status
|
The Kafka AcceptedBundle contains the *requested* block number and the flashblock state used for *simulation*, not the actual inclusion location. The websocket flashblock feed provides the real (block, flashblock_index). - Store Kafka metering data in pending map keyed by tx hash - Populate cache when flashblock websocket events arrive with real location - Remove unused FlashblockSnapshot and snapshot channel - Bound pending map to 10k entries with FIFO eviction - All transactions are bundles; warn on any misses
- Replace BTreeMap<ResourceKind, ResourceEstimate> with ResourceEstimates struct - Add rolling window estimation across cached blocks (median per resource) - Add single recommended_priority_fee field (max across resources) - Rename next_block/next_flashblock to min/max_across_flashblocks - Add doc comments explaining the estimation algorithm
Replace bottom-up fee discovery with top-down subtraction algorithm that walks transactions from highest to lowest fee, subtracting usage until remaining capacity falls below bundle demand. - Add ResourceLimits struct for configured capacity limits - Add CLI args for gas, execution time, DA, percentile, and uncongested fee - Return error when bundle demand exceeds resource capacity - Return configurable default fee for uncongested resources
…cking Replace hardcoded cache size with --metering-cache-size CLI argument. Remove unused flashblock-per-block limit tracking that was never actionable.
- Fix O(n²) index rebuild in cache eviction by moving rebuild outside loop - Add --metering-state-root-time-us CLI arg for forward compatibility - Reduce cloning in estimator by using reference slices for aggregation - Fix supporting_transactions to return 0 when no txs fit (was incorrectly 1) - Export ResourceFeeEstimateResponse from public API - Rename supporting_transactions to threshold_tx_count for clarity
The priority fee estimator now respects dynamic DA limits set via the miner_setMaxDASize RPC call. This allows operators to adjust DA limits at runtime without restarting the node. Key changes: - PriorityFeeEstimator accepts optional OpDAConfig for dynamic DA limits - When metering is enabled, the miner RPC module is automatically enabled - Shared OpDAConfig is passed to both OpNode (for miner RPC) and estimator - Add integration test that verifies setMaxDASize affects priority fee estimates
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.