Open obycode opened 1 week ago
This has to be epoch-gated, right?
I don't think so. I think we can change events without breaking consensus. The API will handle back-filling the missed events on migration, then I think the fixed version could emit all events, including the ones that were previously missed, when booting from genesis.
Ok, so we're not going to actually "include" this TX in a block - we basically want to emit a "phantom" tx with these events (as part of a new_block payload)?
Exactly.
Is this required before we can ship #5446?
It's a separate issue from #5446, but more urgent I'd say.
When a token unlock occurs in Stacks 2.x, a mint event is attached to the coinbase transaction. This is what the API uses to track these unlocks.
These unlocks are based on Stacks block height, not tenure height or bitcoin block height, so in 3.x, the Stacks block at which an unlock occurs might not have a coinbase transaction, since only the first block in a tenure includes a coinbase now. The stacks-node needs to attach these events somewhere else. In the current implementation, the events are just dropped if the block does not have a coinbase, causing a discrepancy in the API's view of the balances and total supply.