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 cleanup] fix handleGetPayload to save every payload once the signature is verified #512

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

michaelneuder
Copy link
Collaborator

📝 Summary

Previously, the payloads were only saved by the goroutine at the end of the function if the publication was successful. This caused an issue where we didn't save a delivered payload despite receiving a valid signature from the proposer.

I modified the function to be deferred immediately after the signature is successfully verified.

⛱ Motivation and Context

Once the signature is verified, the payload should be saved no matter what. Even if the publication fails for whatever reason, we want to store the cryptographic evidence that the proposer signed the header.


✅ 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 #512 (3462896) into main (13ede49) will increase coverage by 0.01%.
The diff coverage is 0.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     #512      +/-   ##
==========================================
+ Coverage   31.70%   31.72%   +0.01%     
==========================================
  Files          24       24              
  Lines        4860     4858       -2     
==========================================
  Hits         1541     1541              
+ Misses       3127     3125       -2     
  Partials      192      192              
Flag Coverage Δ
unittests 31.72% <0.00%> (+0.01%) ⬆️

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

Files Changed Coverage Δ
services/api/service.go 37.91% <0.00%> (+0.04%) ⬆️

@michaelneuder michaelneuder merged commit 5dc019f into main Aug 30, 2023
4 checks passed
@michaelneuder michaelneuder deleted the mikeneuder-2023-08-29 branch August 30, 2023 14:04
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