mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Compare commits
1 Commits
209a806c83
...
f94005a73b
| Author | SHA1 | Date | |
|---|---|---|---|
| f94005a73b |
@ -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`]
|
||||
|
||||
@ -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};
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user