Commit 1c80299
committed
Use pending flashblocks state for bundle metering
Integrate flashblocks state into metering to execute bundles on top of
pending flashblock state rather than canonical block state. This ensures
metered gas usage and execution time accurately reflect the effects of
pending transactions (nonces, balances, storage, code changes).
Implementation:
- Add flashblocks-rpc dependency to metering crate
- Update meter_bundle() to accept optional db_cache parameter
- Implement three-layer state architecture:
1. StateProviderDatabase (canonical block base state)
2. CacheDB (applies flashblock pending changes via cache)
3. State wrapper (for EVM builder compatibility)
- Update MeteringApiImpl to accept FlashblocksState
- Get pending blocks and db_cache from flashblocks when available
- Fall back to canonical block state when no flashblocks available
- Update response to include flashblock_index in logs
- Require flashblocks to be enabled for metering RPC
- Update all tests to pass FlashblocksState parameter
The metering RPC now uses the same state as flashblocks eth_call,
ensuring consistent simulation results.1 parent a2ca31d commit 1c80299
File tree
13 files changed
+227
-103
lines changed- crates
- flashblocks-rpc
- src
- metering
- src
- tests
- node/src
13 files changed
+227
-103
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
0 commit comments