-
Couldn't load subscription status.
- Fork 5
Historical accounts state certificate processing #272
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: main
Are you sure you want to change the base?
Conversation
…sages Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
modules/historical_accounts_state/src/immutable_historical_account_store.rs
Outdated
Show resolved
Hide resolved
Signed-off-by: William Hankins <william@sundae.fi>
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.
I wonder if rather than having all these xxxWithPos structs, we should generalise the TxCertificatesMessage to include them - e.g.
(types.rs)
pub struct TxCertificateWithPos {
pub cert: TxCertificate,
pub tx_identifier: TxIdentifier,
pub cert_index: u64
}
(messages.rs)
pub struct TxCertificatesMessage {
/// Ordered set of certificates
pub certificates: Vec<TxCertificateWithPos>,
}
It saves all the extra structs and I think would make handling easier (at least, fewer changes to the original, although more to revert, sorry!)
This PR implements the placeholder
handle_tx_certificatesfunction to process and store historical registration, delegation, and MIR history by stake address. It contributes toward #256 and adds state support for:/accounts/{stake_address}/registrations/accounts/{stake_address}/delegations/accounts/{stake_address}/mirsMain changes:
{Type}WithPoswrappers intx_unpackerto includeTxIdentifierfor historical tracking.handle_tx_certificates, which now processes all relevant certificate types via helper methods (handle_stake_registration_change,handle_stake_delegation, andhandle_mir).get_registration_history,get_delegation_history, andget_mir_historytoHistoricalAccountsStatefor aggregated retrieval from both volatile and immutable state.GetAccountRegistrationHistory,GetAccountDelegationHistory, andGetAccountMIRHistory.Next steps:
rest_blockfrostmodule with REST handlers for the 3 endpoints listed above.