* 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
* Rename `pallet-finality-verifier` to `pallet-bridge-grandpa`
* Missed some CamelCase ones
* Update logging target in GRANDPA pallet
* Rename `pallet-bridge-call-dispatch` to `pallet-bridge-dispatch`
* Rename the dispatch pallet folder
* Update logging target in Dispatch pallet
* Missed a couple
* Format the repo
* Stop listing individual pallets in Compose logs
* Use correct pallet name in module doc comments
* Add `pallet-bridge-dispatch` to README project layout
* Sort crate names in TOML files
* Rename `pallet-bridge-grandpa` runtime Call alias
* 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 runtime:: prefix for message-lane pallet traces
* renamed message-lane (module and primitives) folder into messages
* replace "message lane" with "messages" where appropriate
* 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>
* Move storage proof checker to runtime primtives
* Add method for parsing storage proofs
* Use finality-verifier pallet in runtime-common
* Get bridge pallet compiling again
* Use storage prover from bp-runtime in a few more places
* Don't leak `std` items from proof helper into `no-std` builds
* Fix benchmarking compilation
* Remove unused import in fuzzer
* Add relevant storage items from Substrate pallet
* Add function for importing finalized headers to storage
* Remove unused getter functions
* Add GenesisConfig to pallet
* Add initialization extrinsic
* Add operational extrinsic
* Get existing finality verifier tests compiling again
* Add tests for pallet initialization
* Add tests related to pallet's operational status
* Update tests which were using `pallet-substrate-bridge`
* Add tests related to header imports
* Use wrapper function when init-ing some tests
* Add prefix to tests related to rate limiter
* Fix failed compilation related to GenesisConfig
* Add some documentation
* Change some extrinsics to be Operational
* Add public interface to pallet
* Implement runtime APIs for finality-verifier pallet
* Justify use of `expect` when importing headers
* Reject headers with forced changes
* Add weight to initialize extrinsic
* Remove TODO which will be addressed later
* Move succesful import log to correct location
* Expand proof for when `best_finalized` is fetched
* Move check for newer finalized blocks earlier in pipeline
* Rename `ConflictingFork` error to be more generic
* Only compute finality_target's hash once
* Add missing documentation to Runtime APIs
* Add TODO about using `set_id` from `ScheduledChange` digest
* 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
* 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>
* 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
* 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>
* 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>
* Document relayers fund existence and add root account.
* Introduce initialize method instead of assuming that relayer_fund_account is always required.
* cargo fmt --all
* Fix benchmarks.
* cargo fmt --all
* Fix docs for the relayer fund account.
* 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.
* 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>
* 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>
* 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>