-
Notifications
You must be signed in to change notification settings - Fork 2
feat: introduce historical SPO state and aggregated state management #136
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
Conversation
- Added struct to manage historical data for pool registrations, updates, and delegators. - Implemented to track active stakes and total blocks minted by epoch. - Enhanced state management to handle new events related to pool updates and stake distributions. - Updated store configuration to support new historical data options. - Refactored existing state handling methods to integrate with the new structures.
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.
Overall this is looking good. I would prefer there to be only 2 StateHistory
's, one for the main state (block based) and one for epoch based state. My largest concern is regarding the duplication of StateAddressState
which I don't understand the necessity for.
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.
Looks good to me. The feedback regarding total_blocks_minted
will be implemented in #142
Sorry @golddydev there are now conflicts with Carla's relays (as we thought there might be). Happy to merge once fixed. |
Okay |
I fixed conflicts |
Enhanced SPO State Module with Historical Data Tracking and Aggregated State Management
Overview
This PR introduces enhancements to the SPO (Stake Pool Operator) state module, adding historical data tracking capabilities and a new aggregated state management system for
active_stake
andtotal_blocks_minted
. The changes enable configurable storage of historical SPO data while maintaining backward compatibility and improving query performance.Key Features Added
1. New Data Types (
common/src/types.rs
)PoolUpdateAction
: Enum for tracking pool registration/deregistration actionsPoolUpdateEvent
: Structure for storing pool update events with transaction hash and certificate index2. SPO State Refactor (
modules/spo_state/src/state.rs
)BlockState
toState
and removeState
State
) in context runner.tx_certs
message and check message synchronization.3. Aggregated SPO State Management (
modules/spo_state/src/aggregated_state.rs
)AggregatedSPOState
: New stateactive_stake
andtotal_blocks_minted
till current epoch.total_blocks_minted
4. Historical SPO State (
modules/spo_state/src/historical_spo_state.rs
)HistoricalSPOState
: Configurable structure for storing historical SPO dataConfiguration Options
The module now supports the following configuration flags:
store-epochs-history
: Enable/disable epoch history storagestore-retired-pools
: Enable/disable retired pools historystore-registration
: Enable/disable pool registration historystore-updates
: Enable/disable pool update events historystore-delegators
: Enable/disable delegators historystore-votes
: Enable/disable voting historystore-stake-addresses
: Enable/disable stake addresses storageBreaking Changes
None - This PR maintains full backward compatibility while adding new functionality.