Commit Graph

12 Commits

Author SHA1 Message Date
Svyatoslav Nikolsky 50d6ed186f Migrate to new substrate (#79)
* new substrate version + actually verify justification

* cargo update + fix remaining stuff

* add weight=0 comments

* cargo fmt --all

* fix hash types
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky c6c46462ab Sync ethereum headers using unsigned (substrate) transactions (#45)
* reward submitters on finalization

* PoA -> Substrate: unsigned_import_header API

* fix grumble

* make submitter part of ImportContext

* verify using next validators set + tests

* fix nostd compilation

* add sub-tx-mode argument

* support sub-tx-mode

* impl ValidateUnsigned for Runtime

* do not submit too much transactions to the pool

* cargo fmt

* fix bad merge

* revert license fix

* Update modules/ethereum/src/lib.rs

Co-Authored-By: Hernando Castano <HCastano@users.noreply.github.com>

* Update modules/ethereum/src/verification.rs

Co-Authored-By: Hernando Castano <HCastano@users.noreply.github.com>

* updated comment

* validate receipts before accepting unsigned tx to pool

* cargo fmt

* fix comment

* fix grumbles

* Update modules/ethereum/src/verification.rs

Co-Authored-By: Hernando Castano <HCastano@users.noreply.github.com>

* cargo fmt --all

* struct ChangeToEnact

* updated doc

* fix doc

* add docs to the code method

* simplify fn ancestry

* finish incomplete docs

* Update modules/ethereum/src/lib.rs

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

* Update modules/ethereum/src/lib.rs

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

* return err from unsigned_import_header

* get header once

* Update relays/ethereum/src/ethereum_sync.rs

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

* fix

* UnsignedTooFarInTheFuture -> Custom(err.code())

* updated ImportContext::last_signal_block

* cargo fmt --all

* rename runtime calls

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
Svyatoslav Nikolsky ddff294795 remove duplicate licenses (#47) 2024-04-10 10:28:37 +02:00
Hernando Castano e5f998d7d9 Run RustFmt as part of the CI (#37)
* 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
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky d904a282c8 Reward submitters only when submitted block is finalized (#34)
* reward submitters on finalization

* fix grumble

* make submitter part of ImportContext
2024-04-10 10:28:37 +02:00
Hernando Castano 8232bdfe30 Get Ethereum Relay to Compile (#21)
* 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.
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 91b6248f96 Add license headers (#27)
* Add the scripts.

* Add license preamble.

* Change existing license headers.
2024-04-10 10:28:37 +02:00
Hernando Castano 40b4f78bd8 Add a Node (#22)
* 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
2024-04-10 10:28:37 +02:00
Tomasz Drwięga 7ef276daba Add lock file, fix latest substrate. (#3) 2024-04-10 10:28:37 +02:00
Hernando Castano 987888e163 RustFmt the repo (sorry not sorry) 2024-04-10 10:28:37 +02:00
Hernando Castano fbaa803034 Squashed commit of Rust-ifying the repo:
commit e31c1965a2e6b9a21ce68be63b81915b2b090f1d
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Sun Feb 2 21:15:42 2020 -0500

    Get Ethereum bridge module compiling

commit a497fc1640e68682f61b39414ffb15206c6120e2
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Thu Jan 30 12:15:43 2020 -0500

    Make the toml file look a bit better

commit 898fb7b06cfac7cf866e1a28fed9a4f02bd246a7
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Thu Jan 30 12:06:27 2020 -0500

    Get substrate bridge module compiling

commit 81e1547e6bec9f590cad9ffba0ee5dfa82cda1c1
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Thu Jan 30 11:40:29 2020 -0500

    Create workspace and move more files around
2024-04-10 10:28:37 +02:00
Hernando Castano c06777a42a Squashed commit of slava-bridge-runtime:
commit ae4139bbb3cd4681ff4ad3f335b57e17f49ee895
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Wed Jan 29 22:18:42 2020 -0500

    Move slava-bridge-runtime into modules/ethereum/

commit feb522fff241b36bd74638ab5de04ee1068efd0b
Merge: 53a08fe 00fe0de
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Wed Jan 29 22:17:26 2020 -0500

    Merge branch 'bridge_runtime' of slava-bridge-runtime

commit 00fe0dee5f50dd648e7c0f4af7fcb07f422a30af
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Wed Jan 29 22:14:03 2020 -0500

    Move all files into one folder

commit 46d9bdcc35b022bd802e3f99d3f7477110813e2d
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Wed Jan 29 22:02:37 2020 -0500

    Move files I'm keeping into folder

commit 6d10776610283439764de7897f25e921d08e99dc
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Sun Jan 12 20:42:03 2020 -0500

    Make the bridge-eth-poa module compile again

commit 95283a8672d692ed34501e4e7c380a3038099bf8
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Sun Jan 12 20:39:23 2020 -0500

    Add `sp-api` dependency back

commit 31c476ac25391fb8f896b718998e9e80976a4cfd
Author: Hernando Castano <castano.ha@gmail.com>
Date:   Sun Jan 12 20:28:26 2020 -0500

    Bump dependencies

    Uses new frame-* and pallet-* versioned dependencies
but a few other packages came along for the bump ride

commit e22f41d97758712cd4094b98dc3a884098059bb8
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Tue Dec 10 14:52:04 2019 +0300

    reward + penalize for Eth headers

commit 34d35e7731c79b9e9ff21252063f939400ecfdb4
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Mon Dec 9 12:56:31 2019 +0300

    added couple of TODOs

commit 1a80caf9b643be4b823c9559a132285606641811
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Mon Dec 9 12:11:35 2019 +0300

    removed debug print

commit c590908bfb7e9d2075d1fd77556418eda7f330d3
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Mon Dec 9 11:55:09 2019 +0300

    fixed bridge tests

commit ab164f87019037bbc5cd2a69364ee4623e44ebbc
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Mon Dec 9 11:15:46 2019 +0300

    lost deps

commit 649e90068040a12a1aa78788dd834394201753fa
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Mon Dec 9 09:57:09 2019 +0300

    fix compilation again

commit cece62c2c2ddf772f01151ce3bf6dec28f4d0cca
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Mon Dec 9 09:52:30 2019 +0300

    fix receipts root calculation

commit 92f4026896efbe3e315a909161af06dc1e2a1ff4
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Thu Dec 5 16:09:23 2019 +0300

    check transactions receipts root

commit 2e6a5af5e1bcb843262c5ba475f950cf989eb39b
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Thu Dec 5 15:39:30 2019 +0300

    provide keccak_256_ordered_root to runtime

commit 2970aae4648beb8c531ec7c2ff706b65ea06ba63
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Thu Dec 5 15:15:03 2019 +0300

    use existing keccak builtin from bridge runtime

commit 75c498b0fe600be32b35a3e0d0da3b52ec5fd3b6
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Thu Dec 5 10:32:57 2019 +0300

    submit multiple headers at once

commit cdfdafc21efb4a667f2407c7139921d4b948fd7e
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Wed Dec 4 13:48:42 2019 +0300

    expose && initialize bridge configuration

commit 383b93be54981b13c564218652a85af78c88c4f7
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Wed Dec 4 11:28:22 2019 +0300

    export bridge Call

commit dacc2939db51859a3e1b87250b289b269a80793b
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Wed Dec 4 11:13:56 2019 +0300

    expose BridgeEthPoaCall

commit a5281c9387e622e28cbc89a62d268b359cb2f724
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Wed Dec 4 10:42:41 2019 +0300

    EthereumHeadersApi::is_known_block

commit c5658e1563be9b688355d03b20a62345418e3b78
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Wed Dec 4 10:14:42 2019 +0300

    pub use parity_bytes::Bytes;

commit 94cd24e5535101e871436ca35dcfda27f7955590
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Wed Dec 4 10:01:25 2019 +0300

    exposed EthereumHeadersApi

commit 607ec1760d146e8046122a1d2f868d70e15490e6
Author: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date:   Tue Dec 3 14:51:40 2019 +0300

    EthPoA bridge: runtime
2024-04-10 10:28:37 +02:00