Repository navigation
fix(revocation): store owns accepted revocation records - #41
Merged
Merged
Conversation
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>
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.
InMemoryAuthorityRevocationStorekept the dict it was given and returned the same dict fromget()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, andget()andstoredreturn fresh deep copies, on both the inserted and the duplicate pathdict.setdefaultcall on the copied record, so exactly one of several concurrent inserts reportsinsertedTruerecord_authority_revocation()passes in.copy.deepcopyis not an isolation guarantee for arbitrary objects with their own copy behaviourUnchanged: first wins, canonical bytes, signatures, resolver behaviour, the
dictreturn 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.