Skip to content

Re-think timeouts for getPayload #3956

Open
@michaelsproul

Description

@michaelsproul

Description

Presently Lighthouse uses a 2 second timeout for getPayload, both when requesting a blinded block and when requesting a full block.

pub const ENGINE_GET_PAYLOAD_TIMEOUT: Duration = Duration::from_secs(2);

This means that if the EL is slow we could slow down blinded block proposals to the point where they exceed the 4s attestation deadline. We wait for the maximum of the builder/EL response times here:

// Wait for the builder *and* local EL to produce a payload (or return an error).
let ((relay_result, relay_duration), (local_result, local_duration)) = tokio::join!(
timed_future(metrics::GET_BLINDED_PAYLOAD_BUILDER, async {
builder
.get_builder_header::<T, Payload>(slot, parent_hash, &pubkey)
.await
}),
timed_future(metrics::GET_BLINDED_PAYLOAD_LOCAL, async {
self.get_full_payload_caching::<Payload>(
parent_hash,
timestamp,
prev_randao,
suggested_fee_recipient,
forkchoice_update_params,
)
.await
})
);

For the builder's payload, we will then also need to wait for the block to be un-blinded after signing, which adds yet more latency. With a 500ms offset from the start of the slot (due to e.g. attestation packing) plus 2 seconds of EL response time (worst-case) plus 1s for the VC to sign, unblind, and for the BN+relay to broadcast, we are cutting very close to the 4s deadline.

Steps to resolve

The engine API spec uses a 1s timeout for getPayload at all times, which would be more consistent. However I think it could be advantageous to retain the longer timeout for full blocks and just use the shorter 1s timeout for blinded blocks. I think this could be implemented in a straight-forward way by passing the timeout to get_full_payload_caching. This might be worth implementing after the capella branch is merged, as it also makes a lot of changes to these code paths.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions