Skip to content

Best Attestation Data strategy - exit hard timeout loop immediately upon receiving the first response #297

@oleg-ssvlabs

Description

@oleg-ssvlabs

Description
I was reviewing how soft and hard timeouts work in the Best Attestation Data strategy and noticed a potential improvement in the flow.

From my understanding, the current behavior is as follows:

  • When the soft timeout is reached: If at least one response is received, the hard timeout loop will not be entered. This means that the first available response will be returned from the AttestationData() method. This suggests that the application considers a single response sufficient and it is not worth to wait for additional responses(time is the price to pay) that could improve response quality evaluation and selection of the best one.
  • When the soft timeout is reached and no response is received: The application enters the hard timeout loop. However, once the first response is received, the application does not immediately exit the loop. Instead, it continues waiting until the hard timeout is reached or all responses/errors have been collected.

Proposed Improvement
When the application enters the hard timeout loop and at least one response is received, it should immediately exit the loop rather than waiting for all responses/errors or hard timeout. I think it aligns better with the implementation logic.

Please let me know if I understood the flow correctly.
Thank you

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