v0.2.1-pre.005-fix.001
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/client.rs
|
||||
// version: 3
|
||||
// version: 4
|
||||
|
||||
/// Passive runtime availability reported for one logical HTTP endpoint or role.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
@@ -224,7 +224,7 @@ impl HttpEndpointClient {
|
||||
role_runtimes.push(std::sync::Arc::new(crate::resilience::HttpRoleRuntime::new(role, std::sync::Arc::clone(¬ify))));
|
||||
}
|
||||
ksp_logging_lib::debug!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_name = settings.name(),
|
||||
provider = settings.provider().as_str(),
|
||||
cluster = settings.cluster().as_str(),
|
||||
|
||||
7
crates/ksp-onchain-transport-lib/src/constants.rs
Normal file
7
crates/ksp-onchain-transport-lib/src/constants.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/constants.rs
|
||||
// version: 1
|
||||
|
||||
//! Transport-owned tracing constants.
|
||||
|
||||
/// Owning tracing target for events emitted by the on-chain transport crate.
|
||||
pub(crate) const TRACING_TARGET: &str = "ksp-onchain-transport-lib";
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/executor.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
const HTTP_REQUEST_TIMEOUT: u16 = 408;
|
||||
const HTTP_TOO_MANY_REQUESTS: u16 = 429;
|
||||
@@ -147,7 +147,7 @@ impl crate::HttpTransportPool {
|
||||
};
|
||||
permit.record_success();
|
||||
ksp_logging_lib::debug!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_name = permit.selection().endpoint_name(),
|
||||
role = permit.selection().role().as_str(),
|
||||
rpc_method = method.method(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/lib.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
#![forbid(unsafe_code)]
|
||||
@@ -12,6 +12,7 @@
|
||||
//! JSON-RPC requests while the remaining audited methods stay staged by subsequent `0.2.x` releases.
|
||||
|
||||
mod client;
|
||||
mod constants;
|
||||
mod error;
|
||||
mod executor;
|
||||
mod json_rpc;
|
||||
@@ -21,6 +22,8 @@ mod rpc_canary;
|
||||
mod rpc_method;
|
||||
mod settings;
|
||||
|
||||
pub(crate) use self::constants::TRACING_TARGET;
|
||||
|
||||
/// Passive runtime availability reported for one logical HTTP endpoint.
|
||||
pub use self::client::HttpEndpointAvailability;
|
||||
/// Shareable logical HTTP endpoint client owned by KSP Transport.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/pool.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
/// Safe snapshot of the logical HTTP endpoint pool.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
@@ -105,7 +105,7 @@ impl HttpRequestPermit {
|
||||
pub fn record_success(&self) {
|
||||
self.role_runtime.record_success();
|
||||
ksp_logging_lib::trace!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_name = self.selection.endpoint_name(),
|
||||
role = self.selection.role().as_str(),
|
||||
request_kind = self.selection.request_kind().as_str(),
|
||||
@@ -118,7 +118,7 @@ impl HttpRequestPermit {
|
||||
pub fn record_failure(&self) {
|
||||
self.role_runtime.record_failure();
|
||||
ksp_logging_lib::warn!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_name = self.selection.endpoint_name(),
|
||||
provider = self.selection.client().provider().as_str(),
|
||||
cluster = self.selection.client().cluster().as_str(),
|
||||
@@ -136,7 +136,7 @@ impl HttpRequestPermit {
|
||||
let pause = self.role_runtime.record_rate_limited(provider_retry_after);
|
||||
let cooldown_ms = duration_millis_u64(pause);
|
||||
ksp_logging_lib::warn!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_name = self.selection.endpoint_name(),
|
||||
provider = self.selection.client().provider().as_str(),
|
||||
cluster = self.selection.client().cluster().as_str(),
|
||||
@@ -200,7 +200,7 @@ impl HttpTransportPool {
|
||||
}),
|
||||
};
|
||||
ksp_logging_lib::debug!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_count = pool.inner.clients.len(),
|
||||
available_endpoint_count = pool.snapshot().available_endpoint_count(),
|
||||
max_retries = pool.inner.retry.max_retries(),
|
||||
@@ -376,7 +376,7 @@ impl HttpTransportPool {
|
||||
std::result::Result::Err(_) => return RuntimeSelectionAttempt::Unavailable,
|
||||
};
|
||||
ksp_logging_lib::debug!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_name = selection.endpoint_name(),
|
||||
role = role.as_str(),
|
||||
request_kind = request_kind.as_str(),
|
||||
@@ -491,7 +491,7 @@ impl HttpTransportPool {
|
||||
std::option::Option::None => return selection_failed(role, request_kind),
|
||||
};
|
||||
ksp_logging_lib::debug!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_name = client.name(),
|
||||
role = role.as_str(),
|
||||
request_kind = request_kind.as_str(),
|
||||
@@ -601,7 +601,7 @@ fn selection_error(role: &crate::HttpRoleName, request_kind: &crate::HttpRequest
|
||||
|
||||
fn request_timeout(role: &crate::HttpRoleName, request_kind: &crate::HttpRequestKind, message: &str) -> ksp_core_lib::Result<crate::HttpRequestPermit> {
|
||||
ksp_logging_lib::warn!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
role = role.as_str(),
|
||||
request_kind = request_kind.as_str(),
|
||||
"HTTP request admission deadline expired"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/rpc_method.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
/// Functional category used by the audited Solana HTTP JSON-RPC registry.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
@@ -244,7 +244,7 @@ impl HttpRpcMethodDescriptor {
|
||||
std::option::Option::None => "none",
|
||||
};
|
||||
ksp_logging_lib::warn!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
rpc_method = self.method,
|
||||
documentation_status = self.documentation_status.code(),
|
||||
runtime_status = self.runtime_status.code(),
|
||||
@@ -265,7 +265,7 @@ impl HttpRpcMethodDescriptor {
|
||||
std::option::Option::None => "none",
|
||||
};
|
||||
ksp_logging_lib::warn!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
rpc_method = self.method,
|
||||
documentation_status = self.documentation_status.code(),
|
||||
runtime_status = self.runtime_status.code(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/settings.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
/// Runtime HTTP endpoint URL owned by Transport.
|
||||
///
|
||||
@@ -437,7 +437,7 @@ impl HttpTransportSettings {
|
||||
return invalid_settings("at least one HTTP endpoint must be enabled", "endpoints.enabled");
|
||||
}
|
||||
ksp_logging_lib::debug!(
|
||||
target: env!("CARGO_PKG_NAME"),
|
||||
target: crate::TRACING_TARGET,
|
||||
endpoint_count = self.endpoints.len(),
|
||||
enabled_endpoint_count,
|
||||
"validated HTTP transport settings"
|
||||
|
||||
Reference in New Issue
Block a user