mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +00:00
Make candidate validation bounded again (#2125)
This PR aims to channel the backpressure of the PVF host's preparation and execution queues to the candidate validation subsystem consumers. Related: #708
This commit is contained in:
@@ -60,6 +60,9 @@ pub const PREPARE_BINARY_NAME: &str = "polkadot-prepare-worker";
|
||||
/// The name of binary spawned to execute a PVF
|
||||
pub const EXECUTE_BINARY_NAME: &str = "polkadot-execute-worker";
|
||||
|
||||
/// The size of incoming message queue
|
||||
pub const HOST_MESSAGE_QUEUE_SIZE: usize = 10;
|
||||
|
||||
/// An alias to not spell the type for the oneshot sender for the PVF execution result.
|
||||
pub(crate) type ResultSender = oneshot::Sender<Result<ValidationResult, ValidationError>>;
|
||||
|
||||
@@ -227,7 +230,7 @@ pub async fn start(
|
||||
Err(err) => return Err(SubsystemError::Context(err)),
|
||||
};
|
||||
|
||||
let (to_host_tx, to_host_rx) = mpsc::channel(10);
|
||||
let (to_host_tx, to_host_rx) = mpsc::channel(HOST_MESSAGE_QUEUE_SIZE);
|
||||
|
||||
let validation_host = ValidationHost { to_host_tx, security_status: security_status.clone() };
|
||||
|
||||
|
||||
@@ -104,7 +104,10 @@ mod worker_interface;
|
||||
pub mod testing;
|
||||
|
||||
pub use error::{InvalidCandidate, PossiblyInvalidError, ValidationError};
|
||||
pub use host::{start, Config, ValidationHost, EXECUTE_BINARY_NAME, PREPARE_BINARY_NAME};
|
||||
pub use host::{
|
||||
start, Config, ValidationHost, EXECUTE_BINARY_NAME, HOST_MESSAGE_QUEUE_SIZE,
|
||||
PREPARE_BINARY_NAME,
|
||||
};
|
||||
pub use metrics::Metrics;
|
||||
pub use priority::Priority;
|
||||
pub use worker_interface::{framed_recv, framed_send, JOB_TIMEOUT_WALL_CLOCK_FACTOR};
|
||||
|
||||
Reference in New Issue
Block a user