-
-
Notifications
You must be signed in to change notification settings - Fork 330
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
fix: correctly get signature from single attestation bytes #7266
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devnet-5 #7266 +/- ##
============================================
- Coverage 48.44% 48.43% -0.01%
============================================
Files 602 602
Lines 40321 40323 +2
Branches 2057 2057
============================================
Hits 19532 19532
- Misses 20751 20753 +2
Partials 38 38 |
@@ -470,7 +471,9 @@ async function validateAttestationNoSignatureCheck( | |||
let attDataRootHex: RootHex; | |||
const signature = attestationOrCache.attestation | |||
? attestationOrCache.attestation.signature | |||
: getSignatureFromAttestationSerialized(attestationOrCache.serializedData); | |||
: !isForkPostElectra(fork) |
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.
Personally would like to see the fork switching logic to be hidden in sszBytes.ts
Maybe a function named getSignatureFromBeaconAttestationSerialized
in a similar fashion as getBlockRootFromBeaconAttestationSerialized
.
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.
was debating that as well but figured we only use those in network processor and this pattern was used before already so I went with explicit fork logic in validation itself
lodestar/packages/beacon-node/src/chain/validation/attestation.ts
Lines 265 to 267 in 957684f
const committeeIndexForLookup = isForkPostElectra(fork) | |
? (getCommitteeIndexFromAttestationOrBytes(fork, attestationOrBytes) ?? 0) | |
: PRE_ELECTRA_SINGLE_ATTESTATION_COMMITTEE_INDEX; |
Either one seems fine to me
🎉 This PR is included in v1.26.0 🎉 |
Motivation
Need to correctly handle extracting signature from single attestation
Description
Use
getSignatureFromSingleAttestationSerialized
to extract signature from bytes for post-electra single attestationsCloses #7259