Alexandru Vasile
644626f77e
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
...
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
2024-04-03 19:05:40 +03:00
James Wilson
b069c4425a
Rework light client ( #1475 )
...
* WIP second pass over light client code for simpler API
* First pass new light client
* pub(crate) LightClientRpc::new_raw(), and fmt
* Update examples and add back a way to configure boot nodes and fetch chainspec from a URL
* Fix light client examples
* remove unused deps and tidy lightclient feature flags
* fix wasm error
* LightClientRpc can be cloned
* update light client tests
* Other small fixes
* exclude mod unless jsonrpsee
* Fix wasm-lightclient-tests
* add back docsrs bit and web+native feature flag compile error
* update book and light client example names
* fix docs
2024-03-15 15:21:06 +00:00
Alexandru Vasile
f14bf9a474
debug: Finalized heads
...
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
2024-01-30 16:28:13 +02:00
James Wilson
cf7e2db1b7
chainHead based backend implementation ( #1161 )
...
* add follow_stream impl
* follow_stream_unpin first draft
* add tests for follow_stream_unpin
* more tests and fixes for follow_stream_unpin
* first pass follow_stream_driver
* follow_stream_driver: add tests, fix things, buffer events from last finalized
* First pass finishing Backend impl
* Fix test compile issues
* clippy fixes
* clippy fix and consistify light_client
* revert lightclient tweak
* revert other lightclient thing
* cargo fmt
* start testing unstable backend behind feature flag
* more test fixes and move test-runtime metadata path just incase
* fix compile error
* ensure transaction progress stream actually used and fix another test
* cargo fmt
* CI tweak
* improve some comments and address some feedback bits
* update CI to use our own nightly binary
* wait for finalized block perhaps
2023-09-26 16:58:30 +01:00
James Wilson
a3d25db846
Unstable Backend: add back the old chainHead RPCs/tests ( #1137 )
...
* add back unstable APIs and tests
* clippy fixes
* fmt with new rust
* deserialize from object or array into api versions
* remove inspect
* add some of the other unstable RPC methods we might want
* clippy fix
* no unused deps warning in test crate
* fix doc fails
* legacy -> unstable
Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com >
* runtime_updates -> with_runtiem
* add test and be consistent with naming of unstable RPCs
---------
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
Co-authored-by: Tadeo Hepperle <62739623+tadeohepperle@users.noreply.github.com >
2023-08-29 12:35:35 +01:00
James Wilson
d7124b56f7
Introduce Backend trait to allow different RPC (or other) backends to be implemented ( #1126 )
...
* WIP backend trait
* WIP converting higher level stuff to using Backend impl
* more implementing new backend trait, mainly storage focused
* Get core code compiling with new backend bits
* subxt crate checks passing
* fix tests
* cargo fmt
* clippy/fixes
* merging and other fixes
* fix test
* fix lightclient code
* Fix some broken doc links
* another book link fix
* fix broken test when moving default_rpc_client
* fix dry_run test
* fix more tests; lightclient and wasm
* fix wasm tests
* fix some doc examples
* use next() instead of next_item()
* missing next_item() -> next()s
* move legacy RPc methods to LegacyRpcMethods type to host generic param instead of RpcClient
* standardise on all RpcClient types prefixed with Rpc, and 'raw' trait types prefixed with RawRpc so it's less ocnfusing which is which
* rename fixes
* doc fixes
* Add back system_dryRun RPC method and rename tx.dry_run() to tx.validate(), to signal that the calls are different
* Add a test that we return the correct extrinsic hash from submit()
* add TransactionValid details back, and protect against out of range bytes
* add test for decoding transaction validation from empty bytes
* fix clippy warning
2023-08-22 12:32:22 +01:00
Alexandru Vasile
b97acc5df6
chainHead: Propagate results on the chainHead_follow ( #1116 )
...
* rpc/types: Update chainHead events
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* rpc: Sync chainHead methods with spec
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* testing: Adjust chainHead tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* tests: Ignore block related events to avoid flaky tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* tests: Adjust clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* test: Remove unused OfflineClientT
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update subxt/src/rpc/types.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
* Update subxt/src/rpc/types.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
* Update subxt/src/rpc/types.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
* Update subxt/src/rpc/types.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
* types: Remove serde flags for serialization
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
2023-08-09 17:40:39 +03:00
Alexandru Vasile
ef89752904
light-client: Add experimental light-client support ( #965 )
...
* rpc/types: Decode `SubstrateTxStatus` for substrate and smoldot
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* lightclient: Add light client Error
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* lightclient: Add background task to manage RPC responses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* lightclient: Implement the light client RPC in subxt
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* subxt: Expose light client under experimental feature-flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* artifacts: Add development chain spec for local nodes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update cargo lock
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* examples: Add light client example
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update sp-* crates and smoldot to use git with branch / rev
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Apply cargo fmt
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Fix clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Import hashmap entry
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* lightclient: Fetch spec only if jsonrpsee feature is enabled
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update subxt/src/rpc/lightclient/background.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
* Fix typo
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* artifacts: Update dev chain spec
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* types: Handle storage replies from chainHead_storage
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* artifacts: Add polkadot spec
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* lightclient: Handle RPC error responses
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* examples: Tx basic with light client for local nodes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* example: Light client coprehensive example for live chains
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* examples: Remove prior light client example
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* feature: Rename experimental to unstable
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* book: Add light client section
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* testing: Fix clippy
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* lightclient: Ignore validated events
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust tests for light-clients and normal clients
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* testing: Keep lightclient variant
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Remove support for chainHead_storage for light client
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update light client to point to crates.io
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update sp-crates from crates.io
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Replace Atomic with u64
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Add LightClientBuilder
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust chainspec with provided bootnodes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Add potential_relay_chains to light client builder
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Move the light-client to the background task
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust tracing logs
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update book and example
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Apply cargo fmt
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Remove dev_spec.json artifact
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Examples fix duplicate Cargo.toml
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Use tracing_subscriber crate
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Fix clippy for different features
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Add comment about bootNodes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Add comment about tracing-sub dependency
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Run integration-tests with light-client
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Feature guard some incompatible tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* ci: Enable light-client tests under feature flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* ci: Fix git step name
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust flags for testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust warnings
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Rename feature flag jsonrpsee-ws to jsonrpsee
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Fix cargo check
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* ci: Run tests on just 2 threads
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Move light-client to subxt/src/client
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust LightClientBuilder
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Use ws_url to construct light client for testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Refactor background
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Address feedback
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Remove polkadot.spec and trim sub_id
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Wait for substrate to produce block before connecting light client
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust builder and tests
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Apply fmt
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* ci: Use release for light client testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Add single test for light-client
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Wait for more blocks
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Use polkadot endpoint for testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust cargo check
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* examples: Remove light client chain connection example
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust cargo.toml section for the old example
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust background task to use usize for subscription Id
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Build bootnodes with serde_json::Value directly
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Make channel between subxt user and subxt background unbounded
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Update subxt/src/client/lightclient/builder.rs
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
* Switch to smoldot 0.6.0 from 0.5.0
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Move testing to `full_client` and `light_client` higher modules
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Remove subscriptionID type
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Remove subxt/integration-testing feature flag
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust wait_for_blocks documentation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Adjust utils import for testing
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* Remove into_iter from builder construction
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com >
2023-06-26 12:10:57 +03:00