Commit Graph

126 Commits

Author SHA1 Message Date
Serban Iorga 2ff3a7aa38 Add integrity check for signed extensions (#1780)
* Add integrity check for signed extensions

* Remove unneeded type specification
2024-04-10 10:28:37 +02:00
Serban Iorga 8a4f984a7a Define separate signed extension for BHR/BHW (#1776)
- Make signed extensions for indirect runtimes more extensible
- Define separate signed extension for BHR/BHW
2024-04-10 10:28:37 +02:00
Branislav Kontur 5fdc89d651 Bump xcm-v3 + substrate (#1767)
* Bump xcm-v3 + substrate

* More fixes

* Added `#[pallet::call_index`

* Fixes for MMR (TODO:plese check)

* More call indexes

* Cumulus bump

* Fixes for mmr

* Fixes for weights

* Fixes for xcm

* MMR fixes + cargo fmt

* Fix some rpc errors (bump jsonrpsee version)

* Fix cumulus stuff

* Fixes cumulus

* clippy

* more clipy

* Fix test + unused deps

* PR fixes

* cargo update (bump xcm-v3)

Co-authored-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Serban Iorga 444dbe7173 Use indirect runtime calls for RialtoParachain (#1753)
* Use indirect runtime calls for RialtoParachain

* Code review fixes
2024-04-10 10:28:37 +02:00
Serban Iorga 63a538a9bb Deduplicate pallet call structs used for indirect runtime calls (#1744)
* Small changes

* Define generic bridge pallets call structs

* polkadot-core SignedExtension simplifications

- we don't seem to need to pass the Call as a generic param
- we can use codec(skip) instead of implementing Encode and Decode

* Split BridgeHubRococo and BridgeHubWococo calls

* code review fixes
2024-04-10 10:28:37 +02:00
Serban Iorga bde1629f86 Remove SOURCE_PARACHAIN_PARA_ID (#1716)
* Remove SOURCE_PARACHAIN_PARA_ID

Remove SubstrateParachainsPipeline::SOURCE_PARACHAIN_PARA_ID

* Avoid duplicate ChainBase and ParachainBase implementations

* Replace ChainShadow with UnderlyingChainProvider
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky d63a75697c Only store header state root (pallet-bridge-parachains) (#1701)
* store block number ++ state root in parachains pallet

* fixed parachains finality APIs

* (test commit)

* removed test code

* deduplicated code a bit

* removed commented code

* spelling

* Update modules/parachains/src/lib.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* Update modules/parachains/src/lib.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* Update modules/parachains/src/mock.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* added comment

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 7014046485 only store header state root (pallet-bridge-grandpa) (#1699) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 9c8f8a90e7 removed ESTIMATE_MESSAGE_FEE_METHOD (#1696) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 9e92564c69 refund_pay_dispatch_fee removed (#1695) 2024-04-10 10:28:37 +02:00
Branislav Kontur 02ef3a1a25 Added generic DispatchLevelResult to the MessageDispatchResult (#1670)
* Added generic DispatchLevelResult to the MessageDispatchResult

* Removed unnecessery `Clone + Decode + sp_std::fmt::Debug + Eq` + clippy
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 1688b493cd Remove dispatch_result field (#1660)
* remove dispatch_result field

* fix benchmarks
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 8c845602cf Remove message fee + message send calls (#1642)
* remove message fee

* it is compiling!

* fixes + fmt

* more cleanup

* more cleanup

* restore MessageDeliveryAndDispatchPayment since we'll need relayer rewards

* started rational relayer removal

* more removal

* removed estimate fee subcommand

* remove DispatchFeePayment

* more removals

* removed conversion rates && some metrics

* - unneeded associated type

* - OutboundMessageFee

* fix benchmarks compilation

* fmt

* test + fix benchmarks

* fix send message

* clippy
2024-04-10 10:28:37 +02:00
Branislav Kontur 6c4728f1cc Rococo/Wococo bridge hub relay integration (#1565)
* [BridgeHub] Added bridge-hub-rococo/wococo clients with bridge-hub-rococo-runtime

* [BridgeHub] Add init-bridge stuff for bridge-hub-rococo/wococo

* [BridgeHub] Add init-bridge stuff for bridge-hub-rococo/wococo

* [BridgeHub] Fixed Call-encoding for init-bridge rococo runtime wrapper

* Final index update to runtime calls

* [BridgeHub] Add init-bridge stuff for bridge-hub-rococo/wococo (otherside)

* Added runtime best_finalized functions + relay-headers init

* Renaming and change BridgeHubRococo/Wococo to Rococo/Wococo config

* [BridgeHub] Add relay-parachains (Rococo/Wococo)

* Missing stuff for adding xcm messaging to BridgeHub

* extracted parachain IDs to the primitives

* fix compilation

* Fixes

* Init setup for Rococo->Wococo messaging support

* Removed unused AccountId from `trait MessagesBridge`

* Removed unused trait SenderOrigin

* Small fixes

* Cleaning after master-merge

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes:
- align WeightToFee with BridgeHubRococo runtime
- MAX_HEADER_SIZE
- updated TODOs

* Added relay_messages cfg for BridgeHubWococo -> BridgeHubRococo

Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 6dcecf4425 Reintroduce header chain trait (#1622)
* reintroduce header chain trait

* renive BridgedChainWithMessages::maximal_extrinsic_size
2024-04-10 10:28:37 +02:00
Branislav Kontur 2c0b6b73e0 Bump xcm v3 + substrate
* Bumping substrate/polkadot/cumulus

* Update Cargo.lock

* Fixes

* Fixes for mmr

* Bump clap

* Fix for millau - added CompatibilityMode

* Fixes for rialto-parachain

* Align everywhere branch='master' and just use overrides from main Cargo.toml
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky e97bb57564 weights v1.5: iteration 2 (#1613) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky a3dc2d2748 Bump Substrate/Polkadot/Cumulus refs (aka Weights v1.5) (#1597)
* update Substrate + Polkadot + Cumulus refs

* Origin -> RuntimeOrigin

* weights v1.5

* update refs once again + `cargo test -p pallet-bridge-grandpa` works

* started work on `cargo test -p pallet-bridge-messages`

* cargo test -p pallet-bridge-relayers

* cargo test -p pallet-bridge-parachains

* cargo test -p millau-runtime

* cargo test -p bridge-runtime-common

* cargo test -p rialto-runtime

* cargo test -p rialto-parachain-runtime

* cargo test -p millau-bridge-node

* cargo test -p rialto-bridge-node

* cargo test -p rialto-parachain-collator

* cargo test -p messages-relay

* cargo test -p parachains-relay

* cargo test -p substrate-relay

* cargo test --all

* cargo check -p millau-runtime --locked --features runtime-benchmarks

* fix remaining test

* fmt

* try to allow clippy failure temporarily

* Revert "try to allow clippy failure temporarily"

This reverts commit d1b6593580f07e0dbeecb7ab0aa92cee98888ed3.

* use min_by

* Revert "use min_by"

This reverts commit 33042f49ed37e8dd0505370289e17f03bf1a56ee.

* Revert "Revert "use min_by""

This reverts commit 1d2204f0b14dc81e5650bb574dedb5fa78c7097d.

* trigger CI

* Revert "trigger CI"

This reverts commit 259d91b5606743bba9d043c69f07eac6c8700ef5.

* new day, new clippy warning

* more clippy issues
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky be2a13c747 Remove without_storage_info from parachains pallet (#1596)
* remove without_storage_info from pallet-bridge-parachains

* fix benchmarks
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky f38852f661 Remove pallet::without_storage_info from bridge GRANDPA pallet (#1478)
* remove pallet::without_storage_info from bridge GRANDPA pallet

* StoredBridgedHeader

* spelling

* fix benchmarks

* MAX_BRIDGED_AUTHORITIES: 256 -> 2048

* Update modules/grandpa/src/storage_types.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* Update modules/grandpa/src/storage_types.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* moved max authorities + header size to chain primitives

* removed unused code

* new -> try_new

* fix benchmarks compilation

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 95c30c780c update Substrate/Polkadot/Cumulus refs (#1562)
* update Substrate/Polkadot/Cumulus refs

* finality-grandpa 0.16

* fix miillau-runtime compilation

* fix rialto runtime compilation

* fixed rialto-parachain runtime compilation

* backport GRANDPA test fixes

* helper instead of removed record_all_keys

* substrate-relay is compiling

* millau-bridge-node at least compiles

* rialto-bridge-node at least compiles

* rialto-parachain-collator compiles

* fixings tests (wip)

* fmt

* fixed BEEFY alert

* clippy

* removed unused dep

* -extra var

* move Leaf to mod mmr

* fix benchmarks
2024-04-10 10:28:37 +02:00
Serban Iorga ad38cdb873 Follow-up on #1068 (#1567)
* BestParaHead small changes

Signed-off-by: Serban Iorga <serban@parity.io>

* Renamings

Signed-off-by: Serban Iorga <serban@parity.io>

* Use ParaInfo in parachains loop

Signed-off-by: Serban Iorga <serban@parity.io>

* Define StorageMapKeyProvider

Signed-off-by: Serban Iorga <serban@parity.io>

* CR fixes

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky f35b4f4897 Extract unsigned tx from the SignParam structure (#1561)
* change sign_transaction method

* clippy

* rustup update && clippy

* remove redudnant clone
2024-04-10 10:28:37 +02:00
Branislav Kontur 793321fcfc Reexport paste from sp-runtime in bp-runtime to aviod including paste dependency everywhere (#1556)
* Reexport paste from `sp-runtime` in `bp-runtime` to aviod including `paste` dependency everywhere

* Add import `bp_runtime` to macro calls: decl_bridge_finality_runtime_apis/decl_bridge_messages_runtime_apis
2024-04-10 10:28:37 +02:00
Serban Iorga f3a151feeb Split decl_bridge_runtime_apis!() (#1553)
Signed-off-by: Serban Iorga <serban@parity.io>

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Branislav Kontur 7ad5b0fe56 Bump codec version 3.0.0 -> 3.1.5 + unify parity-scale-codec vs codec (#1552) 2024-04-10 10:28:37 +02:00
Serban Iorga 59c168e89b Declare declare_bridge_chain_runtime_apis! macro
Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Serban Iorga 77af92b17b Follow-up on #1419 (#1531)
* Parachains source cosmetic changes

- Make `ParaHashAtSource` more generic
- Modify `on_chain_parachain_header` to return `HeaderId`
- Shortening variable names

Signed-off-by: Serban Iorga <serban@parity.io>

* Change ParachainsSource::max_head_id type

Change ParachainsSource::max_head_id to Arc<Mutex<NoopOption>>

Signed-off-by: Serban Iorga <serban@parity.io>

* code review changes
2024-04-10 10:28:37 +02:00
Serban Iorga 7969459d07 Change Runtime APIs best_finalized() signature
Change Runtime APIs best_finalized() signature to return Option<HeaderId>

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Serban Iorga cd36d1e15f Define StorageDoubleMapKeyProvider
Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Serban Iorga 5d9bd1d0b5 Reduce the number of macros used for SignedExtensions
Reduce the number of macros used for SignedExtensions

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Serban Iorga dc38e3d079 Define HeaderIdProvider trait
Define HeaderIdProvider trait

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky ceefd1b05d remove account derivation functions (#1498) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 7d97e576d0 Remove without_storage_info for messages pallet (#1487)
* draft: remove without_storage_info for messages pallet

* some cleanup
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky d11d9fd0b7 Parachain loop metrics (#1484)
* parachain loop metrics

* some fixes

* mini refactoring

* add tests
2024-04-10 10:28:37 +02:00
Serban Iorga f8ff3c9142 Unify the operating mode for bridge pallets (#1483)
Unify the operating mode for bridge pallets

- define the OperationMode trait and BasicOperatingMode enum
- use the OperationMode trait in all the bridge pallets
- use BasicOperatingMode instead of IsHalted for the Grandpa pallet
- use BasicOperatingMode as part of MessagesOperatingMode

Signed-off-by: Serban Iorga <serban@parity.io>
2024-04-10 10:28:37 +02:00
Serban Iorga ff342fafa9 Avoid duplicate function definitions
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>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky b870fe74f8 Parachains pallet benchmarks (#1436)
* added parachains pallet benchmarks

* deduplicate insertion of bridged header

* pruning weight

* fixes

* fix compilation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 5340ee5ab5 Added tracked parachains filter (#1432)
* added trackerd parachains filter + changed some docs

* fix compilation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 7a92b40eab Fix clippy warnings + try to enable proper (no-warning) clippy on CI (#1410)
* fix clippy warnings

* try to reenable proper clippy on CI

* fix clippy error

* more Eqs

* ignore clippy::derive-partial-eq-without-eq - clippy seems to be broken now :/
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 5f2f61ced5 messages bridge between RialtoParachain and Millau (#1218) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky d582061dff Remove support for encoded-call messaging from relay and runtime integration code (#1376)
* remove support for encoded-call messaging

* continue cleanup

* continue cleanup

* continue cleanup

* more cleanpup

* more cleanup

* fmt

* continue cleanup

* spellcheck

* rename

* fix benchmarks

* mention encoded-calls-messaging tag

* fixing deployments

* fix messages generation

* fmt
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky c538a39816 Switch to gav-xcm-v3 branch to be able to test bridges + XCMv3 integration (#1378)
* switch to gav-xcm-v3 branch (wip)

* add comment

* play with CI

* keep playing with CI

* play with CI

* trigger CI

* Revert "trigger CI"

This reverts commit fc35ac648fe6a3ea8e710a2e07dfee7d8762c6c4.
2024-04-10 10:28:37 +02:00
Adrian Catangiu d04b018630 Few typos and clippy fixes (#1362)
* fix typos

* clippy fixes
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 133934df7c fix parse_transaction on Rialto+Millau (#1360) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 65c2c0ccce Update Substrate/Polkadot/Cumulus references (#1353)
* cumulus: 4e95228291
polkadot: 975e780ae0d988dc033f400ba822d14b326ee5b9
substrate: 89fcb3e4f62d221d4e161a437768e77d6265889e

* fix refs

* sync changes from https://github.com/paritytech/polkadot/pull/3828

* sync changes from https://github.com/paritytech/polkadot/pull/4387

* sync changes from https://github.com/paritytech/polkadot/pull/3940

* sync with changes from https://github.com/paritytech/polkadot/pull/4493

* sync with changes from https://github.com/paritytech/polkadot/pull/4958

* sync with changes from https://github.com/paritytech/polkadot/pull/3889

* sync with changes from https://github.com/paritytech/polkadot/pull/5033

* sync with changes from https://github.com/paritytech/polkadot/pull/5065

* compilation fixes

* fixed prometheus endpoint startup (it now requires to be spawned within tokio context)
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 2bf5b23262 edition = "2021" (#1346) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky efa3e97210 Encode and estimate Rococo/Wococo/Kusama/Polkadot messages (#1322)
* encode and estimate Rococo/Wococo/Kusama/Polkadot messages

* allow send-message for non-bundled chains

* weight -> dispatch-weight

* fmt

* fix spelling
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 214febc46a expose fee multiplier metrics in messages relay (#1312) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky ea2d6f898d Bump Substrate/Polkadot/Cumulus refs (#1295)
Substrate: 31d90c202d6df9ce3837ee55587b604619a912ba
Polkadot: 60df3c55c711c2872872d6220f98b2611340e051
Cumulus: a9630551c2
2024-04-10 10:28:37 +02:00