-
Notifications
You must be signed in to change notification settings - Fork 13
feat(overlord): add async script to set vote vp value #593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds asynchronous scripts to periodically update vote values based on proposal strategy values. It introduces new voting power value computation logic that relies on an external Overlord service and implements a multi-stage callback state system for managing value synchronization.
- Adds new helper modules for refreshing proposal strategy values and vote VP values
- Refactors vote value calculation to use separate array parameters instead of full objects
- Introduces callback state constants and removes immediate VP value computation during vote creation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/constants.ts | Defines callback state constants for the new sync workflow |
| src/helpers/entityValue.ts | Adds strategy value fetching from Overlord API and refactors vote value calculation |
| src/helpers/proposalStrategiesValue.ts | Implements periodic refresh of proposal strategy values |
| src/helpers/votesVpValue.ts | Implements periodic refresh of vote VP values |
| src/helpers/utils.ts | Adds reusable JSON-RPC request utility function |
| src/helpers/shutter.ts | Refactors to use the new JSON-RPC utility |
| src/writer/vote.ts | Removes immediate VP value calculation, sets initial state for async processing |
| src/writer/proposal.ts | Adds callback state initialization and logging improvement |
| src/index.ts | Registers the new refresh functions to run on startup |
| test/unit/helpers/entityValue.test.ts | Updates tests to match refactored function signature |
| test/integration/writer/proposal.test.ts | Reorganizes imports alphabetically |
| package.json | Updates Node.js types version |
| .env.example | Adds Overlord URL configuration and fixes typo |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ff181ca to
5725853
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
a1e1d5c to
7c0cc53
Compare
f9e1fb7 to
9a00146
Compare
f5e3468 to
a7daf1c
Compare
a7daf1c to
1926816
Compare
In continuation to #567
This PR will add a new async script, which will periodically update votes'
vp_valuewhen necessary.Flow
PENDING_COMPUTE(default value on vote creation), and compute a newvp_value, when the proposalvp_value_by_strategyis ready, as well as assign a new CB (FINALwhen the vp_state is final,PENDING_FINALotherwise)PENDING_COMPUTE