-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[dag] cache votes without re-counting #11808
Conversation
⏱️ 3h 25m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
9604403
to
a184dfa
Compare
consensus/src/dag/dag_store.rs
Outdated
} | ||
|
||
for parent in node.parents_metadata() { | ||
let voting_power = self |
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.
you can move this outside, no?
consensus/src/dag/dag_store.rs
Outdated
.expect("must exist"); | ||
match node_status { | ||
Some(NodeStatus::Unordered { | ||
votes_culumative_voting_power, |
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.
I'd call it weak_vote and strong_vote correspondingly
.expect("must exist"); | ||
let node_status = self | ||
.get_node_ref_mut(parent.round(), parent.author()) | ||
.expect("must exist"); |
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.
just add another expect here instead of unreachable below?
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.
we need a mutable reference to node_status. If i expect, then I wont get a reference to the Option in BTreeMap.
_ = tx.take().expect("must exist").send(certificate); | ||
} | ||
|
||
if partial_signatures.signatures().len() == self.epoch_state.verifier.len() { |
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.
add some comments here to explain why the aggregation is through a channel? I assume it's because we want to keep the rb alive even after cert?
ba071cb
to
1deb748
Compare
a184dfa
to
ae6a329
Compare
1deb748
to
012db41
Compare
ae6a329
to
9a52fb1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
Instead of counting votes each time, this PR adds caching functionality for votes.
Also, checks for epoch when handling a RB node.
Test Plan
Fixed existing tests.