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

feat: Flashblock RPCs #4

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

feat: Flashblock RPCs #4

wants to merge 21 commits into from

Conversation

cody-wang-cb
Copy link
Collaborator

@cody-wang-cb cody-wang-cb commented Feb 5, 2025

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 cache
  • eth_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

@cody-wang-cb cody-wang-cb changed the title Fixed standard RPC flow and added cache Added cache and stream data subscriber to receive data Feb 10, 2025
};
}

pub fn transform_tx(
Copy link
Collaborator Author

@cody-wang-cb cody-wang-cb Feb 12, 2025

Choose a reason for hiding this comment

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

}
}

pub fn transform_receipt(
Copy link
Collaborator Author

@cody-wang-cb cody-wang-cb Feb 12, 2025

Choose a reason for hiding this comment

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

src/rpc.rs Outdated
Self { eth_api, cache }
}

pub fn transform_block(&self, block: OpBlock) -> RpcBlock<Optimism> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,163 @@
use crate::cache::Cache;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cody-wang-cb cody-wang-cb changed the title Added cache and stream data subscriber to receive data feat: Flashblock RPCs Feb 26, 2025
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.

1 participant