Skip to content

Feat/signer two phase commit impl #6319

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

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

jferrant
Copy link
Contributor

@jferrant jferrant commented Jul 21, 2025

Closes #6099

@jferrant jferrant requested review from a team as code owners July 21, 2025 21:59
@aldur aldur linked an issue Jul 22, 2025 that may be closed by this pull request
hstove
hstove previously approved these changes Jul 31, 2025
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.

LGTM! Just a few nits. I found your logic very easy to follow

Signed-off-by: Jacinta Ferrant <[email protected]>
@jferrant jferrant force-pushed the feat/signer-two-phase-commit-impl branch from bd04283 to e304a48 Compare August 1, 2025 20:48
@jferrant jferrant force-pushed the feat/signer-two-phase-commit-impl branch from d46d4ec to 0375c72 Compare August 5, 2025 20:13
@jferrant jferrant requested a review from hstove August 5, 2025 21:22
@jferrant jferrant requested a review from obycode August 5, 2025 21:22
@jferrant jferrant assigned jferrant and unassigned jcnelson and kantai Aug 5, 2025
@jferrant jferrant requested review from jcnelson and kantai August 5, 2025 21:22
hstove
hstove previously approved these changes Aug 5, 2025
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.

Overall LGTM! Just one tiny nit about some debug logs

hstove
hstove previously approved these changes Aug 5, 2025
@jferrant jferrant requested a review from fdefelici August 7, 2025 21:51
Comment on lines 1290 to 1405
let block_response = self.create_block_acceptance(&block_info.block);
self.send_block_pre_commit(signer_signature_hash);
// have to save the signature _after_ the block info
self.handle_block_signature(stacks_client, block_response.as_block_accepted()?);
Some(block_response)
let address = self.stacks_address;
self.handle_block_pre_commit(stacks_client, &address, &signer_signature_hash);
Copy link
Contributor

Choose a reason for hiding this comment

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

This behavior has to be gated by the signer protocol version, right? Otherwise, when signers upgrade, they won't sign blocks until 70% of signers upgrade.

Copy link
Contributor Author

@jferrant jferrant Aug 15, 2025

Choose a reason for hiding this comment

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

They still work with unupgraded signers. They just treat signatures as pre commits if they haven't seen a pre commit from the signer yet. (I have tested this exact scenario in a docker container successfully)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does mean though that upgraded signers send a message that unupgraded signers ignore. Eventualyl though upgraded signers see 70% weight signatures (which they have treated as commits) and issue their signature which unupgraded signers accept no problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an integration test to demonstrate how it works with unupgraded vs upgraded signers: see a584982

@jferrant jferrant requested a review from kantai August 16, 2025 03:22
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.

Signer State Agreement: Two Phase Commit
4 participants