Skip to content
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

staking: emit ABCI events for validator state transitions #4336

Closed
conorsch opened this issue May 6, 2024 · 1 comment · Fixed by #4449
Closed

staking: emit ABCI events for validator state transitions #4336

conorsch opened this issue May 6, 2024 · 1 comment · Fixed by #4449
Assignees
Labels
A-staking Area: Design and implementation of staking and delegation A-telemetry Area: Metrics, logging, and other observability-related features A-tooling Area: developer tooling for building Penumbra itself _P-medium Medium priority

Comments

@conorsch
Copy link
Contributor

conorsch commented May 6, 2024

Is your feature request related to a problem? Please describe.
Currently, the most authoritative view of the active validator set is obtained by running pcli query validator list --show-inactive. We have partial, but crucially flawed, metrics related to validator states that should be removed.

Describe the solution you'd like
When a validator changes state, e.g. from Defined -> Active, or Active -> Jailed, or Active -> Tombstoned, an ABCI event should be emitted. This would allow external tooling like block explorers to consume these events.

Describe alternatives you've considered
We've tried to shore up the emitted metrics, but decided these aren't the right way to represent the validator state info.

Additional context
See related historical discussion in #3746, and recent PR in EventTombstoneValidator - #4277.

@conorsch conorsch added A-tooling Area: developer tooling for building Penumbra itself A-governance Area: Governance A-telemetry Area: Metrics, logging, and other observability-related features labels May 6, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Penumbra May 6, 2024
@github-actions github-actions bot added the needs-refinement unclear, incomplete, or stub issue that needs work label May 6, 2024
@aubrika aubrika changed the title governance: emit ABCI events for validator state transitions staking: emit ABCI events for validator state transitions May 8, 2024
@conorsch conorsch added A-staking Area: Design and implementation of staking and delegation and removed A-governance Area: Governance labels May 8, 2024
@aubrika aubrika added _P-medium Medium priority and removed needs-refinement unclear, incomplete, or stub issue that needs work labels May 8, 2024
@erwanor erwanor added the _P-V1 Priority: slated for V1 release label May 16, 2024
conorsch added a commit that referenced this issue May 16, 2024
The validator state metrics are not accurate, and should be refactored
to use ABCI event emission so that developers can leverage the state
transitions in a sane way. In the meantime, let's remove the incorrect
metrics entirely.

Refs #3746, #4336.
@conorsch
Copy link
Contributor Author

conorsch commented May 16, 2024

Talked through the shape of these events with @plaidfinch and @cratelyn today. We want:

  • catch-all state transition event: penumbra.core.component.stake.v1.EventValidatorStateChange, with fields:
    • validator identity key
    • new state
    • make sure all possible state transitions are accounted for: defined, active, inactive, jailed, tombstoned, enabled, disabled. check genesis states too (which may be earlier than the transition logic)
  • new event: penumbra.core.component.stake.v1.EventValidatorDefinitionUpload
    • every time that a Validator definition is uploaded (which can happen in a variety of different states)
    • should include the entire definition
  • missed-block event: penumbra.core.component.stake.v1.EventValidatorMissedBlock, with fields:
    • validator identity key
    • (this event is only emitted if validator was Active but did not sign)
  • new events: penumbra.core.component.stake.v1.EventDelegate & EventUndelegate

conorsch added a commit that referenced this issue May 20, 2024
The validator state metrics are not accurate, and should be refactored
to use ABCI event emission so that developers can leverage the state
transitions in a sane way. In the meantime, let's remove the incorrect
metrics entirely.

Refs #3746, #4336.
@aubrika aubrika removed the _P-V1 Priority: slated for V1 release label May 30, 2024
@zbuc zbuc closed this as completed in 16750b4 Jun 14, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Penumbra Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-staking Area: Design and implementation of staking and delegation A-telemetry Area: Metrics, logging, and other observability-related features A-tooling Area: developer tooling for building Penumbra itself _P-medium Medium priority
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants