-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Signature duplicate check with checkpointing is slow #2497
Comments
so lastids will expire with forks instead of with ticks? |
They still expire with ticks. Ticks overlap fork lifetimes because the counter moves forward in every fork. So at a specific tick count, multiple LastIds would expire, because the values are different in each fork. |
I'm having trouble with how keeping track of which fork a sig was observed in helps. Is that a memory optimization? Once a status_cache has been parented, it becomes read-only and can be shared across all forks that include the parent bank. Garbage collection is part of squash() currently. |
@rob-solana, it helps with lookups. Since there is just hashmap lookup, vs a bunch |
are SignatureMaps shared across Forks? Arc<RwLock> ? if so, how do they come to be shared? if not, how can a ForkStatusMap have more than one entry? |
@rob-solana it is just a global data structure for all the banks. |
* fix docs format * fix wrong indent * fix wrong indent * fix wrong indent * fix wrong indent * fix wrong indent * fix wrong indent * revert bigtable docs update
Problem
Even with bloom filters, #2289, the signature filtering needs to traverse a bunch of checkpoints per signature to check if its present or not. It looks like a single bloom filter check is going to be on the order of 1us, so 32 checks is going to be to slow for our target tps (although they can be run in parallel).
Proposed Solution
Use a single LastId delimited map that keeps track of which fork the signature had been executed in. This data structure doesn't checkpoint, or merge, and is a single data structure for all the forks in the system.
When checking for dup signatures in the current fork, find the results in the above data structure for all the forks a signature has been processed. Check if the forks are an ancestor of the current fork.
Garbage collect as LastIds expire, since they expire globally for all the forks.
At a specific tick count, multiple LastIds would expire, because the values are different in each fork.
Some interesting optimizations,
and using 80 bits of the Signature instead of the full 256.
tag: @garious @rob-solana @sakridge
The text was updated successfully, but these errors were encountered: