dependabot-preview[bot]
f017b635a8
Bump hex-literal from 0.2.1 to 0.3.0 ( #223 )
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
00bd13f8cd
Exchange pallet benchmarks ( #158 )
...
* exchange benchmarks: framework
* updated comment about tx size
Co-authored-by: Tomasz Drwięga <tomasz@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
ebdfffc4b1
Fixed best_ethereum_block() call parameters encoding ( #188 )
...
* fixed best_ethereum_block() params encoding
* updated versions
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
a7208c05e0
Relay PoA lock-funds transactions proofs ( #177 )
...
* relay exchange transaction(s)
* fixed Ethereum::get_block_by_hash
* added exchange trace
* fixed method name
* update for new web3
* svyatonik/rust-web3 -> tomusdrw/rust-web3
* if let Some() -> .expect()
* extracted loops in separate functions
* use yaml references (TIL)
* get eth header with transactions
* cargo fmt --all
* Update primitives/ethereum-poa/src/lib.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update relays/ethereum/src/ethereum_exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update relays/ethereum/src/rpc_errors.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update relays/ethereum/src/exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* removed comment
* Update relays/ethereum/src/ethereum_exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update relays/ethereum/src/ethereum_exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* module-level comments
* updated readme
* use web3 from crates.io
* added missing fields info in error description
* cargo fmt --all
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
2024-04-10 10:28:37 +02:00
Hernando Castano
3236aa8000
Update Substrate to rc4 ( #175 )
...
* 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 >
2024-04-10 10:28:37 +02:00
Hernando Castano
002e18a47c
Benchmark Ethereum Pallet ( #149 )
...
* 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
2024-04-10 10:28:37 +02:00
Denis S. Soldatov aka General-Beck
e9a67d334c
Add cargo deny ( #166 )
...
* Add cargo deny
* deny - master
* Copy deny.toml to .
* cargo deny check
* upload artifacts
* install cargo deny
* typo
* up install cargo deny
* update archive
* typo
* path's
* allow failure cargo deny
* allew failure log
* cargo deny init
* add deny.toml and compare with embark actions
* fix options
* Fix cargo deny.
* Remove cargo audit (same as deny)
Co-authored-by: Tomasz Drwięga <tomasz@parity.io >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
e39ca0dc16
Runtime benchmarks: start ( #136 )
...
* 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 >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
f5a00140cb
Forbid appending blocks to forks that are competing with finalized chain ( #138 )
...
* Error::TryingToFinalizeSibling
* cargo fmt --all
* updated PruningStrategy comment
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
a0c8206684
Move pruning strategy to runtime level ( #128 )
...
* move pruning strategy to runtim level
* cargo fmt --all
* Update modules/ethereum/src/lib.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* finalize_headers -> finalize_and_prune_headers
* PruningStrategy::default()
* fn import_of_non_best_block_may_finalize_blocks()
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
b701c2be8d
Update Substrate to latest master (rc3) ( #129 )
...
* Substrate 606c56d2e2f69f68f3947551224be6a3515dff60
* update jsonrpsee
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
643075f7fa
Finality votes cache ( #116 )
...
* removeInMemoryStorage + extract Kovan stuff to runtime
* removed comment from the future
* remove redundant conversions
* remove redundant `u8 as usize`
* remove redundant `u8 as usize`
* Update modules/ethereum/src/mock.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* use hex-literal in kovan config
* cargo fmt --all
* extracted insert_header
* cargo fmt --all
* finality cache
* cargo fmt --all
* cargo fmt --all
* impl Default for FinalityVotes
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
Co-authored-by: Hernando Castano <castano.ha@gmail.com >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
7294ea44e1
Claim funds on Substrate chain by providing proof of funds locking on PoA chain ( #91 )
...
* ethereum exchange module
* continue
* continue
* added tests for exchange module
* moved
* remove println
* move again
* fixes
* removed redundant deps
* cargo fmt
* fund_locks_transaction_decode_works
* cargo fmt --all
* fix error processing
* added some tracing to bridge modules
* more tests
* more tests
* cargo fmt --all
* kovan.rs -> exchange.rs
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
* added assumption doc
* Airdrop -> DepositInto
* AsIs -> Identity
* OnTransactionSubmitted
* Transfers::Key = Id
* typo
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
* block+tx+proof -> proof { block, tx, proof }
* cargo fmt --all
* docs
* check <-> verify
* parse hex
* extracted exchange primitives to separate crate
* added docs to runtime::exchange module
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* typo
* Update modules/currency-exchange/Cargo.toml
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* add docs to currency-exchange module
* change tests names
* cargo fmt --all
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Update bin/node/runtime/src/exchange.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* fixed verify_transaction_finalized for siblings of finalized blocks
* cargo fmt --all
* added double spend note
* cargo fmt --all
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com >
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
a7e7c895f6
Bump substrate version ( #120 )
...
* bump substrate
* cargo fmt --all
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
944859319e
Limit number of headers that are pruned within single import Call ( #105 )
...
* 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 >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
a6a86c21bb
Use runtime storage in PoA -> Substrate module tests ( #103 )
...
* removeInMemoryStorage + extract Kovan stuff to runtime
* removed comment from the future
* remove redundant conversions
* remove redundant `u8 as usize`
* remove redundant `u8 as usize`
* Update modules/ethereum/src/mock.rs
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* use hex-literal in kovan config
* cargo fmt --all
* extracted insert_header
* cargo fmt --all
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
2024-04-10 10:28:37 +02:00
Svyatoslav Nikolsky
7a3468a919
removed unused files ( #99 )
2024-04-10 10:28:37 +02:00
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