diff --git a/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs b/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs index 56c9f2b4c37dc..093f354a92381 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs @@ -118,6 +118,7 @@ mod benchmarks { capella: Fork { version: hex!("03000000"), epoch: 0 }, deneb: Fork { version: hex!("04000000"), epoch: 0 }, electra: Fork { version: hex!("05000000"), epoch: 80000000000 }, + fulu: Fork { version: hex!("06000000"), epoch: 80000000001 }, }; let finalized_root_gindex = EthereumBeaconClient::::finalized_root_gindex_at_slot( update.attested_header.slot, diff --git a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs index 03cf9d60481f1..0b820a972c037 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/lib.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/lib.rs @@ -627,6 +627,9 @@ pub mod pallet { /// Returns the fork version based on the current epoch. pub(super) fn select_fork_version(fork_versions: &ForkVersions, epoch: u64) -> ForkVersion { + if epoch >= fork_versions.fulu.epoch { + return fork_versions.fulu.version + } if epoch >= fork_versions.electra.epoch { return fork_versions.electra.version } diff --git a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs index 7d253ab7ee33c..5d58324490717 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs @@ -137,6 +137,10 @@ parameter_types! { electra: Fork { version: hex!("05000000"), epoch: 0, + }, + fulu: Fork { + version: hex!("06000000"), + epoch: 100000000, } }; } diff --git a/bridges/snowbridge/pallets/ethereum-client/src/tests.rs b/bridges/snowbridge/pallets/ethereum-client/src/tests.rs index f1679834b8338..356d79b8d37b1 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/tests.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/tests.rs @@ -230,6 +230,7 @@ fn compute_fork_version() { capella: Fork { version: [0, 0, 0, 3], epoch: 30 }, deneb: Fork { version: [0, 0, 0, 4], epoch: 40 }, electra: Fork { version: [0, 0, 0, 5], epoch: 50 }, + fulu: Fork { version: [0, 0, 0, 6], epoch: 60 }, }; new_tester().execute_with(|| { assert_eq!(EthereumBeaconClient::select_fork_version(&mock_fork_versions, 0), [0, 0, 0, 0]); diff --git a/bridges/snowbridge/pallets/inbound-queue/src/mock.rs b/bridges/snowbridge/pallets/inbound-queue/src/mock.rs index 9ed982ebfa4be..c26fa14420bf1 100644 --- a/bridges/snowbridge/pallets/inbound-queue/src/mock.rs +++ b/bridges/snowbridge/pallets/inbound-queue/src/mock.rs @@ -69,28 +69,32 @@ impl pallet_balances::Config for Test { parameter_types! { pub const ChainForkVersions: ForkVersions = ForkVersions { genesis: Fork { - version: [0, 0, 0, 1], // 0x00000001 + version: hex!("00000001"), epoch: 0, }, altair: Fork { - version: [1, 0, 0, 1], // 0x01000001 + version: hex!("01000001"), epoch: 0, }, bellatrix: Fork { - version: [2, 0, 0, 1], // 0x02000001 + version: hex!("02000001"), epoch: 0, }, capella: Fork { - version: [3, 0, 0, 1], // 0x03000001 + version: hex!("03000001"), epoch: 0, }, deneb: Fork { - version: [4, 0, 0, 1], // 0x04000001 + version: hex!("04000001"), epoch: 0, }, electra: Fork { - version: [5, 0, 0, 0], // 0x05000000 + version: hex!("05000000"), epoch: 80000000000, + }, + fulu: Fork { + version: hex!("06000000"), + epoch: 80000000001, } }; } diff --git a/bridges/snowbridge/primitives/beacon/src/types.rs b/bridges/snowbridge/primitives/beacon/src/types.rs index 7ec6a180b5634..4863a70bb8d42 100644 --- a/bridges/snowbridge/primitives/beacon/src/types.rs +++ b/bridges/snowbridge/primitives/beacon/src/types.rs @@ -37,6 +37,7 @@ pub struct ForkVersions { pub capella: Fork, pub deneb: Fork, pub electra: Fork, + pub fulu: Fork, } #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs index 7a129e141712d..e09ed18250ab3 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs @@ -144,6 +144,10 @@ parameter_types! { electra: Fork { version: hex!("05000000"), epoch: 0, + }, + fulu: Fork { + version: hex!("06000000"), + epoch: 5000000, } }; } @@ -173,7 +177,11 @@ parameter_types! { }, electra: Fork { version: hex!("90000074"), - epoch: 222464, // https://github.com/ethereum/EIPs/pull/9322/files + epoch: 222464, + }, + fulu: Fork { + version: hex!("90000075"), + epoch: 272640, // https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline }, }; } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_ethereum_config.rs index 9ad79ad6c5724..a0799b9deaef9 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_ethereum_config.rs @@ -223,7 +223,11 @@ parameter_types! { }, electra: Fork { version: hex!("90000074"), - epoch: 222464, // https://github.com/ethereum/EIPs/pull/9322/files + epoch: 222464, + }, + fulu: Fork { + version: hex!("90000075"), + epoch: 272640, // https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline }, }; } @@ -255,6 +259,10 @@ parameter_types! { version: hex!("05000000"), epoch: 0, }, + fulu: Fork { + version: hex!("06000000"), + epoch: 5000000, + } }; } diff --git a/prdoc/pr_9938.prdoc b/prdoc/pr_9938.prdoc new file mode 100644 index 0000000000000..1bd7d93d7737c --- /dev/null +++ b/prdoc/pr_9938.prdoc @@ -0,0 +1,15 @@ +title: 'Snowbridge - Adds Fulu hardfork' +doc: +- audience: Runtime Dev + description: Set fork version for Fulu hardfork on Sepolia. +crates: +- name: snowbridge-pallet-ethereum-client + bump: patch +- name: snowbridge-pallet-inbound-queue + bump: patch +- name: snowbridge-beacon-primitives + bump: patch +- name: bridge-hub-westend-runtime + bump: patch +- name: bridge-hub-rococo-runtime + bump: patch