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 d4ea5f058b81d..9e6ad0ff0e824 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 fd27505a547c1..38329f61329fb 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 4a81e4243c12d..b9eb7351b94db 100644 --- a/bridges/snowbridge/pallets/inbound-queue/src/mock.rs +++ b/bridges/snowbridge/pallets/inbound-queue/src/mock.rs @@ -64,28 +64,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 e036653ca6da6..88ec1d534a658 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 ef682b59a2605..403cebb79fff3 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 @@ -221,7 +221,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 }, }; } @@ -253,6 +257,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