-
Notifications
You must be signed in to change notification settings - Fork 287
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
Governance support for pindexer
#4708
base: main
Are you sure you want to change the base?
Conversation
This adds the identity key to delegator votes and the voting power to validator votes, as well as renaming EventEnactProposal to EventProposalPassed (because the former was a misnomer)
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.
This self-review attempts to explain the changes made, largely focusing on the changes made to pd
, as changes to pindexer
are self-contained and still in testing/development.
crates/core/component/governance/src/action_handler/validator_vote.rs
Outdated
Show resolved
Hide resolved
crates/core/component/governance/src/action_handler/validator_vote.rs
Outdated
Show resolved
Hide resolved
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.
There are two high-level changes that need to be made before this can be merged:
-
There should be no changes, even refactorings, to consensus-critical code along the way to adding indexer support. At most, new data can be emitted in events. We don't have bandwidth to carefully review changes to consensus-critical logic along the way to adding this logic.
-
The data produced by the
AppView
implementation is expected to be consumed by third-party clients. Thus, theAppView
impl should not be defining its own data formats ad-hoc. It should be using the canonical data formats we already have, which can be processed using standardized tooling from the Buf registry.
944bd8f
to
4eab8bf
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.
All changes, even refactors, to consensus-critical code have been backed out, excepting alterations to emitted events.
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.
More self-review on the latest iteration, which I believe resolves the outstanding concerns above.
@@ -296,7 +296,7 @@ impl AppActionHandler for ProposalSubmit { | |||
// state needed to vote as delegators | |||
state.mark_proposal_started(); | |||
|
|||
state.record_proto(event::proposal_submit(self)); | |||
state.record_proto(event::proposal_submit(self, current_block, voting_end)); |
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.
Need to record this information for the indexer.
pb::ProposalKind::UnfreezeIbcClient => ProposalKind::UnfreezeIbcClient, | ||
} | ||
} | ||
} |
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.
ProposalKind
now has a canonical proto serialization, so that it can be used in application code without ad-hoc serialization formats. It previously lacked one.
enum ProposalKind { | ||
SIGNALING = 0; | ||
EMERGENCY = 1; | ||
PARAMETER_CHANGE = 2; | ||
COMMUNITY_POOL_SPEND = 3; | ||
UPGRADE_PLAN = 4; | ||
FREEZE_IBC_CLIENT = 5; | ||
UNFREEZE_IBC_CLIENT = 6; | ||
} |
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.
Added canonical proto representation for a proposal kind, so that it can be serialized to a database. This is not used in consensus at this time.
// The start height for the proposal. | ||
uint64 start_height = 2; | ||
// The end height for the proposal. | ||
uint64 end_height = 3; |
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.
Need to record start and end heights for proposals when they are submitted.
Running this, I get
|
This has been fixed after I ran into it myself.
…On Wed, Jul 17, 2024 at 10:20 AM, Henry de Valence ***@***.***(mailto:On Wed, Jul 17, 2024 at 10:20 AM, Henry de Valence <<a href=)> wrote:
Running this, I get
Error: error returned from database: bind message supplies 0 parameters, but prepared statement "sqlx_s_2" requires 1
Caused by:
bind message supplies 0 parameters, but prepared statement "sqlx_s_2" requires 1
—
Reply to this email directly, [view it on GitHub](#4708 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAERYYMKPAENMNT4O27A3BTZMZ4RRAVCNFSM6AAAAABK3OT7O6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZTGQ2DMOBYGA).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Describe your changes
This adds a governance module to
pindexer
, along with tiny changes topd
's governance events to fully support it.Checklist before requesting a review
If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: