pub struct ProbeHandler { /* private fields */ }Expand description
Serves cdn/probe/v1: reads a framed ProbeMessage::Request, writes a
framed ProbeMessage::Response.
rate_per_mb is the served price, fixed at startup. Reprice by restarting
the daemon (see runtime::reload::warn_restart_required_sections).
Implementations§
Source§impl ProbeHandler
impl ProbeHandler
Sourcepub const ALPN: &'static [u8] = ALPN_PROBE
pub const ALPN: &'static [u8] = ALPN_PROBE
The ALPN this handler answers on: cdn/probe/v1, the unauthenticated
latency and availability probe.
Sourcepub fn new(
node_id: PublicKey,
rate_per_mb: u64,
metrics: Arc<Metrics>,
limiter: Arc<ConnectionLimiter>,
probe_rate_limiter: Arc<ProbeRateLimiter>,
cache: CacheEngine,
eth_signer: Arc<PrivateKeySigner>,
slash_domain: Eip712Domain,
stake_lane: Option<StakeLanePolicy>,
relay_foreign_namespaces: bool,
chain_freshness: Option<ChainFreshness>,
) -> Self
pub fn new( node_id: PublicKey, rate_per_mb: u64, metrics: Arc<Metrics>, limiter: Arc<ConnectionLimiter>, probe_rate_limiter: Arc<ProbeRateLimiter>, cache: CacheEngine, eth_signer: Arc<PrivateKeySigner>, slash_domain: Eip712Domain, stake_lane: Option<StakeLanePolicy>, relay_foreign_namespaces: bool, chain_freshness: Option<ChainFreshness>, ) -> Self
Build the probe handler from the runtime state it answers out of: the node’s identity and advertised rate, the rate limiters that gate an unauthenticated caller, and the signer that attests each response.
Trait Implementations§
Source§impl Debug for ProbeHandler
impl Debug for ProbeHandler
Source§impl ProtocolHandler for ProbeHandler
impl ProtocolHandler for ProbeHandler
Source§async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
Handle an incoming connection. Read more
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> impl Future<Output = Result<Connection, AcceptError>> + Send
fn on_accepting( &self, accepting: Accepting, ) -> impl Future<Output = Result<Connection, AcceptError>> + Send
Optional interception point to handle the
Accepting state. Read moreAuto Trait Implementations§
impl !Freeze for ProbeHandler
impl !RefUnwindSafe for ProbeHandler
impl !UnwindSafe for ProbeHandler
impl Send for ProbeHandler
impl Sync for ProbeHandler
impl Unpin for ProbeHandler
impl UnsafeUnpin for ProbeHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
Source§fn accept(
&self,
connection: Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
fn accept( &self, connection: Connection, ) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
fn on_accepting( &self, accepting: Accepting, ) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.