Unify the operating mode for bridge pallets
- define the OperationMode trait and BasicOperatingMode enum
- use the OperationMode trait in all the bridge pallets
- use BasicOperatingMode instead of IsHalted for the Grandpa pallet
- use BasicOperatingMode as part of MessagesOperatingMode
Signed-off-by: Serban Iorga <serban@parity.io>
* fix clippy warnings
* try to reenable proper clippy on CI
* fix clippy error
* more Eqs
* ignore clippy::derive-partial-eq-without-eq - clippy seems to be broken now :/
* switch to gav-xcm-v3 branch (wip)
* add comment
* play with CI
* keep playing with CI
* play with CI
* trigger CI
* Revert "trigger CI"
This reverts commit fc35ac648fe6a3ea8e710a2e07dfee7d8762c6c4.
* fix(spellcheck): test of fixing
* fix(hunspell): improved many typos etc.
* fix(hunspell): all errors solved
* fix(hunspell): extended scope of files - the build should fail
* Return error code.
* Fix spelling, sort dictionary.
* fix(hunspell): added fix to gitlabs check
* fix(typo): one typo and test of verification on github
* fix(typo): one typo
Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
* 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
* 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.
* 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
* 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
* 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
* 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>
* 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
* 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
* 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.
* 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
* 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>
* 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
* 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>
* Add header-chain primitive crate
* Make MinimalHeaderChain functionaly the same as PeerBlockchain
* Use a better doc comment for MinimalHeaderChain
* Fix benchmark compilation
* Rust Fmt
* Remove Substrate based dependencies
* Rename MinimalHeaderChain to BaseHeaderChain
**Update:** Pushed additional changes based on the review comments.
**This pull request fixes various spelling mistakes in this
repository.**
Most of the changes are contained in the first **3** commits:
- `Fix spelling mistakes in comments and docs`
- `Fix spelling mistakes in test names`
- `Fix spelling mistakes in error messages, panic messages, logs and
tracing`
Other source code spelling mistakes are separated into individual
commits for easier reviewing:
- `Fix the spelling of 'authority'`
- `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
- `Fix the spelling of 'prev_enqueud_messages'`
- `Fix the spelling of 'endpoint'`
- `Fix the spelling of 'children'`
- `Fix the spelling of 'PenpalSiblingSovereignAccount'`
- `Fix the spelling of 'PenpalSudoAccount'`
- `Fix the spelling of 'insufficient'`
- `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
- `Fix the spelling of 'subtracted'`
- `Fix the spelling of 'CandidatePendingAvailability'`
- `Fix the spelling of 'exclusive'`
- `Fix the spelling of 'until'`
- `Fix the spelling of 'discriminator'`
- `Fix the spelling of 'nonexistent'`
- `Fix the spelling of 'subsystem'`
- `Fix the spelling of 'indices'`
- `Fix the spelling of 'committed'`
- `Fix the spelling of 'topology'`
- `Fix the spelling of 'response'`
- `Fix the spelling of 'beneficiary'`
- `Fix the spelling of 'formatted'`
- `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
- `Fix the spelling of 'succeeded'`
- `Fix the spelling of 'reopened'`
- `Fix the spelling of 'proposer'`
- `Fix the spelling of 'InstantiationNonce'`
- `Fix the spelling of 'depositor'`
- `Fix the spelling of 'expiration'`
- `Fix the spelling of 'phantom'`
- `Fix the spelling of 'AggregatedKeyValue'`
- `Fix the spelling of 'randomness'`
- `Fix the spelling of 'defendant'`
- `Fix the spelling of 'AquaticMammal'`
- `Fix the spelling of 'transactions'`
- `Fix the spelling of 'PassingTracingSubscriber'`
- `Fix the spelling of 'TxSignaturePayload'`
- `Fix the spelling of 'versioning'`
- `Fix the spelling of 'descendant'`
- `Fix the spelling of 'overridden'`
- `Fix the spelling of 'network'`
Let me know if this structure is adequate.
**Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
`Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
as it is.
~~**Note:** In some places the term `Receival` is used to refer to
message reception, IMO `Reception` is the correct word here, but I left
it as it is.~~
~~**Note:** In some places the term `Overlayed` is used instead of the
more acceptable version `Overlaid` but I also left it as it is.~~
~~**Note:** In some places the term `Applyable` is used instead of the
correct version `Applicable` but I also left it as it is.~~
**Note:** Some usage of British vs American english e.g. `judgement` vs
`judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
are both present in different places, but I suppose that's
understandable given the number of contributors.
~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
triggers errors in CI when I make changes to it, so I left it as it
is.~~
Lifting some more dependencies to the workspace. Just using the
most-often updated ones for now.
It can be reproduced locally.
```sh
# First you can check if there would be semver incompatible bumps (looks good in this case):
$ zepter transpose dependency lift-to-workspace --ignore-errors syn quote thiserror "regex:^serde.*"
# Then apply the changes:
$ zepter transpose dependency lift-to-workspace --version-resolver=highest syn quote thiserror "regex:^serde.*" --fix
# And format the changes:
$ taplo format --config .config/taplo.toml
```
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>