Skip to content

Commit 62e8850

Browse files
claravanstadengithub-actions[bot]
authored andcommitted
BACKPORT-CONFLICT
1 parent 4af1ddf commit 62e8850

File tree

9 files changed

+85
-7
lines changed

9 files changed

+85
-7
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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,43 @@ impl snowbridge_pallet_outbound_queue_v2::Config for Runtime {
198198
type Helper = Runtime;
199199
}
200200

201+
<<<<<<< HEAD
202+
=======
203+
#[cfg(not(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test)))]
204+
parameter_types! {
205+
pub const ChainForkVersions: ForkVersions = ForkVersions {
206+
genesis: Fork {
207+
version: hex!("90000069"),
208+
epoch: 0,
209+
},
210+
altair: Fork {
211+
version: hex!("90000070"),
212+
epoch: 50,
213+
},
214+
bellatrix: Fork {
215+
version: hex!("90000071"),
216+
epoch: 100,
217+
},
218+
capella: Fork {
219+
version: hex!("90000072"),
220+
epoch: 56832,
221+
},
222+
deneb: Fork {
223+
version: hex!("90000073"),
224+
epoch: 132608,
225+
},
226+
electra: Fork {
227+
version: hex!("90000074"),
228+
epoch: 222464,
229+
},
230+
fulu: Fork {
231+
version: hex!("90000075"),
232+
epoch: 272640, // https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
233+
},
234+
};
235+
}
236+
237+
>>>>>>> c223162 (Snowbridge - Adds Fulu hardfork (#9938))
201238
#[cfg(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test))]
202239
parameter_types! {
203240
pub const ChainForkVersions: ForkVersions = ForkVersions {
@@ -225,6 +262,10 @@ parameter_types! {
225262
version: hex!("05000000"),
226263
epoch: 0,
227264
},
265+
fulu: Fork {
266+
version: hex!("06000000"),
267+
epoch: 5000000,
268+
}
228269
};
229270
}
230271

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)