🧪 Test script for event-based rev-reg management - #1751
Merged
Conversation
EKS E2E Test Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ff137
marked this pull request as ready for review
August 1, 2025 11:51
ff137
force-pushed
the
feat/rev-reg-events
branch
from
August 4, 2025 19:14
0dc3533 to
285f066
Compare
ff137
force-pushed
the
feat/rev-reg-events
branch
from
August 7, 2025 18:55
4092b1d to
0e45870
Compare
New env vars: - ANONCREDS_REVOCATION_SETUP_MAX_RETRY_COUNT, default 3 - ANONCREDS_REVOCATION_SETUP_RETRY_SLEEP_TIME, default 3
- Retry indefinitely, with event expiry timestamps for enhanced recovery - Improved traceability, logging request_id
…ull-handling -> backup rev reg
- log exception for mystery error during handling events - create request_id before full-handling event is emitted
- better handling of redirect (HTTPFound) exception in middleware - update tenacity retries to skip retrying on specific did-registrar service not available error - remove legacy, in-between event: RevRegDefFinishedEvent
|
ff137
marked this pull request as ready for review
August 26, 2025 08:00
cl0ete
approved these changes
Aug 26, 2025
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.



Contributes a revocation registry resilience testing script, which tests the new event-driven approach (openwallet-foundation/acapy#3831).
Old NATS events related to revocation registry management:
anoncreds::credential-definition::finished-- Initial credential definition event that kicks off the revocation setup processanoncreds::revocation-registry-definition::finished-- Successful storage event for revocation registry definition that triggers creation of revocation list (kept for backwards compatibility, no longer used)anoncreds::revocation-list::finished-- Finished event for revocation list (kept for backwards compatibility, not used in state machine)New NATS events for tracking automated revocation resource creation:
Revocation registry definition:
anoncreds::revocation-registry-definition::create-requested-- Event indicating that creation of a revocation registry definition resource on the ledger is requestedanoncreds::revocation-registry-definition::create-response-- Response event that triggers the store event for the revocation registry definitionanoncreds::revocation-registry-definition::store-requested-- Event requesting storage of the revocation registry definition resultanoncreds::revocation-registry-definition::store-response-- Response event that triggers the finished event and backup creation if it's the first registryReovcation list:
anoncreds::revocation-list::create-requested-- Event requesting creation of a revocation listanoncreds::revocation-list::create-response-- Response event for revocation list creationanoncreds::revocation-list::store-requested-- Event triggered by create-response to request storage of the revocation listanoncreds::revocation-list::store-response-- Response event that triggers activation if it's for the first registryRegistry activation:
anoncreds::revocation-registry::activation-requested-- Event requesting activation of revocation registry, triggered for first registry and during full handlinganoncreds::revocation-registry::activation-response-- Response event for revocation registry activationFull registry handling:
anoncreds::revocation-registry::full-detected-- Event indicating revocation registry is full, sets current registry to full, emits event to activate backup, and emits event to create new backupanoncreds::revocation-registry::full-handling-completed-- Event emitted after current registry is set to full (backup activation and new backup creation are queued asynchronously)Notification if maximum retries gets exceeded:
anoncreds::revocation-registry::intervention-required-- Event notifying issuer that manual intervention is required when retries continue to failThe test script (
app/tests/e2e/experimental/rev_reg_resilience_testing/test_rev_reg_resilience.py) is skipped by default as it's only intended for local testing.It covers 11 different scenarios, each one interrupting the multitenant agent at a different point in the rev reg creation flow, and the test asserts that events recover properly when the agent starts up again, by revoking credentials and proving they are revoked.
The agent must be run at DEBUG log level for the monitor script to successfully detect when to interrupt the agent.
The agent's REGISTRY_SIZE env var can also be decreased to 4, to ensure that backup registries will be created and tested as well. The test script will issue and verify 10 credentials, so a REGISTRY_SIZE < 5 means that both initial registries will fill up, and backup will have to be created and used in order for tests to pass.
Includes some improvement to exception log handling for the acapy errors when agent is interrupted. Also refactors the other experimental test (
test_many_revocations.py) to be up to date and usable. Common test fixtures are modularized for better reuse between these modules.