pub struct BlockSessionContext {Show 15 fields
pub block: Arc<Block>,
pub prevout_values_buffer: Arc<Vec<i64>>,
pub script_pubkey_indices_buffer: Arc<Vec<(usize, usize)>>,
pub script_pubkey_buffer: Arc<Vec<u8>>,
pub witness_buffer: Arc<Vec<Vec<Witness>>>,
pub tx_contexts: Arc<Vec<TxScriptContext>>,
pub ecdsa_sub_counters: Arc<Vec<AtomicUsize>>,
pub schnorr_collector: Option<Arc<SchnorrSignatureCollector>>,
pub height: Natural,
pub median_time_past: Option<u64>,
pub network: Network,
pub activation: ForkActivationTable,
pub results: Arc<SegQueue<Vec<(usize, bool)>>>,
pub precomputed_sighashes: Arc<Vec<Option<[u8; 32]>>>,
pub precomputed_p2pkh_hashes: Arc<Vec<Option<[u8; 20]>>>,
}Expand description
Session context for one block; set at start_session, used by workers until complete. When schnorr_collector is None, verify in-place (no batch collection). TxScriptContext stored in Arc to avoid cloning full context per check (workers get Arc::clone). Block-level buffers are immutable (Arc<Vec<…>>) — no locks during worker execution.
Fields§
§block: Arc<Block>§prevout_values_buffer: Arc<Vec<i64>>Block-level buffer for all prevout values; TxScriptContext.prevout_values_range indexes into this.
script_pubkey_indices_buffer: Arc<Vec<(usize, usize)>>Block-level buffer for (start, len) pairs into script_pubkey_buffer; TxScriptContext.script_pubkey_indices_range indexes into this.
script_pubkey_buffer: Arc<Vec<u8>>Block-level buffer for all prevout script_pubkeys; (start, len) from script_pubkey_indices_buffer index into this.
witness_buffer: Arc<Vec<Vec<Witness>>>Block-level witness data; workers index via session.witness_buffer[ctx.tx_index][input_idx].
tx_contexts: Arc<Vec<TxScriptContext>>§ecdsa_sub_counters: Arc<Vec<AtomicUsize>>§schnorr_collector: Option<Arc<SchnorrSignatureCollector>>§height: Natural§median_time_past: Option<u64>§network: Network§activation: ForkActivationTableFork heights for this validation session (same table as BlockValidationContext::activation).
results: Arc<SegQueue<Vec<(usize, bool)>>>Lock-free: workers push batch_results; master drains at complete(). Reduces Mutex contention.
precomputed_sighashes: Arc<Vec<Option<[u8; 32]>>>Precomputed sighashes for P2PKH inputs, indexed by ecdsa_index_base + input_idx. None = not precomputed (worker computes on demand).
precomputed_p2pkh_hashes: Arc<Vec<Option<[u8; 20]>>>Precomputed HASH160(pubkey) for P2PKH inputs, indexed same as precomputed_sighashes.
Auto Trait Implementations§
impl Freeze for BlockSessionContext
impl RefUnwindSafe for BlockSessionContext
impl Send for BlockSessionContext
impl Sync for BlockSessionContext
impl Unpin for BlockSessionContext
impl UnsafeUnpin for BlockSessionContext
impl UnwindSafe for BlockSessionContext
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
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