-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
This commit moves to batch queries when responding to QueryCandidateVotes messages. This simplifies the code in the provisioner and dispute-coordinator by no longer requiring to make use of a FuturesOrdered when awaiting multiple quries. Instead, the provisioner need only request the batch itself.
cd0a9fe
to
681aece
Compare
dc932bc
to
39ab51b
Compare
39ab51b
to
0aeee12
Compare
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.
Migrated comments from the other PR over.
#3447 was closed when another PR was merged. I just noticed today.
)? { | ||
query_output.push(v.into()); | ||
} else { | ||
return Err( |
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.
@rphmeier Here is the modification that ensures we only respond if every (session_index, candidate_hash)
exists in the db or we return an error.
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.
This is returning an io Error from the entire subsystem. We should probably just log something and continue. There's no need to break the message processing loop.
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.
It's important to make a distinction between errors the subsystem encounters while processing requests and requests the subsystem can't fulfill, but is fine with being able to skip those. As written, any request referencing missing data could interrupt the subsystem and potentially take it down.
Err(oneshot::Canceled) => { | ||
tracing::debug!( | ||
target: LOG_TARGET, | ||
"Unable to query candidate votes - subsystem disconnected?", |
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.
@rphmeier Added the added debug!
log
Is this still missing guide changes? |
bab0be5
to
c5ebfb4
Compare
Added guide changes and moved away from the all-or-nothing model. Instead, the session_index and candidate_hash are being sent in the response. This removes the need for a clone and seems to handle the overall behavior in a cleaner fashion. |
This PR modifies the communication protocol between the provisioner and the dispute-coordinator. In the past, the dispute-coordinator kept track of a FuturesOrdered of oneshot-receivers and constructed a view of the recent disputes in this fashion.
Instead, it is more efficient to allow batch queries and only iterator over the recent disputes once. We leverage a single oneshot channel to reply to the batch Vec<(SessionIndex, CandidateHash)> request with the Vec<(SessionIndex, Candidatehash, CandidateVotes)> batch response.
Closes #3439