Skip to content

Commit 0a1bdcb

Browse files
paritytech-release-backport-bot[bot]claravanstadenacatangiu
authored
[stable2509] Backport #9938 (#9954)
Backport #9938 into `stable2509` from claravanstaden. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Clara van Staden <[email protected]> Co-authored-by: Adrian Catangiu <[email protected]>
1 parent 1d52545 commit 0a1bdcb

File tree

9 files changed

+53
-8
lines changed

9 files changed

+53
-8
lines changed

bridges/snowbridge/pallets/ethereum-client/src/benchmarking/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ mod benchmarks {
118118
capella: Fork { version: hex!("03000000"), epoch: 0 },
119119
deneb: Fork { version: hex!("04000000"), epoch: 0 },
120120
electra: Fork { version: hex!("05000000"), epoch: 80000000000 },
121+
fulu: Fork { version: hex!("06000000"), epoch: 80000000001 },
121122
};
122123
let finalized_root_gindex = EthereumBeaconClient::<T>::finalized_root_gindex_at_slot(
123124
update.attested_header.slot,

bridges/snowbridge/pallets/ethereum-client/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,9 @@ pub mod pallet {
627627

628628
/// Returns the fork version based on the current epoch.
629629
pub(super) fn select_fork_version(fork_versions: &ForkVersions, epoch: u64) -> ForkVersion {
630+
if epoch >= fork_versions.fulu.epoch {
631+
return fork_versions.fulu.version
632+
}
630633
if epoch >= fork_versions.electra.epoch {
631634
return fork_versions.electra.version
632635
}

bridges/snowbridge/pallets/ethereum-client/src/mock.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ parameter_types! {
137137
electra: Fork {
138138
version: hex!("05000000"),
139139
epoch: 0,
140+
},
141+
fulu: Fork {
142+
version: hex!("06000000"),
143+
epoch: 100000000,
140144
}
141145
};
142146
}

bridges/snowbridge/pallets/ethereum-client/src/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ fn compute_fork_version() {
230230
capella: Fork { version: [0, 0, 0, 3], epoch: 30 },
231231
deneb: Fork { version: [0, 0, 0, 4], epoch: 40 },
232232
electra: Fork { version: [0, 0, 0, 5], epoch: 50 },
233+
fulu: Fork { version: [0, 0, 0, 6], epoch: 60 },
233234
};
234235
new_tester().execute_with(|| {
235236
assert_eq!(EthereumBeaconClient::select_fork_version(&mock_fork_versions, 0), [0, 0, 0, 0]);

bridges/snowbridge/pallets/inbound-queue/src/mock.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,32 @@ impl pallet_balances::Config for Test {
6464
parameter_types! {
6565
pub const ChainForkVersions: ForkVersions = ForkVersions {
6666
genesis: Fork {
67-
version: [0, 0, 0, 1], // 0x00000001
67+
version: hex!("00000001"),
6868
epoch: 0,
6969
},
7070
altair: Fork {
71-
version: [1, 0, 0, 1], // 0x01000001
71+
version: hex!("01000001"),
7272
epoch: 0,
7373
},
7474
bellatrix: Fork {
75-
version: [2, 0, 0, 1], // 0x02000001
75+
version: hex!("02000001"),
7676
epoch: 0,
7777
},
7878
capella: Fork {
79-
version: [3, 0, 0, 1], // 0x03000001
79+
version: hex!("03000001"),
8080
epoch: 0,
8181
},
8282
deneb: Fork {
83-
version: [4, 0, 0, 1], // 0x04000001
83+
version: hex!("04000001"),
8484
epoch: 0,
8585
},
8686
electra: Fork {
87-
version: [5, 0, 0, 0], // 0x05000000
87+
version: hex!("05000000"),
8888
epoch: 80000000000,
89+
},
90+
fulu: Fork {
91+
version: hex!("06000000"),
92+
epoch: 80000000001,
8993
}
9094
};
9195
}

bridges/snowbridge/primitives/beacon/src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub struct ForkVersions {
3737
pub capella: Fork,
3838
pub deneb: Fork,
3939
pub electra: Fork,
40+
pub fulu: Fork,
4041
}
4142

4243
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ parameter_types! {
144144
electra: Fork {
145145
version: hex!("05000000"),
146146
epoch: 0,
147+
},
148+
fulu: Fork {
149+
version: hex!("06000000"),
150+
epoch: 5000000,
147151
}
148152
};
149153
}
@@ -173,7 +177,11 @@ parameter_types! {
173177
},
174178
electra: Fork {
175179
version: hex!("90000074"),
176-
epoch: 222464, // https://github.com/ethereum/EIPs/pull/9322/files
180+
epoch: 222464,
181+
},
182+
fulu: Fork {
183+
version: hex!("90000075"),
184+
epoch: 272640, // https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
177185
},
178186
};
179187
}

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_ethereum_config.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ parameter_types! {
221221
},
222222
electra: Fork {
223223
version: hex!("90000074"),
224-
epoch: 222464, // https://github.com/ethereum/EIPs/pull/9322/files
224+
epoch: 222464,
225+
},
226+
fulu: Fork {
227+
version: hex!("90000075"),
228+
epoch: 272640, // https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
225229
},
226230
};
227231
}
@@ -253,6 +257,10 @@ parameter_types! {
253257
version: hex!("05000000"),
254258
epoch: 0,
255259
},
260+
fulu: Fork {
261+
version: hex!("06000000"),
262+
epoch: 5000000,
263+
}
256264
};
257265
}
258266

prdoc/pr_9938.prdoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: 'Snowbridge - Adds Fulu hardfork'
2+
doc:
3+
- audience: Runtime Dev
4+
description: Set fork version for Fulu hardfork on Sepolia.
5+
crates:
6+
- name: snowbridge-pallet-ethereum-client
7+
bump: patch
8+
- name: snowbridge-pallet-inbound-queue
9+
bump: patch
10+
- name: snowbridge-beacon-primitives
11+
bump: patch
12+
- name: bridge-hub-westend-runtime
13+
bump: patch
14+
- name: bridge-hub-rococo-runtime
15+
bump: patch

0 commit comments

Comments
 (0)