**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.~~
We currently use a bit of a hack in `.cargo/config` to make sure that
clippy isn't too annoying by specifying the list of lints.
There is now a stable way to define lints for a workspace. The only down
side is that every crate seems to have to opt into this so there's a
*few* files modified in this PR.
Dependencies:
- [x] PR that upgrades CI to use rust 1.74 is merged.
---------
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
* Change copyright year to 2023 from 2022
* Fix incorrect update of copyright year
* Remove years from copy right header
* Fix remaining files
* Fix typo in a header and remove update-copyright.sh
* Expose allocation stats in `FreeingBumpHeapAllocator`
* Return allocation stats when calling into the runtime
* Bump `parity-scale-codec` to 3.1.3 (fork)
* Prevent double allocation of the payload when calling `sp_io::storage::get`
* Fix tests
* Remove unnecessary `mut`
* Enable the `bytes` feature for `parity-scale-codec` in `sp-runtime-interface`
* Update client/allocator/src/freeing_bump.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Bump `parity-scale-codec` to 3.1.3
* Fix some of the UI tests
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* runtime-interface: Implement `register_only` functions
The runtime interface supports versioning of functions. Currently, if you add a new function it will
be used by the runtime automatically. This results in requiring all nodes of a network to upgrade
before the runtime is upgraded, otherwise they will fail to instantiate the new runtime because of
missing host functions. This pr introduces `register_only` functions. This can be used when a new
runtime interface function should be introduced, but the actual usage can be deferred. This means
that nodes will have the host function for this, but the runtime will still use the old version of
the function when being compiled for wasm. However, when a runtime is enacted that uses the new host
function, the "old nodes" will already have the host function and will continue to work.
* Update primitives/runtime-interface/src/lib.rs
Co-authored-by: cheme <emericchevalier.pro@gmail.com>
* Update primitives/runtime-interface/proc-macro/src/utils.rs
Co-authored-by: cheme <emericchevalier.pro@gmail.com>
* FMT
Co-authored-by: cheme <emericchevalier.pro@gmail.com>
* Statically register host WASM functions
* Fix `substrate-test-client` compilation
* Move `ExtendedHostFunctions` to `sp-wasm-interface`
* Fix `sp-runtime-interface` tests' compilation
* Fix `sc-executor-wasmtime` tests' compilation
* Use `runtime_interface` macro in `test-runner`
* Fix `sc-executor` tests' compilation
* Reformatting/`rustfmt`
* Add an extra comment regarding the `H` generic arg in `create_runtime`
* Even more `rustfmt`
* Depend on `wasmtime` without default features in `sp-wasm-interface`
* Bump version of `sp-wasm-interface` to 4.0.1
* Bump `sp-wasm-interface` in `Cargo.lock` too
* Bump all of the `sp-wasm-interface` requirements to 4.0.1
Maybe this will appease cargo-unleash?
* Revert "Bump all of the `sp-wasm-interface` requirements to 4.0.1"
This reverts commit 0f7ccf8e0f371542861121b145ab87af6541ac30.
* Make `cargo-unleash` happy (maybe)
* Use `cargo-unleash` to bump the crates' versions
* Align to review comments
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 )
* 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>
* emit a custom section from impl_runtime_apis!
This change emits a custom section from the impl_runtime_apis! proc macro.
Each implemented API will result to emitting a link section `runtime_apis`.
During linking all sections with this name will be concatenated and
placed into the final wasm binary under the same name.
* Introduce `runtime_version` proc macro
This macro takes an existing `RuntimeVersion` const declaration, parses
it and emits the version information in form of a linking section.
Ultimately such a linking section will result into a custom wasm
section.
* Parse custom wasm section for runtime version
* Apply suggestions from code review
Co-authored-by: David <dvdplm@gmail.com>
* Fix sc-executor integration tests
* Nits
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Refactor apis section deserialization
* Fix version decoding
* Reuse uncompressed value for CallInWasm
* Log on decompression error
* Simplify if
* Reexport proc-macro from sp_version
* Merge ReadRuntimeVersionExt
* Export `read_embedded_version`
* Fix test
* Simplify searching for custom section
Co-authored-by: David <dvdplm@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Fixes logging of target names with dashes
There was a bug in tracing-core which resulted in not supporting dashes
in target names. This was fixed upstream. Besides that a test was added
to ensure that we don't break this again.
* Extend test
* 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>
* Bump version
* update test-utils crates to be ready for publishing
* adding changelog
* Adding automaticly generated READMEs
* fixing versions
* another version mishap
* Add transactional storage functionality to OverlayChanges
A collection already has a natural None state. No need to
wrap it with an option.
* Add storage transactions runtime interface
* Add frame support for transactions
* Fix committed typo
* Rename 'changes' variable to 'overlay'
* Fix renaming change
* Fixed strange line break
* Rename clear to clear_where
* Add comment regarding delete value on mutation
* Add comment which changes are covered by a transaction
* Do force the arg to with_transaction return a Result
* Use rust doc comments on every documentable place
* Fix wording of insert_diry doc
* Improve doc on start_transaction
* Rename value to overlayed in close_transaction
* Inline negation
* Improve wording of close_transaction comments
* Get rid of an expect by using get_or_insert_with
* Remove trailing whitespace
* Rename should to expected in tests
* Rolling back a transaction must mark the overlay as dirty
* Protect client initiated storage tx from being droped by runtime
* Review nits
* Return Err when entering or exiting runtime fails
* Documentation fixup
* Remove close type
* Move enter/exit runtime to excute_aux in the state-machine
* Rename Discard -> Rollback
* Move child changeset creation to constructor
* Move child spawning into the closure
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Fixup for code suggestion
* Unify re-exports
* Rename overlay_changes to mod.rs and move into subdir
* Change proof wording
* Adapt a new test from master to storage-tx
* Suggestions from the latest round of review
* Fix warning message
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>