Commit Graph

15862 Commits

Author SHA1 Message Date
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
Svyatoslav Nikolsky 23f5f3cdd6 Limit messages weight in batch (#496)
* limit messages in the batch by weight/count

* fixed components compilation

* reverted obsolete parts of #469

* implement generated_messages_weights

* actually use computed weight in message proof

* fmt and clippy

* fixed TODO

* clippy

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

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

* add issue reference

* add assert message

* grumbles

* fmt

* reexport weight from bp-message-lane

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
Hernando Castano e515f4fb62 Fixes for Millau-Rialto Deployment (#493)
* Expose two nodes publicly through brucke.link

* Use flags for GNU `sed` instead of BSD `sed`

* Update Substrate relay entrypoint scripts to initialize bridge

* Add Rialto to Millau relay to Compose deployment

* Stop initializing Rialto chain through chainspec

* Include logging for Substrate pallet

* Make Rialto to Millau entrypoint executable

* Use YAML references for relay components

* Use published Substrate Relay image

* Relay messages from Millau to Rialto

* Use Bob nodes to serve message lane

* Fix some port number issues for PoA-Rialto deployment

* Stop directly referencing `environment` anchor in nodes

* Add probable cause to relayer error message

* Edit monitoring config file in-place

* Add some sleep time between bridge init call and starting relays

* Expose grafana.

* Use Root key as bridge pallet owner

In our case that's going to be Alice since she's Root for our Dev
and Local chains.

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 0e6d2b8913 Removed unused file (#498)
* removed unused file

* another unused file
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 8d4e004d61 Fix Typo in Relay CLI Subcommand Description (#497) 2024-04-10 10:28:37 +02:00
Hernando Castano c8e4d536a2 Remove Millau Genesis Config in Rialto Node (#494) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 0c38193af7 Relay subcommands to initialize substrate bridge pallet (#483)
* initialize substrate bridge from relay

* is_halted: false

* initialize using su instead of owner

* Fix wording in comments

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Hernando Castano 3f7655a056 Allow Substrate Pallet to be Halted (#485)
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 6c0110c11e Bump async-std from 1.6.5 to 1.7.0 (#491) 2024-04-10 10:28:37 +02:00
Hernando Castano 184871525c Rework Compose Setup for Millau Deployment (#464)
* Rename `rialto` deployment to `eth-sub-bridge`

* Add base Compose configs for Rialto and Eth-PoA nodes

* Add new compose file for eth-sub deployment

* Rename bridge-nodes to rialto-nodes

* Update bootnode entries for Rialto nodes

* Remove new compose file since it was used for quick test

* Rename bridge nodes in entrypoint scripts

* Remove all nodes from Eth-Sub Compose file

The nodes should be getting pulled in from the new compose files.

* Remove TODO comment

* Rename nodes to networks

Reflects the fact that a set of nodes makes up a network.

* Add Compose file for Millau network nodes

* Enable logging for all Millau nodes

* Delete Rialto reserved peers file

* Rename `bridge-config` to `scripts`

* Add Compose file for Rialto-Millau bridge

* Move bridge deployments into `bridges` folder

* Drop `bridges` prefix from bridge deployments

* Rename folder that had scripts for working with binaries

* Move proxy configuration to common top level folder

* Make a top level `monitoring` folder

* Start updating deployment README

* More updates in the README

* Remove usage of Git overrides

* Remove scripts to run Eth<->Sub

I don't think these are used anymore

* Remove Github Docker build instructions from main README

* Add note about monitoring

* Update Millau state root

* Add script for running and updating Compose deployments

* Remove old update script

* Explain usage of `run` script

* Update Millau state_root again

* Remove repeated Prom image from Rialto-Millau bridge

* Quick fix to stop containers in `run` script

* Pin GrafanaMatrix Dockerfile to old commit

The latest master has some changes in how the application is run. We don't
want to update just yet so we're pinning to an old commit.

* Make Compose files use a project directory

The main consequence of this change is that all paths have to be specified
from the root of the `deployments` folder. However, this makes it so that
we can reuse components in different deployments, like the GranfaMatrix
Dockerfile which is shared by all bridges.

* Use `project-directory` when stopping and updating network

If we don't use the full Compose command which includes `project-directory`
not all the containers get cleaned up correctly.

* Update path in Bridge Dockerfile

* Correctly ignore `target` folders in Docker builds

* Wait for Rialto nodes before running relay

* Make `run` script a little less sketchy

* Clean up deployment README

* Remove stray line

* Have run script automatically change into correct directory

* Use PoA-to-Rialto instead of Eth-to-Sub in names

* Rename `eth-poa-sub` bridge deployment to `poa-rialto`

* Use /entrypoints volume for entrypoint scripts

* Be more consistent with relay service names

* Remove `docker-compose` prefix from network Compose files

* Add comment explaning Grafana Matrix commit

* Fix wording in README

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

* Cleanup unused line in README

* Add link to Slava's test scripts

* Remove uneccessary piping when `cd`-ing in `run.sh`

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 74a2359c04 Print progress of message races (#489)
* print message race progress

* fmt

* Update relays/messages-relay/src/message_race_loop.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 739fb655a8 Fixed block where proof is generated (#488)
* fixed block where proof is generated

* proof_is_generated_at_best_block_known_to_target_node
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 439c3e9a70 Fixed client used in headers maintain (#487)
* fixed client used in headers maintain

* fmt
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 2a6af69ff0 enable GrandpaRpcApi for Rialto (#486) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 20fea45d1f Verify messages proofs (#480)
* verify messages proofs

* fmt

* clippy

* grumbles
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 3d24a4e34e verify messages delivery proofs (#482) 2024-04-10 10:28:37 +02:00
Hernando Castano cac8319480 Allow Substrate Pallet to be Initialized via Dipatchable (#481)
* Add dispatchable for intializing pallet

* Add Polkadot JS types for Substrate bridge pallet

* Ensure Root is the only one that can initialize the pallet

* Add some tests

* Pack initialization data into struct

* Only allow pallet to be initialized once

* Use new initialization config in nodes

* Rename ScheduledChange in Ethereum pallet

We're renaming it to prevent clashes with Substrate bridge pallet type
of the same name. This is relevant when importing types to Polkadot JS
Apps.

* Move all Polkadot JS types into one file

* Appease Clippy
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky d4fc7bebdc Millau -> Rialto messages relay (#399)
* Millau messages -> Rialto relay

* prepare for custom race strategy of delivery race

* custom strategy for delivery race

* update TODOs

* add reference to issue 457

* impl reconnect

* clippy

* fix check in test

* fmt

* removed obsolete TODO

* fixed another TODOs

* fmt

* use MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE const from primitives

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

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

* added SubstrateMessagesProof typedef

* fix test

* removed comment

* additional_proof_required -> ProofParameters

* typo

* multiline literal

* clippy

* fix typo

* and_then -> await

* update_source_latest_confirmed_nonce

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

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

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
Svyatoslav Nikolsky 804ef55146 Move storage keys computation to the message-lane pallet (#478)
* compute required storage keys in the message-lane pallet

* Update modules/message-lane/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 2d7eacf6e2 Parse substrate message proof (#479)
* parse substrate message proof

* unfinalized_header
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky b0a5e75ff4 is_finalized_header - use is_finalized flag (#476) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 3e45356aad Rialto -> Millau headers relay (#477)
* Rialto -> Millau headers relay

* removed more constraints

* removed file from other PR

* Update primitives/rialto/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 b027c81266 Substrate relay guards (#470)
* substrate relay guards

* checked time condition

* ChainWithBalances

* removed obsolete comment

* Update relays/substrate-client/src/chain.rs

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

* trailing space

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky cc1da1bb39 Ability to halt/resume message-lane pallet (#472)
* halt/resume message-lane pallet

* fmt

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

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

* include weights in halt/resume operations

* remove trailing space

* set_owner

* Shorten doc comment length

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky ef9357596f Return cumulative dispatch weight of messages from the messageLane_proveMessages (#469)
* implement OutboundLaneApi and InboundLaneApi for Millau /Rialto runtimes

* fixed typo
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 51f39c4427 Update jsonrpsee reference (#467)
* update Millau state_root

* update jsonrpsee reference
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky b99fa90edd SubmitMillauToRialtoMessage subcommand in substrate-relay (#460)
* substrate-relay::SubmitMillauToRialtoMessage

* typo

* Update relays/substrate/src/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