Skip to content
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

Handle Syncing Executon Client #13597

Merged
merged 3 commits into from
Feb 9, 2024
Merged

Handle Syncing Executon Client #13597

merged 3 commits into from
Feb 9, 2024

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Feb 8, 2024

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

Handles the case where an EL is syncing and cannot provide us with the desired payloads.

Which issues(s) does this PR fix?

Fixes #13566

Other notes for review

@nisdas nisdas added the Ready For Review A pull request ready for code review label Feb 8, 2024
@nisdas nisdas requested a review from a team as a code owner February 8, 2024 11:17
@@ -649,6 +651,10 @@ func (s *Service) retrievePayloadsFromExecutionHashes(
return nil, fmt.Errorf("could not fetch payload bodies by hash %#x: %v", executionHashes, err)
}

if len(payloadBodies) != len(executionHashes) {
Copy link
Contributor

@nalepae nalepae Feb 8, 2024

Choose a reason for hiding this comment

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

Should not this check be directly in the GetPayloadBodiesByHash function?

According to the specification, is such a length mismatch happens, it is a bug in the EL.

Client software MUST place responses in the order given in the request, using null for any missing blocks. For instance, if the request is [A.block_hash, B.block_hash, C.block_hash] and client software has data of payloads A and C, but doesn't have data of B, the response MUST be [A.body, null, C.body].

If this check is written directly in the GetPayloadBodiesByHash function, then all calls to this function will benefit of this check.

In the contrary, all callers of GetPayloadBodiesByHashwill need to do the same check.

Copy link
Member Author

Choose a reason for hiding this comment

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

In the case referenced in the issue description the node is optimistically syncing which indicates that the EL might have just come online, which is why they return nothing instead of empty payloads. It might be a race condition on the EL's side but in the event of bugs across different clients we can just handle it on our end. I have pushed up the change to handle the mismatch in the function

terencechain
terencechain previously approved these changes Feb 9, 2024
@nisdas nisdas added this pull request to the merge queue Feb 9, 2024
Merged via the queue into develop with commit a0787e2 Feb 9, 2024
17 checks passed
@nisdas nisdas deleted the fixPanicWithEL branch February 9, 2024 09:29
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic occurred" error="runtime error: index out of range [0] with length 0"
3 participants