stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3.01k stars 667 forks source link

Feat/buffer stackerdb messages #5118

Closed jcnelson closed 1 month ago

jcnelson commented 1 month ago

This PR updates the unsolicited message handling logic to allow unsolicited p2p messages to be stored and retried in one of two conditions:

This new code path is required to correctly buffer and retry StackerDBPushChunk messages, which can arrive at a Stacks node before the message's identified tenure tip has been processed. With this patch, the node buffers up StackerDBPushChunk messages and retries them when the Stacks tenure changes. Before, they were erroneously retried when the sortition tip changed (meaning, they were likely to be dropped since the new sortition would have arrived before the corresponding tenure-change block).

This improves miner signer reliability in the face of Stacks nodes not all arriving at the same Stacks tip at the same time.

This closes #5116

jferrant commented 1 month ago

I think this broke forked_tenure_is_ignored.

I also am seeing unit test failures but I don't actually know which test broke. Just seeing the CI broken.