-
Notifications
You must be signed in to change notification settings - Fork 128
cmd: add API partial deposit flow #4032
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4032 +/- ##
==========================================
+ Coverage 54.81% 54.93% +0.11%
==========================================
Files 242 246 +4
Lines 31040 31295 +255
==========================================
+ Hits 17014 17191 +177
- Misses 11785 11827 +42
- Partials 2241 2277 +36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 for the first pass.
f2ef1e0 to
5c1a131
Compare
5c1a131 to
f134b54
Compare
|
| } | ||
|
|
||
| // do aggregation | ||
| fullDeposits := []eth2p0.DepositData{} |
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.
Can we do make([]eth2p0.DepositData,dr.Amounts)? and then later fullDeposits[i]=... ?
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.
What do we gain from filling the slice with empty objects which we later overwrite over creating an empty one to which we later on amend new objects?
I personally never liked empty objects in slices as it's really error prone and useful only in specific cases.
| return errors.Wrap(err, "match local validator key shares with their counterparty in cluster lock") | ||
| } | ||
|
|
||
| pubkeys := []eth2p0.BLSPubKey{} |
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.
make([]eth2p0.BLSPubKey,config.ValidatorPublicKeys) and then pubkeys[i]=blsPK
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.
Pull Request Overview
This pull request introduces deposit signing and fetching functionality for distributed validators, enabling operators to sign and fetch deposit messages through the Obol API. The key purpose is to allow modification of withdrawal addresses after creation but before validator activation.
Key changes:
- Added new CLI commands for deposit signing (
deposit sign) and fetching (deposit fetch) - Created deposit handling API endpoints and mock server implementation
- Refactored common code by extracting shared utilities from exit.go to obolapi.go
- Renamed
ErrNoExittoErrNoValueto make it reusable for both exits and deposits
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| testutil/obolapimock/obolapi.go | New file containing extracted common mock server utilities (testServer, auth middleware, helper functions) |
| testutil/obolapimock/exit.go | Removed duplicated code that was moved to obolapi.go, kept exit-specific logic |
| testutil/obolapimock/deposit.go | New file implementing mock deposit API handlers (submit partial, fetch full) |
| cmd/deposit.go | New file defining shared deposit command configuration and flags |
| cmd/depositsign.go | New file implementing deposit signing command logic |
| cmd/depositfetch.go | New file implementing deposit fetching command logic |
| cmd/depositsign_internal_test.go | New test file for deposit signing functionality |
| cmd/depositfetch_internal_test.go | New test file for deposit fetching functionality |
| cmd/cmd.go | Added deposit commands to the root command |
| app/obolapi/deposit.go | New file implementing client-side deposit API calls |
| app/obolapi/deposit_model.go | New file defining deposit API request/response models |
| app/obolapi/deposit_test.go | New test file for deposit API integration |
| app/obolapi/exit.go | Renamed ErrNoExit to ErrNoValue |
| app/obolapi/exit_test.go | Renamed test functions to be more specific (TestAPIExit, TestAPIExitMissingSig) |
| app/obolapi/api.go | Updated to use renamed ErrNoValue |
| cmd/exit_fetch.go | Updated to use renamed ErrNoValue |
| cmd/exit_delete.go | Updated to use renamed ErrNoValue |
| cmd/exit_broadcast.go | Updated to use renamed ErrNoValue |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


charon deposit sign: sign partial deposit -> publish to the apicharon deposit fetch: fetch deposits from the api -> aggregate signatures -> save full deposit locallycategory: feature
ticket: #3992