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

Ensure that fork version is 4 bytes #395

Merged
merged 1 commit into from
Nov 4, 2022
Merged

Ensure that fork version is 4 bytes #395

merged 1 commit into from
Nov 4, 2022

Conversation

jtraglia
Copy link
Collaborator

@jtraglia jtraglia commented Nov 4, 2022

📝 Summary

If a custom genesis fork version that's fewer than 4 bytes (e.g., -genesis-fork-version 0xabcd) is specified, the missing bytes will be filled with "random" bytes (e.g., 0xabcd6364). This PR will return an error if the fork version isn't exactly 4 bytes. Previously, it only returned an error if it was greater than 4 bytes.

⛱ Motivation and Context

Fixes #277.

✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy

@codecov-commenter
Copy link

Codecov Report

Merging #395 (2fbac58) into main (f146349) will decrease coverage by 0.33%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #395      +/-   ##
==========================================
- Coverage   66.07%   65.74%   -0.34%     
==========================================
  Files           7        7              
  Lines         902      902              
==========================================
- Hits          596      593       -3     
- Misses        271      273       +2     
- Partials       35       36       +1     
Flag Coverage Δ
unittests 65.74% <0.00%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/utils.go 75.67% <0.00%> (ø)
server/service.go 76.95% <0.00%> (-0.70%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jtraglia jtraglia merged commit 2f3a1c2 into flashbots:main Nov 4, 2022
@jtraglia jtraglia deleted the update-fork-version-check branch November 4, 2022 16:01
screwyprof pushed a commit to screwyprof/mev-boost that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Truncated fork version hex results in corrupted data
3 participants