Repository navigation
Port remaining production hardening and verify witness conformance in CI - #6
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Selectively ports the still-useful changes from #4 onto current main, retaining #5's Rekor v2, persistent deduplication, strict signature verification, atomic witness/monitor updates, bounded HTTP clients, current dependencies, and contiguous serialized vindex indexing.
EXTERNAL_WITNESSES/EXTERNAL_WITNESS_KEYSconfiguration. Timestamped witness signatures cannot satisfy log-signature verification.Witness suite quality
The original HTTP suite mostly checked status codes and an em-dash prefix, which was insufficient. Every successful response now independently verifies the C2SP wire signature using Python
cryptography: signer, alg-0x04 key ID, 76-byte encoding, timestamp and exact signed checkpoint body. Added verifier-tampering checks, process-restart persistence and simultaneous conflicting first checkpoints. Missing test case files fail rather than silently skip; unsupported public-only custom log configurations fail explicitly.The new concurrency test exposed a real SQLite initialization race (500 on simultaneous first requests).
get_or_initnow uses a conflict-safe insert then reads the winning state, preserving main's atomic conditional state updates.This is our regression suite, not an official C2SP certification. Its README documents that it uses our Python Merkle helper and SQLite, and does not simulate power loss or exhaust the protocol. Existing Rust security tests and PostgreSQL CI coverage remain enabled.
Deliberately not ported
Validation
cargo test --workspace: passes (PostgreSQL-specific test needs CI's configured service).cargo clippy --workspace --all-targets --all-features -- -D warnings: passes.cargo fmt --all -- --check: passes.cd witness-conformance && uv run --locked pytest --entrypoint=../target/debug/witness -q: 31 passed.Supersedes the production changes in #4; does not include its bulk-import/deployment scope.