Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/cast-hyperliquid-system-sender.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
foundry-common: patch
cast: patch
forge: patch
---

Recognized the HyperEVM system sender that credits HyperCore transfers, so replaying transactions from a block that contains one no longer fails base fee validation.
12 changes: 10 additions & 2 deletions crates/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ pub const OPTIMISM_SYSTEM_ADDRESS: Address = address!("0xdeaddeaddeaddeaddeaddea
/// The system address, the sender of the first transaction in every block:
pub const MONAD_SYSTEM_ADDRESS: Address = address!("0x6f49a8F621353f12378d0046E7d7e4b9B249DC9e");

/// HyperEVM system address that credits HyperCore -> HyperEVM native transfers.
///
/// These are legacy envelopes with `gasPrice = 0` and a receipt `gasUsed` of `0`, so replaying one
/// as a regular transaction fails base fee validation and aborts the whole block replay.
pub const HYPERLIQUID_SYSTEM_ADDRESS: Address =
address!("0x2222222222222222222222222222222222222222");

/// MegaETH system address for `Set Slots` in the MegaETH oracle.
///
/// Transactions from this sender are submitted with gas price 0.
Expand All @@ -62,14 +69,15 @@ pub const TYPE_BINDING_PREFIX: &str = "string constant schema_";
///
/// Transactions from these senders usually don't have a any fee information OR set absurdly high fees that exceed the gas limit (See: <https://github.com/foundry-rs/foundry/pull/10608>)
///
/// See: [ARBITRUM_SENDER], [OPTIMISM_SYSTEM_ADDRESS], [MONAD_SYSTEM_ADDRESS], [MEGA_SYSTEM_ADDRESS]
/// and [Address::ZERO]
/// See: [ARBITRUM_SENDER], [OPTIMISM_SYSTEM_ADDRESS], [MONAD_SYSTEM_ADDRESS],
/// [MEGA_SYSTEM_ADDRESS], [HYPERLIQUID_SYSTEM_ADDRESS] and [Address::ZERO]
pub fn is_known_system_sender(sender: Address) -> bool {
[
ARBITRUM_SENDER,
OPTIMISM_SYSTEM_ADDRESS,
MONAD_SYSTEM_ADDRESS,
MEGA_SYSTEM_ADDRESS,
HYPERLIQUID_SYSTEM_ADDRESS,
Address::ZERO,
]
.contains(&sender)
Expand Down
Loading