-
Notifications
You must be signed in to change notification settings - Fork 959
SingleAttestation implementation
#6488
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
Conversation
|
I've ran some kurtosis tests interoping against prysm and we are attesting correctly EDIT: we are NOT interoping correctly at the moment. I am working on debugging the issue |
ba06501 to
366bed3
Compare
consensus/types/src/attestation.rs
Outdated
| }; | ||
|
|
||
| if committee.index != self.committee_index as u64 { | ||
| return Err(Error::InvalidCommittee); |
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.
| return Err(Error::InvalidCommittee); | |
| return Err(Error::UnexpectedCommittee(committee.index, self.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.
I've updated the args for this method. Instead of passing in the full BeaconCommittee obj, I'm passing in the committee slice. Upstream from this method call I make a check for the existence of the specific committee for the slot and committee_index and return either a Error::NoCommitteeForSlotAndIndex or log a warn message if the committee isn't found
michaelsproul
left a comment
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.
Approved modulo Lion's small tweaks
| .send(kind) | ||
| .map(|count| log_count("attestation", count)), | ||
| EventKind::SingleAttestation(_) => self | ||
| .attestation_tx |
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 is not correct I believe. There's a new event name single_attestation, so you should have a new (tx,rx) and broadcast there. https://github.com/ethereum/beacon-APIs/blob/aa1be259e2d8a64f451dd304913e0310779f6f80/apis/eventstream/index.yaml#L70
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.
Yeah otherwise calls into the event stream with error with unknown topic
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.
I believe the attestation_tx is just for SSE which is for our own internal infra? We still emit a SingleAttestation event with the new single_attestation topic name, which I think is spec compliant. I could be wrong though
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.
ok maybe I am wrong, ill double check, thanks
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.
lighthouse/common/eth2/src/types.rs
Line 1267 in 0d90135
| pub enum EventTopic { |
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.
Yep you were right, heres the fix
54844b3
|
Looks like one of the SSE tests is failing ( |
|
I believe i've fixed the test failure but I think I need to add some test coverage for the new single_attestation event topic |
|
i've added test coverage for the new |
| let current_fork = self | ||
| .spec | ||
| .fork_name_at_slot::<T::EthSpec>(v.attestation().data().slot); | ||
| if current_fork.electra_enabled() { |
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.
Is it necessary to check the fork now? Can we have single attestations before electra?
dapplion
left a comment
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.
PR is good to go!
pawanjay176
left a comment
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.
LGTM as well
|
@mergify queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at 06329ec |

Issue Addressed
Closes #6380
Proposed Changes
Spec: ethereum/consensus-specs#3900
Convert single attestation as early as possible to reduce code diff
Conga-lined off:
v1.5.0-beta.0#6731