pub struct PotOConsensus {
pub engine: Box<dyn TensorEngine>,
pub challenge_gen: ChallengeGenerator,
pub mml_validator: MMLPathValidator,
pub neural_validator: NeuralPathValidator,
}Expand description
The PoT-O consensus engine. Orchestrates challenge generation, tensor computation, MML validation, and neural path matching.
Fields§
§engine: Box<dyn TensorEngine>§challenge_gen: ChallengeGenerator§mml_validator: MMLPathValidator§neural_validator: NeuralPathValidatorImplementations§
Source§impl PotOConsensus
impl PotOConsensus
pub fn new(difficulty: u64, max_tensor_dim: usize) -> PotOConsensus
Sourcepub fn generate_challenge(
&self,
slot: u64,
slot_hash: &str,
) -> Result<Challenge, TribeError>
pub fn generate_challenge( &self, slot: u64, slot_hash: &str, ) -> Result<Challenge, TribeError>
Generate a new challenge from the latest Solana slot data.
Sourcepub fn mine(
&self,
challenge: &Challenge,
miner_pubkey: &str,
max_iterations: u64,
) -> Result<Option<PotOProof>, TribeError>
pub fn mine( &self, challenge: &Challenge, miner_pubkey: &str, max_iterations: u64, ) -> Result<Option<PotOProof>, TribeError>
Attempt to mine a proof for a given challenge. Iterates nonces until both MML and neural-path constraints are satisfied, or max_iterations is hit.
Sourcepub fn verify_proof(
&self,
proof: &PotOProof,
challenge: &Challenge,
) -> Result<bool, TribeError>
pub fn verify_proof( &self, proof: &PotOProof, challenge: &Challenge, ) -> Result<bool, TribeError>
Verify a proof offline (same checks the on-chain program performs).
Sourcepub fn expected_paths_and_calcs(&self, challenge: &Challenge) -> (u64, u64)
pub fn expected_paths_and_calcs(&self, challenge: &Challenge) -> (u64, u64)
Expected path and calc counts for this challenge (for status dashboard treemap).
- expected_paths: length of the neural path signature (deterministic per challenge).
- expected_calcs: 1 + difficulty (one base tensor op plus difficulty-derived steps).
Sourcepub fn engine_stats(&self) -> EngineStats
pub fn engine_stats(&self) -> EngineStats
Expose a read-only view of engine stats via the TensorEngine abstraction.
Auto Trait Implementations§
impl Freeze for PotOConsensus
impl !RefUnwindSafe for PotOConsensus
impl Send for PotOConsensus
impl Sync for PotOConsensus
impl Unpin for PotOConsensus
impl UnsafeUnpin for PotOConsensus
impl !UnwindSafe for PotOConsensus
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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 more