fix: complete stalled setup when activating a posted revocation registry#4164
Open
kukgini wants to merge 1 commit into
Open
fix: complete stalled setup when activating a posted revocation registry#4164kukgini wants to merge 1 commit into
kukgini wants to merge 1 commit into
Conversation
f4c5af3 to
898b5f2
Compare
When no active registry exists, get_or_create_active_registry promoted the oldest posted registry with a bare wallet state change. A registry is only left in the posted state when its setup pipeline stalled between publishing the definition and publishing the initial entry (e.g. the tails file upload to the tails server failed), so the promoted registry had an unresolvable tailsLocation (holders get 404 and cannot build non-revocation proofs) and possibly no initial accumulator entry on the ledger. Every credential subsequently issued against it was silently unverifiable. Resume the stalled pipeline instead: re-upload the tails file (put_file already treats HTTP 409 'already exists' as success, so this is idempotent against the reference tails server) and publish the initial entry, which itself performs the posted -> active transition. On failure the registry stays posted and promotion is retried on the next issuance attempt instead of activating a broken registry. Signed-off-by: kukgini <kukgini@gmail.com>
898b5f2 to
6c1ff19
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.



Description
IndyRevocation.get_or_create_active_registrypromoted the oldestpostedregistry toactivewith a bare wallet state change (_set_registry_status).A registry is only ever left in a lasting
postedstate when its setup pipeline stalled betweensend_defandsend_entry— most commonly a failed tails file upload (on_revocation_registry_init_event:send_def→upload_tails_file→send_entry). Promoting such a registry by flipping the wallet state skips the missed steps, so the "recovered" registry is broken:tailsLocationpoints at a file the tails server never received — holders get a 404 and can never build non-revocation proofs, andREVOC_REG_ENTRY) is missing from the ledger.Every credential subsequently issued against it is silently unverifiable. If the agent's local tails copy was also lost (ephemeral storage), issuance instead wedges on
get_or_fetch_local_tails_pathuntil manual intervention.This PR resumes the stalled pipeline instead of bare-flipping the state:
upload_tails_file()— idempotent against the reference tails server, sinceput_filealready treats HTTP 409 "already exists" as success — covers the case where the original failure happened after the upload;send_entry()— publishes the missed initial entry and itself performs theposted -> activetransition (it also already contains thefix_ledger_entrycorrection path for entry conflicts).If either step fails, the registry stays
posted, an error is logged, and promotion is retried naturally on the next issuance attempt (callers already treat aNoneresult as retry-after-delay). This is deliberately conservative: the worst case becomes "issuance paused with loud errors" instead of "broken credentials issued".Note on endorser-mediated deployments: the promotion path has no endorser context, so the resume performs a direct ledger write; for endorser authors it will fail and leave the registry
posted, which is no worse than the previous behavior (a broken activation).Tests: reworked
test_get_or_create_active_registry_has_no_active_with_postedto assert the missed steps run and no bare state change occurs; addedtest_get_or_create_active_registry_posted_setup_incompleteasserting that a registry whose setup cannot be completed is not activated. (The 3TestDeleteTailsfailures reproduce on a pristinemaincheckout and are unrelated.)Backport request: this code path ships in the 1.3 LTS line (observed on a 1.3.4 deployment; the function and the
put_file409 handling are identical on1.3-lts). We'd appreciate a backport to1.3-lts— happy to open that PR ourselves if preferred.Related Issue
N/A — full analysis included above.
Type of Change
Checklist