Skip to content

Conversation

@abi87
Copy link
Contributor

@abi87 abi87 commented Oct 17, 2023

Why this should be merged

This PR implements https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/41-remove-pending-stakers.md

Post-Durango activation, any new staking transaction will create a new staker in AvalancheGo and begin validating the network once the tx is accepted. As per ACP-41, no transaction formats are modified or added.

How this works

The StartTime field in stakers is set to the current chain time. StartTime is not validated post-Durango activation.

Transactions are rejected if they do not satisfy MinStakeDuration <= EndTime - CurrentTime <= MaxStakeDuration

How this was tested

  • CI
  • Added UTs

@abi87 abi87 marked this pull request as ready for review October 17, 2023 13:53
@abi87 abi87 mentioned this pull request Oct 17, 2023
@marun
Copy link
Contributor

marun commented Oct 17, 2023

Suggestions:

  • Update all e2e tests to not provide Start to txs.Validator
  • Update e2e tests that log validator/delegator 'start time' to reflect the switch from chosen start time to time of tx acceptance
  • Remove e2e.DefaultValidatorStartTime

@marun
Copy link
Contributor

marun commented Oct 17, 2023

Out of curiosity, why is the only way to set the duration from the difference between end time and tx acceptance time? Why not add a new Duration field and deprecate Start/End?

@abi87
Copy link
Contributor Author

abi87 commented Oct 17, 2023

Out of curiosity, why is the only way to set the duration from the difference between end time and tx acceptance time? Why not add a new Duration field and deprecate Start/End?

Definitely not the only way to do that, just the only backward compatible way I could think of. If we had freedom to change, e.s. the AddValidatorTx format we could have dropped Start/End and introduce a Duration. However AddValidatorTxs are included in the genesis so we cannot freely modify them. Adding a second version to the codec to control what is marshalled/unmarshalled is tricky. We are left with this solution

@abi87 abi87 force-pushed the validator_metadata_codec branch 2 times, most recently from 172c8e0 to a6ae416 Compare October 23, 2023 17:17
Base automatically changed from validator_metadata_codec to dev October 23, 2023 19:09
marun
marun previously requested changes Oct 25, 2023
Copy link
Contributor

@marun marun left a comment

Choose a reason for hiding this comment

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

Making these requests formal so they don't get lost:

  • Update all e2e tests to not provide Start to txs.Validator
  • Update e2e tests that log validator/delegator 'start time' to reflect the switch from chosen start time to time of tx acceptance
  • Remove e2e.DefaultValidatorStartTime

@abi87
Copy link
Contributor Author

abi87 commented Nov 13, 2023

Making these requests formal so they don't get lost:

  • Update all e2e tests to not provide Start to txs.Validator
  • Update e2e tests that log validator/delegator 'start time' to reflect the switch from chosen start time to time of tx acceptance
  • Remove e2e.DefaultValidatorStartTime

Hey @marun, I've finally done most of this, with the exception of the logging the staking start time. To do that I need to query P-chain state and I wonder if this would make test less readable/slower? I lean toward doing it, I like testing being as verbose as humanly possible, but would like your input before proceeding.

@abi87 abi87 requested a review from marun November 13, 2023 13:43
Base automatically changed from post_durango_startTime_storing to dev December 14, 2023 18:57
@dhrubabasu dhrubabasu requested a review from marun December 14, 2023 19:09
@StephenButtolph StephenButtolph mentioned this pull request Dec 18, 2023
1 task
@dhrubabasu
Copy link
Contributor

Superseded by #2314

@dhrubabasu dhrubabasu closed this Dec 18, 2023
@dhrubabasu dhrubabasu deleted the pending_stakers_removal branch December 18, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project
Status: In Review 👀

Development

Successfully merging this pull request may close these issues.

Drop Pending Stakers

5 participants