*: fix deposit fetch#4526
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes charon deposit fetch aggregating partial signatures with wrong share indices when fewer-than-all (but threshold-many) peers submit signatures from non-contiguous share indices. The mock test server now stores the partial signer's public key, the client maps it back to the correct share index via the cluster lock's PubShares, and the test exercises a non-contiguous 3-of-5 case.
Changes:
- Plumb
partialPubKeysfrom the cluster lock intoobolapi.GetFullDepositand use it to resolve each partial signature's true share index from itsPartialPublicKey, replacing the buggy positionalsigIdx+1mapping. - Make the mock Obol server persist
PartialPublicKeyand always updatepartialDeposits(not only on the!amtFoundbranch); rename the response JSON tag frompublic_keytopubkey. - Enrich the
MarshalDepositDataverification error with pubkey/signature/withdrawal/amount/network context, and broaden the deposit test to a 3-of-5 cluster submitting from non-contiguous nodes.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/obolapi/deposit.go | Adds partialPubKeys parameter and pubkey→share-index lookup used during threshold aggregation. |
| app/obolapi/deposit_model.go | Renames FullDepositResponse.PublicKey JSON tag to pubkey and drops the stale "ordered by share index" comment. |
| app/obolapi/deposit_test.go | Switches to a 3-of-5 cluster, submitting from non-contiguous nodes; passes PubShares into GetFullDeposit. |
| cmd/depositfetch.go | Looks up the validator's PubShares from the lock and forwards them to GetFullDeposit. |
| testutil/obolapimock/deposit.go | Stores PartialPublicKey in mock partials, removes unused shareIdx, and always upserts the deposit blob. |
| eth2util/deposit/deposit.go | Adds structured context fields to the invalid-deposit-signature error. |
| cmd/cmd_internal_test.go | Adds a blank line (no behavioral change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4526 +/- ##
==========================================
- Coverage 57.01% 56.99% -0.02%
==========================================
Files 245 245
Lines 32971 32994 +23
==========================================
+ Hits 18799 18806 +7
- Misses 11789 11803 +14
- Partials 2383 2385 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Fix
charon deposit fetchfailures when partial unordered amount of peers (but threshold enough) have submitted signatures.category: bug
ticket: none