diff --git a/crates/consensus/src/hardforks/bytecode/eip7002_isthmus.hex b/crates/consensus/src/hardforks/bytecode/eip7002_isthmus.hex deleted file mode 100644 index ac68704f..00000000 --- a/crates/consensus/src/hardforks/bytecode/eip7002_isthmus.hex +++ /dev/null @@ -1 +0,0 @@ -7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5f556101f880602d5f395ff33373fffffffffffffffffffffffffffffffffffffffe1460cb5760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146101f457600182026001905f5b5f82111560685781019083028483029004916001019190604d565b909390049250505036603814608857366101f457346101f4575f5260205ff35b34106101f457600154600101600155600354806003026004013381556001015f35815560010160203590553360601b5f5260385f601437604c5fa0600101600355005b6003546002548082038060101160df575060105b5f5b8181146101835782810160030260040181604c02815460601b8152601401816001015481526020019060020154807fffffffffffffffffffffffffffffffff00000000000000000000000000000000168252906010019060401c908160381c81600701538160301c81600601538160281c81600501538160201c81600401538160181c81600301538160101c81600201538160081c81600101535360010160e1565b910180921461019557906002556101a0565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14156101cd57505f5b6001546002828201116101e25750505f6101e8565b01600290035b5f555f600155604c025ff35b5f5ffd diff --git a/crates/consensus/src/hardforks/bytecode/eip7251_isthmus.hex b/crates/consensus/src/hardforks/bytecode/eip7251_isthmus.hex deleted file mode 100644 index b2776ac3..00000000 --- a/crates/consensus/src/hardforks/bytecode/eip7251_isthmus.hex +++ /dev/null @@ -1 +0,0 @@ -7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5f5561019e80602d5f395ff33373fffffffffffffffffffffffffffffffffffffffe1460d35760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f82111560685781019083028483029004916001019190604d565b9093900492505050366060146088573661019a573461019a575f5260205ff35b341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060021160e7575060025b5f5b8181146101295782810160040260040181607402815460601b815260140181600101548152602001816002015481526020019060030154905260010160e9565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd diff --git a/crates/consensus/src/hardforks/bytecode/isthmus_tx_2.hex b/crates/consensus/src/hardforks/bytecode/isthmus_tx_2.hex deleted file mode 100644 index d63b6900..00000000 --- a/crates/consensus/src/hardforks/bytecode/isthmus_tx_2.hex +++ /dev/null @@ -1 +0,0 @@ -7ef9048ca0d7103194e3e72ff7b95822746ebbd97b2488b35c59b024c667140d5c8043584994a05d9eed37862dab22b002b8f6668b8fb0c4d7988080808303d09080b9044b3766666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666663566353536313031663838303630326435663339356666333333373366666666666666666666666666666666666666666666666666666666666666666666666666666665313436306362353736303131356635343830376666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666313436313031663435373630303138323032363030313930356635623566383231313135363036383537383130313930383330323834383330323930303439313630303130313931393036303464353635623930393339303034393235303530353033363630333831343630383835373336363130316634353733343631303166343537356635323630323035666633356233343130363130316634353736303031353436303031303136303031353536303033353438303630303330323630303430313333383135353630303130313566333538313535363030313031363032303335393035353333363036303162356635323630333835663630313433373630346335666130363030313031363030333535303035623630303335343630303235343830383230333830363031303131363064663537353036303130356235663562383138313134363130313833353738323831303136303033303236303034303138313630346330323831353436303630316238313532363031343031383136303031303135343831353236303230303139303630303230313534383037666666666666666666666666666666666666666666666666666666666666666666303030303030303030303030303030303030303030303030303030303030303031363832353239303630313030313930363034303163393038313630333831633831363030373031353338313630333031633831363030363031353338313630323831633831363030353031353338313630323031633831363030343031353338313630313831633831363030333031353338313630313031633831363030323031353338313630303831633831363030313031353335333630303130313630653135363562393130313830393231343631303139353537393036303032353536313031613035363562393035303566363030323535356636303033353535623566353438303766666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666663134313536313031636435373530356635623630303135343630303238323832303131313631303165323537353035303566363130316538353635623031363030323930303335623566353535663630303135353630346330323566663335623566356666640a \ No newline at end of file diff --git a/crates/consensus/src/hardforks/bytecode/isthmus_tx_3.hex b/crates/consensus/src/hardforks/bytecode/isthmus_tx_3.hex deleted file mode 100644 index ce0b8781..00000000 --- a/crates/consensus/src/hardforks/bytecode/isthmus_tx_3.hex +++ /dev/null @@ -1 +0,0 @@ -7ef903d8a0bce1c9a1ed49c420ff0567861314f0acc7cca0944b76307fedf038bffd26a50e94e24b968ab4319a580d9ffc7ac29466894feeb3618080808303d09080b903973766666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666663566353536313031396538303630326435663339356666333333373366666666666666666666666666666666666666666666666666666666666666666666666666666665313436306433353736303131356635343830376666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666313436313031396135373630303138323032363030313930356635623566383231313135363036383537383130313930383330323834383330323930303439313630303130313931393036303464353635623930393339303034393235303530353033363630363031343630383835373336363130313961353733343631303139613537356635323630323035666633356233343130363130313961353736303031353436303031303136303031353536303033353438303630303430323630303430313333383135353630303130313566333538313535363030313031363032303335383135353630303130313630343033353930353533333630363031623566353236303630356636303134333736303734356661303630303130313630303335353030356236303033353436303032353438303832303338303630303231313630653735373530363030323562356635623831383131343631303132393537383238313031363030343032363030343031383136303734303238313534363036303162383135323630313430313831363030313031353438313532363032303031383136303032303135343831353236303230303139303630303330313534393035323630303130313630653935363562393130313830393231343631303133623537393036303032353536313031343635363562393035303566363030323535356636303033353535623566353438303766666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666663134313536313031373335373530356635623630303135343630303138323832303131313631303138383537353035303566363130313865353635623031363030313930303335623566353535663630303135353630373430323566663335623566356666640a \ No newline at end of file diff --git a/crates/consensus/src/hardforks/forks.rs b/crates/consensus/src/hardforks/forks.rs index 567a5c9e..e91d20b7 100644 --- a/crates/consensus/src/hardforks/forks.rs +++ b/crates/consensus/src/hardforks/forks.rs @@ -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::>().len(), 3); +/// assert_eq!(isthmus_upgrade_tx.collect::>().len(), 1); /// ``` #[derive(Debug, Default, Clone, Copy)] #[non_exhaustive] @@ -60,6 +60,6 @@ mod tests { assert_eq!(fjord_upgrade_txs.collect::>().len(), 3); let isthmus_upgrade_tx = Hardforks::ISTHMUS.txs(); - assert_eq!(isthmus_upgrade_tx.collect::>().len(), 3); + assert_eq!(isthmus_upgrade_tx.collect::>().len(), 1); } } diff --git a/crates/consensus/src/hardforks/isthmus.rs b/crates/consensus/src/hardforks/isthmus.rs index aa04f5f1..31833215 100644 --- a/crates/consensus/src/hardforks/isthmus.rs +++ b/crates/consensus/src/hardforks/isthmus.rs @@ -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 { - ([ - 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() } } @@ -121,13 +67,10 @@ mod tests { #[test] fn test_isthmus_txs_encoded() { let isthmus_upgrade_tx = Isthmus.txs().collect::>(); - assert_eq!(isthmus_upgrade_tx.len(), 3); + assert_eq!(isthmus_upgrade_tx.len(), 1); - let expected_txs: Vec = 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 = + 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); }