vielite's blog

QA-02: Deterministic RNG in BlockSync Peer Selection

April 1, 2026
1 min read
Table of Contents
monad-qa-02-deterministic-rng-in-blocksync

Summary

BlockSync initializes its peer-selection RNG with a fixed seed: ChaCha8Rng::seed_from_u64(123456).

Vulnerability details

2025-09-monad/bft/monad-blocksync/src/blocksync.rs
pub fn new(override_peers: Vec<NodeId<CertificateSignaturePubKey<ST>>>) -> Self {
Self {
headers_requests: Default::default(),
payload_requests: Default::default(),
self_headers_requests: Default::default(),
self_payload_requests: Default::default(),
self_payload_requests_in_flight: 0,
self_completed_headers_requests: Default::default(),
self_request_mode: BlockSyncSelfRequester::StateSync,
override_peers,
rng: ChaCha8Rng::seed_from_u64(123456),
}
}

Impact

Because every run begins with the same seed, peer selection follows a repeatable pattern across executions. That makes load distribution more predictable and can make targeted peer-pressure strategies easier.

Recommendation

Seed the RNG from real entropy instead of a hardcoded constant.