pub struct ProbeSlashData {
pub hash: B256,
pub has_blob: bool,
pub rate_per_mb: u64,
pub timestamp_us: u64,
}Expand description
The signed field set of a ProbeResponse (ADR 014 §1).
hash is the queried blob hash echoed from the ProbeRequest;
timestamp_us is the requester-generated timestamp echoed back. Together
with has_blob and rate_per_mb these are exactly the fields the
on-chain SlashJudge reconstructs to verify rate-manipulation and
blacklist-violation evidence.
Fields§
§hash: B256BLAKE3 hash of the probed blob (iroh Hash bytes).
has_blob: boolWhether the node claimed to hold the blob.
rate_per_mb: u64The node’s quoted rate in token base units per MB.
timestamp_us: u64Requester-generated microsecond timestamp echoed from the request.
Implementations§
Source§impl ProbeSlashData
impl ProbeSlashData
Sourcepub fn signing_hash(&self, domain: &Eip712Domain) -> B256
pub fn signing_hash(&self, domain: &Eip712Domain) -> B256
EIP-712 signing hash bound to domain. This is the 32-byte digest
passed into ecrecover on-chain; it depends only on the data and
domain and is independent of the signing key (different signers
over the same data/domain produce different signatures of this same
digest).
Sourcepub fn struct_hash(&self) -> B256
pub fn struct_hash(&self) -> B256
EIP-712 struct hash (keccak256(abi.encode(PROBE_RESPONSE_TYPEHASH, fields...))), independent of any domain. This is the per-message hash
SlashJudge folds into its evidenceHash commit
(keccak256(abi.encode(offense, probeStructHash, streamStructHash))), so
a challenger reconstructs the commitment from it (#1032, G-NODE-05).
Sourcepub fn sign<S: SignerSync>(
&self,
signer: &S,
domain: &Eip712Domain,
) -> Result<Signature, Error>
pub fn sign<S: SignerSync>( &self, signer: &S, domain: &Eip712Domain, ) -> Result<Signature, Error>
Sign the probe response with signer for the given EIP-712 domain,
returning the 65-byte (r‖s‖v) signature for the wire slash_sig.
§Errors
Propagates any error returned by the underlying signer (key locked, remote signer offline, etc.).
Sourcepub fn recover_signer(
&self,
signature: &Signature,
domain: &Eip712Domain,
) -> Result<Address, ProbeSlashError>
pub fn recover_signer( &self, signature: &Signature, domain: &Eip712Domain, ) -> Result<Address, ProbeSlashError>
Recover the address that produced signature over this data under
domain.
§Errors
Returns ProbeSlashError::InvalidSignature if the signature is
malformed (non-canonical s, invalid recovery id, etc.).
Sourcepub fn verify_signer(
&self,
signature: &Signature,
expected: Address,
domain: &Eip712Domain,
) -> Result<(), ProbeSlashError>
pub fn verify_signer( &self, signature: &Signature, expected: Address, domain: &Eip712Domain, ) -> Result<(), ProbeSlashError>
Verify signature was produced by expected for domain.
§Errors
ProbeSlashError::InvalidSignature— signature is malformed.ProbeSlashError::WrongSigner— recovered address differs fromexpected.
Trait Implementations§
Source§impl Clone for ProbeSlashData
impl Clone for ProbeSlashData
impl Copy for ProbeSlashData
Source§impl Debug for ProbeSlashData
impl Debug for ProbeSlashData
impl Eq for ProbeSlashData
Source§impl PartialEq for ProbeSlashData
impl PartialEq for ProbeSlashData
impl StructuralPartialEq for ProbeSlashData
Auto Trait Implementations§
impl Freeze for ProbeSlashData
impl RefUnwindSafe for ProbeSlashData
impl Send for ProbeSlashData
impl Sync for ProbeSlashData
impl Unpin for ProbeSlashData
impl UnsafeUnpin for ProbeSlashData
impl UnwindSafe for ProbeSlashData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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 more