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

fix: gocognit on publish block and fixing publish blinded block header check #14913

Merged
merged 6 commits into from
Feb 11, 2025

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Feb 11, 2025

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

a continuation of #14897 that fixes the publish blinded block endpoints and re-factors the code to remove the gocognit error as well as easier handling of future hard fork types.

note this PR is required to fix electra setups with a validator running in REST mode with mevboost.

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

@james-prysm james-prysm added Bug Something isn't working API Api related tasks Cleanup Code health! Builder PR or issue that supports builder related work labels Feb 11, 2025
@james-prysm james-prysm requested a review from a team as a code owner February 11, 2025 19:08
@james-prysm james-prysm requested review from prestonvanloon and rkapka and removed request for dB2510 February 11, 2025 19:09
@james-prysm james-prysm changed the title refactored code and added in checks for blinded endpoints fix: gocognit on publish block and fixing publish blinded block header check Feb 11, 2025
@james-prysm james-prysm added the Electra electra hardfork label Feb 11, 2025
writer.Body = &bytes.Buffer{}
server.PublishBlindedBlock(writer, request)
assert.Equal(t, http.StatusBadRequest, writer.Code)
assert.StringContains(t, fmt.Sprintf("could not decode request body into %s consensus block", version.String(version.Phase0)), writer.Body.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you either add a comment why the error string should contain version.Phase0 or change the test name to "Blinded Electra block without version header on Phase0 fork"?

@james-prysm james-prysm added this pull request to the merge queue Feb 11, 2025
Merged via the queue into develop with commit 1502583 Feb 11, 2025
17 checks passed
@james-prysm james-prysm deleted the blockv2-cognit branch February 11, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Bug Something isn't working Builder PR or issue that supports builder related work Cleanup Code health! Electra electra hardfork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants