Repository navigation
Conversation
nicolasLuduena
force-pushed
the
fix/attestation-unreachable-vault-check
branch
from
November 25, 2026 02:12
aedf87b to
4287db3
Compare
nicolasLuduena
changed the base branch from
main
to
fix/240-registry-double-init-test
November 25, 2026 02:12
This was referenced Nov 25, 2026
lolaaimar
force-pushed
the
fix/attestation-unreachable-vault-check
branch
from
November 25, 2026 19:49
b910721 to
7c05c80
Compare
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
An equal vault id commits to the same claim, whose nullifier the replay check has already rejected, so "Claim already accepted" could never fire.
lolaaimar
force-pushed
the
fix/attestation-unreachable-vault-check
branch
from
November 25, 2026 20:47
7c05c80 to
d600820
Compare
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
Stacked on #285 (stack: #291 → #292 → #293 → #294 → #285 → #283 → #282); it shares no files with them.
verifyAttestationchecked the vault for the claim's id right after the replay check. That second assert can never fire, so this PR removes it:verifyAttestation assert(!nullifiers.member(nullifier), "Observation replay") nullifiers.insert(nullifier) id = persistentCommit(claim, rand) - assert(!claimsVault.member(id), "Claim already accepted") claimsVault.insert(id, entry)If the vault already held
id, the replay check would have rejected the call first:verifyAttestationwrites toclaimsVaultandnullifiers, and it inserts into both in the same call. A failed assert aborts the call, so every vault entry has its claim's nullifier.persistentCommitis binding, so an equal id means the same claim, barring a SHA-256 collision.nullifierOfdepends only on the claim's fields (ADR 0006, ADR 0012), so the same claim gives the same nullifier.Concurrent transactions run the same checks in the same order against the ledger, so they end the same way.
The argument breaks for an app that embeds the module and writes to
A_nullifiersorA_claimsVaultfrom its own circuits. Such an app also breaks the module's replay protection, and no app in the repo does it.The contracts README's guarantees no longer name
"Claim already accepted"; they say the replay check also covers a resubmission under the same vault randomness. Apatchchangeset for@txpipe/thoth-contractsrecords the change.Evidence
The new test resubmits an identical claim with the same vault randomness, the only case the removed assert was meant to catch:
attestation.compact, the test passes and the call fails withObservation replay, so the vault check is never reached.After: with the assert removed, the test passes with the same error.
On the full stack, all four mocks compile with
npm run compact:no-zk. Build,npm run typesandnpm run check(Biome andcompact format -c) pass. The full suite passes: 776 passed, 4 skipped (the opt-in live checks).No verification skill in this repo.
Merge Danger
Door: two-way
Blast Radius: contracts consumers
A circuit that embeds
attestation.compactloses one assert and gets slightly smaller. No input that used to pass now fails, and no input that used to fail now passes. A deployed contract keeps its old circuit until you redeploy it.