dn2-check: the reorg read ignores the exec follower's replay of old history after a restart (lines far below the exec tip)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-06 22:52:30 +00:00
parent 5e4dc171e9
commit b180ac0403

View file

@ -22,7 +22,9 @@ def read(item):
shift = SINCE_SHIFT.replace("LOGFILE", log).replace("SINCE_UTC", since_log)
cmd = f"""w=$({miner} watch 1 grpc://127.0.0.1:{rpc} 2>/dev/null | grep -o 'blocks=[0-9]*.*synced=[a-z]*' | tail -1); echo W $w
SL="$({shift})"; echo SINCE_LOCAL $SL
echo REJ $(awk -v s="$SL" '($1" "$2) >= s' {log} | grep -c 'PoW rejected') REORG $(awk -v s="$SL" '($1" "$2) >= s' {log} | grep -oE 'selected-chain reorg: [0-9]+ chain blocks' | grep -oE '[0-9]+ chain' | awk 'BEGIN{{m=0}} {{if ($1>m) m=$1}} END{{print m}}')
TIP=$(curl -s -m 6 -X POST -H 'Content-Type: application/json' --data '{{"jsonrpc":"2.0","id":1,"method":"igneum_getExecStatus","params":[]}}' http://127.0.0.1:{evm}/ | grep -oE '"executedTip":"0x[0-9a-f]+"' | grep -oE '0x[0-9a-f]+'); TIPN=$((${{TIP:-0x0}}))
echo REJ $(awk -v s="$SL" '($1" "$2) >= s' {log} | grep -c 'PoW rejected') REORG $(awk -v s="$SL" '($1" "$2) >= s' {log} | grep -oE 'selected-chain reorg: [0-9]+ chain blocks removed, unwinding to height [0-9]+' | awk -v t=$TIPN 'BEGIN{{m=0}} {{d=$3; h=$NF; if (t-h < 300 && d>m) m=d}} END{{print m}}')
# a reorg line more than 300 blocks below the exec tip is the follower re-walking the chain's old history after a restart (22:17Z: "unwinding to height 33" on a chain at 11,500), not a live reorg
echo EXEC $(curl -s -m 6 -X POST -H 'Content-Type: application/json' --data '{{"jsonrpc":"2.0","id":1,"method":"igneum_getExecStatus","params":[]}}' http://127.0.0.1:{evm}/ | grep -oE '"executedTip":"0x[0-9a-f]+"' | grep -oE '0x[0-9a-f]+')
echo PAID $(curl -s -m 6 -X POST -H 'Content-Type: application/json' --data '{{"jsonrpc":"2.0","id":1,"method":"igneum_getProvingStatus","params":[]}}' http://127.0.0.1:{evm}/ | grep -oE '"paidSegments":[0-9]+' | grep -oE '[0-9]+')
echo VER $(grep -oE 'igneumd/2\\.1\\.0-[0-9a-f]+' {log} | tail -1) DIGEST $(grep -o 'digest: [0-9a-f]*' {log} | tail -1 | awk '{{print substr($2,1,16)}}')"""