-
Notifications
You must be signed in to change notification settings - Fork 681
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
Accept out-of-order votes #4327
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic change that removes asserting that rounds-check / out-of-order-votes LGTM.
Only have one NIT re: error messages.
Note that we have an consistency in formatting. In pox-4 the error constants are stored as an Int, in this contract, the error constants are stored as (err uint).
No preference for either format but preferable we stick to a single syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. The spec requires out-of-order votes?
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## next #4327 +/- ##
===========================================
- Coverage 72.17% 54.77% -17.40%
===========================================
Files 445 445
Lines 317208 317198 -10
===========================================
- Hits 228945 173757 -55188
- Misses 88263 143441 +55178 ☔ View full report in Codecov by Sentry. |
@MarvinJanssen Yes, as discussed with @kantai in https://nakamotoslack.slack.com/archives/C067BHSN1SL/p1706799771752509?thread_ts=1706690349.397339&cid=C067BHSN1SL Are you read to approve this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting a hold on this for the time being; it's not ready to merge. Will update with more details later.
…rk/stacks-core into fix/pox-4-vote-out-of-order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a few nits, I think this test should evaluate the contract state after the TX's are confirmed (via read-only calls)
|
||
// first vote should succeed | ||
let tx1 = &receipts[receipts.len() - 2]; | ||
let tx1 = &receipts[receipts.len() - 3]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's better to use explicit nonces to avoid these kind of off-by-one errors
@@ -350,7 +359,7 @@ fn vote_for_aggregate_public_key_in_last_block() { | |||
); | |||
|
|||
// second vote should fail with duplicate vote error | |||
let tx2 = &receipts[receipts.len() - 1]; | |||
let tx2 = &receipts[receipts.len() - 2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also better to use explicit names for the tx instead of tx2
. I'd have to read too much into the test just to find out what tx this is testing
Value::Response(ResponseData { | ||
committed: true, | ||
data: Box::new(Value::Bool(true)) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value::Response(ResponseData { | |
committed: true, | |
data: Box::new(Value::Bool(true)) | |
}) | |
Value::okay_true() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it's not this PR's code but Value::error(Value::UInt(10002)).unwrap()
for errors
…rk/stacks-core into fix/pox-4-vote-out-of-order
These changes are now included in #4360. |
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. |
Description
Currently,
.signer-voting
rejects votes that are not for the latest round.This PR removes this restriction. Votes out of round are accepted.
Applicable issues
.signer-voting
need to accept out of round votes #4322Additional info (benefits, drawbacks, caveats)
Checklist
docs/rpc/openapi.yaml
andrpc-endpoints.md
for v2 endpoints,event-dispatcher.md
for new events)clarity-benchmarking
repobitcoin-tests.yml