Skip to content

refactor(signature_collector): Remove base_hash #437

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

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

dknopik
Copy link
Member

@dknopik dknopik commented Jul 17, 2025

Consider the comment:

        /// A hash that identifies what we are signing. Note that the actual signing root might be
        /// different - for example, because we are in different beacon chain attestation
        /// committees, and the attestation data differs therefore.
        base_hash: Hash256,

This is example incorrect. Only the actual attestation data is signed - which is the same for all validators. Therefore there is no reason for this base_hash field to exist - we can simply use the signing root for the same purpose.

Additional Info

Also renamed ValidatorSigningData to SigningData now that we also use the data within for committee signature tracking purposes.

@dknopik dknopik added the ready-for-review This PR is ready to be reviewed label Jul 17, 2025
@diegomrsantos diegomrsantos requested a review from Copilot July 18, 2025 12:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the base_hash field from the signature collector system, as the comment indicating it was needed for different signing roots was incorrect. The actual attestation data is the same for all validators, so the signing root can be used directly instead of maintaining a separate base hash.

  • Removed base_hash parameter from SignatureRequester::Committee variant and all related function calls
  • Renamed ValidatorSigningData to SigningData to reflect its broader usage beyond just validator signing
  • Updated all references to use the signing root directly instead of the base hash for committee signature tracking

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
anchor/validator_store/src/lib.rs Removed base_hash parameter from collect_signature method and all its call sites, replaced logic to use Role::Committee check instead
anchor/signature_collector/src/lib.rs Removed base_hash field from SignatureRequester::Committee, renamed ValidatorSigningData to SigningData, updated committee signature tracking to use signing root
Comments suppressed due to low confidence (1)

anchor/validator_store/src/lib.rs:974

  • This line computes data_hash but it's no longer used anywhere in the code after removing the base_hash parameter. This creates unused code that should be removed.
            };

@@ -355,7 +353,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
committee_id,
};

let requester = if let Some(base_hash) = base_hash {
let requester = if role == Role::Committee {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please explain this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review This PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants