1 Commits

Author SHA1 Message Date
f94005a73b feat: Support highest_precompile_address 2025-07-19 21:16:54 +00:00
6 changed files with 22 additions and 11 deletions

View File

@ -219,8 +219,7 @@ fn not_from_system_tx<Eth: EthWrapper>(log: &Log, provider: &Eth::Provider) -> b
!transactions
.iter()
.filter(|tx| tx.is_system_transaction())
.map(|tx| *tx.tx_hash())
.any(|tx_hash| tx_hash == log.transaction_hash.unwrap())
.map(|tx| *tx.tx_hash()).any(|tx_hash| tx_hash == log.transaction_hash.unwrap())
}
/// Helper to convert a serde error into an [`ErrorObject`]

View File

@ -1,4 +1,3 @@
pub mod call_forwarder;
pub mod chainspec;
pub mod consensus;
mod evm;
@ -7,5 +6,6 @@ pub mod hl_node_compliance;
pub mod node;
pub mod pseudo_peer;
pub mod tx_forwarder;
pub mod call_forwarder;
pub use node::primitives::{HlBlock, HlBlockBody, HlPrimitives};

View File

@ -268,7 +268,7 @@ where
});
}
// NOTE: This is adapted from hyperliquid-dex/hyper-evm-sync#5
// NOTE: Hotfix for the precompile issue (#17). Remove this once the issue is fixed.
const WARM_PRECOMPILES_BLOCK_NUMBER: u64 = 8_197_684;
if block_number >= U256::from(WARM_PRECOMPILES_BLOCK_NUMBER) {
fill_all_precompiles(ctx, precompiles_mut);

View File

@ -112,8 +112,7 @@ where
) -> Result<ResultAndState<Self::HaltReason>, Self::Error> {
// NOTE: This is used for block traces.
// Per hyper-evm-sync, HyperEVM doesn't seem to call this method, so
// - we just return a success result with no changes, which gives the same semantics as
// HyperEVM.
// - we just return a success result with no changes, which gives the same semantics as HyperEVM.
// - In a long term (ideally), consider implementing SystemCaller.
Ok(ResultAndState::new(
ExecutionResult::Success {

View File

@ -38,11 +38,11 @@ impl HlStorage {
tables::BlockReadPrecompileCalls,
> = provider.tx_ref().cursor_write::<tables::BlockReadPrecompileCalls>()?;
for (block_number, extras) in inputs {
for (block_number, extra) in inputs {
precompile_calls_cursor.append(
block_number,
&Bytes::copy_from_slice(
&rmp_serde::to_vec(&extras).expect("Failed to serialize read precompile calls"),
&rmp_serde::to_vec(&extra).expect("Failed to serialize read precompile calls"),
),
)?;
}
@ -58,7 +58,7 @@ impl HlStorage {
where
Provider: DBProvider<Tx: DbTx>,
{
let mut extras: Vec<HlExtras> = Vec::with_capacity(inputs.len());
let mut extra: Vec<HlExtras> = Vec::with_capacity(inputs.len());
let mut precompile_calls_cursor =
provider.tx_ref().cursor_read::<tables::BlockReadPrecompileCalls>()?;
@ -68,10 +68,10 @@ impl HlStorage {
.map(|(_, calls)| calls)
.map(|calls| rmp_serde::from_slice(&calls).unwrap())
.unwrap_or_default();
extras.push(precompile_calls);
extra.push(precompile_calls);
}
Ok(extras)
Ok(extra)
}
}

View File

@ -1,3 +1,16 @@
//! Tables and data models.
//!
//! # Overview
//!
//! This module defines the tables in reth, as well as some table-related abstractions:
//!
//! - [`codecs`] integrates different codecs into [`Encode`] and [`Decode`]
//! - [`models`](crate::models) defines the values written to tables
//!
//! # Database Tour
//!
//! TODO(onbjerg): Find appropriate format for this...
use alloy_primitives::{BlockNumber, Bytes};
use reth_db::{table::TableInfo, tables, TableSet, TableType, TableViewer};
use std::fmt;