Skip to content
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

Staking v4 init auciton nodes list #3818

Merged
merged 12 commits into from Mar 2, 2022

Conversation

mariusmihaic
Copy link
Contributor

@mariusmihaic mariusmihaic commented Feb 18, 2022

  • Added flag for staking v4 init epoch. Upon activation, all nodes from staking queue will be moved to Auction list
  • Fixed a bug in unit tests when adding keys to waiting list: if the waiting list already had elements, old code would have overwritten the existing waiting list

@@ -313,6 +317,13 @@ func (s *systemSCProcessor) ProcessSystemSmartContract(
}
}

if s.flagStakingV4Enabled.IsSet() {
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to flag Init

Copy link
Contributor

Choose a reason for hiding this comment

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

287 you need a disable flag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Renamed to flagStakingV4InitEnabled
  • Also added a disable flag

@mariusmihaic mariusmihaic changed the title En 11661 staking v4 init Staking v4 init auciton nodes list Feb 21, 2022
@mariusmihaic mariusmihaic self-assigned this Feb 21, 2022
@mariusmihaic mariusmihaic marked this pull request as ready for review March 1, 2022 06:22
Base automatically changed from merge-dev-into-liquid-staking to feat/liquid-staking March 1, 2022 09:04
@iulianpascalau iulianpascalau self-requested a review March 1, 2022 10:05
@@ -187,6 +187,10 @@
# StakeLimitsEnableEpoch represents the epoch when stake limits on validators are enabled
StakeLimitsEnableEpoch = 5

# StakingV4InitEnableEpoch represents the epoch when staking v4 is initialized. This is the epoch in which
# all nodes from staking queue are moved in the auction list
StakingV4InitEnableEpoch = 1000000
Copy link
Contributor

Choose a reason for hiding this comment

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

for testing purposes you can set this to 3 or 4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, changed it

@@ -313,6 +320,13 @@ func (s *systemSCProcessor) ProcessSystemSmartContract(
}
}

if s.flagInitStakingV4Enabled.IsSet() {
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be called only on the epoch when we activate the staking v4. Is this correct?
Do we need this flag to execute something only on the activation epoch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This is the expected behavior. We only want these actions to happen only once, hence the name StakingV4InitEnableEpoch.
On this epoch, the only thing we want is to move all nodes from staking queue to auction list ("remove" waiting list).
Starting next epoch, using another flag -StakingV4EnableEpoch- we will start sorting auction nodes based on top up.

Reason being that we only want to "empty" the staking queue only once

Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

@mariusmihaic mariusmihaic merged commit 4b0af04 into feat/liquid-staking Mar 2, 2022
@mariusmihaic mariusmihaic deleted the EN-11661-staking-v4-init branch March 2, 2022 13:45
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.

None yet

3 participants