Skip to content

Conversation

@mattfoley8
Copy link
Contributor

No description provided.

@mattfoley8 mattfoley8 requested a review from lazynina June 5, 2023 16:11
@mattfoley8 mattfoley8 self-assigned this Jun 5, 2023
@mattfoley8 mattfoley8 requested a review from a team as a code owner June 5, 2023 16:11
lib/constants.go Outdated
AssociationsAndAccessGroupsMigration MigrationName = "AssociationsAndAccessGroupsMigration"
BalanceModelMigration MigrationName = "BalanceModelMigration"
ProofOfStake1StateSetupMigration MigrationName = "ProofOfStake1StateSetupMigration"
ProofOfStake2ConsensusCutoverMigration MigrationName = "ProofOfStake2ConsensusCutoverMigration"
Copy link
Member

Choose a reason for hiding this comment

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

Are any encoders actually changing with this block height? If not, we don't need an encoder migration. Adding an encoder migration will cause the node to iterate over all the index to compute the post-migration state. It's a bit of an expensive operation so if we can only have one migration, that's preferable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll delete the ConsensusCutoverMigration for now. It's not used yet, but I think we will need it. But trivial to add back when we do. We use the StateSetupMigration for e.g. gating the new fields on a UtxoOperation.

Copy link
Member

Choose a reason for hiding this comment

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

I guess my thinking is that if we KNOW we are going to be performing a migration later, we can perform it now without consequence. For example, if we want to start including a new field, but it isn't relevant until the 2nd block height, we can just encode its default value.

@mattfoley8 mattfoley8 changed the base branch from feature/proof-of-stake to mf/pos-merge-20230605 June 6, 2023 13:20
@mattfoley8 mattfoley8 merged commit e774ec4 into mf/pos-merge-20230605 Jun 6, 2023
@mattfoley8 mattfoley8 deleted the mf/consolidate-pos-block-heights branch June 6, 2023 17:29
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.

3 participants