Commit Graph

15956 Commits

Author SHA1 Message Date
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
Svyatoslav Nikolsky 1bf2eb1ab5 Message lane pallet parameters + updatable conversion rate (#728)
* message lane pallet parameters

* updated comment

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

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

* fmt

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Tomasz Drwięga e8b5a53eed Change SS58Prefixes (#739)
* Workaround for SS58Prefix issues in the UI.

* Change prefixes.

Co-authored-by: adoerr <0xad@gmx.net>
2024-04-10 10:28:37 +02:00
Tomasz Drwięga b806fb7756 Fix formatting. (#738) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 90113303f1 Fix updated clippy grumbles (#733)
* Revert "Pin Rust Nightly to 2020-12-17 (#652)"

This reverts commit e54e6f7e3d34c28d698e637f9099162b3c1917e9.

* fix clippy

* clippy again

* more clippy in test code

* and new cargo fmt

* another try
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 85bb45b5d3 ForbidOutboundMessages and ForbidInboundMessages (#735) 2024-04-10 10:28:37 +02:00
Tomasz Drwięga 470b51d2a9 Rework relay CLI a bit (#734)
* Change CLI UX.

* De-duplicate main.

* De-duplicate send message.

* Add more docs and extract functions.

* Fix scripts.

* cargo fmt --all

* Add missing 'u'.
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 2493ce93b3 Bump env_logger from 0.8.2 to 0.8.3 (#725)
Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.8.2...v0.8.3)

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
Tomasz Drwięga 7aa51f8d30 Update to latest substrate (#723)
* Bump substrate deps.

* Bump scale.

* Bump ethabi.

* Remove inherent from aura.

* Migrate to construct_runtime

* cargo fmt --all
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 32342bf6e5 remove lower limit of message weight (#727) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky c4b931ba29 Keep multiple latest confirmed nonces at source in messages relay (#719)
* keep multiple latest confirmed nonces at source in messages relay

* post-merge fix
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 705a41528f Increase message fee call (#718)
* fn increase_message_fee()

* benchmarks + weights

* - extra lines

* split error
2024-04-10 10:28:37 +02:00
Hernando Castano d835233571 Finality Pallet Rate Limiter (#720)
* Add simple rate limiting mechanism

* Add tests

* Small test cleanup

* Hook MaxRequests into runtimes
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 010748e409 Fix max extrinsic weight in relay + logging (#717)
* fix max weight in relay + logging

* removed duplicate info
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky ca91d34059 limit number of pending messages at outbound lane (#715) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 2f457775bb Account proof size in weight formula (#679)
* fix broken message lane benchmarks

* proof-size related benchmarks

* impl Size for proof parameters

* include proof weight into weight formula

* left TODO

* fixed proof size

* WeightInfoExt::receive_messages_proof_weight

* charge for extra message bytes delivery in send_message

* removed default impl of WeightsInfoExt

* moved weight formulas to WeightInfoExt

* receive_messages_proof_outbound_lane_state_overhead is included twice in weight

* typo

* typo

* fixed TODO

* more asserts

* started wotk on message-lane documentation

* expected_extra_storage_proof_size() is actually expected in delivery confirmation tx

* update README.md

* ensure_able_to_receive_confirmation

* test rialto message lane weights

* removed TODO

* removed unnecessary trait requirements

* fixed arguments

* fix compilation

* decreased basic delivery tx weight

* fmt

* clippy

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

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

* structs

* Update primitives/millau/src/lib.rs

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

* removed readme.md

* removed obsolete trait bounds

* Revert "removed readme.md"

This reverts commit 50b7376a41687a94c27bf77565434be153f87ca1.

* Update bin/runtime-common/src/messages.rs

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

* Update bin/runtime-common/src/messages.rs

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

* Update bin/runtime-common/src/messages.rs

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

* Update bin/runtime-common/src/messages.rs

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

* Update bin/runtime-common/src/messages.rs

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

* Update bin/runtime-common/src/messages.rs

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

* Update bin/runtime-common/src/messages.rs

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

* PreComputedSize

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
Hernando Castano fb7c191234 Stop Importing Full Header Chain (#707)
* Make AncestryProof type more flexible

* Only import single finalized header instead of a chain

* Fix unchecked header import tests

* Add option for limiting ancestry proof size

* Update finality verifier Config in runtimes

* Update some documentation

* Fix Clippy warning

* Allow AncestryChecker to return proof size

Stops us from abusing the `Size` trait

* Remove Size impl for Vec<T>

* Remove size contraints for ancestry proofs

With different proof types its unclear how to "size" should be interpreted,
so we remove this requirement all together to avoid confusion.
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 2f44aecd97 Bump serde_json from 1.0.61 to 1.0.62 (#708)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.61 to 1.0.62.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.61...v1.0.62)

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
dependabot-preview[bot] 0344d8de84 Bump serde from 1.0.121 to 1.0.123 (#709) 2024-04-10 10:28:37 +02:00
Hernando Castano 51364e732c Add Logging to Finality Verifier Pallet (#702)
* Add some logging to the finality verifier pallet

* Add finality target to happy path log
2024-04-10 10:28:37 +02:00
Hernando Castano 8c7d0ca35d Wire Finality Verifier Pallet Into Runtimes (#696)
* Add Finality Verifier pallet to runtimes

* Implement simple ancestry checker

* Use the new checker in runtimes

* Remove unused import warning

* Bump max allowed ancestry proof size

* Add a few optimization suggestions when verifying ancestry

* Use session length as upper bound for ancestry proof size

* Remove unused time units
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky d73100cb30 Fixed call encoding in signature digest (#699)
* fixed call encoding in signature digets

* udpated test
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 4719cb2292 Add finality verifier test with different validator set id. (#698)
* Add test for invalid set id.

* cargo fmt --all

* Update modules/finality-verifier/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
dependabot-preview[bot] 277167face Bump serde from 1.0.118 to 1.0.121 (#674) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 8953967d92 pause relays(s) when node is syncing (#605) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 8ee90afae6 Pre-dispatch call filter (#687)
* pre-dispatch call filter

* swap filter <-> weight

* clippy

* fmt
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] a9e607c9a2 Bump ethereum-types from 0.10.0 to 0.11.0 (#693) 2024-04-10 10:28:37 +02:00
dependabot-preview[bot] adb58d8fb0 Bump log from 0.4.13 to 0.4.14 (#692) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 19c87db139 Add proof-size related benchmarks to message lane module (#675)
* fix benchmakrs + proof-size related benchmarks

* 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
Hernando Castano ac1d12e607 Bump Substrate Dependency (#684)
* Bump Substrate to commit `0b0d124d5`

* Get Millau node compiling

* Get Rialto node compiling

* Increase account reference count before test

* Fix Clippy warnings for Millau node

* Fix Clippy warnings for Rialto node

* Trigger build.

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
2024-04-10 10:28:37 +02:00
Hernando Castano e4f195d14c Make Account Derivation More Unique (#686)
* Use more unique prefix when generating account IDs

* Update derived addresses used in tests

* Make `account` prefix more unique

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

* Update test account IDs again

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2024-04-10 10:28:37 +02:00
Hernando Castano b921a485fb Add Unchecked Header Writes to Bridge Pallet (#672)
* Add method for unchecked header imports

* Update docs for importing unchecked headers

* Import unchecked headers in HeaderChain implementation

* Fix Clippy warnings

* Move unchecked header import out of Verifier struct

* Clean up unchecked import tests

* Change HeaderChain API to accept iterator of headers

* Use chains of headers in tests

* Remove unused Result return type when appending finalized headers

* Add test which shows that genesis changes are not enacted

* Use initial header's hash for unchecked authority set changes

* Appease Clippy

* Check ancestry before making unchecked writes

* Fix typo

* Fix Clippy warning

* Add note about `ancestry_proof` structure

* Use best hash storage item directly

Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky acee5580ca decode call after spec_version check (#663) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 44bf84269a Extract common part of relay loops (#660)
* extract common parts of relay loops: begin

* merge client impls

* backoff in exchange loop

* reconnect without clone
2024-04-10 10:28:37 +02:00
Andreas Doerr 926520292e Prevent potential signature reuse (#667)
* patch audit findings #42

* extend msg signature for substrate relay

* signature verification test

* make proof dependet on call_dispatch crate

* silence clippy

* revert deny exception

* address code review

* since it's not really a proof, call it digest
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 9414c0d6fe Emit dispatch message when whole message (payload) has invalid encoding (#664)
* emit dispatch message when whole message (payload) has invalid encoding

* DispatchMessage::dispatch accepts Result
2024-04-10 10:28:37 +02:00
Hernando Castano dee8d6df94 Clean up initialization tests slightly (#678) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 38c1bf89b4 Update weight related parameters in relay (#662)
* update weight-related parameters in relay

* asserts + docs

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Hernando Castano be59072359 Migrate Finality Verifier Pallet to FRAME v2 (#669)
* Get pallet compiling with FRAME v2

* Get tests compiling

* Stop printing metadata in tests

* Remove more metadata related code

* Remove unecessary storage attribute
2024-04-10 10:28:37 +02:00
Hernando Castano ea5d8662be Finality Verifier Pallet (#629)
* Add skeleton for `pallet-finality-verifier`

* Sketch out implementation for importing finality proofs

* Get pallet compiling

* Introduce skeleton for mock runtime

* Start using real Grandpa types in finality pallet

* Redefine types in header chain primitives crate

* Implement HeaderChain for Substrate bridge pallet

* Plug Substrate Bridge Pallet into verifier mock

* Fix compilation of `header-chain` primitives

* Start writing to base pallet storage

* Add first "cross-pallet" test

* Move keyring primitives used in tests to shared crate

* Stop pulling `std` deps into `no_std` builds

* Revert "Stop pulling `std` deps into `no_std` builds"

This reverts commit f74dd660652f98b7336936d1534a4e63cc9169a5.

* Revert "Move keyring primitives used in tests to shared crate"

This reverts commit b774fa730b2cdc40545afff308a66b0840266001.

* Use new SS58Prefix type in mock

* Start using `bp-test-utils` in finality pallet

* Start using real justification code

* Get a test working with real justification verification

* Add basic tests for invalid proofs

* Get rid of AncestryProof config type

* Add error types to transaction outcome

* Bound number of headers allowed in a single ancestry proof

* Disallow invalid authority sets

* Remove unused items

* Add some documentation

* Get rid of Clippy warnings

* Rename BaseHeaderChain to TransactionVerifier

* Remove unused code

* Make dummy trait implementations more generic

* Fix more Clippy complaints

* Update tests to use fix for duplicate headers

* Fix benchmarking compilation

* Rename TransactionVerifier to InclusionProofVerifier
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 5e38b126f2 fix compilation (#671) 2024-04-10 10:28:37 +02:00
Hernando Castano 5847020fdf Explain why we defer signature verification (#668) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 0f56f18778 Use real weights to compute message delivery and dispatch fee (#598)
* message fee formula

* update GetDelvieryConfirmationTransactionFee

* include cost of transactions (i.e. not only dispatch cost) in delivery_and_dispatch_fee

* endow relayers fund account

* include db ops weight in max tx weight estimation

* (in bytes)

Co-authored-by: Hernando Castano <castano.ha@gmail.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky fd7f2a45d8 Fixed messages count check (#659)
* fixed messages count check

* explicit check of `messages_count` in the receive_messages_proof

* change messages_count to be u32

* 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
Hernando Castano 6cd4f5edf1 Disallow Duplicate Best Headers (#653)
* Add test proving bug

* Add checks for duplicate headers

* Fix Clippy error
2024-04-10 10:28:37 +02:00
dependabot-preview[bot] 507edb950c Bump log from 0.4.11 to 0.4.13 (#657) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 8be43d1e63 fixed actual dispatch weight calculation (#658) 2024-04-10 10:28:37 +02:00
dependabot-preview[bot] d630b6f751 Bump futures from 0.3.9 to 0.3.12 (#655) 2024-04-10 10:28:37 +02:00
dependabot-preview[bot] b94ac80a55 Bump async-std from 1.8.0 to 1.9.0 (#654) 2024-04-10 10:28:37 +02:00