Skip to content

Spec discrepancy for when attestations can be sent #8616

@0xmrree

Description

@0xmrree

Description

In the phase0 validator spec we have:

A validator should create and broadcast the attestation to the associated
attestation subnet when either (a) the validator has received a valid block from
the expected block proposer for the assigned slot or (b)
get_attestation_due_ms(epoch) milliseconds has transpired since the start of
the slot -- whichever comes first.

Currently lighthouse validator client unconditionally follows the (b) case and never sends the attestations out early as in the (a) case defined in the spec. We can see this as we only start the attestation tasks after 1/3 of the slot time has passed. https://github.com/sigp/lighthouse/blob/stable/validator_client/validator_services/src/attestation_service.rs#L163

let interval_fut = async move {
    loop {
        if let Some(duration_to_next_slot) = self.slot_clock.duration_to_next_slot() {
            sleep(duration_to_next_slot + slot_duration / 3).await; // <-- HERE!

            if let Err(e) = self.spawn_attestation_tasks(slot_duration) {
            ...
    }
};

Should lighthouse send attestations out early if the node gets a proposed block before the time defined by ATTESTATION_DUE_BPS? (or further ATTESTATION_DUE_BPS_GLOAS) so that we match the spec behavior?

Note

The fact that sleep uses magic / 3 instead ATTESTATION_DUE_BPS: 3333 is talked about separately here: #8615

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions