Commit Graph

20 Commits

Author SHA1 Message Date
Branislav Kontur 874ab44e00 Bump substrate/polkadot/cumulus (#1962)
* Bump substrate/polkadot/cumulus

* sp_finality_grandpa - >sp_consensus_grandpa

* sp_beefy -> sp_consensus_beefy

* pallet_randomness_collective_flip -> pallet_insecure_randomness_collective_flip

* fix

* Cumulus parachain stuff

* Cumulus parachain stuff one more

* Millau/Rialto runtimes

* Removed pallet_insecure_randomness_collective_flip

* Millau node

* Removed session historial

* TMP: just try disable all fetches

* Docs in gitlab.yml
2024-04-10 10:28:37 +02:00
Serban Iorga e7debc4b09 Fix init-bridge (#1900) 2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 498a3e83d0 Weight+size limits for bridge GRANDPA pallet calls (#1882)
* weight+size limits for bridge GRANDPA pallet calls

* continue

* fixed all tests

* some changes to refund computations

* post_dispatch_refunds_relayer_in_all_finality_batch_with_extra_weight

* - dup code

* do not return Pays::No if call is above weight/size limits

* relayer_pays_tx_fee_when_submitting_huge_mandatory_header and relayer_pays_tx_fee_when_submitting_justification_with_long_ancestry_votes

* clippy

* fmt

* clippy

* small change in docs

* fixed GRANDPA-limits constants for Polkadot-like chains

* clippy

* clippy + spelling

* Update primitives/polkadot-core/src/lib.rs

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

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

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

* reverted unnecessary change

* GrandpaJustification::max_reasonable_size

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 1d6e8a9a26 optimize justification before submit (#1887)
* optimize justification before submit

* fmt

* spelling

* clippy

* fmt again

* aaand compilation

* clippy
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
Svyatoslav Nikolsky ea2d6f898d Bump Substrate/Polkadot/Cumulus refs (#1295)
Substrate: 31d90c202d6df9ce3837ee55587b604619a912ba
Polkadot: 60df3c55c711c2872872d6220f98b2611340e051
Cumulus: a9630551c2
2024-04-10 10:28:37 +02:00
hacpy bd70de8b8b Match substrate's fmt (#1148)
* Alter gitlab.

* Use substrate's rustfmt.toml

* cargo +nightly fmt --all

* Fix spellcheck.

* cargo +nightly fmt --all

* format.

* Fix spellcheck and fmt

* fmt?

* Fix spellcheck

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 37d067c0e0 Update submit finality proof weight formula (#981)
* updated weight formula for submit_finality_proof

* remove common prefix traces

* update docs

* single benchmark

* Re-generate weights.

* Update delivery transaction limits

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
Co-authored-by: Hernando Castano <hernando@hcastano.com>
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky 700d63672b Custom justification verification (#979)
* custom justification verification

* is_ancestor -> ensure_descendant

* PrecommitIsNotCommitDescendant

* Update primitives/header-chain/src/justification.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 21baffc832 Update Copyright Date to 2021 (#864)
* Update copyright date to 2021

* Bump date in license header template
2024-04-10 10:28:37 +02:00
Hernando Castano 1928e2b870 Use Vote Ancestries Directly in Weight Calculations (#862)
* Use more accurate weight calculation in declared weight

* Remove session length and validator set size config constants

* Remove config params from mock

* Allow specifying total number of votes-ancestries per justification

* Change limits used during benchmarking

* Regenerate weights

* Use simplified weight annotation

* Remove comment

* Address leftover TODO

* Prevent possible divide by zero errors

* Use correct argument order in weight declaration
2024-04-10 10:28:37 +02:00
Hernando Castano 67cdca8aa4 Use GrandpaJustification instead of Vec<u8> in Pallet API (#847)
* Stop passing raw encoded justifications to pallet API

By having the API accept a struct-ified justification we are able to
better utilize the justifications fields for weight calculations.

* Update relayer code to use decoded justifications

* Add justification to `expect()` statement

* Fix some imports

* Make justification wrapper contain decoded justification

* Rename some fields

* Get rid of warnings

* Appease Clippy

* Only decode justification once at init time

* Remove unnecessary method

* Remove justification wrapper

This became kinda unnecessary since we could implement the FinalityProof
trait on GrandpaJustification directly.
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
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
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 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
Hernando Castano c6df9924e4 Move justification code to primitives crate (#640)
* Move justification module to header-chain primitives crate

* Get justification module compiling in new location

* Get justification module tests compiling

* Use justification code from `header-chain` crate

Mostly compiles, having issues with std/test feature flags across crates.

* Move some code around

* Move justification tests to integration testing crate

* Add `test-utils` crate

* Remove tests and test-helper module from justification code

* Use `test-utils` in Substrate bridge pallet tests

* Remove `sp-keyring` related code from `pallet-substrate-bridge`

* Remove `helpers` module from `pallet-substrate-bridge`

* Add some documentation

* Add more documentation

* Fix typo

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
Serban Iorga 9a3e2c8c5a Remove bridges subtree 2024-04-10 10:28:37 +02:00
Branislav Kontur 68d2363701 Update bridges subtree (#1944) 2023-10-19 16:30:17 +03:00
Serban Iorga 142a11ad95 Update bridges subtree (#1392)
* Move the bridges subtree under root

* Squashed 'bridges/' changes from 277f0d5496..e50398d1c5

e50398d1c5 bridges subtree fixes (#2528)
99af07522d Markdown linter (#1309) (#2526)
733ff0fe7a `polkadot-staging` branch: Use polkadot-sdk dependencies (#2524)
e8a59f141e Fix benchmark with new XCM::V3 `MAX_INSTRUCTIONS_TO_DECODE` (#2514)
62b185de15 Backport `polkadot-sdk` changes to `polkadot-staging` (#2518)
d9658f4d5b Fix equivocation detection containers startup (#2516) (#2517)
d65db28a8f Backport: building images from locally built binaries (#2513)
5fdbaf45f6 Start the equivocation detection loop from the complex relayer (#2507) (#2512)
7fbb67de46 Backport: Implement basic equivocations detection loop (#2375)
cb7efe245c Manually update deps in polkadot staging (#2371)
d17981fc33 #2351 to polkadot-staging (#2359)

git-subtree-dir: bridges
git-subtree-split: e50398d1c594e4e96df70b0bd376e565d17e8558

* Reapply diener workspacify

* Fix Cargo.toml

* Fix test

* Adjustments
2023-09-11 11:47:45 +03:00