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

Continuous Staking 2 - Dropping Pending Validators #1387

Closed
wants to merge 223 commits into from

Conversation

abi87
Copy link
Contributor

@abi87 abi87 commented Apr 20, 2023

Why this should be merged

No more pending validators. To add a validator we should specify just its duration, not start/end time anymore. Staking will start as soon as validatorTx is accepted.

How this works

First off, this PR is based off #1530

Its content:

  1. Immediately insert a current staker when AddValidatorTx is verified, instead of a pending one
  2. Immediately insert a current staker when AddSubnetValidatorTx is verified, instead of a pending one
  3. Immediately insert a current staker when AddPermssionlessValidatorTx is verified, instead of a pending one
  4. Immediately insert a current staker when AddDelegatorTx is verified, instead of a pending one
  5. Immediately insert a current staker when AddPermssionlessDelegatorTx is verified, instead of a pending one
  6. Introduce continuous staking fork handling in mempool. Post Continuous fork the won't be need to distinguish stakerTxs from other since we won't need to drop the stakerTxs starting too far away in the future

How this was tested

CI + extra UTs for now. Missing fork enabling in testnet and some more e2e tests.

@abi87 abi87 changed the base branch from master to stakers_update_ops April 20, 2023 08:59
// Add allows inserting a transaction in mempool.
// Timestamp is the chain tip time. It's needed to
// handle hard forks
Add(tx *txs.Tx, timestamp time.Time) error
Copy link
Contributor Author

@abi87 abi87 Apr 20, 2023

Choose a reason for hiding this comment

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

Continuous staking fork will change the way txs are stored in mempool. Once activated, there won't be need anymore to distinguish stakers txs and drop those with start time too far ahead in the future.
Currently the easier way to let mempool handle the change in tx classification is to pass chain time at the time Add is called.

@abi87 abi87 self-assigned this Apr 26, 2023
maru-ava and others added 27 commits September 20, 2023 16:11
Co-authored-by: Dhruba Basu <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Dan Laine <[email protected]>
Signed-off-by: Stephen Buttolph <[email protected]>
Co-authored-by: Dan Laine <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Co-authored-by: aaronbuchwald <[email protected]>
Copy link

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will cause this PR to ignore lifecycle events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous staking lifecycle/stale vm This involves virtual machines
Projects
Archived in project
Status: In Review 👀
Development

Successfully merging this pull request may close these issues.

Continuous Staking
10 participants