Skip to main content

FreshnessPolicy

Trait FreshnessPolicy 

Source
pub trait FreshnessPolicy: Send {
    // Required method
    fn select(
        &mut self,
        candidates: &[(Address, U256)],
        obs: &SlotObservationTracker,
        now: u64,
    ) -> Vec<(Address, U256)>;

    // Provided method
    fn on_new_block(&mut self, _block: u64) { ... }
}
Expand description

Decides which volatile candidate slots must be verified this cycle.

The controller passes the volatile candidates (predicted read set) plus the current observation stats and now; the policy returns the subset to re-fetch. Correctness does not depend on the policy being complete — the background validator always re-checks each sim’s actual volatile read set before trusting results — so a policy only trades RPC cost against how often a Corrected verdict is needed.

Required Methods§

Source

fn select( &mut self, candidates: &[(Address, U256)], obs: &SlotObservationTracker, now: u64, ) -> Vec<(Address, U256)>

Of these volatile candidate slots, which must be verified this cycle?

Provided Methods§

Source

fn on_new_block(&mut self, _block: u64)

Hook called when the controller advances to a new block.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§