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

feat: add signer CLI function to generate signature #4319

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

hstove
Copy link
Contributor

@hstove hstove commented Jan 31, 2024

This PR adds a new command to the stacks-signer CLI:

stacks-signer generate-stacking-signature \
  --pox-address bc123... \
  --reward-cycle 100 \
  --config ./config.toml \
  --period 12 \
  --topic stack-stx

This is built on top of #4277, which isn't merged yet, so I'm opening this as a draft until that PR is reviewed and merged.

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

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

Comparison is base (be5ea05) 83.35% compared to head (38a7465) 83.35%.

Files Patch % Lines
stacks-signer/src/cli.rs 58.33% 30 Missing ⚠️
stacks-signer/src/main.rs 93.84% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4319      +/-   ##
==========================================
- Coverage   83.35%   83.35%   -0.01%     
==========================================
  Files         446      446              
  Lines      318545   318774     +229     
==========================================
+ Hits       265539   265721     +182     
- Misses      53006    53053      +47     

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

@hstove hstove force-pushed the feat/signer-delegate-control branch from ee8eabc to 37c7c52 Compare January 31, 2024 23:26
@hstove hstove force-pushed the feat/signer-cli-stacking-sig branch from 00d67fd to 56c1dd6 Compare January 31, 2024 23:27
@hstove hstove linked an issue Feb 1, 2024 that may be closed by this pull request
@hstove hstove force-pushed the feat/signer-delegate-control branch 2 times, most recently from 381525b to 53427cf Compare February 2, 2024 21:07
@hstove hstove force-pushed the feat/signer-cli-stacking-sig branch 2 times, most recently from 2b2b71a to aadf908 Compare February 6, 2024 20:14
@hstove hstove force-pushed the feat/signer-cli-stacking-sig branch from aadf908 to 7433864 Compare February 6, 2024 21:35
Copy link
Collaborator

@jferrant jferrant left a comment

Choose a reason for hiding this comment

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

LGTM :D Thankss for doing this!


#[derive(Parser, Debug, Clone)]
/// Arguments for the generate-stacking-signature command
pub struct GenerateStackingSignatureArgs {
Copy link
Member

@zone117x zone117x Feb 8, 2024

Choose a reason for hiding this comment

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

It would be useful to have test vectors with hex strings, e.g. containing the serialized payload for this struct. That way other folks could leverage the same vectors to be more confident in their implementation (like in a js one).

Not super important though unless we actually envision needing to implement similar code in js any time soon.

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.

LGTM, thanks @hstove!

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.

Thanks for this @hstove! Is there a way to test this in an integration test, so as to verify that the output of this command can be used in pox-4 for a stacking signature?

Base automatically changed from feat/signer-delegate-control to next February 8, 2024 21:18
@hstove hstove marked this pull request as ready for review February 9, 2024 00:07
@hstove hstove requested a review from jcnelson February 9, 2024 00:18
@hstove
Copy link
Contributor Author

hstove commented Feb 9, 2024

Is there a way to test this in an integration test, so as to verify that the output of this command can be used in pox-4 for a stacking signature?

Good call, added!

@saralab saralab merged commit 9690ecd into next Feb 9, 2024
2 checks passed
@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 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signer CLI command to generate Stacking transaction information
6 participants