From f1e5bac52f72c9d87901555003acf4ebc28d265b Mon Sep 17 00:00:00 2001 From: sprites0 <199826320+sprites0@users.noreply.github.com> Date: Thu, 17 Apr 2025 07:20:36 +0000 Subject: [PATCH] chore: Sync with hyper-evm-sync --- crates/primitives-traits/src/transaction/signed.rs | 4 ++-- crates/revm/src/database.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/primitives-traits/src/transaction/signed.rs b/crates/primitives-traits/src/transaction/signed.rs index 41ae8f7d3..ff61dc208 100644 --- a/crates/primitives-traits/src/transaction/signed.rs +++ b/crates/primitives-traits/src/transaction/signed.rs @@ -20,14 +20,14 @@ pub trait FullSignedTx: SignedTransaction + MaybeCompact + MaybeSerdeBincodeComp impl FullSignedTx for T where T: SignedTransaction + MaybeCompact + MaybeSerdeBincodeCompat {} /// Hyperliquid system transaction from address. -pub const HL_SYSTEM_TX_FROM_ADDR: Address = address!("2222222222222222222222222222222222222222"); +pub const NATIVE_TOKEN_SYSTEM_ADDRESS: Address = address!("2222222222222222222222222222222222222222"); /// Check if the transaction is impersonated. /// Signature part is introduced in block_ingest, while the gas_price is trait of hyperliquid system transactions. pub fn is_impersonated_tx(signature: &Signature, gas_price: Option) -> Option
{ if signature.r() == U256::from(1) && signature.v() == true && gas_price == Some(0u128) { if signature.s() == U256::from(1) { - Some(HL_SYSTEM_TX_FROM_ADDR) + Some(NATIVE_TOKEN_SYSTEM_ADDRESS) } else { let s = signature.s().reduce_mod(U256::from(U160::MAX).add(U256::from(1))); let s = U160::from(s); diff --git a/crates/revm/src/database.rs b/crates/revm/src/database.rs index a6998b028..9a0c295f2 100644 --- a/crates/revm/src/database.rs +++ b/crates/revm/src/database.rs @@ -159,7 +159,8 @@ impl DatabaseRef for StateProviderDatabase { /// /// Returns `Ok` with the block hash if found, or the default hash otherwise. fn block_hash_ref(&self, number: u64) -> Result { - if number >= 270000 { + const NON_PLACEHOLDER_BLOCK_HASH_HEIGHT: u64 = 243_538; + if number >= NON_PLACEHOLDER_BLOCK_HASH_HEIGHT { // Get the block hash or default hash with an attempt to convert U256 block number to u64 Ok(self.0.block_hash(number)?.unwrap_or_default()) } else {