Skip to content

Conversation

@niran
Copy link
Contributor

@niran niran commented Oct 24, 2025

Implements JSON-RPC endpoint to simulate and meter Optimism transaction bundles, returning detailed gas usage, execution time, and bundle hash using Flashbots methodology.

Includes reusable meter_bundle() function for non-RPC contexts.

Implements JSON-RPC endpoint to simulate and meter Optimism transaction bundles, returning detailed gas usage, execution time, and bundle hash using Flashbots methodology.

Includes reusable meter_bundle() function for non-RPC contexts.
@danyalprout danyalprout self-requested a review October 27, 2025 00:28
Copy link
Collaborator

@danyalprout danyalprout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, left some comments on things that stood out but aren't blockers to merging.

Can we add a sanity check e2e test to this? Happy to do it in a follow up PR

niran added 4 commits October 27, 2025 17:11
Add comprehensive tests following flashblocks-rpc pattern with funded
test accounts from genesis.json. Tests cover bundle metering, gas
calculations, state resolution, and error handling.
- Add tips-core dependency (default-features=false to avoid version conflicts)
- Replace MeterBundleRequest with tips-core Bundle
- Use BundleWithMetadata.bundle_hash() instead of manual calculation
- Use bundle.block_number and bundle.min_timestamp for simulation
- Update docs to clarify TIPS Bundle format
- Add workaround for op-alloy 0.20/0.21 version mismatch (temporary until next reth release)
@niran niran requested a review from danyalprout October 28, 2025 00:24
@niran
Copy link
Contributor Author

niran commented Oct 28, 2025

Once this is reviewed, I'm going to re-open this PR against main to merge it in now that there's a feature flag for it. (thanks @wlawt)

EDIT: turns out the merge base is editable! It's now based on main.

Update tips-core to rev 27674ae which includes the metering response types.
Remove local type definitions and use the types from tips-core instead.
niran added 2 commits October 29, 2025 11:16
Bundle metering now always uses the latest available block state for
simulation. The bundle.block_number parameter is only used for TIPS
bundle validity checks, not for state selection.
@niran niran merged commit f76c7cb into main Oct 29, 2025
8 checks passed
@niran niran deleted the metering-rpc branch October 29, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants