Skip to content

*: strenghten checks for fetching deposits from API#4541

Merged
KaloyanTanev merged 3 commits into
mainfrom
kalo/strenghten-api-deposit-checks
May 26, 2026
Merged

*: strenghten checks for fetching deposits from API#4541
KaloyanTanev merged 3 commits into
mainfrom
kalo/strenghten-api-deposit-checks

Conversation

@KaloyanTanev
Copy link
Copy Markdown
Collaborator

Do a bit more verifications on the data fetched from the API. Nothing that was breaking initially though.

category: misc
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

This PR strengthens validation of deposit data fetched from the Obol API by deriving the ETH2 network from the lock file earlier and using it to BLS-verify partial and aggregated deposit signatures, reducing the chance that malformed or misleading API responses can poison the aggregated deposit signature.

Changes:

  • Derive network from the cluster lock fork version before fetching deposits, and pass it through to the API client.
  • Extend obolapi.Client.GetFullDeposit to accept network and BLS-verify each partial signature against its claimed share, plus verify the final aggregated signature.
  • Update the Obol API deposit test to pass network into GetFullDeposit.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
cmd/depositfetch.go Computes network earlier and passes it into full-deposit fetching.
app/obolapi/deposit.go Adds network param and verifies partial + aggregated signatures; adds extra response sanity checks.
app/obolapi/deposit_test.go Updates test call site to include network argument.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/obolapi/deposit.go Outdated
Comment thread app/obolapi/deposit.go
Comment thread app/obolapi/deposit.go
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 73.80952% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.13%. Comparing base (c97cd83) to head (21bfe37).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
app/obolapi/deposit.go 75.67% 5 Missing and 4 partials ⚠️
cmd/depositfetch.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4541      +/-   ##
==========================================
+ Coverage   57.08%   57.13%   +0.04%     
==========================================
  Files         245      245              
  Lines       33003    33020      +17     
==========================================
+ Hits        18839    18865      +26     
+ Misses      11787    11779       -8     
+ Partials     2377     2376       -1     

☔ 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.

@sonarqubecloud
Copy link
Copy Markdown

@KaloyanTanev KaloyanTanev enabled auto-merge (squash) May 26, 2026 14:59
@KaloyanTanev KaloyanTanev merged commit 0b10479 into main May 26, 2026
9 of 10 checks passed
@KaloyanTanev KaloyanTanev deleted the kalo/strenghten-api-deposit-checks branch May 26, 2026 15:05
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