Skip to content

*: fix deposit fetch#4526

Merged
KaloyanTanev merged 2 commits into
mainfrom
kalo/fix-deposit-fetch
May 19, 2026
Merged

*: fix deposit fetch#4526
KaloyanTanev merged 2 commits into
mainfrom
kalo/fix-deposit-fetch

Conversation

@KaloyanTanev
Copy link
Copy Markdown
Collaborator

Fix charon deposit fetch failures when partial unordered amount of peers (but threshold enough) have submitted signatures.

category: bug
ticket: none

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 partialPubKeys from the cluster lock into obolapi.GetFullDeposit and use it to resolve each partial signature's true share index from its PartialPublicKey, replacing the buggy positional sigIdx+1 mapping.
  • Make the mock Obol server persist PartialPublicKey and always update partialDeposits (not only on the !amtFound branch); rename the response JSON tag from public_key to pubkey.
  • Enrich the MarshalDepositData verification 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.

Comment thread cmd/depositfetch.go
Comment thread app/obolapi/deposit.go Outdated
Comment thread app/obolapi/deposit_model.go
@KaloyanTanev KaloyanTanev requested a review from Copilot May 18, 2026 21:33
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.99%. Comparing base (2c42245) to head (89277f0).

Files with missing lines Patch % Lines
eth2util/deposit/deposit.go 0.00% 8 Missing ⚠️
app/obolapi/deposit.go 81.81% 1 Missing and 1 partial ⚠️
cmd/depositfetch.go 75.00% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KaloyanTanev KaloyanTanev merged commit ed4d51e into main May 19, 2026
14 of 16 checks passed
@KaloyanTanev KaloyanTanev deleted the kalo/fix-deposit-fetch branch May 19, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants