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

Update StackStxOp to include signer key #4412

Merged
merged 36 commits into from Mar 20, 2024

Conversation

8marz8
Copy link
Contributor

@8marz8 8marz8 commented Feb 22, 2024

Description

Following the signer-key authorization in #4377, this PR updates stack-stx burn op (StackStxOp) to include signer-key.

Applicable issues

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 95.51167% with 50 lines in your changes are missing coverage. Please review.

Project coverage is 83.39%. Comparing base (0e9cf5d) to head (cb136bf).
Report is 7 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4412      +/-   ##
==========================================
+ Coverage   83.33%   83.39%   +0.06%     
==========================================
  Files         453      453              
  Lines      328494   329585    +1091     
  Branches      323      323              
==========================================
+ Hits       273744   274853    +1109     
+ Misses      54742    54724      -18     
  Partials        8        8              
Files Coverage Δ
...c/chainstate/burn/operations/test/serialization.rs 100.00% <100.00%> (ø)
stackslib/src/chainstate/coordinator/tests.rs 90.80% <100.00%> (+0.01%) ⬆️
stackslib/src/chainstate/burn/operations/mod.rs 62.36% <75.00%> (+0.54%) ⬆️
stackslib/src/chainstate/burn/db/sortdb.rs 91.97% <91.66%> (+<0.01%) ⬆️
stackslib/src/chainstate/stacks/db/blocks.rs 90.04% <92.85%> (+<0.01%) ⬆️
...ckslib/src/chainstate/burn/operations/stack_stx.rs 86.67% <94.37%> (+3.61%) ⬆️
...net/stacks-node/src/tests/nakamoto_integrations.rs 95.56% <97.12%> (+0.29%) ⬆️
testnet/stacks-node/src/tests/neon_integrations.rs 74.12% <97.01%> (+0.82%) ⬆️
...-node/src/burnchains/bitcoin_regtest_controller.rs 87.30% <80.88%> (+0.12%) ⬆️

... and 22 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e9cf5d...cb136bf. Read the comment docs.

Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

Nice job! I think this is pretty close. You should mainly add an integration test (like in nakamoto_integrations)

stackslib/src/chainstate/burn/db/sortdb.rs Outdated Show resolved Hide resolved
stackslib/src/chainstate/burn/operations/stack_stx.rs Outdated Show resolved Hide resolved
stackslib/src/chainstate/burn/operations/stack_stx.rs Outdated Show resolved Hide resolved
stackslib/src/chainstate/stacks/db/blocks.rs Outdated Show resolved Hide resolved
@8marz8 8marz8 force-pushed the feat/stacking-burnops-include-signer-key branch 2 times, most recently from 08b6dd8 to 525ba04 Compare February 26, 2024 17:02
@8marz8 8marz8 marked this pull request as ready for review February 26, 2024 19:25
@hstove hstove self-requested a review March 1, 2024 16:49
@hstove
Copy link
Contributor

hstove commented Mar 4, 2024

Ah, I just realized that #4461 will require an update to this burn op (two new u128 fields)

Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

Everything looks great, I just have some comments around backwards compatibility with the existing burn op structure. Nice work!

stackslib/src/chainstate/burn/operations/stack_stx.rs Outdated Show resolved Hide resolved
stackslib/src/chainstate/burn/operations/stack_stx.rs Outdated Show resolved Hide resolved
stackslib/src/chainstate/burn/operations/stack_stx.rs Outdated Show resolved Hide resolved
stackslib/src/chainstate/burn/db/sortdb.rs Outdated Show resolved Hide resolved
@8marz8 8marz8 force-pushed the feat/stacking-burnops-include-signer-key branch from cd6a10a to 3d2043e Compare March 4, 2024 23:48
@8marz8 8marz8 requested a review from hstove March 5, 2024 16:29
@hstove
Copy link
Contributor

hstove commented Mar 19, 2024

As I was updating this PR for one of @jcnelson's review comments, I noticed a logic bug: the function process_stacking_ops automatically calls set-signer-key-authorization to ensure that the internal Clarity transaction is successful. We missed this on previous reviews, but we definitely don't want this behavior: the whole point (for the most part) of set-signer-key-authorization is to support having stack-stx burn ops without needing the whole signature. However, we still want to ensure that the signer has provided this authorization beforehand. With the way this PR currently works, you could use this burn op to bypass the whole signer key authorization check.

This isn't a huge change - we'll need to strip out the mentioned code in process_stacking_ops, and then update the integration tests to add the set-signer-key-authorization check before making the burn ops.

@hstove hstove requested review from jcnelson, jferrant and hstove and removed request for hstove March 19, 2024 19:43
hstove
hstove previously approved these changes Mar 20, 2024
@hstove hstove dismissed their stale review March 20, 2024 13:54

Dismissing because I committed

kantai
kantai previously approved these changes Mar 20, 2024
Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

LGTM -- just one comment trying to spread the good news about the PoxVersions enum.

jferrant
jferrant previously approved these changes Mar 20, 2024
@8marz8 8marz8 dismissed stale reviews from jferrant and kantai via cb136bf March 20, 2024 16:34
@8marz8 8marz8 enabled auto-merge March 20, 2024 21:16
@8marz8 8marz8 added this pull request to the merge queue Mar 20, 2024
Merged via the queue into next with commit 498b6c0 Mar 20, 2024
2 of 3 checks passed
ASuciuX added a commit to ASuciuX/stacks-core that referenced this pull request Apr 2, 2024
@8marz8 8marz8 deleted the feat/stacking-burnops-include-signer-key branch April 8, 2024 17:26
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.

[Nakamoto] stack-stx burn op requires a signing key and signature [Nakamoto] Bug in stack-stx burn op
5 participants