Skip to content

Commit e9c6db0

Browse files
authored
Merge pull request #156 from bifrost-platform/hotfix-02
hotfix: prevent duplicate new relayer addresses to be set
2 parents 6ddd9b9 + c9e9a1c commit e9c6db0

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

pallets/relay-manager/src/pallet/impls.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ impl<T: Config> Pallet<T> {
316316
pub fn add_to_relayer_sets(old: T::AccountId, new: T::AccountId) -> DispatchResult {
317317
let round = Round::<T>::get();
318318
<DelayedRelayerSets<T>>::try_mutate(round, |relayer_sets| -> DispatchResult {
319+
ensure!(
320+
!relayer_sets.into_iter().any(|r| r.old == old || r.new == new),
321+
Error::<T>::AlreadyRelayerSetRequested
322+
);
323+
319324
Ok(relayer_sets
320325
.try_push(DelayedRelayerSet::new(old, new))
321326
.map_err(|_| <Error<T>>::TooManyDelayedRelayers)?)

runtime/mainnet/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
162162
// The version of the authorship interface.
163163
authoring_version: 1,
164164
// The version of the runtime spec.
165-
spec_version: 2037,
165+
spec_version: 2038,
166166
// The version of the implementation of the spec.
167167
impl_version: 1,
168168
// A list of supported runtime APIs along with their versions.

runtime/testnet/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
157157
// The version of the authorship interface.
158158
authoring_version: 1,
159159
// The version of the runtime spec.
160-
spec_version: 495,
160+
spec_version: 496,
161161
// The version of the implementation of the spec.
162162
impl_version: 1,
163163
// A list of supported runtime APIs along with their versions.

0 commit comments

Comments
 (0)