* Start
* More work!
* Moar
* More changes
* More fixes
* More worrk
* More fixes
* More fixes to make it compile
* Adds `NoOffchainStorage`
* Pass the extensions
* Small basti making small progress
* Fix merge errors and remove `ExecutionContext`
* Move registration of `ReadRuntimeVersionExt` to `ExecutionExtension`
Instead of registering `ReadRuntimeVersionExt` in `sp-state-machine` it is moved to
`ExecutionExtension` which provides the default extensions.
* Fix compilation
* Register the global extensions inside runtime api instance
* Fixes
* Fix `generate_initial_session_keys` by passing the keystore extension
* Fix the grandpa tests
* Fix more tests
* Fix more tests
* Don't set any heap pages if there isn't an override
* Fix small fallout
* FMT
* Fix tests
* More tests
* Offchain worker custom extensions
* More fixes
* Make offchain tx pool creation reusable
Introduces an `OffchainTransactionPoolFactory` for creating offchain transactions pools that can be
registered in the runtime externalities context. This factory will be required for a later pr to
make the creation of offchain transaction pools easier.
* Fixes
* Fixes
* Set offchain transaction pool in BABE before using it in the runtime
* Add the `offchain_tx_pool` to Grandpa as well
* Fix the nodes
* Print some error when using the old warnings
* Fix merge issues
* Fix compilation
* Rename `babe_link`
* Rename to `offchain_tx_pool_factory`
* Cleanup
* FMT
* Fix benchmark name
* Fix `try-runtime`
* Remove `--execution` CLI args
* Make clippy happy
* Forward bls functions
* Fix docs
* Update UI tests
* Update client/api/src/execution_extensions.rs
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Koute <koute@users.noreply.github.com>
* Update client/cli/src/params/import_params.rs
Co-authored-by: Koute <koute@users.noreply.github.com>
* Update client/api/src/execution_extensions.rs
Co-authored-by: Koute <koute@users.noreply.github.com>
* Pass the offchain storage to the MMR RPC
* Update client/api/src/execution_extensions.rs
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
* Review comments
* Fixes
---------
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
Co-authored-by: Koute <koute@users.noreply.github.com>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
* add serde_full feature flag
add serde_full to sp_runtime
add space to toml
add serde_full to application-crypto
add serde_full to arithmetic
fix arithmetic
add serde full to beefy
add serde full to consensus
add serde_full to core
add serdefull to finality grandpa
add serde_full to several primitives crates
make rpc no_std compatible
add scale info to runtime
make serializer no_std compatible
add serde full to storage
add full serde to version
add serde full to weights
add all serde_full features
add . to comment
add missing impl-serde
fix no-std build
fix build
add full_crypto to serde_full
serde_full also implements crypto
full_serde does not work with full_crytpo. needs std
no no_std serde impl possible
also for crypto std is necessary
no serde full for application crypto
fix arithmetic
fix tomls
fix some things
impl fmt for Signature
add serialize to Public
add impl_maybe_marker_serde_full
fix sp-application-crypto toml
add serde feature flag
fix clippy
fix toml grandpa
fix grandpa
rename if_std to if_serde
keystore is not no_std compatible
make keystore vrf no_std compatible
fix nopos-elections
fix rpc
fix serializer
fix test-primitives
fix version
add comment
add serde full only import for format string
remove all(serde_full and full_crypot) as serde_full enforces full_crypto
make comment better readable
even better comment
clean up rpc toml
clean up toml
clean up serializer toml
clean up storage toml
fix std build
update .lock
fix sp-version
move sp_std import
test extern crate alloc
replace sp_std with core
add missing core
sp_core: serde feature do not enforce full crypto
application-crypto: serde feature do not enforce full crypto
rename serde_full to serde
add dep:serde and alloc to default feature
add full_crypto and remove unnecessary debu/fmt impls for serde
update comment
remove obolsete change in display AccountId32
remove extra changes
minimize diff
revert keystore changes
remove std from keystore
remove full-crypto feature
fix serde import
fix comment
fix feature = serde
* rename serde_full to serde
* move #[doc(hidden)] back
* remove feature = full crypto require frm MultiSigner
* reorder serde and scale_info import
* fix bs58 missing alloc import in serde feature
* add `from_string` to serde feature and add unimplemented
* remove serde feature from fixed_point display
* Remove serde/alloc
Co-authored-by: Davide Galassi <davxy@datawok.net>
* Update primitives/consensus/babe/Cargo.toml
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update primitives/arithmetic/src/fixed_point.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* revert `from_string`fixed impl back to std only
* remove duplicate runtime string impl
* use sp_std::alloc
* remove no_std compatible rpc
* remove no_std compatibility from serializer
* rename mpl_maybe_marker_serde to std_or_serde
* update .lock
* add sp-std to executor
* fix sp-std import
* fix sp_std::format import
* use crate import
* add serde feature
* Update primitives/core/src/lib.rs
---------
Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: Bastian Köcher <git@kchr.de>
* 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
* Offchain-worker: Make it possible to disable http support
If a chain doesn't require http support in its offchain workers, this pr enables them to disable the
http support.
* Switch to bitflags
* Use Capabilities
* Update client/offchain/src/lib.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Fix test
* Update client/offchain/src/lib.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Tomasz Drwięga <tomusdrw@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 )
* 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>
* 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
* Moving offchain change set to state machine overlay change set,
preparing use of change set internally.
* Make change set generic over key and value, and use it for offchain
indexing.
* test ui change
* remaining delta
* generating with standard method
* Remove 'drain_committed' function, and documentation.
* Default constructor for enabling offchain indexing.
* Remove offchain change specific iterators.
* remove pub accessor
* keep previous hierarchy, just expose iterator instead.
* Update primitives/state-machine/src/overlayed_changes/mod.rs
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* fix line break
* missing renamings
* fix import
* fix new state-machine tests.
* Don't expose InnerValue type.
* Add test similar to set_storage.
* Remove conditional offchain storage (hard to instantiate correctly).
* fix
* offchain as children cannot fail if top doesn't
Co-authored-by: Addie Wagenknecht <addie@nortd.com>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Make offchain indexing work
This fixes some bugs with offchain indexing to make it actually working ;)
* Fix tests
* Fix browser build
* Update client/db/src/offchain.rs
Co-authored-by: cheme <emericchevalier.pro@gmail.com>
* Remove seperation between prefix and key
Co-authored-by: cheme <emericchevalier.pro@gmail.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>
* Fix mocking multiple http calls in the same function call
Fixes an issue where a function call would perform more than one http request and wait for each to complete before proceeding. The `RequestId` comes from the length of the `requests` collection in the `OffchainState` and if a request is completed before the next one starts it will be removed and the "next expected" will be off by one. This PR tries to fix that by using a request counter that tracks how many requests have been performed so that we can `remove()` items from the `expected_requests` at the right index.
I suspect that this is a sub-optimal soluton and perhaps requests and their mocks should live side by side in the same collection, e.g. in a tuple of `(PendingRequest, Option<ExpectedRequest>)`.
* Update primitives/core/src/offchain/testing.rs
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
* Update primitives/core/src/offchain/testing.rs
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
* Panic on overflow
* Update primitives/core/src/offchain/testing.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Use a Deque and push/pop expected requests
* fix test
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* feat/offchain/storage: add remove interface method
* feat/offchain/storeage: add remote to StorageValueRef
* feat/offchain/storage: add storage lock
* fix/review: Apply suggestions from code review
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* refactor/offchain/storage/lock: introduce `Lockable` trait part 1 of 2
* chore/offchain/rename: _remove -> clean
* feat/offchain/storage/lock: add TimeAndBlock based part 2 of 2
* fix/offchain/storage/lock: block and time expiry must be && not ||
* chore/offchain/storage: minor fmt doc comments
* doc/comment: prefer markdown emphasis over CAPS
* doc/comment: rewrap multiline module level docs
* doc/comment: rephrase
* impl sleep_until and use the actual time for the test env
* feat/test: add more tests, ignore some sample impl doctests
* fix/review: Apply suggestions from code review
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* doc/comment: better description
* fix/review: Apply suggestions from code review
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* chore/storage: lifetime cleanup
* fix/cleanup: trait bounds, cargo-spellcheck + extra explanations
* fix/doc: periods +-
* fix/review: Apply suggestions from code review
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* cleanup: remove explicit lifetime bound, copy -> clone
* fix/review: make trait Lockable contain only static, try_lock should not return Err(Option<L>),
* chore/lifetimes: remove a couple of lifetime bounds which the compiler can figure out
* refactor: migrate to an instant based
* fix/feedback: fix, reduce, rename, docs update pending
* docs/reword: adjust to changed code
* fix/offchain/testing: timestamp and sleep_until shall not block
* chore/lines: lines must < 100 chars
* fix/docs: add missing pub field doc comments
* refactor/x: try_lock does not need to return an Option<_>
* refactor/simplify: a better way of waiting for a lock to resolve
* docs: consistency
* fix/line: < 100
* fix/doctest/use: avoid crate::
* fix/doctest: *
* fix/review: remove unused trait bound
* fix/review: pretty by const fn
* fix/review: reduce default timeout to 20s
* docs: grammar
* fix/review: add with_block_deadline
* doc: revamp BlockNumberProvider documentation to be less frame centric
* chore: fmt
* docs: add missing doc comment
Co-authored-by: Bernhard Schuster <bernhard@parity.io>
Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>