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

Improve revoke delegate stx #4157

Merged
merged 9 commits into from
Jan 11, 2024
Merged

Improve revoke delegate stx #4157

merged 9 commits into from
Jan 11, 2024

Conversation

friedger
Copy link
Collaborator

@friedger friedger commented Dec 12, 2023

Description

This PR improves the function revoke-delegate-stx so that the information which pool the user just left is transparent. The function call would fail if the user is not part of a pool.

Furthermore, an event for revoking is synthesized similar to other pox events.

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

@friedger friedger force-pushed the feat/pox-4-revoke-delegate-stx branch from c068795 to 983a693 Compare December 12, 2023 11:52
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (d7e9a80) 83.09% compared to head (6445cd4) 82.79%.

Files Patch % Lines
stackslib/src/chainstate/stacks/boot/mod.rs 94.59% 2 Missing ⚠️
pox-locking/src/events.rs 97.05% 1 Missing ⚠️
...tackslib/src/chainstate/stacks/boot/pox_4_tests.rs 99.28% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4157      +/-   ##
==========================================
- Coverage   83.09%   82.79%   -0.31%     
==========================================
  Files         430      430              
  Lines      306140   306345     +205     
==========================================
- Hits       254382   253631     -751     
- Misses      51758    52714     +956     

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

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.

Thanks @friedger! Should this PR be against the next branch?

@friedger
Copy link
Collaborator Author

friedger commented Dec 13, 2023

@zone117x This PR uses infrastructure code (yarn test for pox-4, single source file for pox-4) added in #4094

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @friedger

@friedger friedger force-pushed the feat/pox-4-revoke-delegate-stx branch from b0a7476 to c360c95 Compare January 9, 2024 14:58
@friedger friedger changed the base branch from feat/pox-4-disallow-stacking-during-prepare-phase to next January 9, 2024 14:59
@friedger friedger changed the base branch from next to chore/pox-4-single-file January 9, 2024 15:54
@friedger friedger changed the base branch from chore/pox-4-single-file to next January 9, 2024 15:55
chore: add check for stacking during prepare phase

chore: re-add deleted code

feat: add revoke-delegate-stx event

chore: re-add deleted code

feat: add check for delegation state in revoke-delegate-stx

chore: move revoke tests to pox-4

chore: add test for revoke event

chore: fmt

feat: revoke-delegate-stx fails also after expiry

fix: use correct type

fix: make revoke-delegate-stx event backwards compatible

chore: revert unwanted changes

chore: remove unwanted changes
@friedger friedger force-pushed the feat/pox-4-revoke-delegate-stx branch from 33d551d to c77969b Compare January 9, 2024 16:32
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.

I have yet to test these changes in the API, but so far LGTM. This should be merged, and I'll open an issue if any bugs are uncovered during testing.

@jcnelson jcnelson merged commit 15e76e5 into next Jan 11, 2024
2 checks passed
format!(
r#"
{{
data: {{ delegate-to: '{delegate_to} }}
Copy link
Contributor

@janniks janniks Jan 15, 2024

Choose a reason for hiding this comment

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

Should this be delegated-to like in the delegation map in Clarity? cc @friedger

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@janniks I was inspired by the delegate-stx parameter name and the database column of the pox3_events table

But your suggestion makes sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created new issue #4246

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, good point. Might make sense in that case to keep named the same. Not sure 🤔

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

6 participants