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

[code health] Refactor fee recipient check in handleSubmitNewBlock #479

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

michaelneuder
Copy link
Collaborator

📝 Summary

Pull the fee recipient check into an independent function. This is the first PR in a set to refactor the handleSubmitNewBlock function to be more modular. This increases readability and unit-testability of the components that make up a block submission, and allows for this logic to be reused in other block submission paths.

⛱ Motivation and Context

In order to make #466 easier to review, we want to refactor some of the block submission path to be reusable for v2 optimistic submissions. This has the nice added benefit of improving the code health of the relay as a whole, which is a nice perk :-)

📚 References

https://notes.ethereum.org/@mikeneuder/optimistic-v2 describes the status of v2 optimistic relaying.


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@codecov-commenter
Copy link

Codecov Report

Merging #479 (3922f05) into main (372dcd1) will increase coverage by 0.26%.
The diff coverage is 95.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #479      +/-   ##
==========================================
+ Coverage   30.58%   30.84%   +0.26%     
==========================================
  Files          24       24              
  Lines        4783     4788       +5     
==========================================
+ Hits         1463     1477      +14     
+ Misses       3121     3113       -8     
+ Partials      199      198       -1     
Flag Coverage Δ
unittests 30.84% <95.00%> (+0.26%) ⬆️

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

Impacted Files Coverage Δ
services/api/service.go 34.94% <95.00%> (+0.72%) ⬆️

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.

3 participants