Commit Graph

16004 Commits

Author SHA1 Message Date
Tomasz Drwięga 70e9db4aad Initialize logger properly. (#843) 2024-04-10 10:28:37 +02:00
Hernando Castano 78a9cdca66 Larger Test Keyring Support (#842)
* Allow creation of authority lists with any number of authorities

* Move keyring helpers into their own module

* Add helper for generating list of test accounts

* Fix import names in tests

* Rename Keyring trait to Signer

* Get list of accounts in a more functional way

* Clarify meaning of `test_keyring` return type

* Use concrete test account type instead of generics

* Make sure voter set contains all authorities which signed off on pre-commits
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky a17c7eb80c Changed how relay loops are started (#840)
* slightly changed relay loop initialization

* git mv

* clippy

* more clippy

* loop_run -> run_loop

* review and clippy

* clippy
2024-04-10 10:28:37 +02:00
Hernando Castano 8d122b03f1 Rename Finality Verifier and Call Dispatch Pallets (#838)
* Rename `pallet-finality-verifier` to `pallet-bridge-grandpa`

* Missed some CamelCase ones

* Update logging target in GRANDPA pallet

* Rename `pallet-bridge-call-dispatch` to `pallet-bridge-dispatch`

* Rename the dispatch pallet folder

* Update logging target in Dispatch pallet

* Missed a couple

* Format the repo

* Stop listing individual pallets in Compose logs

* Use correct pallet name in module doc comments

* Add `pallet-bridge-dispatch` to README project layout

* Sort crate names in TOML files

* Rename `pallet-bridge-grandpa` runtime Call alias
2024-04-10 10:28:37 +02:00
Tomasz Drwięga acb872fbb0 Flatten back the structure (#837)
* Remove chains.

* Move relay clients.

* Flatten generic.

* Fix fmt.
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 647eb80165 Westend->Millau headers relay in deployments (#831)
* reorganize monitoring

* Westend->Millau bridge

* support multiple bridges

* initialize Westend -> Millau bridge byMillau.George

* fix intersecting ports

* ignore dashboards

* single bridged network

* deal with multple --env-file args

* fix chain name

* use images from docker hub

* update show_help

* updated comment

* mount whole dashboards directory

* removed unneeded network

* reverted reverse-proxy changes

* prometheus -> targets

* separate Grafana.Dockerfile with builtin /etc/grafana

* Revert "separate Grafana.Dockerfile with builtin /etc/grafana"

This reverts commit 53e04c4556f882d19e3af0fac581a926b8e0c167.

* read dashboards from /etc/grafana/dashboards

* stop comment
2024-04-10 10:28:37 +02:00
Hernando Castano 1c7b5d1b30 Tunable Justification Generator (#835)
* Add way to create tunable GRANDPA justifications

* Use new function in tests

* Allow multiple authorities on a single fork

* Only store pre-commit targets instead of full ancestry chains

* Rename precommit_header to be more generic

* Push new digest item instead of overriding entire digest

* Ensure that we generate chains with non-zero length

* Extract justification creation parameters into struct

* Appease Clippy
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 4105575794 Rename pallet-message-lane into pallet-bridge-messages (#834)
* use runtime:: prefix for message-lane pallet traces

* renamed message-lane (module and primitives) folder into messages

* replace "message lane" with "messages" where appropriate
2024-04-10 10:28:37 +02:00
Hernando Castano eb7c96ba14 Make Test Helpers no_std Compatible (#823)
* Use `sp-application-crypto` when generating test justifications

* Try to justifications tests compiling

* Try using `ed25519_dalek` for justification creation

* Small cleanup

* Correctly generate a Keypair

The public key didn't correspond to what would be derived
with the given private key.

* Remove enum index hack

* Clean up test account helper functions

* Fix tests in `pallet-finality-verifier`

* Get `pallet-substrate-bridge` tests compiling again

* Use the correct keyring in justification tests

* Clean up Keyring related code a bit

* Appease Clippy

* Remove unused import

* Use keyring variants directly

* Remove unecessary From implementation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 401d3847d1 Add multiplier parameter to transaction_payment function (#830)
* transaction_payment_without_multiplier -> transaction_payment

* tests

* fmt
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky c95b1eb970 relay_loop().await from main relay function (#829) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 4cd6d128ea updat jsonrpsee (#828) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky d749bc3a96 Sync Westend to Millau (#824)
* make finality verifier pallet instantiable

* add second instance of finality verifier pallet to the Millau runtime

* add Westend -> Millau headers relay

* use wss to connect to public westend nodes

* initialize with best_finalized_block

* typo

* Revert "initialize with best_finalized_block"

This reverts commit 954ed2832372d67618abc1a06d47e66faa93f674.

* pass VoterSet by ref

* new bridge initialization code

* loop upper bound

* Polkadot -> Westend

* fixed tests compilation

* default-features

* assert
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 249a8f73ff Make finality verifier pallet instantiable (#825)
* make finality verifier pallet instantiable

* try to fix benchmarks

* fix benchmarks compilation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 715258785f Added some ML-related constants for polkadot-like chains (#822)
* added some ML-related constants for polkadot-like chains

* comment
2024-04-10 10:28:37 +02:00
Tomasz Drwięga d9bec5f387 Reorganize relay code to make it easy to add new networks. (#813)
* Nest some crates.

* Alter command execution to make it easier to add new bridges.

* Rename sub-dirs.

* cargo fmt --all

* Address clippy.

* Update relays/substrate/src/rialto_millau/cli.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 53cdf66071 More tests for finality relay (#816)
* more tests for finality relay

* clippy

* remove env_logger dep

* fmt

* more clippy

* removed prune_unjustified_headers

* review
2024-04-10 10:28:37 +02:00
Hernando Castano d8852fd197 Clean Finality Verifier Pallet (#804)
* Remove unused Config types from `pallet-finality-verifier`

* Remove unused AncestryChecker trait

* Remove ancestry proof parameter from relayer calls

* Update docs to reflect current state of pallet

* Remove mock ancestry checker

* Remove unused error

* Write headers outside of function used for authority set changes

* Move justification verification into helper function

* Add documentation suggestions

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Clean up module level documentation a bit

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 84cd93f936 Add Westend & Rococo primitives (#808)
* Move chain primitives to a sub-folder.

* Update workspace members.

* Extract core parts of polkadot.

* cargo fmt --all

* Remove TODO.

* cargo fmt --all

* Fix crate names.

* Add to the latest API.

* cargo fmt --all

* Add nested lock files to ignore (generated during cargo fmt)

* Fix compilation.

* cargo fmt --all

* Fix ignore pattern.

* Address review comments.
2024-04-10 10:28:37 +02:00
Hernando Castano 47aa6634a2 Simplify operational extrinsics (#810)
* Simplify operational extrinsics

* Remove old extrinsics from finality verifier
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 8f11732bb9 Uniform git dependencies (Backport of substrate#2589) (#805)
* Make Substrate deps uniform

* Rest of the deps.

* Fix broken merge.

* Revert substrate.

* Fix tests

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 903018db3d Add Transaction Payment Custom RPC (#806)
* Transaction payment RPC.

* Add payment RuntimeApi to fix the build.

* cargo fmt --all
2024-04-10 10:28:37 +02:00
Hernando Castano 51db99ea79 Move Storage Parser from Bridge Pallet (#793)
* Move storage proof checker to runtime primtives

* Add method for parsing storage proofs

* Use finality-verifier pallet in runtime-common

* Get bridge pallet compiling again

* Use storage prover from bp-runtime in a few more places

* Don't leak `std` items from proof helper into `no-std` builds

* Fix benchmarking compilation

* Remove unused import in fuzzer
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 80533af331 Use globs for workspace members. (#802)
* Add all members.

* Change members to globs.

* Remove runtime-common.
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 324e083cba Changed delivery and dispatch fee computation methods (#795)
* removed weight <-> fee mess

* updated documentation

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Hernando Castano f7c3bd4e08 Bump Substrate (#796)
* Bump Substrate to version used by Polkadot (`5f056830`)

* Use `log` crate for runtime logging

See https://github.com/paritytech/substrate/pull/8128/ for more info.

* Stop using return value from `execute_block`

* Update test weight
2024-04-10 10:28:37 +02:00
Tomasz Drwięga afb48a547e bridges: fix random_seed (#797)
Co-authored-by: André Silva <andrerfosilva@gmail.com>
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 56354c7d1a Bump serde from 1.0.123 to 1.0.124 (#801)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.123 to 1.0.124.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.123...v1.0.124)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky f87053c1cb Relay Millau && Rialto headers using (future) finality verifier API (#761)
* finality proofs relay

* SyncHeader::is_mandatory

* empty ancestry proof

* logs

* fixed submit condition

* fixed wrong split index

* tick comment

* recent_finality_proofs

* basic finality loop tests

* removed obsolete files

* rename files in substrate relay

* fmt

* clippy

* fixed TODOs

* clippy

* stop syncing if target node is out of sync

* more clippy

* more clippy

* Update relays/finality-relay/src/finality_loop.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update relays/finality-relay/src/finality_loop.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update relays/finality-relay/src/finality_loop.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* docs

* moved doc

* typo

* Update relays/finality-relay/src/finality_loop_tests.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update relays/finality-relay/src/finality_loop_tests.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* header_and_finality_proof_by_number -> header_and_finality_proof

* VecDeque isn't required (because of make_contiguous)

* fixed wrong expect

* Update relays/finality-relay/src/finality_loop.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update relays/substrate/src/rialto_headers_to_millau.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update relays/substrate/src/rialto_headers_to_millau.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* RialtoSyncHeader

* Update relays/finality-relay/src/finality_loop.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update relays/finality-relay/src/finality_loop.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* removed wrong comment

* Update relays/finality-relay/src/finality_loop.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* fix used runtime methods names

* fix for new jsonrpsee

* fix comment

* initialize finality verifier pallet

* fmt

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Hector Bulgarini e13ff320ea Adding message relayer scripts, reformating send message scripts (#790)
* Adding message relayer scripts, reformating send message scripts

* Addressing PR feedback

* Update README.md

Valid .

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Fixing send-message-from-rialto-millau

* Fixing send message script from millau to rialot

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky a2b8bb191b Migrate to jsonrpsee v2 (#787)
* POC jsonrpsee v2

* POC update ws client

* connect to eth nodes using ws

* fix for subscriptions

* reverted unncecessary changes

* reference jsonrpsee from crates.io

* fixed eth port in deployments

* fmt

* order deps

* remove unnecessary comment

* clone is no longer required for subscriptions

* treat RpcError::Internal as connection error

* resubscribe on terminate

* Update deployments/bridges/poa-rialto/entrypoints/poa-exchange-tx-generator-entrypoint.sh

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Hernando Castano 6cfd87783e Unify Substrate Bridge Pallet with Finality Verifier (#783)
* Add relevant storage items from Substrate pallet

* Add function for importing finalized headers to storage

* Remove unused getter functions

* Add GenesisConfig to pallet

* Add initialization extrinsic

* Add operational extrinsic

* Get existing finality verifier tests compiling again

* Add tests for pallet initialization

* Add tests related to pallet's operational status

* Update tests which were using `pallet-substrate-bridge`

* Add tests related to header imports

* Use wrapper function when init-ing some tests

* Add prefix to tests related to rate limiter

* Fix failed compilation related to GenesisConfig

* Add some documentation

* Change some extrinsics to be Operational

* Add public interface to pallet

* Implement runtime APIs for finality-verifier pallet

* Justify use of `expect` when importing headers

* Reject headers with forced changes

* Add weight to initialize extrinsic

* Remove TODO which will be addressed later

* Move succesful import log to correct location

* Expand proof for when `best_finalized` is fetched

* Move check for newer finalized blocks earlier in pipeline

* Rename `ConflictingFork` error to be more generic

* Only compute finality_target's hash once

* Add missing documentation to Runtime APIs

* Add TODO about using `set_id` from `ScheduledChange` digest
2024-04-10 10:28:37 +02:00
Bobin Mathew 95f5d2248e Create CODE_OF_CONDUCT.md (#791) 2024-04-10 10:28:37 +02:00
Hernando Castano f1553e3de9 Update Substrate Node build script (#786)
Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
2024-04-10 10:28:37 +02:00
Tomasz Drwięga da41afd105 Add Bridge calls encoding to relay CLI (#780)
* Bridge calls.

* Allow encoding messages for both Rialto and Millua.

* Add docs.

* Display full extrinsics in debug.

* cargo fmt --all

* Use info instead of debug,.

* Clarify units.
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 077e2cc11b Derive bridged accounts (#781)
* Add derivation support.

* Add custom decoder for Accounts.

* cargo fmt --all

* Fix warn.

* Fix articles.

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 3764cda726 Add few CLI helpers (#764)
* Adding call encoding.

* Add message payload encoding.

* Nicer output.

* Add fee estimation.

* cargo fmt --all

* Split message payload encoding into separate command.

* Use HexBytes.

* cargo fmt --all

* Fix compilation.
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] c9a8ac0b32 Bump serde_json from 1.0.63 to 1.0.64 (#777) 2024-04-10 10:28:37 +02:00
Tomasz Drwięga 7602d910d4 Disable cache in CI builds. (#772)
* Disable cache.

* Fix tests.

* Fix clippy?

* cargo fmt --all
2024-04-10 10:28:37 +02:00
Andreas Doerr de5ac085a1 Bump Substrate and Deps (#770)
* Bump Substrate and Deps

* silence clippy
2024-04-10 10:28:37 +02:00
Hernando Castano 658e4e9b5c Use No-Op Ancestry Checker (#755)
* Use no-op ancestry checker

* Check that current header height is greater than last finalized

* Ensure that incoming headers are strictly greater than last finalized

* Ensure that header numbers always increase in tests
2024-04-10 10:28:37 +02:00
Hernando Castano c00a47d5ca Stop counting invalid requests towards rate limit (#765) 2024-04-10 10:28:37 +02:00
Tomasz Drwięga 19f021e34c Add default for some options. (#763) 2024-04-10 10:28:37 +02:00
Tomasz Drwięga c3d651d29a Add inspect command to take a look at extrinsics. (#762)
* Add inspect command to take a look at extrinsics.

* cargo fmt --all

* New weight for on-chain remark in tests

* Minor style tweaks.

Co-authored-by: adoerr <0xad@gmx.net>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 4a1a990fa6 Message lane integration documentation (#736)
* how-to-integrate-message-lane-module

* added README stub for bridge-runtime-common

* added README stub for pallet-bridge-call-dispatch

* bridge-runtime-common documentation

* call dispatch module documentation

* some fixes

* more fixes

* more fixes

* more fixes

* more fixes for runtime-common/README.md

* more fixes in call-dispatch/README.md

* more fixes in call-dispatch/README.md

* more fixes in call-dispatch/README.md

* more fixes in message-lane/README.md

* more fixes in message-lane/README.md

* Wrap most text at 100 characters

* Clean up some of the formatting

* Fix broken link

* Stop running CI for README changes

* Don't run any CI steps on documentation changes

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 89b0f7beda verify ADDITIONAL_MESSAGE_BYTE_DELIVERY_WEIGHT constant value (#731) 2024-04-10 10:28:37 +02:00
Tomasz Drwięga 82739314a8 Bump substrate in subtree import preparation. (#759) 2024-04-10 10:28:37 +02:00
Tomasz Drwięga 441c95ba2b Set weird substrate global state for custom SS58 prefixes (#754)
* Issue with SS58 decoding.

* Switch to test branch.

* Fix set.

* Revert "Switch to test branch."

This reverts commit d79e42ea9bc780edb20296dae546d534f1916fc7.

* cargo fmt --all

Co-authored-by: adoerr <0xad@gmx.net>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 1b2e6cdeb0 Generate large messages (#700)
* generate large messages

* consider headers sync lag when computing number of rewards in confirmation

* more fixes

* fix logs

* fix warnings

* do not wait until tx that has delivered nonces will be finalized before submitting other tx

* tests for maximal weight/size

* cleanup

* cleanup

* clippy

* compilation

* args for dispatch weight and remark size

* ExplicitOrMaximal

* clippy
2024-04-10 10:28:37 +02:00
Andreas Doerr 3dfef2cd2c Send message doc (#746)
* add document

* Send message documentation

* Apply review

Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>

Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
2024-04-10 10:28:37 +02:00