Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce header chain trait #1622

Merged
merged 2 commits into from
Nov 11, 2022
Merged

Conversation

svyatonik
Copy link
Contributor

@svyatonik svyatonik commented Nov 4, 2022

There's a lot of changes, but it is mostly moving code around and removing some duplicate functions. The main change is the new HeaderChain which represents a storage of Chain headers. This trait is implemented for both bridge GRANDPA and parachains pallets (for latter the adapter struct ParachainHeaders is used). This way we may write code (e.g. glue code for bridge-messages pallet) in abstracted way - e.g. there's now single verify_messages_proof function vs previous verify_messages_proof (for chains with GRANDPA) verify_messages_proof_from_parachain (for parachains).

I've also refactored + removed some obsolete concepts from the messages.rs file + changed how tests are working (we no longer need type tests, since we're using Chain trait).

Draft until I'll test it locallyTested

@svyatonik svyatonik added the A-chores Something that has to be done, as part of regular maintenance label Nov 4, 2022
@svyatonik svyatonik marked this pull request as ready for review November 4, 2022 11:00
@svyatonik svyatonik merged commit 93946ab into master Nov 11, 2022
@svyatonik svyatonik deleted the reintroduce-header-chain-trait branch November 11, 2022 12:31
@@ -186,16 +170,16 @@ pub trait BridgedChainWithMessages: ChainWithMessages {
pub type ThisChain<B> = <B as MessageBridge>::ThisChain;
/// Bridged chain in context of message bridge.
pub type BridgedChain<B> = <B as MessageBridge>::BridgedChain;
/// Underlying chain type.
pub type UnderlyingChainOf<C> = <C as ChainWithMessages>::Chain;
Copy link
Contributor

Choose a reason for hiding this comment

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

@svyatonik
just very nit: what about renaming ChainWithMessages -> UnderlyingChain,
ChainWithMessages here is not very descriptive and also we have two trait ChainWithMessages

jiguantong pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Jan 6, 2023
jiguantong pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Jan 9, 2023
boundless-forest pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Jan 12, 2023
* Anchor polkadot-v0.9.32

* fix parity-util-mem conflict

* Anchor polkadot-v0.9.33

* Companion for paritytech/parity-bridges-common#1613

* Companion for paritytech/parity-bridges-common#1616

* Companion for paritytech/parity-bridges-common#1619

* Companion for paritytech/parity-bridges-common#1623

* Companion for paritytech/parity-bridges-common#1622

* Companion for paritytech/parity-bridges-common#1655

* Companion for paritytech/parity-bridges-common#1670

* Companion for paritytech/parity-bridges-common#1690

* Correct cargo

* Revert "Companion for paritytech/parity-bridges-common#1690"

This reverts commit 926b32d.

* Revert "Companion for paritytech/parity-bridges-common#1670"

This reverts commit b96b41c.

* Fix compile

* Revert "Companion for paritytech/parity-bridges-common#1622"

This reverts commit 4c5865d.

* Fix compile

* format

* Fix test

* Fix dispatch test

* Try fix compile with darwinia-2.0

* Revert "Try fix compile with darwinia-2.0"

This reverts commit c9dcd67.

* Update prepare branch

* Format

* Remove unused trait

* Remove unused import
jiguantong pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Jan 17, 2023
* Anchor polkadot-v0.9.32

* fix parity-util-mem conflict

* Anchor polkadot-v0.9.33

* Companion for paritytech/parity-bridges-common#1613

* Companion for paritytech/parity-bridges-common#1616

* Companion for paritytech/parity-bridges-common#1619

* Companion for paritytech/parity-bridges-common#1623

* Companion for paritytech/parity-bridges-common#1622

* Companion for paritytech/parity-bridges-common#1655

* Companion for paritytech/parity-bridges-common#1670

* Companion for paritytech/parity-bridges-common#1690

* Correct cargo

* Revert "Companion for paritytech/parity-bridges-common#1690"

This reverts commit 926b32d.

* Revert "Companion for paritytech/parity-bridges-common#1670"

This reverts commit b96b41c.

* Fix compile

* Revert "Companion for paritytech/parity-bridges-common#1622"

This reverts commit 4c5865d.

* Fix compile

* format

* Fix test

* Fix dispatch test

* Try fix compile with darwinia-2.0

* Revert "Try fix compile with darwinia-2.0"

This reverts commit c9dcd67.

* Update prepare branch

* Format

* Remove unused trait

* Remove unused import
jiguantong pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Jan 17, 2023
…238)

* Anchor polkadot-v0.9.32

* fix parity-util-mem conflict

* Anchor polkadot-v0.9.33

* Companion for paritytech/parity-bridges-common#1613

* Companion for paritytech/parity-bridges-common#1616

* Companion for paritytech/parity-bridges-common#1619

* Companion for paritytech/parity-bridges-common#1623

* Companion for paritytech/parity-bridges-common#1622

* Companion for paritytech/parity-bridges-common#1655

* Companion for paritytech/parity-bridges-common#1670

* Companion for paritytech/parity-bridges-common#1690

* Correct cargo

* Revert "Companion for paritytech/parity-bridges-common#1690"

This reverts commit 926b32d.

* Revert "Companion for paritytech/parity-bridges-common#1670"

This reverts commit b96b41c.

* Fix compile

* Revert "Companion for paritytech/parity-bridges-common#1622"

This reverts commit 4c5865d.

* Fix compile

* format

* Fix test

* Fix dispatch test

* Try fix compile with darwinia-2.0

* Revert "Try fix compile with darwinia-2.0"

This reverts commit c9dcd67.

* Update prepare branch

* Format

* Remove unused trait

* Remove unused import
jiguantong pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Apr 13, 2023
jiguantong pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Apr 18, 2023
svyatonik pushed a commit that referenced this pull request Jul 17, 2023
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.34 to 1.0.35.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@1.0.34...1.0.35)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
serban300 pushed a commit to serban300/parity-bridges-common that referenced this pull request Mar 27, 2024
* reintroduce header chain trait

* renive BridgedChainWithMessages::maximal_extrinsic_size
serban300 pushed a commit to serban300/parity-bridges-common that referenced this pull request Apr 8, 2024
* reintroduce header chain trait

* renive BridgedChainWithMessages::maximal_extrinsic_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-chores Something that has to be done, as part of regular maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants