subspace_proof_of_space

Trait Table

source
pub trait Table:
    Sized
    + Send
    + Sync
    + 'static {
    type Generator: TableGenerator<Self>;

    const TABLE_TYPE: PosTableType;

    // Required methods
    fn generate(seed: &PosSeed) -> Self;
    fn find_proof(&self, challenge_index: u32) -> Option<PosProof>;
    fn is_proof_valid(
        seed: &PosSeed,
        challenge_index: u32,
        proof: &PosProof,
    ) -> bool;

    // Provided methods
    fn generate_parallel(seed: &PosSeed) -> Self { ... }
    fn generator() -> Self::Generator { ... }
}
Expand description

Proof of space kind

Required Associated Constants§

source

const TABLE_TYPE: PosTableType

Proof of space table type

Required Associated Types§

source

type Generator: TableGenerator<Self>

Instance that can be used to generate tables with better performance

Required Methods§

source

fn generate(seed: &PosSeed) -> Self

Generate new table with 32 bytes seed.

There is also Self::generate_parallel() that can achieve lower latency.

source

fn find_proof(&self, challenge_index: u32) -> Option<PosProof>

Try to find proof at challenge_index if it exists

source

fn is_proof_valid( seed: &PosSeed, challenge_index: u32, proof: &PosProof, ) -> bool

Check whether proof created earlier is valid and return quality bytes if yes

Provided Methods§

source

fn generate_parallel(seed: &PosSeed) -> Self

Generate new table with 32 bytes seed using parallelism.

This implementation will trade efficiency of CPU and memory usage for lower latency, prefer Self::generate() unless lower latency is critical.

source

fn generator() -> Self::Generator

Returns a stateful table generator with better performance

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§