feat: update revm 19 alloy 09 (#13594)

This commit is contained in:
Matthias Seitz
2024-12-30 19:49:39 +01:00
committed by GitHub
parent a6325c41e0
commit 0b135a2670
54 changed files with 273 additions and 341 deletions

View File

@ -1,7 +1,7 @@
//! `eth_` Extension traits.
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types_eth::erc4337::ConditionalOptions;
use alloy_rpc_types_eth::erc4337::TransactionConditional;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
/// Extension trait for `eth_` namespace for L2s.
@ -13,6 +13,6 @@ pub trait L2EthApiExt {
async fn send_raw_transaction_conditional(
&self,
bytes: Bytes,
condition: ConditionalOptions,
condition: TransactionConditional,
) -> RpcResult<B256>;
}

View File

@ -1,6 +1,7 @@
//! Loads fee history from database. Helper trait for `eth_` fee and transaction RPC methods.
use alloy_consensus::BlockHeader;
use alloy_eips::eip7840::BlobParams;
use alloy_primitives::U256;
use alloy_rpc_types_eth::{BlockNumberOrTag, FeeHistory};
use futures::Future;
@ -166,7 +167,7 @@ pub trait EthFees: LoadFee {
for header in &headers {
base_fee_per_gas.push(header.base_fee_per_gas().unwrap_or_default() as u128);
gas_used_ratio.push(header.gas_used() as f64 / header.gas_limit() as f64);
base_fee_per_blob_gas.push(header.blob_fee().unwrap_or_default());
base_fee_per_blob_gas.push(header.blob_fee(BlobParams::cancun()).unwrap_or_default());
blob_gas_used_ratio.push(
header.blob_gas_used().unwrap_or_default() as f64
/ alloy_eips::eip4844::MAX_DATA_GAS_PER_BLOCK as f64,
@ -207,7 +208,7 @@ pub trait EthFees: LoadFee {
// Same goes for the `base_fee_per_blob_gas`:
// > "[..] includes the next block after the newest of the returned range, because this value can be derived from the newest block.
base_fee_per_blob_gas.push(last_header.next_block_blob_fee().unwrap_or_default());
base_fee_per_blob_gas.push(last_header.next_block_blob_fee(BlobParams::cancun()).unwrap_or_default());
};
Ok(FeeHistory {
@ -332,7 +333,7 @@ pub trait LoadFee: LoadBlock {
async move {
self.block_with_senders(BlockNumberOrTag::Latest.into())
.await?
.and_then(|h| h.next_block_blob_fee())
.and_then(|h| h.next_block_blob_fee(BlobParams::cancun()))
.ok_or(EthApiError::ExcessBlobGasNotSet.into())
.map(U256::from)
}