-
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
Implement eth_feeHistory
and eth_maxPriorityFeePerGas
APIs
#2221
base: main
Are you sure you want to change the base?
Implement eth_feeHistory
and eth_maxPriorityFeePerGas
APIs
#2221
Conversation
|
Branch | 1512-implement-eth_feehistory-to-support-type-2-transactions |
Testbed | self-hosted |
Click to view all benchmark results
Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
---|---|---|---|
full-blocks-erc20-transfers/full-blocks-erc20-transfers | 📈 view plot 🚷 view threshold | 1,258.60(+1.15%)Baseline: 1,244.26 | 1,633.60 (77.04%) |
full-blocks-evm-transfers/full-blocks-evm-transfers | 📈 view plot 🚷 view threshold | 435.80(-12.92%)Baseline: 500.48 | 719.34 (60.58%) |
full-blocks-zil-transfers/full-blocks-zil-transfers | 📈 view plot 🚷 view threshold | 3,373.00(-13.97%)Baseline: 3,920.64 | 5,140.35 (65.62%) |
process-empty/process-empty | 📈 view plot 🚷 view threshold | 10.13(+11.36%)Baseline: 9.10 | 11.41 (88.77%) |
…ment-eth_feehistory-to-support-type-2-transactions
…ment-eth_feehistory-to-support-type-2-transactions
…ment-eth_feehistory-to-support-type-2-transactions
…ment-eth_feehistory-to-support-type-2-transactions
… fee history structure
…ment-eth_feehistory-to-support-type-2-transactions
…ment-eth_feehistory-to-support-type-2-transactions
…ment-eth_feehistory-to-support-type-2-transactions
eth_feeHistory
and eth_maxPriorityFeePerGas
APIs
@@ -196,6 +198,7 @@ impl Header { | |||
.duration_since(SystemTime::UNIX_EPOCH) | |||
.unwrap_or_default() | |||
.as_secs(), | |||
base_fee_per_gas: 0, |
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.
Why is this zero? Shouldn't it be set to the gas price?
} | ||
|
||
let newest_block: BlockNumberOrTag = params.next()?; | ||
let reward_percentiles: Option<Vec<f64>> = params.optional_next()?.unwrap_or_default(); |
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.
Did you mean to add unwrap_or_default
here? I believe this means the API is now expecting a Option<Option<Vec<f64>>>
which doesn't make much sense.
let tx = node | ||
.get_transaction_by_hash(*tx_hash)? | ||
.ok_or_else(|| anyhow!("transaction not found: {}", tx_hash))?; | ||
Ok(tx.tx.effective_priority_fee(block.header.base_fee_per_gas)) |
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.
Is it correct to use the priority fee here? This will be zero for all non-EIP-1559 transactions.
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.
I think not, because if I call eth_feeHistory
on a Ethereum mainnet block from before EIP-1559, there are non-zero values in reward
.
reward_percentiles | ||
.iter() | ||
.map(|x| { | ||
let i = (x * fees_len / 100_f64) as usize; | ||
effective_priority_fees.get(i).cloned().unwrap_or_default() | ||
}) | ||
.collect() |
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.
Some comments here would be nice. It took me a while to work out what this was doing and why it is correct.
No description provided.