-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Flashblock RPCs #4
base: main
Are you sure you want to change the base?
Conversation
}; | ||
} | ||
|
||
pub fn transform_tx( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation similar to https://github.com/paradigmxyz/reth/blob/main/crates/optimism/rpc/src/eth/transaction.rs#L84
} | ||
} | ||
|
||
pub fn transform_receipt( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation similar to https://github.com/paradigmxyz/reth/blob/main/crates/optimism/rpc/src/eth/receipt.rs#L26
src/rpc.rs
Outdated
Self { eth_api, cache } | ||
} | ||
|
||
pub fn transform_block(&self, block: OpBlock) -> RpcBlock<Optimism> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation similar to https://github.com/paradigmxyz/reth/blob/v1.1.5/crates/rpc/rpc-types-compat/src/block.rs#L84
@@ -0,0 +1,163 @@ | |||
use crate::cache::Cache; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
websocket implementation similar to https://github.com/flashbots/rollup-boost/blob/flashblocks/src/flashblocks.rs
Added support for 3 RPCs
eth_getBlockByNumber
with pending tag.eth_getTransactionReceipt
, it checks if it exists in the DB first, if not, then maybe it's a flashblock receipt then it checks in the cacheeth_getBalance
with pending tag.It runs a websocket client and listens to the rollup-boost web proxy. It parses the message and store the necessary information into the cache.
For message out of order scenarios, currently only handles to not updating older blocks, but doesn't handle cases like same block payload message out of order, will be TODO for future updates.
Verified locally and devnet.
https://base-sepolia-alpha-reth-rpc-donotuse.cbhq.net:8545