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

SSE Payload Attributes subscription #318

Merged
merged 9 commits into from
Mar 29, 2023
Merged

SSE Payload Attributes subscription #318

merged 9 commits into from
Mar 29, 2023

Conversation

avalonche
Copy link
Collaborator

📝 Summary

Adds SSE payload attributes subscription on the relay.

⛱ Motivation and Context

As part of ethereum/beacon-APIs#305 SSE endpoint providing payload attributes allows the relay to retrieve prev_randao and withdrawals with a custom BN fork to retrieve this information.

📚 References


✅ 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-commenter commented Mar 21, 2023

Codecov Report

Merging #318 (32a2e6e) into main (6640511) will decrease coverage by 0.41%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #318      +/-   ##
==========================================
- Coverage   18.34%   17.94%   -0.41%     
==========================================
  Files          20       20              
  Lines        3559     3639      +80     
==========================================
  Hits          653      653              
- Misses       2826     2905      +79     
- Partials       80       81       +1     
Flag Coverage Δ
unittests 17.94% <0.00%> (-0.41%) ⬇️

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

Impacted Files Coverage Δ
beaconclient/mock_beacon_instance.go 65.71% <0.00%> (-0.96%) ⬇️
beaconclient/multi_beacon_client.go 48.43% <0.00%> (-1.04%) ⬇️
beaconclient/prod_beacon_instance.go 18.32% <0.00%> (-3.31%) ⬇️
services/api/service.go 13.08% <0.00%> (-0.61%) ⬇️

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

services/api/service.go Outdated Show resolved Hide resolved
services/api/service.go Outdated Show resolved Hide resolved
}
log := api.log.WithField("proposalSlot", proposalSlot)

log.Info("updating payload attributes")
Copy link
Collaborator

Choose a reason for hiding this comment

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

this function will be called multiple times for each payload attributes -- namely once per CL client. therefore this function should somehow guard against it.

question: do we need to support multiple parents? or do we just always use the latest received one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

makes sense to compare the parent hash as well but I think we can use the hash from the "best" BN from in the multi-BN instance to keep consistent state?

services/api/service.go Outdated Show resolved Hide resolved
services/api/service.go Outdated Show resolved Hide resolved
services/api/service.go Outdated Show resolved Hide resolved
@metachris metachris requested a review from Ruteri March 22, 2023 10:29
services/api/service.go Outdated Show resolved Hide resolved
services/api/service.go Outdated Show resolved Hide resolved
services/api/service.go Outdated Show resolved Hide resolved
@avalonche avalonche force-pushed the sse-subscription branch 2 times, most recently from 9da38d0 to cd56de9 Compare March 27, 2023 20:59
@metachris
Copy link
Collaborator

Deployed to Sepolia and Zhejiang testnets!

@metachris metachris merged commit fc0c773 into main Mar 29, 2023
@metachris metachris deleted the sse-subscription branch March 29, 2023 10:21
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