Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Sync upstream #174

Closed
wants to merge 31 commits into from
Closed

Sync upstream #174

wants to merge 31 commits into from

Conversation

wuminzhe
Copy link
Collaborator

@wuminzhe wuminzhe commented Aug 8, 2022

The Changes in runtime scope

https://github.com/paritytech/parity-bridges-common/commits/master?before=24e5a3747387178677370876fb78cf505d1127a6+35&path%5B%5D=modules

Sync Prs List

svyatonik and others added 30 commits August 8, 2022 14:21
Avoid duplicate function definitions for:
- ensure_owner_or_root()
- ensure_not_halted()
- set_owner()
- set_operating_mode() / set_operational()
Signed-off-by: Serban Iorga <serban@parity.io>
Define macro that generates tests for set_owner() and set_operating_mode()
in order to avoid duplicate code.

Signed-off-by: Serban Iorga <serban@parity.io>
Signed-off-by: Serban Iorga <serban@parity.io>
Add unit test in order to check that the submit_parachain_heads() call
returns an error when the pallet is halted.

Signed-off-by: Serban Iorga <serban@parity.io>
Signed-off-by: Serban Iorga <serban@parity.io>
@wuminzhe wuminzhe marked this pull request as draft August 8, 2022 09:01
@wuminzhe

This comment was marked as duplicate.

@wuminzhe wuminzhe marked this pull request as ready for review August 9, 2022 06:25
@aurexav
Copy link
Member

aurexav commented Sep 1, 2022

Let's pay more attention to this.

@boundless-forest
Copy link
Member

Let's pay more attention to this.

I recommend splitting the work into smaller ones before we begin reviewing this PR, because it is not so easy to review.

@wuminzhe
Copy link
Collaborator Author

wuminzhe commented Sep 9, 2022

  1. See if you missed anything? Is the initial commit correct? skipped commit needed?
  2. Select important commits for deep reviewing.

@@ -270,7 +271,7 @@ pub mod pallet {
/// Hash of the best finalized header.
#[pallet::storage]
pub type BestFinalized<T: Config<I>, I: 'static = ()> =
StorageValue<_, BridgedBlockHash<T, I>, ValueQuery>;
StorageValue<_, (BridgedBlockNumber<T, I>, BridgedBlockHash<T, I>), OptionQuery>;
Copy link
Member

@boundless-forest boundless-forest Sep 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The storage value type changed from BridgedBlockHash<T, I> to a tuple (BridgedBlockNumber<T, I>, BridgedBlockHash<T, I>). Need to dig deeper to see if it breaks the storage on the chain.

#[pallet::storage]
pub(super) type IsHalted<T: Config<I>, I: 'static = ()> = StorageValue<_, bool, ValueQuery>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This storage item is no longer used, needs a migration when upgrading the runtime.

/// The goal of this extension is to avoid "mining" transactions that provide outdated bridged
/// headers and messages. Without that extension, even honest relayers may lose their funds if
/// there are multiple relays running and submitting the same information.
#[macro_export]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -17,25 +17,25 @@
//! Storage keys of bridge GRANDPA pallet.

/// Name of the `IsHalted` storage value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment needs to be updated, No IsHalted anymore.

// If this test fails, then something has been changed in module storage that is breaking
// compatibility with previous pallet.
let storage_key = best_finalized_hash_key("BridgeGrandpa").0;
let storage_key = best_finalized_key("BridgeGrandpa").0;
assert_eq!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to forget to update the implementation_match.rs

@@ -705,12 +714,12 @@ pub mod pallet {
#[pallet::storage]
#[pallet::getter(fn operating_mode)]
pub type PalletOperatingMode<T: Config<I>, I: 'static = ()> =
StorageValue<_, OperatingMode, ValueQuery>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three storage types are updated, be careful.

@boundless-forest
Copy link
Member

boundless-forest commented Sep 14, 2022

I looked over all the changes besides para chain part. Left some feedback. @wuminzhe

* Companion for parity-briddges-common/1379

* Remove unused mod

* Format
@aurexav
Copy link
Member

aurexav commented Oct 12, 2022

Suppressed by #206.

But the reviews are still helpful.

@aurexav aurexav closed this Oct 12, 2022
@boundless-forest boundless-forest deleted the aki-sync-upstream branch October 20, 2022 02:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants