Add support to automatically copy votes between SVs [ci] (#3084)#4691
Open
ericmann wants to merge 6 commits intohyperledger-labs:mainfrom
Open
Add support to automatically copy votes between SVs [ci] (#3084)#4691ericmann wants to merge 6 commits intohyperledger-labs:mainfrom
ericmann wants to merge 6 commits intohyperledger-labs:mainfrom
Conversation
Adds an optional `copyVotesFrom: Option[String]` field that specifies the name of another SV whose governance votes should be automatically copied. This supports the use case where an operator runs multiple SV nodes and wants votes kept in sync. Resolves: hyperledger-labs#3084 Signed-off-by: Eric Mann <eric@avrofi.com>
Implements a ScheduledTaskTrigger that polls for VoteRequests where a configured source SV has voted but this SV has not, then automatically casts a matching vote (same accept/reject decision and reason). The trigger resolves SV names via DsoRules.svs and uses the VoteRequest tracking CID pattern to handle contract ID changes between polling and submission. Resolves: hyperledger-labs#3084 Signed-off-by: Eric Mann <eric@avrofi.com>
Conditionally registers the trigger when copyVotesFrom config is set, and adds it to expectedTriggerClasses for trigger validation. Signed-off-by: Eric Mann <eric@avrofi.com>
Tests three scenarios with sv2 configured to copy votes from sv1: - Source SV creates a vote request and trigger copies the accept vote, including idempotency on re-run - Source SV casts a reject vote and trigger copies it correctly - Source SV has not voted yet so trigger produces no tasks Signed-off-by: Eric Mann <eric@avrofi.com>
Signed-off-by: Eric Mann <eric@avrofi.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.
Adds a
copyVotesFromconfiguration option toSvAppBackendConfigthat enables automatic copying of governance votes (VoteRequests) from a named source SV. This supports the use case where an operator runs multiple SV nodes and wants votes kept in sync between them.The implementation follows the established
ScheduledTaskTriggerpattern (modeled afterFollowAmuletConversionRateFeedTrigger). When configured, a newCopyVotesTriggerpolls for VoteRequests where the source SV has voted but this SV has not, and automatically casts a matching vote with the same accept/reject decision and reason.Configuration example:
copy-votes-from = "Digital-Asset-2"Changes:
SvAppConfig.scala: AddcopyVotesFrom: Option[String]toSvAppBackendConfigCopyVotesTrigger.scala: NewScheduledTaskTriggerimplementationSvDsoAutomationService.scala: Conditional trigger registration +expectedTriggerClassesCopyVotesTimeBasedIntegrationTest.scala: Integration tests covering accept/reject vote copying, idempotency, and no-op when source SV hasn't votedFixes #3084
Pull Request Checklist
PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines