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

[StackerDB] a replica lose slots if the number of slots decreases #5142

Closed jcnelson closed 2 weeks ago

jcnelson commented 3 weeks ago

There is a bug in the way StackerDB reconfiguration behaves if the number of slots decreases. The replica won't delete the now-obsolete slots. This in turn leads to problems synchronizing with new nodes that didn't ever materialize those chunks in the first place -- each will declare the other as having sent invalid StackerDBChunkInv messages, since the number of slots will be different.

The fix is to delete unused chunks on the call to StackerDBTx::reconfigure_stackerdb()

jcnelson commented 2 weeks ago

This has been fixed in #5152