mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 03:27:58 +00:00
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
This commit is contained in:
@@ -23,7 +23,8 @@ use cumulus_primitives_core::{
|
||||
},
|
||||
InboundDownwardMessage, ParaId, PersistedValidationData,
|
||||
};
|
||||
use polkadot_overseer::Handle as OverseerHandle;
|
||||
use polkadot_overseer::{prometheus::PrometheusError, Handle as OverseerHandle};
|
||||
use polkadot_service::SubstrateServiceError;
|
||||
use sc_client_api::StorageProof;
|
||||
|
||||
use futures::Stream;
|
||||
@@ -58,18 +59,34 @@ pub enum RelayChainError {
|
||||
WorkerCommunicationError(String),
|
||||
#[error("Scale codec deserialization error: {0}")]
|
||||
DeserializationError(CodecError),
|
||||
#[error("Scale codec deserialization error: {0}")]
|
||||
#[error("Polkadot service error: {0}")]
|
||||
ServiceError(#[from] polkadot_service::Error),
|
||||
#[error("Substrate service error: {0}")]
|
||||
SubServiceError(#[from] SubstrateServiceError),
|
||||
#[error("Prometheus error: {0}")]
|
||||
PrometheusError(#[from] PrometheusError),
|
||||
#[error("Unspecified error occured: {0}")]
|
||||
GenericError(String),
|
||||
}
|
||||
|
||||
impl From<RelayChainError> for ApiError {
|
||||
fn from(r: RelayChainError) -> Self {
|
||||
sp_api::ApiError::Application(Box::new(r))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CodecError> for RelayChainError {
|
||||
fn from(e: CodecError) -> Self {
|
||||
RelayChainError::DeserializationError(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RelayChainError> for sp_blockchain::Error {
|
||||
fn from(r: RelayChainError) -> Self {
|
||||
sp_blockchain::Error::Application(Box::new(r))
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait that provides all necessary methods for interaction between collator and relay chain.
|
||||
#[async_trait]
|
||||
pub trait RelayChainInterface: Send + Sync {
|
||||
@@ -155,7 +172,7 @@ pub trait RelayChainInterface: Send + Sync {
|
||||
async fn is_major_syncing(&self) -> RelayChainResult<bool>;
|
||||
|
||||
/// Get a handle to the overseer.
|
||||
fn overseer_handle(&self) -> RelayChainResult<Option<OverseerHandle>>;
|
||||
fn overseer_handle(&self) -> RelayChainResult<OverseerHandle>;
|
||||
|
||||
/// Generate a storage read proof.
|
||||
async fn prove_read(
|
||||
@@ -233,7 +250,7 @@ where
|
||||
(**self).is_major_syncing().await
|
||||
}
|
||||
|
||||
fn overseer_handle(&self) -> RelayChainResult<Option<OverseerHandle>> {
|
||||
fn overseer_handle(&self) -> RelayChainResult<OverseerHandle> {
|
||||
(**self).overseer_handle()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user