-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
feat: beacon node process electra attestations EIP-7549 #6738
Conversation
|
||
const validatorIndices = this.getBeaconCommittees(data.slot, committeeIndices); | ||
|
||
const attestingIndices = new Set(aggregationBits.intersectValues(validatorIndices)); |
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 the array from intersectValues
directly, there should not be any duplicates here
if there is, it'll fail the validation anyway, the created Set
does not help
} else { | ||
const {aggregationBits, committeeBits, data} = attestation as electra.Attestation; | ||
|
||
// There is a naming conflict on the term `committeeIndices` |
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.
add TODO: resolve the naming conflicts...
`aggregationBitsLength=${attestation.aggregationBits.bitLen} committeeLength=${committee.length}` | ||
); | ||
if (fork >= ForkSeq.electra) { | ||
if (data.index !== 0) { |
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.
use assert.equal
util
.map((committeeIndex) => epochCtx.getBeaconCommittee(data.slot, committeeIndex).length) | ||
.reduce((acc, committeeSize) => acc + committeeSize, 0); | ||
|
||
if (attestationElectra.aggregationBits.bitLen !== participantCount) { |
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.
use assert.equal
util
@@ -146,7 +147,7 @@ export async function importBlock( | |||
|
|||
for (const attestation of attestations) { | |||
try { | |||
const indexedAttestation = postState.epochCtx.getIndexedAttestation(attestation); | |||
const indexedAttestation = postState.epochCtx.getIndexedAttestation(fork, attestation); |
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.
add TODO: figure out how to reuse the attesting indices computed from state transition
getIndexedAttestationSignatureSet(state, state.epochCtx.getIndexedAttestation(attestation)) | ||
getIndexedAttestationSignatureSet( | ||
state, | ||
state.epochCtx.getIndexedAttestation(state.epochCtx.config.getForkSeq(signedBlock.message.slot), attestation) |
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.
add TODO: figure how to get attesting indices of an attestation once per block processing
@tuyennhv all your feedbacks have been addressed, and the changes are reflected in |
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 review post merge
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
* Process attestations in block * Fix check-types * Address comments
🎉 This PR is included in v1.22.0 🎉 |
getBeaconCommittees()
to retrieve multiple committees from a single attestationgetAttestingIndices()
to retrieve a list of indices of validators who attested in the provided attestationPart of #6341 and #6689