HomePhabricator

Seed RNG with precision timestamps on receipt of net messages.

Description

Seed RNG with precision timestamps on receipt of net messages.

Summary:
PR17573:

Exposes a generic dead-simple "SeedEvent" interface, but currently just used for net messages.

This PR caused CI failures on Windows, and was patched the day after its merge with the following:

PR17670

This moves events_hasher and events_mutex into RNGState() in random.cpp. This guarantees (through the existing GetRNGState() function) that the mutex is always created before any events are added, even when that happens inside global initializers.

Fixes the issue reported here: #17573 (comment), and includes the annotation from #17666).

This is a backport of Core PR17573 and PR17670

Test Plan:

cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug
ninja all check-all

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8287

Details

Provenance
Matt Corallo <git@bluematt.me>Authored on Nov 5 2020, 19:35
PiRKCommitted on Nov 5 2020, 19:35
abc-botPushed on Nov 5 2020, 19:40
Reviewer
Restricted Owners Package
Differential Revision
D8287: Seed RNG with precision timestamps on receipt of net messages.
Parents
rABCea176cecdd4b: test: add unit test for non-standard txs with wrong nVersion
Branches
Unknown
Tags
Unknown