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

pox-4: disallow stacking during prepare phase #4094

Closed

Conversation

friedger
Copy link
Collaborator

@friedger friedger commented Nov 28, 2023

Description

This PR update pox-4 to disallow stacking during the prepare phase

Applicable issues

Additional info (benefits, drawbacks, caveats)

When user stack stx during the prepare phase, their stx is locked, but they do not earn rewards. In addition, pool operators have extra work to remove these pool members.

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated

@friedger friedger changed the base branch from master to next November 28, 2023 13:21
@friedger friedger marked this pull request as ready for review November 28, 2023 13:26
@friedger friedger mentioned this pull request Nov 28, 2023
5 tasks
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8cffc38) 85.08% compared to head (f947264) 82.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4094      +/-   ##
==========================================
- Coverage   85.08%   82.89%   -2.20%     
==========================================
  Files         429      429              
  Lines      302009   302009              
==========================================
- Hits       256976   250358    -6618     
- Misses      45033    51651    +6618     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@setzeus setzeus mentioned this pull request Nov 28, 2023
8 tasks
@jcnelson
Copy link
Member

jcnelson commented Nov 28, 2023

Hi @friedger, thanks for sending this over!

Regarding the PR organization, we don't use Clarinet to test pox-4 (or any PoX implementation) because PoX is not a smart contract. It's a part of the Clarity VM that just happens to be written in Clarity. Its behavior and implementation is deeply dependent on the ways in which the node interacts with it (e.g. in order to lock/unlock STX, calculate reward sets, and so on). We test PoX in Rust via tests in pox-locking/src and in stackslib/src/chainstate/stacks/boot/.

@jcnelson
Copy link
Member

Regarding the PR organization, we don't use Clarinet to test pox-4 (or any PoX implementation) because PoX is not a smart contract

Actually, I want to clarify this. It's totally fine to use Clarinet to test pox-4 (see https://github.com/hirosystems/stacks-e2e-testing); it's just that it shouldn't come as a substitute or at the expense of the Rust tests we have for locking/unlocking.

@friedger
Copy link
Collaborator Author

pox_4.rs and pox_4_tests.rs is not yet in branch next. Therefore, rust tests for pox-4 are out of scope of this PR.

@moodmosaic
Copy link
Member

We test PoX in Rust via tests in pox-locking/src and in stackslib/src/chainstate/stacks/boot/.

@jcnelson, this means we need a pox_4.rs similar to https://github.com/stacks-network/stacks-core/blob/next/pox-locking/src/pox_3.rs, right?

@jcnelson
Copy link
Member

jcnelson commented Nov 29, 2023 via email

@friedger
Copy link
Collaborator Author

checks are green now :-)

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

The new event for revoke-delegate-stx looks good. I'm not sure about the implications of the stacking during prepare phase change, so my approval for this PR wouldn't mean much. @janniks any thoughts?

@friedger
Copy link
Collaborator Author

friedger commented Dec 1, 2023

I have added a link to the discussion on discord before this feature request (https://discord.com/channels/621759717756370964/730814571517968436/1112787020117463100) to the corresponding github issue

@friedger friedger mentioned this pull request Dec 3, 2023
5 tasks
@friedger
Copy link
Collaborator Author

friedger commented Dec 6, 2023

All comments addressed

pox-locking/src/events.rs Outdated Show resolved Hide resolved
pox-locking/src/events.rs Outdated Show resolved Hide resolved
@friedger
Copy link
Collaborator Author

Changes related to revoke-delegate-stx have been removed.
This PR should be now much easier to merge.

@friedger friedger force-pushed the feat/pox-4-disallow-stacking-during-prepare-phase branch from ff2c499 to 6ed2a25 Compare December 12, 2023 11:45
@friedger friedger mentioned this pull request Dec 13, 2023
5 tasks
Copy link
Collaborator

@setzeus setzeus left a comment

Choose a reason for hiding this comment

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

Reviewed & all LGTM. Only thoughts are maybe the name registration tests should be extracted / part of another PR?

Edit* Especially since I see more BNS tests in #4100 & #4116 I think it might make sense to make a separate PR strictly for BNS items.

@friedger
Copy link
Collaborator Author

@zone117x Could you please review this again?

@obycode
Copy link
Contributor

obycode commented Dec 19, 2023

Feedback from PR meeting - let's open a discussion. @AshtonStephens

@zone117x zone117x removed their request for review December 19, 2023 15:26
@jcnelson
Copy link
Member

Discussion created: #4193

@friedger friedger mentioned this pull request Dec 19, 2023
5 tasks
setzeus added a commit that referenced this pull request Dec 20, 2023
@friedger friedger marked this pull request as draft January 10, 2024 09:03
@friedger
Copy link
Collaborator Author

Converted to draft until discussion is concluded

@saralab
Copy link
Contributor

saralab commented Jan 23, 2024

Risky , will reconsider for next HF

@saralab saralab closed this Jan 23, 2024
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pox: Disallow stacking locks during prepare phase
10 participants