Expand description
§Stratum V2 Channels
channels_sv2 provides primitives and abstractions for Stratum V2 (Sv2) Channels.
This crate implements the core channel management functionality for both mining clients and servers, including standard, extended, and group channels, and share accounting mechanisms.
§Features
- Channel primitives for SV2 mining protocol
- Channel management for mining servers and clients
- Standard, extended, and group channel support
- Share accounting
- Server-side job lifecycle management
clientmodule isno_stdcompatible. To enable it build the crate withno_stdfeature.
Re-exports§
pub use extranonce_manager::MAX_EXTRANONCE_LEN;pub use vardiff::classic::VardiffState;pub use vardiff::Vardiff;
Modules§
- bip141
- Provides functionality to strip coinbase_tx_prefix and coinbase_tx_suffix from bip141 marker, flag and witness data.
- chain_
tip - Chain Tip
- client
- Sv2 channels - Mining Clients Abstractions.
- extranonce_
manager - Extranonce prefix allocation for downstream SV2 channels.
- merkle_
root - outputs
- Utilities to deserialize outputs.
- server
- Sv2 channels - Mining Servers Abstraction.
- target
- Helper functions related to
Target - vardiff
Constants§
- MAX_
FUTURE_ BLOCK_ TIME - Mirrors Bitcoin Core’s
MAX_FUTURE_BLOCK_TIME(src/chain.h): a block timestamp more than 2 hours in the future is consensus-invalid. - MAX_
SEEN_ SHARES_ CAP - Upper clamp on the seen-shares budget derived by
seen_shares_budget, in hashes. - MIN_
SEEN_ SHARES_ CAP - Lower clamp applied to the seen-shares budget derived by
seen_shares_budget. - SEEN_
SHARES_ MARGIN - Safety margin applied on top of the expected share rate when bounding the accepted-share
dedup cache (
seen_shares). - VERSION_
ROLLING_ MASK - Version rolling mask as per BIP323: only these general-purpose bits may differ between a job’s advertised version and a share’s version. All other bits of a share’s version must match the job’s version exactly.
- WORST_
CASE_ TIP_ MINUTES - Worst-case chain-tip lifetime, in minutes, assumed when bounding the accepted-share dedup
cache (
seen_shares).
Functions§
- seen_
shares_ budget - Returns the maximum number of accepted-share hashes retained for duplicate detection, given the channel’s expected share rate: