Skip to content

Commit

Permalink
fix: remove eip-7002 and eip-7251
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Feb 1, 2025
1 parent b566df9 commit 4620d52
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 76 deletions.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion crates/consensus/src/hardforks/bytecode/isthmus_tx_2.hex

This file was deleted.

1 change: 0 additions & 1 deletion crates/consensus/src/hardforks/bytecode/isthmus_tx_3.hex

This file was deleted.

4 changes: 2 additions & 2 deletions crates/consensus/src/hardforks/forks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::{Ecotone, Fjord, Isthmus};
/// ```rust
/// use op_alloy_consensus::{Hardfork, Hardforks};
/// let isthmus_upgrade_tx = Hardforks::ISTHMUS.txs();
/// assert_eq!(isthmus_upgrade_tx.collect::<Vec<_>>().len(), 3);
/// assert_eq!(isthmus_upgrade_tx.collect::<Vec<_>>().len(), 1);
/// ```
#[derive(Debug, Default, Clone, Copy)]
#[non_exhaustive]
Expand Down Expand Up @@ -60,6 +60,6 @@ mod tests {
assert_eq!(fjord_upgrade_txs.collect::<Vec<_>>().len(), 3);

let isthmus_upgrade_tx = Hardforks::ISTHMUS.txs();
assert_eq!(isthmus_upgrade_tx.collect::<Vec<_>>().len(), 3);
assert_eq!(isthmus_upgrade_tx.collect::<Vec<_>>().len(), 1);
}
}
83 changes: 13 additions & 70 deletions crates/consensus/src/hardforks/isthmus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,83 +20,29 @@ impl Isthmus {
/// EIP-2935 From Address
pub const EIP2935_FROM: Address = address!("E9f0662359Bb2c8111840eFFD73B9AFA77CbDE10");

/// EIP-7002 From Address
pub const EIP7002_FROM: Address = address!("a05D9eED37862daB22b002b8F6668B8Fb0c4D798");

/// EIP-7251 From Address
pub const EIP7251_FROM: Address = address!("e24B968aB4319a580d9FFc7Ac29466894FeEb361");

/// Returns the source hash for the Isthmus Deposit Contract deployment.
pub fn deposit_contract_source() -> B256 {
UpgradeDepositSource { intent: String::from("Isthmus: deposit contract deployment") }
.source_hash()
}

/// Returns the source hash for the Isthmus Withdrawals Request Contract deployment.
pub fn withdrawals_request_contract_source() -> B256 {
UpgradeDepositSource {
intent: String::from("Isthmus: withdrawals request contract deployment"),
}
.source_hash()
}

/// Returns the source hash for the Isthmus Consolidation Requests Contract deployment.
pub fn consolidation_requests_contract_source() -> B256 {
UpgradeDepositSource {
intent: String::from("Isthmus: consolidation requests contract deployment"),
}
.source_hash()
}

/// Returns the EIP-2935 creation data.
pub fn eip2935_creation_data() -> Bytes {
include_bytes!("./bytecode/eip2935_isthmus.hex").into()
}

/// Returns the EIP-7002 creation data.
pub fn eip7002_creation_data() -> Bytes {
include_bytes!("./bytecode/eip7002_isthmus.hex").into()
}

/// Returns the EIP-7251 creation data.
pub fn eip7251_creation_data() -> Bytes {
include_bytes!("./bytecode/eip7251_isthmus.hex").into()
}

/// Returns the list of [TxDeposit]s for the network upgrade.
pub fn deposits() -> impl Iterator<Item = TxDeposit> {
([
TxDeposit {
source_hash: Self::deposit_contract_source(),
from: Self::EIP2935_FROM,
to: TxKind::Create,
mint: 0.into(),
value: U256::ZERO,
gas_limit: 250_000,
is_system_transaction: false,
input: Self::eip2935_creation_data(),
},
TxDeposit {
source_hash: Self::withdrawals_request_contract_source(),
from: Self::EIP7002_FROM,
to: TxKind::Create,
mint: 0.into(),
value: U256::ZERO,
gas_limit: 250_000,
is_system_transaction: false,
input: Self::eip7002_creation_data(),
},
TxDeposit {
source_hash: Self::consolidation_requests_contract_source(),
from: Self::EIP7251_FROM,
to: TxKind::Create,
mint: 0.into(),
value: U256::ZERO,
gas_limit: 250_000,
is_system_transaction: false,
input: Self::eip7251_creation_data(),
},
])
([TxDeposit {
source_hash: Self::deposit_contract_source(),
from: Self::EIP2935_FROM,
to: TxKind::Create,
mint: 0.into(),
value: U256::ZERO,
gas_limit: 250_000,
is_system_transaction: false,
input: Self::eip2935_creation_data(),
}])
.into_iter()
}
}
Expand All @@ -121,13 +67,10 @@ mod tests {
#[test]
fn test_isthmus_txs_encoded() {
let isthmus_upgrade_tx = Isthmus.txs().collect::<Vec<_>>();
assert_eq!(isthmus_upgrade_tx.len(), 3);
assert_eq!(isthmus_upgrade_tx.len(), 1);

let expected_txs: Vec<Bytes> = vec![
hex::decode(include_bytes!("./bytecode/isthmus_tx_1.hex")).unwrap().into(),
hex::decode(include_bytes!("./bytecode/isthmus_tx_2.hex")).unwrap().into(),
hex::decode(include_bytes!("./bytecode/isthmus_tx_3.hex")).unwrap().into(),
];
let expected_txs: Vec<Bytes> =
vec![hex::decode(include_bytes!("./bytecode/isthmus_tx_1.hex")).unwrap().into()];
for (i, expected) in expected_txs.iter().enumerate() {
assert_eq!(isthmus_upgrade_tx[i], *expected);
}
Expand Down

0 comments on commit 4620d52

Please sign in to comment.