stacks-network / stacks-core

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

Queue new atlas instances before committing block operations #3634

Open kantai opened 1 year ago

kantai commented 1 year ago

PR #3086 makes the atlas instance queueing logic much more shutdown-tolerant by replacing the in-memory pipeline with a persistent data store. However, an atlas instance is only queued after the block has already been processed (and committed). This means that it is possible for a node to shutdown in between these events, and therefore "losing" the atlas instances.

This was discussed in that PR's review process (https://github.com/stacks-network/stacks-blockchain/pull/3086#discussion_r848992723)

jcnelson commented 1 year ago

Damn, wish I saw this earlier. I would have blocked #3086 had I seen this earlier.

This needs to get fixed before 2.1.0.0.3.

kantai commented 1 year ago

While I think this should be addressed, I don’t agree it necessarily must block a release— after all, the current behavior in 2.1.0.0.2 already is worse than this (I don’t think any release of the stacks-node has ever guaranteed atlas instantiation before the block commits).

jcnelson commented 1 year ago

I know, but with the recent work on the DB-backed Atlas queue, addressing this concern should be trivial -- just store the new attachments before committing to the block.