Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1847: Track Stakepool Retirements in the DB r=jonathanknowles a=jonathanknowles # Issue Number #1815 #1816 #1817 #1819 #1880 # Overview This PR: - [x] Extends the pool DB schema to make it possible to store: - [x] retirement certificates. - [x] the order of publication of certificates _within the same block_, for both registration and retirement certificates. This is necessary, as the intra-block order is _significant_. - [x] Adds the `RegistrationStatus` type, which indicates the current registration and retirement status of a pool. There are _three_ possibilities: 1. `NotRegistered` (indicates that a pool has never been registered) 2. `Registered` (indicates that a pool has been registered but _not_ retired) (provides a registration certificate) 3. `RegisteredAndRetired` (indicates that a pool has been registered _and_ retired) (provides both a registration and a retirement certificate) - [x] Adds the `readRegistrationStatus` function to the pool DB layer, making it possible to determine the current `RegistrationStatus` of a pool. - [x] Updates the `retirement` field of `ApiStakePool` with live information. # Property Tests This PR adds property tests to ensure that: - [x] the `determinePoolRegistrationStatus` function respects the correct order of precedence for registration and retirement certificates: - for a given pool, a registration certificate always _supercedes_ a prior retirement certificate. - for a given pool, a retirement certificate always _augments_ the latest registration certificate. - [x] `readPoolRegistrationStatus` queries work correctly in the presence of blocks containing multiple certificates for the same pool. - [x] database rollback works correctly in the presence of retirement certificates. - [x] values of type `SlotInternalId` can be correctly written to and read from the database. # Future Work A **_future_** PR will add integration tests to ensure that: - retiring a pool eventually results in a correct update to the `retirement` field of `ApiStakePool`, when read through the `ListStakePools` operation. - retiring and then re-registering a pool clears the `retirement` field. See QA section of #1819. Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
- Loading branch information
Showing
11 changed files
with
966 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.