-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: support pending block in feeHistory endpoint #11800
base: main
Are you sure you want to change the base?
Conversation
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.
cool, overall this looks right, some suggestions, though not 100% sure all are feasible
@mattsse I think this should be ready |
@@ -87,6 +98,9 @@ pub trait EthFees: LoadFee { | |||
.map_err(Self::Error::from_eth_err)? | |||
.ok_or(EthApiError::HeaderNotFound(newest_block.into()))?; | |||
|
|||
let pending_block = | |||
if newest_block.is_pending() { self.local_pending_block().await? } else { None }; |
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.
looks like it is unreachable because of
reth/crates/rpc/rpc-eth-api/src/helpers/fee.rs
Lines 78 to 84 in 09506aa
if newest_block.is_pending() { | |
// cap the target block since we don't have fee history for the pending block | |
newest_block = BlockNumberOrTag::Latest; | |
// account for missing pending block | |
block_count = block_count.saturating_sub(1); | |
} | |
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.
yep
this also seems problematic because fee history cache won't contain a pending block I'd prefer us to have a test for this. we've just added a simple fee history e2e test in #12058, so you can use it as reference |
this would be hard to use |
should close #11795