27 static const auto g_ctx_seed = []() -> std::optional<uint256> {
34 std::cerr <<
RANDOM_CTX_SEED <<
" must consist of up to " <<
uint256::size() * 2 <<
" hex digits (\"0x\" prefix allowed), it was set to: '" << num <<
"'.\n";
bool EnableFuzzDeterminism()
#define Assert(val)
Identity function.
static constexpr unsigned int size()
static std::optional< uint256 > FromUserHex(std::string_view str)
static const uint256 ZERO
std::atomic< bool > g_used_g_prng
uint256 GetRandHash() noexcept
Generate a random uint256.
std::atomic< bool > g_seeded_g_prng_zero
void MakeRandDeterministicDANGEROUS(const uint256 &seed) noexcept
Internal function to set g_determinstic_rng.
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.
@ FIXED_SEED
Seed with a fixed value that never changes over the lifetime of this process.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.