Skip to content

fix(adkg): concurrency issue when waiting for RBCs#256

Open
azixus wants to merge 9 commits intomainfrom
fix/adkg/rbc-wait
Open

fix(adkg): concurrency issue when waiting for RBCs#256
azixus wants to merge 9 commits intomainfrom
fix/adkg/rbc-wait

Conversation

@azixus
Copy link
Contributor

@azixus azixus commented Dec 11, 2025

Two issues are fixed in that PR.

The first is to wait for RBC instances to completes once all ABAs have been completed. Not a bug, but otherwise the ABAs may run for longer, which results in unnecessary communications.

The second issue, was more problematic, but with low probability of occurring. Essentially, before executing the final RBC, we were waiting as follows:

loop {
  if rbc_input \subset current_acss_completed
    break;
  else
    await register_notification();
}

With the way the notification system works, a permit is only stored if a thread is already waiting, otherwise, no permit was issued. This means that if the notification occurred right after the condition, and before we actually await on the notification, it would be missed.

I fixed it by registering for the notification prior to checking the condition:

loop {
  notification = register_notification();
  if rbc_input \subset current_acss_completed
    break;
  else
    await notification;
}

Copy link
Contributor

@AnomalRoil AnomalRoil 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 little question and a reminder.

Base automatically changed from fix/adkg/mvba to main January 28, 2026 13:55
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.

2 participants