* implement events handling, implement parent_id for spans & events
* add events to sp_io::storage
* update test
* add tests
* adjust limit
* let tracing crate handle parent_ids
* re-enable current-id tracking
* add test for threads with CurrentSpan
* fix log level
* remove redundant check for non wasm traces
* remove duplicate definition in test
* Adding conditional events API
* prefer explicit parent_id over current,
enhance test
* limit changes to client::tracing event implementation
* remove From impl due to fallback required on parent_id
* make tracing codecable
* replace with global tracing
* new tracing interface
* impl TracingSubscriber in client
* implement access to global TracingSubscriber from primitives
* span for wasm
* increment towards Wasm Tracing Subscriber implementation
* increment, remove sp-tracing from runtime-interface
* increment, it compiles
* attained original functionality with new mechanism
* implement remaining TracingSubscriber functions
* remove spans from decl_module
* add handling for encoded values
* Revert "replace with global tracing"
This reverts commit 8824a60deea54d9b437407a21c8ceaf6a1902ee5.
* Wasm Side Tracing
* tracing on wasm
* enable tracing wasm on node-runtime
* export all the macros in std
* tracing subscriber on wasm-side only
* pass spans and events over and record them
* reactivate previous code and cleanup
* further cleaning up
* extend the span macros, activate through executive
* tracking the actual extrinsic, too
* style
* fixing tests
* spaces -> tabs
* attempting to reactivate params
* activate our tests in CI
* some passing
* tests passing
* with core lazy
* global tracer for wasm side with pass over
* fixing metadata referencing
* remove const_fn feature requirement
* reenable dispatch traces
* reset client tracing
* further cleaning up
* fixing runtime-test
* move tracing-build setup into runtime-test
* Merge DebugWriter from tracing and frame-support, move to sp-std
* remove dangling fixme
* Docs for tracing primitives
* cleaning up a bit more
* Wasm interface docs
* optimise docs.rs setup
* adding tracing flags to uncomment
* remove brace
* fixing imports
* fixing broken syntax
* add required modules
* nicer formatting
* better target management
* adding low level storage tracing events into frame
* add custom Debug impl for WasmMetadata
* cloning profiler
* adding info about cloning profiler
* using in-scope for within calls
* proper time tracing, cleaning up println
* allow to disable tracing on runtime_interface-macro
* disable tracing for wasm-tracing-interface
* simplify wasm-tracing-api
* update client to new interface
* fixing docs and tests for sp-tracing
* update integration tests
* re-activating enter_span
* dropping FIXME, it's documented
* fix formatting
* fix formatting
* fix imports
* more debug info
* inform wasm about it being disabled by returning 1
* only one tracer, but enabled multi-all support
* make trait pub again for tests
* Apply suggestions from code review
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
* fixing wasm doc tests for proper usage
* remove unnecessary import
* fixing formatting
* minor style fixes
* downgrading wabt
* update error message for UI
* Fix interface test
* next attempt to fix macros
* geee
* revert tracing on hashed for future PR
* remove local macros, use originals
* we are able to convert to static items
* implement more WasmValue types
* adding support to convert str, debug and encoded values
* more minor fixes
* revert unsafe 'static making
* fix indentation
* remove commented lines
* bump all them tracing versions
* cleaning up docs and info
* document new flag
* the new layered system handles span cloning better
* Apply suggestions from code review
Co-authored-by: David <dvdplm@gmail.com>
Co-authored-by: Matt Rutherford <mattrutherford@users.noreply.github.com>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: David <dvdplm@gmail.com>
* init_logger: switch from log-based to tracing-based and add compatibility layer
* Move tracing profiling subscriber related config realization
* sp-tracing: change profiling to be a layer instead of a subscriber
* Enable profiling layer in cli
* Change all test env_logger init to sp_tracing::try_init_simple
* Remove all local env_logger dependency
* Add missing tracing-subscriber dependency
* frame-sudo: fix tests
* frame-support: fix tests
* Fix frame/pallet and executor tests
* Fix the remaining tests
* Use subscriber's try_init as recommended by @davidbarsky
* Be explict that the tracing-log feature is needed
* Set subscriber writer to stderr
* Shorter line width
* Update cargo lock tracing version
* Fix sc_tracing crate compile
* Fix sc_authority_discovery crate test
* unremove default-features
* Leave enabled to default true
* Warn if global default cannot be set
* Fix unused import
* Remove unused PROXY_TARGET
* Change all reference from rc5 to rc6
* Change all reference of rc2 to rc6
* Fix styling
* Fix typo
* make logger init error'ing
* re-fixing the test issue
Co-authored-by: Benjamin Kampmann <ben@parity.io>
* Fix the benchmarks
* Migrate staking to weightInfo
* Fix global benchmarks
* re-calculate the submit solution weight.
* Fix some refund.
* Get rid of all the extra parameters.
* Fix staking tests.
* new values from the bench machine.
* Fix some grumbles
* better macro
* Some better doc
* Move to interpreted wasm
* Make it work temporarily
* Final fix of default ones.
* Fix payout benchmarks
* Fix payout stuff
* One last fix
* use benchmarking machine for numbers
* update weight docs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Add fuzzer for the compact custom codec implementation introduced in PR #6720.
This commit adds a fuzzing harness for the custom compact encoding/decoding
introduced in PR #6720.
* Update primitives/npos-elections/fuzzer/src/compact.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Update Cargo.lock: Add changes in elections-fuzzer
* Change indentation from spaces to tabs
Co-authored-by: Vincent Ulitzsch <vincent@srlabs.de>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Fix `storage::read`
It should return the length of the storage item after the given offset.
Before it returned always the length of the full storage item.
* Fix tests
* checkpoint before removing CT from change trie
* before trie backend without tx
* undo
* Started no transaction, but would need using a different root
calculation method, out of the scope of this pr, will roll back.
* Remove NoTransaction.
* partially address review.
dummy stats implementation for no_std.
* Remove ChangeTrieOverlay.
* modified function
* Remove witness_ext
* need noops changes root
* update from cumulus branch
* line break
* remove warning
* line break
* From review: renamings and stats active in no std (except time).
* include cache, exclude change trie cache with individual temporary bad looking
no_std check
* little test
* fuse imports and filter_map prepare_extrinsics_input_inner fold.
* put back ExtInner into Ext, awkward double proto for new function.
* Apply suggestions from code review
* Update primitives/state-machine/Cargo.toml
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* add offchain worker api to set reserved nodes.
* new offchain api to get node public key.
* node public key from converter
* refactor set reserved nodes ocw api.
* new ndoe authorization pallet
* remove unnecessary clone and more.
* more
* tests for node authorization pallet
* remove dependency
* fix build
* more tests.
* refactor
* Update primitives/core/src/offchain/testing.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Update frame/node-authorization/src/lib.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Update frame/node-authorization/src/lib.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Update frame/node-authorization/src/lib.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* format code
* expose NetworkService
* remove NetworkStateInfo in offchain
* replace NodePublicKey with PeerId.
* set max length of peer id.
* clear more
* use BTreeSet for set of peers.
* decode opaque peer id.
* extract NetworkProvider for client offchain.
* use OpaquePeerId in node authorization pallet.
* fix test
* better documentation
* fix test
* doc
* more fix
* Update primitives/core/src/offchain/mod.rs
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* Update client/offchain/src/api.rs
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* derive serialize and deserialize
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This edge count is used for weighing, and it is somewhat trivial to review and verify that the current implementation was ignoring `votes16` field of the struct. As reminder, the struct is like this:
```rust
struct Compact {
votes1: ... ,
votes2: ...,
...,
votes16: ...,
}
```
I already will fix this in https://github.com/paritytech/substrate/pull/7007, but since it might take a while, this one can go in asap and make it to the very next runtime.
* frame/authority-discovery: Have authorities() return both current and next
Authority address lookups on the DHT happen periodically (every 10
mintues) and are rather slow (~10 seconds).
In order to smooth the transition period between two sessions, have the
runtime module return both the current as well as the next authority
set. Thereby the client authority module will:
1. Publish its addresses one session in advance.
2. Prefetch the addresses of authorities of the next session in advance.
* frame/authority-discovery: Deduplicate authority ids
* frame/authority-discovery: Don't dedup on_genesis authorities
* frame/authority-discovery: Remove mut and sort on comparison in tests
* frame/authority-discovery: Use BTreeSet for deduplication
* Fix printing of subkey when using the `--network` override
This fixes a bug where `--network` did not printed the account ss58 address for the
requested network. Basically we now always print all account ss58 addresses using the
requested network.
* Review comments
* Fixes test
* Update client/cli/src/commands/inspect.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/cli/src/commands/utils.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Fix more tests
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* *: Update to next libp2p version (likely v0.24.0)
* Revert "*: Update to next libp2p version (likely v0.24.0)"
This reverts commit ffe1545aba6c2557a2843579de331f3fc1c60743.
* */Cargo.toml: Update to libp2p v0.24.0
* client/network/src/service: Handle ConnectionClosed returning Option
* Cargo.*: Test kad usize conversion
* Revert "Cargo.*: Test kad usize conversion"
This reverts commit ad317879782f982cb4a4c76029a72b5b97e82bec.
* Cargo.lock: Update to libp2p-kad v0.22.1
* client/cli/Cargo.toml: Update to libp2p 0.24.0
* Bump version
* update test-utils crates to be ready for publishing
* adding changelog
* Adding automaticly generated READMEs
* fixing versions
* another version mishap
* draft
* revert
* WIP
* all that remains is tests
* update Cargo.lock
* tests WIP
* WIP refactor node-template-runtime and node-runtime
* implments sc_cli::RuntimeAdapter for node_template_runtime::Runtime
* final draft
* fix update_config for subcommands
* proper AccountId decoding
* test-runtime tests
* revert
* move RuntimeAdapter to cli-utils
* use &'static str for TryFrom::<&'a str>::Error for Ss58AddressFormat
* tests
* add frame-system to sc-cli dev-dependencies
* add frame-system to sc-cli dev-dependencies
* fix ui test
* wip
* fixed inspect test
* bump impl version
* bump impl version, fixx spaces remove todos
* pallet-balances-cli, rustc for some reason cannot resolve pallet_balances_cli in node-cli 😩
* wip
* Subcommand::run takes &self
* can't believe i missed that 🤦🏾♂️
* bump wasm-bindgen for some reason
* adds key subcommand, rename generate-node-key to generate-node-id
* cargo update and crossed fingers 🤞🏽
* update ui test
* update more ui tests
* should be all good now
* revert subkey change
* revert subkey change
* adds frame-utilities-cli
* Apply suggestions from code review
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
* removes frame from sc-cli, fix license
* my editor and ci disagrees on line width
* bump spec version
* turn off default features for parity-scale-codec
* enable full_crypto feature for sp-core in cli-utils
* merge frame-utilities-cli with pallet-balances-cli
* remove full_crypto feature from sp_core in cli-utils
* bump Cargo.lock
* cli-utils -> frame-utils
* rename BlockNumber to GenericNumber, fix spaces
* fix spaces
* construct additional_signed manually
* sign test
* remove unused vars
* implement subkey with frame-utilities-cli and sc_cli
* fix moduleid test
* CI and clion disagree on line widths
* adds associated Params type to SignedExtensionProvider
* Apply suggestions from code review
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
* move some code around
* removes unneccesary generic params
* moves module_id back to frame_utilities_cli
* Apply suggestions from code review
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* remove print_ext
* remove MaybeDisplay from pallet_balances::Trait::Balance
* a lot of stuff tbh
* adds ExtrasParamsBuilder
* remove tests for ModuleIdCmd
* address comments from PR
* bump Cargo.lock
* manually insert key into keystore
* remove unnecessary SharedParams
* add validation to vanity pattern, remove unused arg
* remove SharedParams from Sign, Vanity, Verify
* remove SharedParams from ModuleIdCmd, remove expect from Verify, new line to Cargo.toml
* remove SharedParams from InsertCmd
* 🤦🏾♂️
* deleted prometheus.yml
* move a few things around
* fix vanity test
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Benjamin Kampmann <ben@parity.io>
* pow: check can_author_with before calling check_inherents
* babe: check can_author_with before calling check_inherents
* aura: check can_author_with before calling check_inherents
* Fix node and node template compile
* Add missing comma
* Put each parameter on its own line
* Add debug print
* Fix line width too long
* Fix pow line width issue
* Update to libp2p-0.23.
Thereby incorporate bandwidth measurement along the
lines previously done by libp2p itself.
* Tweak dependencies for wasm32 compilation.
For wasm32 we need to enable unstable features to
make `task::Builder::local` available.
* Simplify dependencies.
* Simplify.
Leave the calculation of bytes sent/received per second
to the outer layers of the code, subject to their own
individual update intervals.
* Cleanup
* Re-add lost dev dependency.
* Avoid division by zero.
* Remove redundant metric.
* Enable sending of noise legacy handshakes.
* Add comment about monotonic gauge.
* CI
Actually I use this quite often when debugging some WASM bugs and there
is no harm in enabling it by default. Before I just always copied it
everytime I needed it.
* Revalidate transactions only on latest best block
We should revalidate transactions only on the latest best block and not
on any arbitrary block. The revalidation before failed when there were
multiple blocks on the height given to the revalidation function, but no
block was imported as best block.
* Update test-utils/runtime/transaction-pool/src/lib.rs
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
* Fix tests
* Only process best blocks in the transaction pool
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
We need to order the delta before calculating the storage root, because
the order is important if the storage root is calculated using a storage
proof. The problem is arises when the delta is different than at the
time the storage root was recorded, because we may require a different
node that is not part of the proof and so, the storage root can not be
calculated. The problem is solved by always order the delta to use the
same order when calculating the storage root while recording the
stroage proof and when calculating the storage root using
the storage proof.
To prevent this bug in future again, a regression test is added.
Fixes: https://github.com/paritytech/cumulus/issues/146
* support custom ss58addressformat in from_ss58check_with_version
* fix str parse
1. if can parse with u8, use u8 into.
2. if u8 can't parse, convert to str then parse
* add a test
* typo
* add error description in test
* fix the `TryFrom<u8>` for `Ss58AddressFormat`
change check logic in TryFrom<u8> to replace modified code in `from_ss58check_with_version`
* use Ss58AddressFormat::default() replace DEFAULT_VERSION
* Apply suggestions from code review
* Update primitives/core/src/crypto.rs
* Update primitives/core/src/crypto.rs
* Update primitives/core/src/crypto.rs
* Update primitives/core/src/crypto.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>