Commit Graph

15888 Commits

Author SHA1 Message Date
Svyatoslav Nikolsky 8e8e89511f Message lane weight formulas (#596)
* weight formulas for message-lane calls

* extracted WeightInfoExt into separate file
2024-04-10 10:28:37 +02:00
Hernando Castano a6c3de51d3 Fixes for Polkadot Integration (#586)
* Add AccountIdConverter impl to Kusama and Polkadot primitives

* Add missing message lane config constants

* Add more consts

* Add another missing const

* Move consts in primitives so that they're consistent across files

* Move types and consts to more intuitive locations

* Downgrade hyper from v0.13.8 to v0.13.6

This conflicts with a requirement on the Polkadot side
which requires that hyper is =v0.13.6

* Update hyper to v0.13.9

* Update async-io to v1.3.1

* Update socket2 from v0.3.15 to v0.3.18

* Update message weight/size constants

* Make BlockWeights/Length parameter types

Allows us to re-use these types from both the runtime and
the message lane config files without creating a new instance
of them.

* Remove uneccesary weight constants

These can be found in the `runtime-common` crate used
by Polkadot/Kusama. The constants there will also be
the most up-to-date versions.
2024-04-10 10:28:37 +02:00
Andreas Doerr 5cafbaa0ad Readme community section (#594)
* Readme community section

* better links

* address review

* correct Element history

* Update README.md

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

* Fix link to Element.io

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky e5f6e309a6 Automated weights for message lane module (#590)
* automated weights

* associated WeightInfo type

* update weights using wasmtime

* disable clippy for autogenerated weight.rs

* fix
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky c9310312b2 fix benchmarks compilation (#595) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 043a008723 add relayers_state param to the receive_messages_delivery_proof (#584) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 595481f02e Enable Wasmtime and Remove secp256k1 (#593)
Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 5e4358a727 Fix clippy warning (#591)
* clippy

* still clippy

* clippy again
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 9deea5d251 Benchmark for message delivery confirmation transaction (#570)
* receive_delivery_proof benchmarks

* fix compilation

* Update modules/message-lane/src/benchmarking.rs

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

* Update modules/message-lane/src/benchmarking.rs

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

* Update modules/message-lane/src/benchmarking.rs

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

* Update modules/message-lane/src/benchmarking.rs

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

* Update modules/message-lane/src/benchmarking.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 b45d65f330 Fix grandpa initialization (#583)
* fix grandpa initialization

* fnt
2024-04-10 10:28:37 +02:00
Hernando Castano a8ae048a3e Add correct Docker commands in README (#580)
* Add correct Docker commands in README

* Split long line
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 63e2655c8b Add messages count parameter to delivery transaction (#581)
* add messages count parameter to delivery transaction

* fix benchmarks compilation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 6317a31e25 Benchmarks for message delivery transaction (#567)
* benchmarks for pallet_message_lane::receive_messages_proof

* use CallOrigin::TargetAccount (worst case of CallOrigin)

* fmt

* closures

* Update modules/message-lane/src/benchmarking.rs

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

* Update modules/message-lane/src/benchmarking.rs

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

* fix compilation

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Hernando Castano f26775d690 Rialto to Millau Transfer Generator (#568)
* Add option to relay for sending transfers to Millau chain

* Endow derived accounts on Millau chain

* Update message generator entrypoint script to send transfers

* Use correct command when sending messages

* Send Root messages from Root origin on source chain

* Wrap calls from Root Origin in Sudo Call

* Allow Root to send messages without paying fees

* Use correct variable when sending messages to Rialto

* Print warning if no message type is provided to script.

* Add note mentioning that certain source origins aren't supported yet

* Use correct runtime when initializing header sync

* Remove option to send messages as Root

* Remove endowment of derived Root accounts

* Fix indentation.

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
2024-04-10 10:28:37 +02:00
Hernando Castano ee655b1057 Update Substrate Dependency (#566)
* Update `sp-io` dependency

* Rename Trait to Config

* RustFmt

* Bump `sp-io` again

* Use new frame_system weight types in Rialto and Millau runtimes

* Update test Runtimes to use new weight types

* Bump `sp-io` again

* Update to not-the latest first.

* Update benchmarks.

* Another Trai.

* Move new weight types into runtime primitive crates

This allows us to check limits for extrinsics from other parts
of the codebase without pulling in the entire chain runtime.

* Remove leftover comments

* Move new functions to a better location

* Small formatting fixes

* Add actual documentation to new weight config types

* Decrease maximum block weight of Millau chain

* Decreease maximum block length of Millau chain

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 8a5b51a944 Limit size of message delivery transaction (#575)
* limit messages size in delivery transaction

* docs
2024-04-10 10:28:37 +02:00
Hernando Castano d47658c92e High-Level Documentation (#565)
* High level docs - start.

* Clean up README

* Start adding details to high level docs

* More docs on the header sync pallet

* Testing scenarios document.

* Add some scenarios.

* Add multi-sig scenario.

* Start writing about message dispatch pallet

* Move content from old README into PoA specific doc

* Apply suggestions from code review

Co-authored-by: Andreas Doerr <adoerr@users.noreply.github.com>

* GRANDPA for consistency.

* Describe scenario steps.

* WiP

* Add notes about block production and forks

* Update.

* Add sequence diagram for Millau to Rialto transfer

* Clean up header sync pallet overview

* Remove leftover example code

* Clean up testing scenarios and amend sequence diagram.

* Linking docs.

* Add some more docs.

* Do a bit of cleanup on the high-level docs

* Clean up the testing scenario

* Fix typos in flow charts

* Fix small typo

* Fix indentation of Rust block

* Another attempt at rendering block correctly

* TIL about lazy list numbering in Markdown

* Add list numbers across sections

* Start counting from correct number

* Update README to use correct path to local scripts

* Wrap ASCII art in code block

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Andreas Doerr <adoerr@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 5a790c9874 Bump async-std from 1.7.0 to 1.8.0 (#574) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 2a0f7c7d17 fix send_message_worst_case (#571) 2024-04-10 10:28:37 +02:00
Hernando Castano 0ff8c2437c Cross-Chain Transfer Generator (#535)
* Attempt at adding Cross-Chain Transfer Generator

* Add Transfer subcommand for sending messages to Rialto

* Add temp helper script for sending messages

* Remove Message and Lane Ids from Dispatch Event

* Increase transfer amount used by script

* Endow derived Dave account on Rialto with funds

* Update Message generator to send more types of messages

This commit first of all updates the script to use the new CLI
commands for sending messages. Second, it adds messages which are
sent from both Target and Source origins.

* Generate messages from Root origin

* Remove dbg! logs from relayer

* Log AccountId as well as HexId

* Remove Balances logs

* Add InstanceId and MessageId back to Dispatch Event

* Add InstanceId and MessageId types for Apps

* Add missing comment

* Document derived accounts as tests

* Move shared commands to variables

* Add example usage for send_message script

* Add docs to message variants

* Fix Clippy complaint
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 6f6c8c2417 Verify Source origin in TargetChainVerifier (#558)
* Make sure to verify sender's origin.

* Make sure to use dispatch verification.

* Add tests.

* cargo fmt --all

* Remove superfluous lifetime.

* Move the check to MessageLanVerifier.

* cargo fmt --all

* Fix docs.
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky f57b7e9de0 Message lane benchmarks: start (#554)
* message lane benchmarks: start

* finish send_message_worst_case benchmark

* fix compilation

* removed redundant bench param
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 2944f997d1 Limit max number of unconfirmed messages at inbound lane (#545)
* limit maximal number of unconfirmed messages at inbound lane

* unrewarded_relayer_entries API

* change relay to support max unrewarded relayer entries

* Update modules/message-lane/src/inbound_lane.rs

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

* Update relays/messages-relay/src/message_lane_loop.rs

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

* removed pub

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 93b3d49047 Bump serde from 1.0.117 to 1.0.118 (#564) 2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 091a9ba7e2 Bump serde_json from 1.0.59 to 1.0.60 (#563) 2024-04-10 10:28:37 +02:00
dependabot-preview[bot] c155c31f50 Bump structopt from 0.3.20 to 0.3.21 (#562) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 2d08a9d213 Polkadot integration (#542)
* kusama primitives + client

* polkadot primitives + client

* lost Chain definitions

* fix compilation and fmt

* Update primitives/runtime/src/lib.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 81a3e7cce3 reject too large (by size) messages (#551) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky f1949c6342 Limit max number of messages in delivery transaction (#541)
* limit max number of messages in delivery tx

* support max-messages-in-delivery-tx in relayer

* clippy

* clippy

* Update modules/message-lane/src/lib.rs

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

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky a872ee6ff1 lower limit for message weight (#536)
* lower limit for message weight

* fmt

* do not include tx overhead in weights returned by weight_limits_of_message_on_bridged_chain

* Use correct chain in comment

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Hernando Castano 951aa36c2b Add Derived Account Origins to Dispatcher (#519)
* Update some docs

* Add derived account origin

* Add tests for derived origin

* Do a little bit of cleanup

* Change Origin type to use AccountIds instead of Public keys

* Update (most) tests to use new Origin types

* Remove redundant test

* Update `runtime-common` tests to use new Origin types

* Remove unused import

* Fix documentation around origin verification

* Update config types to use AccountIds in runtime

* Update Origin type used in message relay

* Use correct type when verifying message origin

* Make CallOrigin docs more consistent

* Use AccountIds instead of Public keys in Runtime types

* Introduce trait for converting AccountIds

* Bring back standalone function for deriving account IDs

* Remove AccountIdConverter configuration trait

* Remove old bridge_account_id derivation function

* Handle target ID decoding errors more gracefully

* Update message-lane to use new AccountId derivation

* Update merged code to use new Origin types

* Use explicit conversion between H256 and AccountIds

* Make relayer fund account a config option in `message-lane` pallet

* Add note about deriving the same account on different chains

* Fix test weight

* Use AccountId instead of Public key when signing Calls

* Semi-hardcode relayer fund address into Message Lane pallet
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky c20b4c868f Fixed clippy warnings (#537)
* fixed clippy warnings

* Revert "Actually use pinned nightly version when building runtimes (#465)"

This reverts commit dedddb6b0f22260e00053c28873a0cb1fbea22e2.

* Revert "Pin Rust Nightly Version (#420)"

This reverts commit 8902ac2030cf7ef48ec512463424f134a3b38804.

* fix after revert

* another fix after revert

* more clippy fixes
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 4f661d2fe0 Message relay fixes for nightly stuck (#532)
* fixed missing else

* really wake up when retry timeout is completed

* do not query weights if target nonce is unknown

* fix compilation
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 889b22bee5 Add more substrate accounts + use one account in one relay (#526)
* add more substrate accounts

* 's

* Update deployments/README.md

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

* Update deployments/README.md

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

* more fixes

* with messages to -> which contain messages for

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 441f63a34f Generic SyncHeader type (#529)
* generic SyncHeader type

* add panic condition to method description

* extract -> into_inner

* checked_sub + expect
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky dd7242bc79 Migrate back to Substrate master (#528)
* migrate back to Substrate master

* fmt

* clippy
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 698d8d5600 added more relay and message-lane pallet logs (#527) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky fe11f6f1d9 Ability to send messages from Rialto to Millau (#525)
* relay Rialto messages to Millau

* impl SubmitRialtoToMillauMessage

* fmt
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] be56ee51d0 Bump futures from 0.3.7 to 0.3.8 (#507)
* Bump futures from 0.3.7 to 0.3.8

Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.7...0.3.8)

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

* Fix clippy.

* Fix more clippy.

* Fix clippy again?

* Cliipy yet again.

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky a0261757f9 Millau -> Rialto messages relay dashboard (#520) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 53791a1d4a Chain specific message lane apis (#503)
* replace generic message lane APIs with chain-specific

* moved SubstrateHeadersSyncPipeline to headers_pipeline.rs

* substrate-specific message lane trait

* Update relays/substrate/src/messages_lane.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 d2ab81340a Use best block state to craft message relay transactions (#499)
* use best block state to craft message relay transactions

* removed obsolete TODO

* Update relays/messages-relay/src/message_race_loop.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
dependabot-preview[bot] f88c71252a Bump async-trait from 0.1.41 to 0.1.42 (#524) 2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 580c8234f5 Bump env_logger from 0.8.1 to 0.8.2 (#523) 2024-04-10 10:28:37 +02:00
Tomasz Drwięga 667f26bfdb Fix cargo-deny. (#522)
* Fix cargo-deny.

* Update time crate.

* Fix time issues.
2024-04-10 10:28:37 +02:00
Hernando Castano e91cab68d4 Avoid Panic When Fetching Info Before Bridge is Initialized (#504)
* Allow bridge pallet to return no finalized headers

* Update Runtime APIs to optionally return best finalized header

* Update relay to handle optional best finalized headers

* Fix Clippy lints

* Return a dummy header instead of an Option

* Remove Option from runtime Apis

* Remove support for handling optional finalized headers in relay
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 595523106e Fixed outbound_lane_data_key (#516) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky db84f84333 Fixed message signed by relay (#515)
* fixed message that is signed by relay

* clippy
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 6dc267393a Use different chain primitives in Millau (#517) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 20fc30404a Fixed referenced balance in rialto_messages.rs (#509)
* fixed referenced balance in rialto_messages

* names

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00