Skip to content

fix(revocation): store owns accepted revocation records - #41

Merged
aeoess merged 2 commits into
mainfrom
fix/revocation-store-ownership
Nov 29, 2026
Merged

aeoess merged 2 commits into
mainfrom
fix/revocation-store-ownership

Conversation

@aeoess

@aeoess aeoess commented Nov 29, 2026

Copy link
Copy Markdown
Member

InMemoryAuthorityRevocationStore kept the dict it was given and returned the same dict from get() and in the insertion result. A held reference could therefore change or empty an accepted revocation record after first-wins acceptance.

The store now owns what it accepts:

  • insert_verified_revocation() deep-copies the record before examining the slot, and get() and stored return fresh deep copies, on both the inserted and the duplicate path
  • the first-wins check and write are one dict.setdefault call on the copied record, so exactly one of several concurrent inserts reports inserted True
  • ownership is stated for plain record data, which is what record_authority_revocation() passes in. copy.deepcopy is not an isolation guarantee for arbitrary objects with their own copy behaviour
  • the store protocol says a store owns accepted records, and that this fixes the stored evidence, not the verdict: the resolver still verifies on every read

Unchanged: first wins, canonical bytes, signatures, resolver behaviour, the dict return type.

Evidence: full suite 3056 passed, 30 skipped, including a 16-thread concurrent insert test repeated 20 times. Mutation log for that file: control 30 pass, get() returning the held dict fails 1, insert keeping the caller's dict fails 1, the duplicate path returning the held dict fails 1, the inserted path returning the held dict fails 1, restored source identical, final 30 pass. Independently reviewed.

The TypeScript SDK gets the matching change in its own PR.

InMemoryAuthorityRevocationStore kept the inserted dict and returned it
from get() and in the insertion result, so a held reference could rewrite
or empty accepted evidence after first-wins acceptance. The store now
deep-copies on insert and hands out deep copies from get() and stored.
The first-wins check and write become one dict.setdefault on the copied
record. First wins, serialized bytes, signatures and resolver behaviour
are unchanged. The store protocol documents ownership.

Signed-off-by: Tymofii Pidlisnyi <tima@aeoess.com>
…t first wins

Signed-off-by: Tymofii Pidlisnyi <tima@aeoess.com>
@aeoess
aeoess merged commit ecb5a04 into main Nov 29, 2026
8 checks passed
@aeoess
aeoess deleted the fix/revocation-store-ownership branch November 29, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant