-
Notifications
You must be signed in to change notification settings - Fork 927
Always use committee index 0 when getting attestation data #8171
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
base: unstable
Are you sure you want to change the base?
Conversation
| let attestation_data_cache_clone = attestation_data_cache.clone(); | ||
|
|
||
| let attestation_service = self.clone(); | ||
| self.inner.executor.spawn_ignoring_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.
Could use spawn_handle and then await the handle to get the attestation data from inside the future (rather than using the attestation_data_cache RwLock).
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.
In case the handle doesn't return the result, it's an error and we probably need to just stop the attestation process for this slot (return Err(..))
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.
Thank you for the comment, I revised in 0967696
| validator = ?duty.pubkey, | ||
| duty_slot = %duty.slot, | ||
| attestation_slot = %attestation_data.slot, | ||
| duty_index = duty.committee_index, |
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.
Could keep these logs (these won't be 0, because the duty still contains the real committee index).
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.
Good point, revised in 0967696
| } | ||
|
|
||
| Ok(Some(attestation_data)) | ||
| drop(attestations_timer); |
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 drop probably not needed (can just rename the timer to _attestations_timer and it will drop when it goes out of scope, when the function finishes)
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.
Put a underscore before the timer and removed this line: 0967696
|
Some required checks have failed. Could you please take a look @chong-he? 🙏 |
Issue Addressed
Proposed Changes
Split the function
publish_attestations_and_aggregatesintopublish_attestationsandhandle_aggregates, so that for attestations, only 1 task is spawned.Additional Info
Tested with Kurtosis on
minimalpreset, which has amax_committees_per_slotof 4. The number of times the VC calls the BN for the endpoint/eth/v1/validator/attestation_datais given by the metric:http_api_paths_times_count{path="v1/validator/attestation_data"}For 100 slots of data:
Before:
http_api_paths_times_count{path="v1/validator/attestation_data"} 398After:
http_api_paths_times_count{path="v1/validator/attestation_data"} 100From the test output, we see that the number of calls to the BN is reduced. On mainnet, the
max_committee_per_slotis 64, the VC should only call the BN only once per slot for this endpoint