-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
A-rpcRelated to the RPC implementationRelated to the RPC implementationC-enhancementNew feature or requestNew feature or requestD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get started
Description
Describe the feature
currently, this fetches the entire block:
| let header = self.recovered_block(BlockNumberOrTag::Latest.into()); |
but we only need the most recent header which we could fethc from
reth/crates/storage/storage-api/src/block.rs
Lines 304 to 310 in 4686778
| /// Returns the latest block header if available | |
| /// | |
| /// Note: This returns a [`SealedHeader`] because it's expected that this is sealed by the | |
| /// provider and the caller does not know the hash. | |
| fn latest_header(&self) -> ProviderResult<Option<SealedHeader<Self::Header>>> { | |
| self.sealed_header_by_id(BlockNumberOrTag::Latest.into()) | |
| } |
but the trait bounds currently only require BlockReader
reth/crates/rpc/rpc-eth-api/src/node.rs
Line 84 in 4686778
| pub trait RpcNodeCoreExt: RpcNodeCore<Provider: BlockReader> { |
but we need BlockReaderIdExt for this
TODO
- extend the Provider bound in LoadFee trait to BlockReaderIdExt
- use latest_header for fetching the fee
we could maybe even bump the trait bound here entirely:
reth/crates/rpc/rpc-eth-api/src/node.rs
Line 84 in 4686778
| pub trait RpcNodeCoreExt: RpcNodeCore<Provider: BlockReader> { |
which is maybe easier long term but more invasive
Additional context
No response
Metadata
Metadata
Assignees
Labels
A-rpcRelated to the RPC implementationRelated to the RPC implementationC-enhancementNew feature or requestNew feature or requestD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get started
Type
Projects
Status
Done