#2653·node

Return an error when native faucet genesis cannot obtain entropy

Author: huitseekerCreated Sep 18, 2026Updated Sep 21, 2026

build_faucet_operator() and build_native_faucet() seed ChaCha20Rng with rand::random(). rand::random() panics if the operating system entropy source fails during first use. Genesis should return that error before it writes any account files.

Seed the generator through SysRng:

rust
fn genesis_rng() -> Result<ChaCha20Rng, GenesisConfigError> {
    ChaCha20Rng::try_from_rng(&mut SysRng).map_err(GenesisConfigError::Entropy)
}

Use genesis_rng()? in both builders and add a GenesisConfigError variant for SysError. Keep the existing [u8; 32] account seed draws.