Skip to content
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

block_number_index added to callBundle reference type #1705

Merged
merged 8 commits into from
Dec 2, 2024

Conversation

ciaranmcveigh5
Copy link
Contributor

Motivation

Ability to quickly identify via an API call why a bundle did not land

paradigmxyz/reth#12353

Solution

Allow callBundle simulations to occur from a block index rather than a state_block_number, if a bundle has a target transaction that lands in block x this enables you to simulate from the exact index in block x where the target transaction landed to see if there were transactions higher in the block that caused a state conflict.

PR Checklist

  • Ran cargo test --doc - no tests present for alloy_rpc_types_mev
  • No documentation present on alloy_rpc_types_mev outside of "Types for the MEV bundle JSON-RPC namespace."

@ciaranmcveigh5
Copy link
Contributor Author

One thing to note, there are 2 options naming wise, which likely have implications on the implementation

Don't have a strong opinion on which is better

Option 1

  • Naming: block_number_index
  • Fields that must be present: block_number & block_number_index

Option 2

  • Naming: state_block_number_index
  • Fields that must be present: block_number, state_block_number & state_block_number_index

This requires you to update the state_block_number to be the same as the block_number and include all 3 fields

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

since this is just an extra setting, this should be fine

@ciaranmcveigh5
Copy link
Contributor Author

Just updated the imports for TransactionIndex

@mattsse mattsse enabled auto-merge (squash) December 2, 2024 15:03
@mattsse mattsse merged commit af482e0 into alloy-rs:main Dec 2, 2024
26 checks passed
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.

2 participants