Commit Graph

13 Commits

Author SHA1 Message Date
Sebastian Kunert 88ead41f9d Cleanup: Remove polkadot-service dependency from minimal node (#2430)
* Remove polkadot-service dependency from minimal-node

* Clean up error handline

* Remove unwanted changes

* Unused deps
2023-04-04 15:05:38 +00:00
Bastian Köcher 52d1067db6 relay-chain-interface: Do not depend on polkadot-service (#2287) 2023-03-07 15:17:05 +01:00
Sam Elamin 1faed8b0f0 add warp_sync_params (#1909)
* wait for relay chain to sync then get parachain header

* Spawn new thread to wait for the target block

* second round of comments from the PR on substrate

* third round of pr comments

* add zombienet tests

* rebase issues

* refactor tests based on pr comments

* rebase issues

* pr comments

* passing zombienet test

* cargo +nightly fmt

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* use cargo lock from master

* pr comments

* cargo fmt

* use finalised block instead of best block

* use import notification stream

* rebase changes

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/relay-chain-interface/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/relay-chain-interface/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* pr comments

* use new file names

* db snaphots moved to google cloud storage

* Update client/network/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/service/src/lib.rs

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* pr comments

* Update zombienet/tests/0007-full_node_warp_sync.toml

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* Update zombienet/tests/0007-full_node_warp_sync.toml

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* Scenario 1

Parachain node and in-node relay chain both start with --sync warp. This ensures that the waiting logic works as expected.

Scenario 2
Parachain node starts with warp sync, relay chain points to a node already synced up

scenario 3
Parachain node starts with warp sync, relay chain points to a node that uses warp sync

* Use test-parachain

* use test-parachain chainspecs

* remove relay chain spec as it is no longer required

* add back relaychain spec file

* pr comments

* Upload snapshots to google cloud

* Update zombienet/tests/0007-prepare-warp-sync-db-snapshot.md

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* update documentation

* Fix snapshot URLs

* use master lock file

* add finalized_block_hash

* Patch diener for CI

* Bump Zombienet

* Add 0007 zombienet test

* Bump zombienet

* Revert "Patch diener for CI"

This reverts commit 9ece6c9fc9b17058b61cd7e9dee29d3a9af87841.

* merge fixes

* use master lock file

* Update Substrate & Polkadot

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
2023-02-14 19:15:43 +00:00
s0me0ne-unkn0wn 7d8d4d2106 Use primitives reexported from polkadot_primitives crate root (#2067)
* Use primitives reexported from `polkadot_primitives` crate root

* restart CI

* Fixes after merge

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: parity-processbot <>
2023-01-11 12:06:58 +00:00
Bastian Köcher ac2dc71ab2 Remove the RelaychainClient trait (#2068)
* Remove the `RelaychainClient` trait

It was just some historical trait that isn't really required anymore. Besides that this pr re-exports
types that are being used by the relay chain interface to make its usage easier.

* Fix warning
2023-01-09 09:44:06 +01:00
Sebastian Kunert babf73bbc6 Allow to specify multiple relay chain RPC urls for collator node (#1880)
* Allow specification of multiple urls for relay chain rpc nodes

* Add pooled RPC client basics

* Add list of clients to pooled client

* Improve

* Forward requests to dispatcher

* Switch clients on error

* Implement rotation logic

* Improve subscription handling

* Error handling cleanup

* Remove retry from rpc-client

* Improve naming

* Improve documentation

* Improve `ClientManager` abstraction

* Adjust zombienet test

* Add more comments

* fmt

* Apply reviewers comments

* Extract reconnection to extra method

* Add comment to reconnection method

* Clean up some dependencies

* Fix build

* fmt

* Provide alias for cli argument

* Apply review comments

* Rename P* to Relay*

* Improve zombienet test

* fmt

* Fix zombienet sleep

* Simplify zombienet test

* Reduce log clutter and fix starting position

* Do not distribute duplicated imported and finalized blocks

* fmt

* Apply code review suggestions

* Move building of relay chain interface to `cumulus-client-service`

* Refactoring to not push back into channel

* FMT
2022-12-15 11:42:07 +01:00
Sebastian Kunert 7612d616e0 Enable collation via RPC relay chain node (#1585)
* Add minimal overseer gen with dummy subsystems

* Fix dependencies

* no-compile: only client transaction pool missing

* Remove unused imports

* Continue to hack towards PoC

* Continue

* Make mini node compile

* Compiling version with blockchainevents trait

* Continue

* Check in lockfile

* Block with tokio

* update patches

* Update polkadot patches

* Use polkadot-primitives v2

* Fix build problems

* First working version

* Adjust cargo.lock

* Add integration test

* Make integration test work

* Allow startinc collator without relay-chain args

* Make OverseerRuntimeClient async

* Create separate integration test

* Remove unused ChainSelection code

* Remove unused parameters on new-mini

* Connect collator node in test to relay chain nodes

* Make BlockChainRPCClient obsolete

* Clean up

* Clean up

* Reimplement blockchain-rpc-events

* Revert "Allow startinc collator without relay-chain args"

This reverts commit f22c70e16521f375fe125df5616d48ceea926b1a.

* Add `strict_record_validation` to AuthorityDiscovery

* Move network to cumulus

* Remove BlockchainRPCEvents

* Remove `BlockIdTo` and `BlockchainEvents`

* Make AuthorityDiscovery async

* Use hash in OverseerRuntime

* Adjust naming of runtime client trait

* Implement more rpc-client methods

* Improve error handling for `ApiError`

* Extract authority-discovery creationand cleanup

* RPC -> Rpc

* Extract bitswap

* Adjust to changes on master

* Implement `hash` method

* Introduce DummyChainSync, remove ProofProvider and BlockBackend

* Remove `HeaderMetadata` from blockchain-rpc-client

* Make ChainSync work

* Implement NetworkHeaderBackend

* Cleanup

* Adjustments after master merge

* Remove ImportQueue from network parameters

* Remove cargo patches

* Eliminate warnings

* Revert to HeaderBackend

* Add zombienet test

* Implement `status()` method

* Add more comments, improve readability

* Remove patches from Cargo.toml

* Remove integration test in favor of zombienet

* Remove unused dependencies, rename minimal node crate

* Adjust to latest master changes

* fmt

* Execute zombienet test on gitlab ci

* Reuse network metrics

* Chainsync metrics

* fmt

* Feed RPC node as boot node to the relay chain minimal node

* fmt

* Add bootnodes to zombienet collators

* Allow specification of relay chain args

* Apply review suggestions

* Remove unnecessary casts

* Enable PoV recovery for rpc full nodes

* Revert unwanted changes

* Make overseerHandle non-optional

* Add availability-store subsystem

* Add AuxStore and ChainApiSubsystem

* Add availability distribution subsystem

* Improve pov-recovery logging and add RPC nodes to tests

* fmt

* Make availability config const

* lock

* Enable debug logs for pov-recovery in zombienet

* Add log filters to test binary

* Allow wss

* Address review comments

* Apply reviewer comments

* Adjust to master changes

* Apply reviewer suggestions

* Bump polkadot

* Add builder method for minimal node

* Bump substrate and polkadot

* Clean up overseer building

* Add bootnode to two in pov_recovery test

* Fix missing quote in pov recovery zombienet test

* Improve zombienet pov test

* More debug logs for pov-recovery

* Remove reserved nodes like on original test

* Revert zombienet test to master
2022-10-10 09:06:26 +02:00
Sebastian Kunert b6a2a38c91 Introduce RPC Worker (#1462)
* Extract json-rpc-client and introduce worker

* Initial rpc worker

* Add error handling

* Use bounded channels for listeners

* Improve naming and clean up

* Use tracing channels

* Improve code readability

* Decrease channel size limit

* Remove unused dependency

* Fix docs

* RPC -> Rpc

* Start worker in initialization method

* Print error in case a distribution channel is full

* Fix docs

* Make `RpcStreamWorker` private

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Use tokio channels and add TODO item

* Remove `Option` from `to_worker_channel`

Co-authored-by: Davide Galassi <davxy@datawok.net>
2022-08-01 12:08:57 +02:00
Robert Habermeier 8eee3c37c4 Companion for primitives consolidation into v2 (#1071)
* branches

* update all primitives references

* fmt

* Update Polkadot & Substrate

* Again

Co-authored-by: Bastian Köcher <info@kchr.de>
2022-03-10 09:33:05 +00:00
Sebastian Kunert 234c42c2df Introduce rpc client for relay chain full node (#963)
* Initial network interface preparations

* Implement get_storage_by_key

* Implement `validators` and `session_index_for_child`

* Implement persisted_validation_data and candidate_pending_availability

* Fix method name for persisted_validation_data and add encoded params

* Implement `retrieve_dmq_contents` and `retrieve_all_inbound_hrmp_channel_contents`

* Implement `prove_read`

* Introduce separate RPC client, expose JsonRpSee errors

* Simplify closure in call_remote_runtime_function

* Implement import stream, upgrade JsonRpSee

* Implement finality stream

* Remove unused method from interface

* Implement `is_major_syncing`

* Implement `wait_on_block`

* Fix tests

* Unify error handling `ApiError`

* Replace WaitError with RelayChainError

* Wrap BlockChainError in RelayChainError

* Unify error handling in relay chain intefaces

* Fix return type of proof method

* Improve error handling of new methods

* Improve error handling and move logging outside of interface

* Clean up

* Remove unwanted changes, clean up

* Remove unused import

* Add format for StatemachineError and remove nused From trait

* Use 'thiserror' crate to simplify error handling

* Expose error for overseer, further simplify error handling

* Reintroduce network interface

* Implement cli option

* Adjust call_state method to use hashes

* Disable PoV recovery when RPC is used

* Add integration test for network full node

* Use Hash instead of BlockId to ensure compatibility with RPC interface

* Fix cargo check warnings

* Implement retries

* Remove `expect` statements from code

* Update jsonrpsee to 0.8.0 and make collator keys optional

* Make cli arguments conflicting

* Remove unused `block_status` method

* Add clippy fixes

* Cargo fmt

* Validate relay chain rpc url

* Clean up dependencies and add one more integration test

* Clean up

* Clean up dependencies of relay-chain-network

* Use hash instead of blockid for rpc methods

* Fix tests

* Update client/cli/src/lib.rs

Co-authored-by: Koute <koute@users.noreply.github.com>

* Improve error message of cli validation

* Add rpc client constructor

* Do not use debug formatting for errors

* Improve logging for remote runtime methods

* Only retry on transport problems

* Use PHash by value, rename test

* Improve tracing, return error  on relay-chain-interface build

* Fix naming, use generics instead of deserializing manually

* Rename RelayChainLocal and RelayChainNetwork

* lock

* Format

* Use impl trait for encodable runtime payload

* Only instantiate full node in tests when we need it

* Upgrade scale-codec to 3.0.0

* Improve expect log

Co-authored-by: Koute <koute@users.noreply.github.com>
2022-03-01 12:37:51 +01:00
yjh e4576e541d Fix some typos for client (#968)
* chore: fix typos for consensus

* chore: fix typos for RelayChainError
2022-02-09 11:20:00 +01:00
Sebastian Kunert a9630551c2 Unify RelayChainInterface error handling and introduce async (#909) 2022-01-25 18:27:54 +01:00
Sebastian Kunert 7b42df10f3 Introduce interface for relay chain interaction (#835) 2021-12-22 19:02:11 +01:00