diff --git a/.ots/c0685dabfb48360a3abc103b75357f94e9f054b2.ots b/.ots/c0685dabfb48360a3abc103b75357f94e9f054b2.ots new file mode 100644 index 0000000..a12cdad Binary files /dev/null and b/.ots/c0685dabfb48360a3abc103b75357f94e9f054b2.ots differ diff --git a/.ots/commit-chain.txt b/.ots/commit-chain.txt index 97112e9..d0f9c04 100644 --- a/.ots/commit-chain.txt +++ b/.ots/commit-chain.txt @@ -2,3 +2,8 @@ 4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e 392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 +c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e +392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 diff --git a/.ots/prev-commit.txt b/.ots/prev-commit.txt index 9687ed2..79c74df 100644 --- a/.ots/prev-commit.txt +++ b/.ots/prev-commit.txt @@ -1 +1 @@ -46aded7b9582bbed673843e2cf8a3f8fa742ad91 +c0685dabfb48360a3abc103b75357f94e9f054b2 diff --git a/.ots/proof.ots b/.ots/proof.ots index 14d73c1..407ebcf 100644 Binary files a/.ots/proof.ots and b/.ots/proof.ots differ diff --git a/backfill-proofs.sh b/backfill-proofs.sh index 6fbc16e..81ea0aa 100755 --- a/backfill-proofs.sh +++ b/backfill-proofs.sh @@ -55,13 +55,21 @@ for COMMIT in $COMMITS; do PROOF_FILE=".ots/${COMMIT}.ots" if [ -f "$PROOF_FILE" ]; then - # Try to upgrade existing proof - echo " Upgrading existing proof..." + # Check if already fully attested + STATUS=$(ots info "$PROOF_FILE" 2>&1 | grep -c "PendingAttestation" || echo "0") + + if [ "$STATUS" -eq 0 ]; then + echo " ✓ Already attested (skipping)" + continue + fi + + # Try to upgrade existing proof (only contacts calendars if pending) + echo " Upgrading pending proof..." if ots upgrade "$PROOF_FILE" 2>/dev/null; then echo " ✓ Upgraded to attested" UPDATED=$((UPDATED + 1)) else - echo " - Still pending (no upgrade available)" + echo " - Still pending (no upgrade available yet)" fi else # Generate new proof for this commit diff --git a/check-attestation.sh b/check-attestation.sh new file mode 100755 index 0000000..5420dd3 --- /dev/null +++ b/check-attestation.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# check-attestation.sh - Check if an OpenTimestamp proof is fully attested +# Usage: check-attestation.sh +# Returns: 0 if fully attested, 1 if pending + +PROOF_FILE="${1:-}" + +if [ -z "$PROOF_FILE" ] || [ ! -f "$PROOF_FILE" ]; then + echo "Error: proof file not found: $PROOF_FILE" >&2 + exit 2 +fi + +# Check for PendingAttestation in ots info output +if ots info "$PROOF_FILE" 2>&1 | grep -q "PendingAttestation"; then + echo "pending" + exit 1 +else + echo "attested" + exit 0 +fi diff --git a/test5.txt b/test5.txt new file mode 100644 index 0000000..ddc3ed7 --- /dev/null +++ b/test5.txt @@ -0,0 +1 @@ +# Test optimized backfill