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

Do not accept signatures, block proposals, or block responses for blocks from different reward cycles #5662

Merged
merged 13 commits into from
Jan 10, 2025

Conversation

jferrant
Copy link
Collaborator

@jferrant jferrant commented Jan 6, 2025

Expands upon #5612

Closes #5611

…cks in a different reward cycle

Signed-off-by: Jacinta Ferrant <[email protected]>
@jferrant jferrant requested a review from a team as a code owner January 6, 2025 17:18
@jferrant jferrant requested a review from jcnelson January 7, 2025 15:22
@aldur aldur modified the milestones: 3.1.0.0.3, 3.1.0.0.4, 3.1.0.0.3 Jan 7, 2025
hstove
hstove previously approved these changes Jan 7, 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!

Signed-off-by: Jacinta Ferrant <[email protected]>
Signed-off-by: Jacinta Ferrant <[email protected]>
@aldur aldur modified the milestones: 3.1.0.0.3, 3.1.0.0.4 Jan 8, 2025
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 -- once the integration test is added with injected stackerdb messages, I'll approve.

testnet/stacks-node/src/tests/signer/v0.rs Outdated Show resolved Hide resolved
testnet/stacks-node/src/tests/signer/v0.rs Outdated Show resolved Hide resolved
@jferrant
Copy link
Collaborator Author

jferrant commented Jan 9, 2025

LGTM -- once the integration test is added with injected stackerdb messages, I'll approve.

I don't know what the purpose of injecting stackerdb messages is. I do test already that signers ignore messages based on reward cycle in both integration tests. If we want to have further checks on validity of messages we will need the following implemented #5671.

I think this PR should be merged regardless.

EDIT: Actually, I think there is one additional path that I do not test that I could check with an injection as you suggest. Let me give that a shot quickly.

Signed-off-by: Jacinta Ferrant <[email protected]>
@jferrant jferrant requested review from kantai and hstove January 9, 2025 14:33
@hstove
Copy link
Contributor

hstove commented Jan 9, 2025

I don't know what the purpose of injecting stackerdb messages is.

Maybe you're thinking the same thing (you later said there was a scenario you could think of), but to me the purpose is that signers properly ignore/handle block responses that come from these "other" signers. For example, it could be a malicious signer, or it could just be an un-upgraded signer.

The tests you have assert that signers ignore block proposals, but really what triggered this issue was not ignoring block responses. I do think the code you have in this PR covers the functionality we want already, I just also think this test scenario would be helpful.

@jferrant
Copy link
Collaborator Author

jferrant commented Jan 9, 2025

I don't know what the purpose of injecting stackerdb messages is.

Maybe you're thinking the same thing (you later said there was a scenario you could think of), but to me the purpose is that signers properly ignore/handle block responses that come from these "other" signers. For example, it could be a malicious signer, or it could just be an un-upgraded signer.

The tests you have assert that signers ignore block proposals, but really what triggered this issue was not ignoring block responses. I do think the code you have in this PR covers the functionality we want already, I just also think this test scenario would be helpful.

It kind of already does this. It handles this case by keeping incoming and outgoing signers around and forcing the valid signers to respond. I verify that none of the "not your cycle signers" do nothing in response to the block proposals as well as the signer signatures. I guess I don't explicitly write to the "wrong" signers signer db, but the slot it is written to does not matter in the signer. They don't care who the originator of a message is so I am still testing the same signer side code. I will add one to accomodate the threshold test though to aid in debugging if we ever have some other bug occur specifically at that point.

@aldur
Copy link
Contributor

aldur commented Jan 10, 2025

Release playbook for the code in this PR:

  1. Except for flaky test and clippy tests, CI of this PR must pass;
  2. Once merged to develop, cut a release branch from there;
  3. The release branch is opened as a PR against master (CC @wileyj);
  4. Block replay (takes roughly 12h);
  5. Run a signer and a miner on mainnet for a limited time with the updated code (in parallel with 4);
  6. Deploy to testnet (in parallel with 4 and 5);
  7. Release (assuming all previous steps are successful);

Targeting Monday, but knowing most folks are traveling this might be released on Tuesday.

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, nice test(s)!

@kantai kantai enabled auto-merge January 10, 2025 16:27
@kantai kantai added this pull request to the merge queue Jan 10, 2025
Merged via the queue into develop with commit 9b5621c Jan 10, 2025
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

5 participants