Skip to content

Conversation

@whankinsiv
Copy link
Collaborator

This PR expands the drep_state module to support all state data needed to align with all /governance/dreps/ related Blockfrost endpoints. A follow up PR will wire these endpoints to the new historical_dreps data.

Main changes:

  • AddedHistoricalDRepState keyed by DRepCredential storing:
    • extended DRep info (deposit, expired/retired flags, active epoch)
    • updates history (registrations, deregistrations, updates with tx_hash and cert_index)
    • metadata anchors
    • delegators credentials
    • votes records
  • Uses StateHistory to commit state changes by block, enabling rollback support.
  • Added conditional subscribers:
    • cardano.governance (for votes when store-votes enabled)
    • cardano.protocol.parameters (for drep expiration tracking when store-info enabled)
  • Extended GovernanceProceduresMessage to include vote_index in each VotingProcedure.
  • Extended DRepRegistration, DRepDeregistration, and DRepUpdate types of TxCertificate with tx_hash and cert_index.

This implementation makes storage configurable within the module so users can keep resource costs low when DRep data isn't needed.

Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Copy link
Collaborator

@golddydev golddydev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fine to me.

}

pub async fn init(&self, context: Arc<Context<Message>>, config: Arc<Config>) -> Result<()> {
fn get_bool_flag(config: &Config, key: (&str, bool)) -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like these could go in a common/config helper?

Copy link
Collaborator

@sandtreader sandtreader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff - only comment is whether we should define a hash type.

@sandtreader sandtreader merged commit 33f8dc0 into main Aug 25, 2025
2 checks passed
@sandtreader
Copy link
Collaborator

Merged but left branch open in case you want to do the hash type

@whankinsiv whankinsiv deleted the whankinsiv/drep-state-expansion branch September 3, 2025 18:33
buddhisthead pushed a commit that referenced this pull request Oct 10, 2025
…pansion

feat: Expanded drep_state with historical state and rollback support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants