Open jcnelson opened 3 weeks ago
Elaborating and simplifying this more -- it's sufficient to only require that remote_tip_block_id
be the sighash OR block ID. This is because the block identified by remote_tip_block_id
already commits to the block ID of its parent, as well as all of its ancestors. Therefore, local_tip_block_id
can be a block ID. Furthermore, remote_tip_block_id
would only need to be a sighash if the requested block is the chain tip; for any other block, remote_tip_block_id
can be the block ID. So, the API endpoint should support both modes of operation (and because these are both sha512/256's, there's essentially zero chance that sighashes and block IDs can collide).
When downloading unconfirmed blocks, it will be necessary to address blocks by sighash instead of block ID because the signature set of the highest block is not guaranteed to be stable. Moreover, if there's a Stacks fork, it's possible that the same blocks can have multiple signature sets.
Quoting below (see https://github.com/stacks-network/stacks-core/issues/4810)