-
Notifications
You must be signed in to change notification settings - Fork 217
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
Record delisted pools in a dedicated table. #2277
Merged
jonathanknowles
merged 7 commits into
jospald/ADP-478/gc-delisted-stake-pools
from
jonathanknowles/simply-delist-pools
Oct 29, 2020
Merged
Record delisted pools in a dedicated table. #2277
jonathanknowles
merged 7 commits into
jospald/ADP-478/gc-delisted-stake-pools
from
jonathanknowles/simply-delist-pools
Oct 29, 2020
Conversation
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
hasufell
suggested changes
Oct 28, 2020
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, just a few remarks
jonathanknowles
added a commit
that referenced
this pull request
Oct 28, 2020
In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 28, 2020
We must replace the set of delisted pools, rather than augmenting it. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 28, 2020
This operation completely replaces the set of delisted pools, rather than augmenting it. Therefore, the name `delistPools` is slightly misleading, as it gives the impression that the existing set will be augmented, which is no longer true. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 28, 2020
In particular, we check that 'putDelistedPools' completely overwrites the existing set every time. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 28, 2020
This test no longer makes sense, as delisted pools are no longer stored in the `pool_registration` table. In response to review feedback: #2277 (comment)
hasufell
reviewed
Oct 28, 2020
jonathanknowles
added a commit
that referenced
this pull request
Oct 28, 2020
In response to review feedback: #2277 (comment)
hasufell
approved these changes
Oct 28, 2020
Record delisted pools in a dedicated table instead of using a field in the `pool_registrations` table. In the updated schema, a pool is delisted if (and only if) there is a single row containing that pool's id in the `delisted_pools` table. This solution has several advantages: 1. We only need a single database row to record that a pool is delisted. 2. We no longer need to carefully to ensure that all registration records for a particular pool have the same delisted status. A pool is either delisted or not delisted: the schema rules out all intermediate states. 3. Pools automatically remain delisted when rollbacks occur or when new certificates are published, with no extra effort. 4. The `putPoolRegistration` function no longer needs to read the most-recently-written registration entry before adding a new entry. 5. Each row in the `pool_registrations` table is now just an immutable record of a registration certificate. 6. The `PoolFlag` type is no longer necessary.
In response to review feedback: #2277 (comment)
We must replace the set of delisted pools, rather than augmenting it. In response to review feedback: #2277 (comment)
jonathanknowles
force-pushed
the
jonathanknowles/simply-delist-pools
branch
from
October 29, 2020 04:10
12f5426
to
b44bbb8
Compare
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
This operation completely replaces the set of delisted pools, rather than augmenting it. Therefore, the name `delistPools` is slightly misleading, as it gives the impression that the existing set will be augmented, which is no longer true. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
In particular, we check that 'putDelistedPools' completely overwrites the existing set every time. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
This test no longer makes sense, as delisted pools are no longer stored in the `pool_registration` table. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
In response to review feedback: #2277 (comment)
This operation completely replaces the set of delisted pools, rather than augmenting it. Therefore, the name `delistPools` is slightly misleading, as it gives the impression that the existing set will be augmented, which is no longer true. In response to review feedback: #2277 (comment)
In particular, we check that 'putDelistedPools' completely overwrites the existing set every time. In response to review feedback: #2277 (comment)
This test no longer makes sense, as delisted pools are no longer stored in the `pool_registration` table. In response to review feedback: #2277 (comment)
In response to review feedback: #2277 (comment)
jonathanknowles
force-pushed
the
jonathanknowles/simply-delist-pools
branch
from
October 29, 2020 06:54
b44bbb8
to
f5681e8
Compare
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
We must replace the set of delisted pools, rather than augmenting it. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
This operation completely replaces the set of delisted pools, rather than augmenting it. Therefore, the name `delistPools` is slightly misleading, as it gives the impression that the existing set will be augmented, which is no longer true. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
In particular, we check that 'putDelistedPools' completely overwrites the existing set every time. In response to review feedback: #2277 (comment)
jonathanknowles
added a commit
that referenced
this pull request
Oct 29, 2020
This test no longer makes sense, as delisted pools are no longer stored in the `pool_registration` table. In response to review feedback: #2277 (comment)
9 tasks
hasufell
pushed a commit
that referenced
this pull request
Oct 30, 2020
In response to review feedback: #2277 (comment)
hasufell
pushed a commit
that referenced
this pull request
Oct 30, 2020
We must replace the set of delisted pools, rather than augmenting it. In response to review feedback: #2277 (comment)
hasufell
pushed a commit
that referenced
this pull request
Oct 30, 2020
This operation completely replaces the set of delisted pools, rather than augmenting it. Therefore, the name `delistPools` is slightly misleading, as it gives the impression that the existing set will be augmented, which is no longer true. In response to review feedback: #2277 (comment)
hasufell
pushed a commit
that referenced
this pull request
Oct 30, 2020
In particular, we check that 'putDelistedPools' completely overwrites the existing set every time. In response to review feedback: #2277 (comment)
hasufell
pushed a commit
that referenced
this pull request
Oct 30, 2020
This test no longer makes sense, as delisted pools are no longer stored in the `pool_registration` table. In response to review feedback: #2277 (comment)
hasufell
pushed a commit
that referenced
this pull request
Oct 30, 2020
In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 6, 2020
In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 6, 2020
We must replace the set of delisted pools, rather than augmenting it. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 6, 2020
This operation completely replaces the set of delisted pools, rather than augmenting it. Therefore, the name `delistPools` is slightly misleading, as it gives the impression that the existing set will be augmented, which is no longer true. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 6, 2020
In particular, we check that 'putDelistedPools' completely overwrites the existing set every time. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 6, 2020
This test no longer makes sense, as delisted pools are no longer stored in the `pool_registration` table. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 6, 2020
In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 10, 2020
In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 10, 2020
We must replace the set of delisted pools, rather than augmenting it. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 10, 2020
This operation completely replaces the set of delisted pools, rather than augmenting it. Therefore, the name `delistPools` is slightly misleading, as it gives the impression that the existing set will be augmented, which is no longer true. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 10, 2020
In particular, we check that 'putDelistedPools' completely overwrites the existing set every time. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 10, 2020
This test no longer makes sense, as delisted pools are no longer stored in the `pool_registration` table. In response to review feedback: #2277 (comment)
KtorZ
pushed a commit
that referenced
this pull request
Nov 10, 2020
In response to review feedback: #2277 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Number
#2249
Overview
This PR records delisted pools in a dedicated table instead of using a field in the
pool_registrations
table.In the updated schema, a pool is delisted if (and only if) there is a single row containing that pool's id in the
delisted_pools
table.This solution has several advantages:
We only need a single database row to record that a pool is delisted.
We no longer need to carefully to ensure that all registration records for a particular pool have the same delisted status. A pool is either delisted or not delisted: the schema rules out all intermediate states.
Pools automatically remain delisted when rollbacks occur or when new certificates are published, with no special effort.
The
putPoolRegistration
function no longer needs to read the most-recently-written registration entry before adding a new entry.Each row in the
pool_registrations
table is now just an immutable record of a registration certificate.