Refactor payload_attestation_service and add payload attestation test to validator client#9357
Conversation
jimmygchen
left a comment
There was a problem hiding this comment.
@chong-he nice work overall! just a few small comments, let me know your thoughts.
| ); | ||
| let body = request.body().expect("Failed to get request body"); | ||
|
|
||
| let message = PayloadAttestationMessage::from_ssz_bytes(body) |
There was a problem hiding this comment.
The request payload is a list of messages, so this won't work when multiple messages are submitted. May be worth adding a test for this scenario too
There was a problem hiding this comment.
We should be able to handle multiple messages for the real endpoint right? In that case, I should modify the mock_beacon_node to handle that, and then add a test for multiple messages. Sounds good?
|
This PR refactors the code to decouple the functions It is now ready for review. |
| return; | ||
| }; | ||
|
|
||
| self.produce_and_publish(attestation_slot).await; |
There was a problem hiding this comment.
I think we want to keep the self.executor.spawn we had before when calling self.produce_and_publish, so a slow response from BN doesn't block the next update task.
| slot_clock = { workspace = true } | ||
| task_executor = { workspace = true } | ||
| tokio = { workspace = true } | ||
| tokio = { workspace = true, features = ["rt-multi-thread", "sync", "signal", "macros", "test-util"] } |
There was a problem hiding this comment.
The test features can go into the dev-dependencies section, so we can keep these out of production builds.
| ); | ||
| let body = request.body().expect("Failed to get request body"); | ||
|
|
||
| let message = <PayloadAttestationMessage>::ssz_fixed_len(); |
There was a problem hiding this comment.
nit: rename variable to chunk_size
jimmygchen
left a comment
There was a problem hiding this comment.
Nice, i think we can merge after fixing the self.executor.spawn issue commented above
payload_attestation_service and add payload attestation test to validator client
Thanks for the review. I address the comments in 04fba50. Re on the |
jimmygchen
left a comment
There was a problem hiding this comment.
Thanks @chong-he ! looks great
Merge Queue Status
This pull request spent 29 minutes 57 seconds in the queue, including 27 minutes 55 seconds running CI. Required conditions to merge
|
Additional Info
Heavily AI-assisted using Claude Code.
Thanks @jimmygchen for the help along the way.