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/stacks signer block proposal #4130

Merged
merged 27 commits into from
Jan 16, 2024
Merged

Conversation

jferrant
Copy link
Collaborator

@jferrant jferrant commented Dec 6, 2023

Description

This is a rather large PR...please forgive.

major changes include:

  • Complete reorg of the stacker db and stacks clients
  • Complete reorg of the signer integration tests for easier adding of tests
  • Changing libsigner to take SignerEvents rather than StackerDBEvents as we now need to subscribe to blocks
  • Handling the new block proposal events within Stacks signer
  • Added a test to handle a validated block (against the RPC endpoint)
  • Enabled stackerdb_dkg_sign test as well since I made substantial changes to the test layout to ensure it still works

Applicable issues

Additional info (benefits, drawbacks, caveats)

Major items left to do that are NOT included in this PR

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

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

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

Comparison is base (15e76e5) 83.13% compared to head (52ccb11) 72.36%.

Files Patch % Lines
testnet/stacks-node/src/tests/signer.rs 79.20% 63 Missing ⚠️
stacks-signer/src/client/stackerdb.rs 69.62% 24 Missing ⚠️
libsigner/src/events.rs 65.15% 23 Missing ⚠️
stacks-signer/src/runloop.rs 83.05% 20 Missing ⚠️
stacks-signer/src/main.rs 0.00% 19 Missing ⚠️
libsigner/src/tests/mod.rs 86.95% 3 Missing ⚠️
stackslib/src/net/api/postblock_proposal.rs 85.00% 3 Missing ⚠️
stacks-signer/src/cli.rs 0.00% 2 Missing ⚠️
stacks-signer/src/client/stacks_client.rs 96.49% 2 Missing ⚠️
stacks-signer/src/client/mod.rs 93.75% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff             @@
##             next    #4130       +/-   ##
===========================================
- Coverage   83.13%   72.36%   -10.77%     
===========================================
  Files         430      432        +2     
  Lines      306345   306587      +242     
===========================================
- Hits       254679   221867    -32812     
- Misses      51666    84720    +33054     

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

@jferrant jferrant force-pushed the feat/stacks-signer-block-proposal branch from c475d16 to 7121809 Compare December 11, 2023 14:00
@jferrant jferrant force-pushed the feat/stacks-signer-block-proposal branch 2 times, most recently from 1f6cc95 to 7db8548 Compare January 10, 2024 14:40
@jferrant jferrant force-pushed the feat/stacks-signer-block-proposal branch 5 times, most recently from 712ff7d to b04ea0a Compare January 11, 2024 19:15
@jferrant jferrant marked this pull request as ready for review January 11, 2024 20:49
Cargo.toml Outdated Show resolved Hide resolved
libsigner/src/events.rs Outdated Show resolved Hide resolved
stacks-signer/src/lib.rs Outdated Show resolved Hide resolved
@jferrant jferrant force-pushed the feat/stacks-signer-block-proposal branch from f3967ab to f65a9ef Compare January 12, 2024 13:39
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
…re to be across signature hash

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
…rom signature

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
…rom signature

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
@jferrant jferrant force-pushed the feat/stacks-signer-block-proposal branch from f65a9ef to bef5177 Compare January 12, 2024 13:40
…24 in stacks-signer code

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
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.

This looks great to me, just had a few comments

…vert postblock_proposal api changes

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
@jferrant jferrant requested a review from kantai January 12, 2024 20:58
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
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!

@@ -0,0 +1,197 @@
use blockstack_lib::burnchains::Txid;
use blockstack_lib::chainstate::nakamoto::NakamotoBlock;
use blockstack_lib::net::api::postblock_proposal::{BlockValidateReject, ValidateRejectCode};
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this stackslib:: now, instead of blockstack_lib?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't find it that way. as far as I am aware its still blockstack_lib. Can find no instance of stackslib::* throughout the code base.

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.

Just a couple comments. Thanks!

…StackerDBChunksEvent to event.rs

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
@jferrant jferrant merged commit f394a3b into next Jan 16, 2024
1 of 2 checks passed
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

3 participants