forked from ava-labs/ortelius
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[PVM, DAC] Txs and proposals #67
Merged
Merged
Conversation
This file contains 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
evlekht
force-pushed
the
evlekht/dac
branch
2 times, most recently
from
August 14, 2023 15:00
24c0fdd
to
5a9f0e1
Compare
evlekht
changed the title
[PVM][Dependencies] AddProposalTx, AddVoteTx, FinishProposalsTx
[PVM, Dependencies] AddProposalTx, AddVoteTx, FinishProposalsTx
Aug 15, 2023
evlekht
force-pushed
the
evlekht/dac
branch
4 times, most recently
from
August 16, 2023 14:37
893e0eb
to
ab94af2
Compare
knikos
previously approved these changes
Aug 17, 2023
evlekht
force-pushed
the
evlekht/dac
branch
3 times, most recently
from
August 18, 2023 12:55
82caefb
to
06023f8
Compare
evlekht
force-pushed
the
evlekht/dac
branch
9 times, most recently
from
September 6, 2023 07:34
20b4b9c
to
78e901a
Compare
evlekht
force-pushed
the
evlekht/dac
branch
3 times, most recently
from
September 11, 2023 18:51
7eee782
to
d0b34b8
Compare
evlekht
force-pushed
the
evlekht/dac
branch
from
September 19, 2023 12:21
d0b34b8
to
e705fde
Compare
evlekht
changed the title
[PVM, Dependencies] AddProposalTx, AddVoteTx, FinishProposalsTx
[PVM, DAC] Txs and proposals
Nov 15, 2023
knikos
reviewed
Nov 24, 2023
knikos
reviewed
Nov 27, 2023
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.
some last comments
knikos
previously approved these changes
Jan 17, 2024
knikos
approved these changes
Jan 22, 2024
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.
Why this should be merged
This PR adds support for DAC voting feature txs, which includes txs indexing and 2 api requests:
/proposals?
and/proposals/:id/votes
How this works
Added txs:
Added proposals and their magellan types:
Admin proposal is flag in proposals table.
PR adds new tables:
dac-proposals
anddac-votes
.When magellan indexes new tx, if its addProposalTx, it will insert new row into proposals table. If its addVoteTx, then it will insert new row into votes table.
Proposals table also contains serialized proposalState from proposal. This state is updated whenever addVoteTx is indexed. Its required to have correct proposal outcome.
Proposal has state and outcome. Outcome is some arbitrary byte returned by proposal.Outcome(), only expected from successful proposals. State is one of following: 0 - in progress (could be still inactive if its before start-time, but thats not tracked in magellan), 1 - successful, 2 - failed.
Proposal state and outcome are updated, when finishProposalsTx is indexed.
How this was tested
Unit-tests, manual tests with local node and db exploring.