* Add Instance type parameter to pallet
* Sketch out what the runtime could look like
* Allow runtime to compile with multiple bridge pallets
* Cargo Fmt
* Allow an instance of a PoA chain to be used with currency-exchange
I specify that it's only _an instance_ instead of _instances_ since the currency-exchange
pallet does not support multiple instances itself. What this commit does is make it so
that the different instances of the PoA chains we currently have are compatible with the
currency-exchange pallet through the implementation of the PeerBlockchain trait.
* Add Instance type parameter to Currency Exchange pallet
* Wire up currency exchange intances in runtime
* Rust Fmt
* Show sccache
* Allow Eth pallet to use a default instance
* Use a default instance in Eth pallet tests
* Remove Rialto and Kovan feature flags
Through some discussions it has been decided that the `bridge-node` should, like
Substrate's `node-template`, be a showcase of the different pallets available in
a project. Because of this I've removed the feature flags for the Rialto and Kovan
networks in favour of having both of them included in the runtime.
* Update the chain_spec to use both Rialto and Kovan configs
* Update pallet level calls used by Substrate client
Allows the project to compile. However, it should be noted that in reality
we shouldn't be hardcoding the pallet we're calling.
* Allow currency-exchange pallet to use a default instance
* Support benchmarking an instance of the Eth pallet
* Update currency exchange benchmarks to work with instances
* Fix test helpers which now need a PoA instance
* Remove Actions for checking Rialto and Kovan features
* Add missing comments
* Update Runtime API string constants
* Add issue number for generic chain support in relay
* Add Runtime APIs for instances of the currency-exchange pallet
* Rust Fmt
Co-authored-by: Denis S. Soldatov aka General-Beck <general.beck@gmail.com>
* Bump Substrate to rc4
* Add BaseCallFilter type
* Add DenyUnsafe to SystemApi extension
* Use new ServiceBuilder build functions
* Add BaseCallFilter to test runtimes
* Remove old comments
* Add `rev` and `git` fields back
Turns out that if you don't have these future release candidates will
be used if available. For instance, once `rc5` is released a fresh pull
would use that instead of `rc4` which is what we want.
* Use tag release instead of specific commit
Will make scripted updates easier in the future
* Add short script to update between `rc` versions
* Update scripts/update_rc.sh
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Add skeleton for worst case import_unsigned_header
* Fix a typo
* Add benchmark test for best case unsigned header import
* Add finality verification to worst case bench
* Move `insert_header()` from mock to test_utils
Allows the benchmarking code to use this without having to pull it in from the mock.
* Add a rough bench to test a finalizing a "long" chain
* Try to use complexity parameter for finality bench
* Improve long finality bench
* Remove stray dot file
* Remove old "worst" case bench
* Scribble some ideas down for pruning bench
* Prune headers during benchmarking
* Clean up some comments
* Make finality bench work for entire range of complexity parameter
* Place initialization code into a function
* Add bench for block finalization with caching
* First attempt at bench with receipts
* Try and trigger validator set change
* Perform a validator set change during benchmarking
* Move `validators_change_receipt()` to shared location
Allows unit tests and benchmarks to access the same helper function
and const
* Extract a test receipt root into a constant
* Clean up description of pruning bench
* Fix cache and pruning tests
* Remove unecessary `build_custom_header` usage
* Get rid of warnings
* Remove code duplication comment
I don't think its entirely worth it to split out so few lines of code.
The benches aren't particularly hard to read anyways.
* Increase the range of the complexity parameter
* Use dynamic number of receipts while benchmarking
As part of this change we have removed the hardcoded TEST_RECEIPT_ROOT
and instead chose to calculate the receipt root on the fly. This will
make tests and benches less fragile.
* Prune a dynamic number of headers
* runtime benchmarks: start
* merge tests + benchmarks infrastructure
* fix compilation
* Fix compilation issues with runtime-benchmark feature flag
Mainly involved pulling in correct dependencies and adding some functions
which were called but didn't yet exist.
* Fix broken compilation for tests
* Move header signing methods into trait
* Move signing related test helpers to own module
* Remove comment about feature flag
* Add constants to tests
* Add top level comment for testing utilities
Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* removeInMemoryStorage + extract Kovan stuff to runtime
* removed comment from the future
* limit number of headers that are pruned within single import Call
* verify that pruning range upper bottom is always-increasing
* Fix typo
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
* Run RustFmt as part of the CI
* Format repo
* Run RustFmt before the default Travis build step
Apparently if you override `script` you also need to make
sure to `build` and `test` the code yourself.
* Format repo
* Update dependencies
Upgrades Substrate based dependencies from v2.0.0 -> v2.0.0-alpha.1
and uses the `jsonrpsee`'s new feature flags. The actual code hasn't
been updated though, so this won't compile.
* Use `RawClient`s from `jsonrpsee`
* Update to use jsonrpsee's new API
* Hook up Ethereum Bridge Runtime, Relay, and Node Runtime
* Bump `parity-crypto` from v0.4 to v0.6
Fixes error when trying to compile tests. This was caused by
`parity-crypto` v0.4's use of `parity-secp256k1` over `secp256k1'.
Using the Parity fork meant multiple version of the same underlying
C library were being pulled in. `parity-crypto` v0.6 moved away from
this, only relying on `secp256k1` thus fixing the issue.
* Copy node-template over from Substrate repo
Got the template at rev=6e6d06c33911
* Use dependencies from crates.io + stop renaming on import
* Remove template pallet
* Stop using crates.io dependencies
Instead they're going to be pinned at v2.0.0-alpha.2
at commit `2afecf81ee19b8a6edb364b419190ea47c4a4a31`
until something stable comes along.
* Remove LICENSE
* Change references of `node-template` to `bridge-node`
* Remove README
* Fix some missed node-template references
* Add WASM toolchain to CI
* Be more specific about nightly version to use
* Maybe don't tie to a specific nightly
* Use composite accounts
* Update to use lazy reaping
* Only use Development chain config
* Initial commit. CLI which parses RPC urls.
* Establish ws connections and make simple RPC requests.
* Complete bridge setup.
* Process subscription events.
* Ctrl-C handler.
* Write a bare-bones README and copy in design doc.
* Modularize code a little bit.
* Communicate with each chain in a separate task.
* Parse headers from RPC subscription notifications.
* Send (fake) extrinsics across bridge channels.
And now it's deadlocked.
* Fix deadlock.
* Clarify in README that this is not-in-progress.
* Move everything into a single folder
* Move Substrate relay into appropriate folder
* Get the Substrate Relay node compiling
* Update Cargo.lock
* Use new composite accounts from Substrate
* Remove specification document
It has been moved to the Wiki on the Github repo.
* Update author + remove comments
* Use latest master for jsonrpsee
Required renaming some stuff (e.g Client -> RawClient)
Co-authored-by: Jim Posen <jim.posen@gmail.com>
commit 265365920836bb1d286c9b48b1902a2de278fdd9
Author: Hernando Castano <castano.ha@gmail.com>
Date: Wed Jan 29 19:51:15 2020 -0500
Move hc-jp-bridge repo to different folder
commit 8271991e95320baba70bd1cb9c4234d0ffd5b638
Merge: 57d0811 304cbc5
Author: Hernando Castano <castano.ha@gmail.com>
Date: Wed Jan 29 19:36:41 2020 -0500
Merge branch 'hc-jp-bridge-module' of hc-jp-bridge-module
commit 304cbc5f02d003ffa5404c1c01e461e5b8539888
Author: Hernando Castano <HCastano@users.noreply.github.com>
Date: Wed Jan 29 00:38:27 2020 -0500
Update bridge pallet to work with the (almost) lastest master (#4672)
* Update decl_error usage
* WIP: Update error handling to use DispatchResult
* Get module compiling with new error handling
* Make tests compile again
Main change was updating the usage of InMemoryBackend
* Move `sp-state-machine` into dev-dependencies
* Bump dependencies to v2.0.0
* Remove some stray comments
* Appy code review suggestion
commit 510cd6d96372688517496efa61773ea2839f8474
Author: Hernando Castano <HCastano@users.noreply.github.com>
Date: Tue Dec 17 12:52:51 2019 -0500
Move Bridge Pallet into FRAME (#4373)
* Move `bridge` crate into `frame` folder
* Make `bridge` pallet compile after `the-big-reorg`
commit ab54e838ef75e6a3f68fd0944bf22598c10c552f
Author: Hernando Castano <castano.ha@gmail.com>
Date: Mon Nov 11 21:56:40 2019 +0100
Use new StorageProof type from #3834
commit 8fc8911fd1b4acc2274c6863fb3dba91b30c90af
Author: Hernando Castano <HCastano@users.noreply.github.com>
Date: Tue Nov 5 00:50:34 2019 +0100
Verify Ancestry between Headers (#3963)
* Create module for checking ancestry proofs
* Use Vec of Headers instead of a HashMap
* Move the ancestry verification into the lib.rs file
* Change the proof format to exclude `child` and `ancestor` headers
* Add a testing function for building header chains
* Rename AncestorNotFound error to InvalidAncestryProof
* Use ancestor hash instead of header when verifying ancestry
* Clean up some stuff missed in the merge
commit dbe85738b68358b790cf927b34a804b965a88f96
or: Hernando Castano <HCastano@users.noreply.github.com>
Date: Fri Nov 1 15:41:58 2019 +0100
Check given Grandpa validator set against set found in storage (#3915)
* Make StorageProofChecker happy
* Update some tests
* Check given validator set against set found in storage
* Use Finality Grandpa's Authority Id and Weight
* Add better error handling
* Use error type from decl_error! macro
commit 31b09216603d3e9c21144ce8c0b6bf59307a4f97
or: Hernando Castano <HCastano@users.noreply.github.com>
Date: Wed Oct 23 14:55:37 2019 +0200
Make tests work after the changes introduced in #3793 (#3874)
* Make tests work after the changes introduced in #3793
* Remove unneccessary import
commit bce6d804aa86504599ff912387295c58f846cbf3
Author: Jim Posen <jim.posen@gmail.com>
Date: Thu Oct 10 12:18:58 2019 +0200
Logic for checking Substrate proofs from within runtime module. (#3783)
commit a7013e94b6c772c1d45a7cacbb445f73f6554fca
Author: Hernando Castano <castano.ha@gmail.com>
Date: Fri Oct 4 15:21:00 2019 +0300
Allow tracking of multiple bridges
commit 3cf648242d631e32bd553a67df54bf5a48912839
Author: Hernando Castano <castano.ha@gmail.com>
Date: Tue Oct 1 14:55:04 2019 +0200
Add BridgeId => Bridge mapping
commit 001c74c45072213e01857d0a2454379b447c5a76
Author: Hernando Castano <castano.ha@gmail.com>
Date: Tue Oct 1 11:10:19 2019 +0200
Get the mock runtime for tests set up
commit 38443a1e8b424ed2f148eb95121d009f730e3b5a
Author: Hernando Castano <castano.ha@gmail.com>
Date: Fri Sep 27 14:52:53 2019 +0200
Clean up some warnings
commit bdc3b01401e89c7111f8bf71f84c50750d25089f
Author: Hernando Castano <castano.ha@gmail.com>
Date: Thu Sep 26 16:41:01 2019 +0200
Add more skeleton code
commit 26995efbf4bac2842eb2822322f7ad3c3e88feb8
Author: Hernando Castano <castano.ha@gmail.com>
Date: Wed Sep 25 15:16:57 2019 +0200
Create `bridge` module skeleton
**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.~~