Skip to content

Conversation

@nadtech-hub
Copy link

This one should close #7983

Signed-off-by: Aliaksei Misiukevich <taberlick@gmail.com>
@nadtech-hub nadtech-hub changed the title Combining distributed and non selection proofs (#7983) Combining distributed and non selection proofs Oct 16, 2025
@cla-assistant
Copy link

cla-assistant bot commented Oct 16, 2025

CLA assistant check
All committers have signed the CLA.

@nadtech-hub nadtech-hub changed the title Combining distributed and non selection proofs Combining (non)-distributed selection proofs Oct 16, 2025
}
}
for (validator_start_slot, duty) in pre_compute_duties {
if slot < *validator_start_slot {
Copy link
Author

@nadtech-hub nadtech-hub Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doubting to keep this case and was wondering why it was only seen in distributed mode
@michaelsproul

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only in the non-distributed mode now, I can't recall why I didn't have that in the distributed mode, but I think we can keep this

@nadtech-hub nadtech-hub reopened this Oct 18, 2025
@chong-he chong-he added val-client Relates to the validator client binary ready-for-review The code is ready for review code-quality labels Dec 17, 2025
@chong-he chong-he self-requested a review December 17, 2025 00:01
@mergify
Copy link

mergify bot commented Dec 17, 2025

Some required checks have failed. Could you please take a look @nadtech-hub? 🙏

@mergify mergify bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Dec 17, 2025
Copy link
Member

@chong-he chong-he left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nadtech-hub , can you update the target branch to unstable?

Some review comments below, thanks

Comment on lines -691 to -696
debug!(
period = sync_committee_period,
%current_slot,
%pre_compute_slot,
"Calculating sync selection proofs"
);
Copy link
Member

@chong-he chong-he Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log is completely removed, but we would want this log in the normal/non-distributed case, together with the log about Finished computing sync selection proofs, so that we can know how long it took to compute the selection proofs.

But for distributed case, this will not be accurate because it involves sending the request to the middleware and waiting to hear from them. What we could do is to add a condition that under distributed/parallel_sign case, we don't log this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your comment is confusing, logging time in parallel mode is incorrect but the debug needs to be activated in parallel mode anyway

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I miss a "don't" in the comment, edited as above. What I mean is, under parallel_sign case, we don't log this; and under normal case, we log it (which is what it does currently)

Comment on lines -784 to -790
if num_validators_updated > 0 {
debug!(
%slot,
updated_validators = num_validators_updated,
"Finished computing sync selection proofs"
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to the comment about calculating sync selection proofs, the same applies here

let sync_map = duties_service.sync_duties.committees.read();
let Some(committee_duties) = sync_map.get(&sync_committee_period) else {
debug!(period = sync_committee_period, "Missing sync duties");
debug!("period" = sync_committee_period, "Missing sync duties");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the original code has the double quote but it's not necessary to have that

Suggested change
debug!("period" = sync_committee_period, "Missing sync duties");
debug!(period = sync_committee_period, "Missing sync duties");

Comment on lines +659 to +664
validator_index,
"slot" = %proof_slot,
"subcommittee_index" = *subnet_id,
// log full selection proof for debugging
"full selection proof" = ?proof,
"Validator is sync aggregator"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of combining both normal and distributed cases, the "full selection proof" will make it confusing, I suggest we just stick to selection_proof, and keep the comment to indicate it is a full selection proof

Also we can remove the double quotes in the fields, I am not sure why I put them there in the past

Suggested change
validator_index,
"slot" = %proof_slot,
"subcommittee_index" = *subnet_id,
// log full selection proof for debugging
"full selection proof" = ?proof,
"Validator is sync aggregator"
validator_index,
slot = %proof_slot,
subcommittee_index = *subnet_id,
// In distributed mode, this is the full selection proof
selection_proof = ?proof,
"Validator is sync aggregator"

Comment on lines -770 to -776
let num_validators_updated = validator_proofs.len();

for (validator_index, proofs) in validator_proofs {
if let Some(Some(duty)) = validators.get(&validator_index) {
duty.aggregation_duties.proofs.write().extend(proofs);
} else {
debug!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep this part of the code until the end of this debug log

@nadtech-hub
Copy link
Author

I'll update tonight, sorry for delay

@nadtech-hub nadtech-hub changed the base branch from stable to unstable December 19, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality val-client Relates to the validator client binary waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

De-duplicate sync selection proof logic (distributed vs non-distributed)

2 participants