-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(flashblocks): support eth_getBlockTransactionCount for flashblocks #20291
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
base: main
Are you sure you want to change the base?
Conversation
* feat: overriding option to add new APIs to support flashblock * fmt * chore: remove code
mattsse
left a comment
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.
that makes sense but should we perhaps change
reth/crates/rpc/rpc-eth-api/src/helpers/block.rs
Lines 77 to 83 in 1752d6f
| if block_id.is_pending() { | |
| // Pending block can be fetched directly without need for caching | |
| return Ok(self | |
| .provider() | |
| .pending_block() | |
| .map_err(Self::Error::from_eth_err)? | |
| .map(|block| block.body().transaction_count())); |
to just
reth/crates/rpc/rpc-eth-api/src/helpers/block.rs
Lines 189 to 192 in 1752d6f
| // If no pending block from provider, build the pending block locally. | |
| if let Some(pending) = self.local_pending_block().await? { | |
| return Ok(Some((pending.block, pending.receipts))); | |
| } |
instead?
fix: update according to review
|
Hi @mattsse, we have made changes according to your suggestion. We now do not duplicate the logic but update the |
| block_id: BlockId, | ||
| ) -> impl Future<Output = Result<Option<usize>, Self::Error>> + Send { | ||
| async move { | ||
| if block_id.is_pending() { |
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.
ah we need to keep this check actually
Summary