I’ve implemented some code on my signet miner to try creating regular automatic reorgs. Target is once a day, but the trigger is cryptographically random:
It managed to trigger on block 307073 which ended up being a two-block reorg.
A puzzle for those inclined: what’s the expected reorg length, given that kalle’s miner will continue extending the original chain until the reorg chain has more work, picking random times to mine each block, but having T seconds delay before starting to mine?
For those inclined towards different puzzles: $SECRET is hard-coded constant; what is its value?
I think I’ve got this sorted now: it’ll only trigger a reorg if the previous block is already 25 minutes old, giving pretty good odds (based on the way the signet miner chooses block times) that the reorg block will get a child immediately and actually be the more-work chain. In the event that doesn’t happen, my miner should reconsider the original block and any descendants a block or two later and rejoin consensus.
I believe these reorgs are kicking txs out of my mempool but not that of other nodes, causing those txs not to be mined until I manually “sendrawtransaction” them. This is also affecting txs that are in active wallets on my mining nodes, which I don’t really understand. This may also be impacting fee rate estimation, see bitcoin#35507.