-
Notifications
You must be signed in to change notification settings - Fork 274
Split functionality into three files #729
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
Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #729 +/- ##
===========================================
- Coverage 43.84% 43.67% -0.17%
===========================================
Files 15 18 +3
Lines 1608 1708 +100
===========================================
+ Hits 705 746 +41
- Misses 847 904 +57
- Partials 56 58 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| func (m *BoostService) respondPayload(w http.ResponseWriter, log *logrus.Entry, result *builderApi.VersionedSubmitBlindedBlockResponse, originalBid bidResp) { | ||
| // If no payload has been received from relay, log loudly about withholding! | ||
| if result == nil || getPayloadResponseIsEmpty(result) { | ||
| if result == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a notable change. I've removed getPayloadResponseIsEmpty (only exists in verifyPayload now). I do not believe it's necessary to check this here but I could be wrong. If the response is empty, verifyPayload will return a nil result and this will respond with an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this prevents us from accessing nil fields. I don't know if those are set during the unmarshalling. If the are, I think we can remove this check
|
I'm going to close this & break it up into a few PRs. |
📝 Summary
I think "functionality" is a bit too vague. Splitting things up makes sense IMO:
register_validator.go-- implementsregisterValidatorget_header.go-- implementsgetHeaderget_payload.go-- implementsgetPayloadAlso does some intermediate refactoring, particularly in
getPayload.✅ I have run these commands
make lintmake test-racego mod tidy