Regular signet reorgs

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:

    HASH=$($CLI getbestblockhash)
    if [ "$(( 0x$(echo $SECRET $HASH | sha256sum | cut -c1-4) % 144 == 0 ))" = 1 ]; then
        # reorg this block
        sleep 1
        echo "**** REORGING BLOCK $H2 $HASH ****"
        bitcoin-cli invalidateblock $HASH
        bitcoin-inq invalidateblock $HASH
        sleep 5
        continue
    fi

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?

2 Likes

I’ve reinstated the signet network on my fork-observer instance: fork.observer/?network=3. The two-block reorg on 307073 looks like this:

It also picks up the coinbase tags of the miners. signet-3 (inquisition) seems to be yours and signet-1 seems to be kalle’s.

There’s also “signet-2” which is mine if the inquisition node fails to build a block