Test Details Overview

Make `duplicate_filter` lock-free with an atomic word per entry (#5285)

The filter is on the path of every inbound publish and vote, and
`transport::message_filter` kept one mutex around its table, so IO
threads inserting at once queued on it.

An entry is now a single atomic 64-bit word: a 48-bit tag from the upper
half of the digest over the low 16 bits of the epoch it went in at, with
the lower half of the digest picking the slot. Insert, erase and
contains replace the word with a compare and swap, and `message_filter`
drops its mutex.

The filter may let a repeat through in a rare race, such as an insert
running alongside an advance or a clear, since whatever follows it has
to cope with repeats anyway. It does not hold back an input it has not
seen.

An entry tells its age for one lap of its 16 epoch bits. `advance ()`
reports when they wrap and the network's cleanup loop then clears the
filter. `duplicate_filter_cutoff` is bounded accordingly: values above
65535 are rejected when the config is read.

__________

Type: commit

Hash: 8f12e40d7fc6391c0d844dc2ac51bc96692b4d98

Created: today

__________

gr0v1ty/nano-node:8f12e40d7fc6391c0d844dc2ac51bc96692b4d98

Test Results

Test Case Status Duration Median Deviation Log Graph
No test results available yet. Check the GitHub test run for job status and logs.