* Split native executor stuff from wasm executor stuff
* Remove `native_runtime_version` in places
* Fix warning
* Fix test warning
* Remove redundant NativeRuntimeInfo trait
* Add a warning for use_native
* Run cargo fmt
* Revert "Add a warning for use_native"
This reverts commit 9494f765a06037e991dd60524f2ed1b14649bfd6.
* Make choosing an executor (native/wasm) an explicit part of service construction
* Add Cargo.lock
* Rename Executor to ExecutorDispatch
* Update bin/node/executor/src/lib.rs
Co-authored-by: Squirrel <gilescope@gmail.com>
* Fix tests
* Fix minor node-executor error
* Fix node cli command thing
Co-authored-by: Squirrel <gilescope@gmail.com>
* Comment out browser stuff
* Remove browser stuff
* Remove more wasm transport code
* Remove ExtTransport and rework how telemetry initialises.
* Change (most) wasm-timer using code to use std::time
* Rename CI-job
* Aura does not compile for wasm
* Remove testing in the browser on CI
* Update README
* Leave `StreamSink` be
* fmt
* RUSTSEC-2021-0076 bump libsecp256k1
libsecp256k1 allows overflowing signatures
https://rustsec.org/advisories/RUSTSEC-2021-0076
Changes were made to conform to libsecp256k1 version differences.
Closes#9356
* parse_standard_slice() -> parse_overflowing_slice()
* Added v2 host function for ecdsa_verify
* Add feature tag over helpers
* Added ecdsa_verify v2 to test runner
* PR feedback
- Spaces -> tabs
- renamed two helper functions
* Fixed imports after rebasing
* Bump rest of libsecp256k1 (and libp2p)
libp2p also uses libsecp256k1 so it is required to be bumped too, along
with all the version difference changes.
* Add version2 for ecdsa pubkey recovery
* libp2p rebase master fixes
* Fix test panic when non Behaviour event is returned
* Update bin/node/browser-testing/Cargo.toml
* Update primitives/core/src/ecdsa.rs
* Update primitives/core/src/ecdsa.rs
* Update Cargo.lock
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Remove unneeded dependencies and dev-dependencies.
Made self_destruct test not dependent on wasm bin size.
Updated code related to deprecated warning on tracing-subscriber `scope()`
( See https://github.com/tokio-rs/tracing/issues/1429 )
* Transaction storage guide and fixes
* Apply suggestions from code review
Co-authored-by: Bruno Škvorc <bruno@skvorc.me>
* Update frame/transaction-storage/README.md
Co-authored-by: Bruno Škvorc <bruno@skvorc.me>
* Extended example
Co-authored-by: Bruno Škvorc <bruno@skvorc.me>
* Decouples light-sync state from chain spec
This decouples the light-sync state from chain spec. First, the
light-sync state currently only works with BABE+Grandpa, so not
all *Substrate* based chains can use this feature. The next problem was
also that this pulled the `sc-consensus-babe` and `sc-finality-grandpa`
crate into `sc-chain-spec`.
If a chain now wants to support the light-sync state, it needs to add
the `LightSyncStateExtension` to the chain spec as an extension. This is
documented in the crate level docs of `sc-sync-state-rpc`. If this
extension is not available, `SyncStateRpc` fails at initialization.
* Fix compilation for browser
* Fmt
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* mark template and utils as non-publish
* switch to development version for testing
* activate unleash check
* maybe if I disable all rules...
* Fix isolated compilation of `max-encoded-len-derive` with `syn`
error[E0369]: binary operation `==` cannot be applied to type `syn::Path`
--> src/lib.rs:88:29
|
88 | .filter(|attr| attr.path == parse_quote!(max_encoded_len_crate))
| --------- ^^ ----------------------------------- _
| |
| syn::Path
error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
Error: could not compile `max-encoded-len-derive`
* WIP: bump changes crates since v3 tag to next breaking
cargo unleash version bump-breaking --changed-since v3.0.0
cargo unleash version set-pre dev --changed-since v3.0.0
FIXME: Don't modify crates that are not yet released, e.g.
`max-encoded-len-derive`
* Update lockfile
* WIP: Bump sp-transaction-pool as well
* WIP: Bump sp-offchain as well
* WIP: Bump frame-system-rpc-runtime-api as well
* WIP: Bump sp-authority-discovery as well
* Manually deactivate dev-deps before `cargo unleash check`
Otherwise we run into `Cycle detected` error.
* Bump sp-consensus-slots
* Add missing Cargo.lock change
* Bump sp-consensus-vrf as well
* Bump sp-keyring as well
* Bump sp-consensus-pow as well
* Try to speed up the `unleash-check` job
Previously, the job took 106 minutes - let's see if explicitly
specifying a `CARGO_TARGET_DIR` will help
* fixup: Ensure the temp target dir exists for unleash check
* Bump pallet-transaction-payment-rpc-runtime-api as well
Needed for Polkadot
* Bump pallet-transaction-payment-rpc as well
Needed for Polkadot
* Try updating crates after patching in the Polkadot CI job
* Use another approach to update patched Substrate crates
* Try to update all sp-core versions in Polkadot CI job
* Simplify sp-core version checking
* Apply another shellcheck lint
* Just do the simplest thing I guess
* Welp don't do --offline then
* Clean up `unleash-check` job triggers
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
* Fix a note in unleash-check cache step
* Add a note about temporary optimization in cargo-unleash
* Pin a newer version of cargo-unleash
Co-authored-by: Igor Matuszewski <xanewok@gmail.com>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
* bump a bunch of deps in parity-common
* primitive-types 0.10.0
* update Cargo.lock
* downgrade a few more
* this is unlikely to help
* try something
* Checkmate, Atheists!
* Transaction pool: Remove futures-diagnose and thread pool
This pr removes `futures-diagnose` as this isn't used anymore. Besides
that the pr also removes the thread pool that was used to validate the
transactions in the background. Instead of this thread pool we now spawn
two separate long running tasks that we use to validate the
transactions. All tasks of the transaction pool are now also spawned as
essential tasks. This means, if any of these tasks is stopping, the node
will stop as well.
* Update client/transaction-pool/src/api.rs
* Remove unused event_metadata variable
* Eliminate mod_name and use pallet names to name enum variants
* Rename field name `pallet` to `path`
* Use only the pallet name to generate variant names
* Use new naming scheme for Event enum in sudo pallet tests
* Use new naming scheme for Event enum in offences pallet tests
* Use new naming scheme for Event enum in contracts pallet tests
* Use new naming scheme for Event enum in collective pallet tests
* Use new naming scheme for Event enum in bounties pallet tests
* Use new naming scheme for Event enum in balances pallet tests
* Use new naming scheme for Event enum in assets pallet tests
* Use new naming scheme for Event enum in frame support tests
* Use new naming scheme for Event enum in tips pallet tests
* Use new naming scheme for Event enum in transaction payment pallet tests
* Use new naming scheme for GenesisConfig fields in example pallet tests
* Use new naming scheme for GenesisConfig fields in elections pallet tests
* Use new naming scheme for Event enum in election provider multi-phase pallet tests
* Use new naming scheme for Event enum in elections phragmen pallet tests
* Use new naming scheme for GenesisConfig fields in chain spec
* Use new naming scheme for Event enum in staking pallet mock
* Use new naming scheme for GenesisConfig fields in node-template chain spec
* Use new naming scheme for GenesisConfig fields in node-testing chain spec
* Use new naming scheme for Event enum in node executor tests
* Use new naming scheme for GenesisConfig fields in transaction storage pallet mock
* Refactor match conditions
* network: allow gossiping to light clients
* grandpa: gossip global messages to light clients
* grandpa: don't send neighbor packets to light clients
* grandpa: fix tests
* grandpa: export run_grandpa_observer
* node: run grandpa observer on light client
* node: start network at end
* Use wasm_timer in finality-grandpa
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* Move `Schedule` from Storage to Config
* Updated CHANGELOG
* Fix nits from review
* Fix migration
* Print the debug buffer as tracing message
* Use `debug` instead of `trace` and update README
* Add additional assert to test
* Rename `schedule_version` to `instruction_weights_version`
* Fixed typo
* Added more comments to wat fixtures
* Add clarification for the `debug_message` field
* Lol
* Yeah
* Moare
* adaasda
* Convert AURA to new pallet macro
* AURA: Switch to `CurrentSlot` instead of `LastTimestamp`
This switches AURA to use `CurrentSlot` instead of `LastTimestamp`.
* Add missing file
* Update frame/aura/src/migrations.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Remove the runtime side provide inherent code
* Use correct weight
* Add TODO
* Remove the Inherent from AURA
* 🤦
* Remove unused stuff
* Update primitives authorship
* Fix babe inherent data provider
* Fix consensus-uncles
* Fix BABE
* Do some further changes to authorship primitives... :D
* More work
* Make it compile the happy path
* Make it async!
* Take hash
* More stuff
* Hacks
* Revert "Hacks"
This reverts commit cfffad88668cfdebf632a59c4fbfada001ef8251.
* Fix
* Make `execute_block` return the final block header
* Move Aura digest stuff
* Make it possible to disable equivocation checking
* Fix fix fix
* Some refactorings
* Comment
* Fixes fixes fixes
* More cleanups
* Some love
* Better love
* Make slot duration being exposed as `Duration` to the outside
* Some slot info love
* Add `build_aura_worker` utility function
* Copy copy copy
* Some stuff
* Start fixing pow
* Fix pow
* Remove some bounds
* More work
* Make grandpa work
* Make slots use `async_trait`
* Introduce `SharedData`
* Add test and fix bugs
* Switch to `SharedData`
* Make grandpa tests working
* More Babe work
* Make grandpa work
* Introduce `SharedData`
* Add test and fix bugs
* Switch to `SharedData`
* Make grandpa tests working
* More Babe work
* Make it async
* Fix fix
* Use `async_trait` in sc-consensus-slots
This makes the code a little bit easier to read and also expresses that
there can always only be one call at a time to `on_slot`.
* Make grandpa tests compile
* More Babe tests work
* Fix network test
* Start fixing service test
* Finish service-test
* Fix sc-consensus-aura
* Fix fix fix
* More fixes
* Make everything compile *yeah*
* Make manual-seal compile
* More fixes
* Start fixing Aura
* Fix Aura tests
* Fix Babe tests
* Make everything compile
* Move code around and switch to async_trait
* Fix Babe
* Docs docs docs
* Move to FRAME
* Fix fix fix
* Make everything compile
* Last cleanups
* Fix integration test
* Change slot usage of the timestamp
* We really need to switch to `impl-trait-for-tuples`
* Update primitives/inherents/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update primitives/inherents/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update primitives/inherents/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Some extra logging
* Remove dbg!
* Update primitives/consensus/common/src/import_queue/basic_queue.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Introduce a "dynamic" block size limit for proposing
This adds support for using a dynamic block size limit per call to
`propose`. This is required for Cumulus/Parachains to always use stay in
the limits of the maximum allowed PoV size.
As described in the docs, the block limit is only checked in the process
of pushing transactions. As we normally do some other operations in
`on_finalize`, it can happen that the block size still grows when there
is some proof being collected (as we do for parachains). This means,
that the given block limit needs to be rather conservative on the actual
value and should not be the upper limit.
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: Andronik Ordian <write@reusable.software>
* More future proof encoded size updating
* Use `ProofRecorderInner`
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/slots/src/lib.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/slots/src/slots.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/basic-authorship/src/basic_authorship.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Make grandpa work
* Introduce `SharedData`
* Add test and fix bugs
* Switch to `SharedData`
* Make grandpa tests working
* More Babe work
* Make it async
* Fix fix
* Use `async_trait` in sc-consensus-slots
This makes the code a little bit easier to read and also expresses that
there can always only be one call at a time to `on_slot`.
* Make grandpa tests compile
* More Babe tests work
* Fix network test
* Start fixing service test
* Finish service-test
* Fix sc-consensus-aura
* Fix fix fix
* More fixes
* Make everything compile *yeah*
* Fix build when we have Rust 1.51
* Update client/consensus/common/src/shared_data.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/common/src/shared_data.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/common/src/shared_data.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/common/src/shared_data.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/common/src/shared_data.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/babe/src/tests.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/consensus/babe/src/tests.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Fix warning
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Add MMR custom RPC.
* Change RuntimeApi to avoid hardcoding leaf type.
* Properly implement the new RuntimeAPI and wire up RPC.
* Extract Offchain DB as separate execution extension.
* Enable offchain DB access for offchain calls.
* Fix offchain_election tests.
* Skip block initialisation for proof generation.
* Fix integration test setup.
* Fix offchain tests. Not sure how I missed them earlier 🤷.
* Fix long line.
* One more test missing.
* Update mock for multi-phase.
* Address review grumbbles.
* Address review grumbles.
* Fix line width of a comment
* Make changes
* Add serialize/deserialize, copy babe epoch config defaults from node runtime
* Fix line widths and turn default features off for serde
* Remove ser/deser from Epoch, fix node-cli
* Apply suggestions
* Add comment to BABE_GENESIS_EPOCH_CONFIG in bin
* Apply suggestions
* Add a sketchy migration function
* Add a migration test
* Check for PendingEpochConfigChange as well
* Make epoch_config in node-cli
* Move updating EpochConfig out of the if
* Fix executor tests
* Calculate weight for add_epoch_configurations
* Fix babe test
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Add more asserts to tests, remove unused changes to primitives/slots
* Allow setting the migration pallet prefix
* Rename to BabePalletPrefix
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Introduce new concept of "slot portion for proposing"
Currently when building a block we actually give the proposer all of the
time in the slot, while this is wrong. The slot is actually split in at
least two phases proposing and propagation or in the polkadot case into
three phases validating pov's, proposing and propagation. As we don't
want to bring that much polkadot concepts into Substrate, we only
support splitting the slot into proposing and propagation. The portion
can now be passed as parameter to AuRa and BABE to configure this value.
However, this slot portion for propagation doesn't mean that the
proposer can not go over this limit. When we miss slots we still apply
the lenience factor to increase the proposing time, so that we have
enough time to build a heavy block.
Besides all what was said above, this is especially required for
parachains. Parachains have a much more constraint proposing window.
Currently the slot duration is at minimum 12 seconds, but we only have
around 500ms for proposing. So, this slot portion for proposing is
really required to make it working without hacks.
* Offgit feedback
* Cast cast cast
Currently we wrap every `GenesisConfig` field in an `Option`, while
we require `Default` being implemented for all pallet genesisconfigs.
Passing `None` also results in the genesis not being initialized, which
is a bug as seen from the perspective of a pallet developer?
This pr changes the fields of the `GenesisConfig` to non `Option` types.
* A clean new attempt
* Checkpoint to move remote.
* A lot of dependency wiring to make it feature gated.
* bad macro, bad macro.
* Undo the DB mess.
* Update frame/support/src/traits.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* unbreak the build
* Better logging and ids for migrations
* Fix doc.
* Test
* Update frame/try-runtime/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Update utils/frame/try-runtime/cli/Cargo.toml
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Update frame/try-runtime/Cargo.toml
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Address most review grumbles.
* Fix build
* Add some comments
* Remove allowing one pallet at a time.
* Rework the PR
* nit
* Slightly better error handling.
* Remove files
* Update utils/frame/remote-externalities/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Update frame/support/src/dispatch.rs
* Update frame/support/src/dispatch.rs
* Fix test
* Make extension trait.
* Bring back try-runtime/std
* remove bincode
* Remove warning
* Change test features
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* contracts: Update README
* contracts: Add CHANGELOG.md
* contracts: Bump version to v3.0.0 and allow publish
* Typos
Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Improve wording in the changelog
* contracts: Add reserved field to ContractInfoOf for future proofing
* also bump frame-benchmarking
* update lockfile
Co-authored-by: Andrew Jones <ascjones@gmail.com>
Co-authored-by: Benjamin Kampmann <ben@parity.io>
* Ensure we spawn the block import worker as an essential task
This pr ensures that we spawn the block import worker as an essential
task. This is quite important as we need to bring down the node when the
block import is done. Besides that it adds some debug output to the
block import worker.
* Don't be stupid :D