Skip to content

chore: remove unused endpoints and dead code paths#236

Open
hankbobtheresearchoor wants to merge 3 commits into
Layr-Labs:masterfrom
hankbobtheresearchoor:chore/remove-unused-endpoints
Open

chore: remove unused endpoints and dead code paths#236
hankbobtheresearchoor wants to merge 3 commits into
Layr-Labs:masterfrom
hankbobtheresearchoor:chore/remove-unused-endpoints

Conversation

@hankbobtheresearchoor
Copy link
Copy Markdown
Contributor

@hankbobtheresearchoor hankbobtheresearchoor commented May 28, 2026

Summary

Removes three HTTP endpoints that are not consumed by any client — Swift provider, console UI, or external integrations — along with their exclusive callee functions.

Changes

1. GET /v1/provider/node-earnings — per-node earnings history

  • Removes handleNodeEarnings handler (billing_handlers.go)
  • Removes GetProviderEarnings() and GetProviderEarningsSummary() from store interface and both Postgres/Memory implementations
  • Rewires integration tests to use GetAccountEarnings() (account-scoped) instead of GetProviderEarnings() (node-scoped)
  • Removes TestNodeEarningsUsesLifetimeTotalsInsteadOfLimitedSlice test
  • Removes TestProviderEarnings_GetByProviderKey and TestProviderEarnings_NewestFirst store tests; renames TestProviderEarnings_LimitRespectedTestProviderEarnings_LimitForAccount

2. GET /v1/billing/wallet/balance — wallet balance lookup

  • Removes handleWalletBalance handler (billing_handlers.go)
  • billing.Ledger().Balance() is preserved — still used by other endpoints (stripe_payouts.go, consumer.go)

3. GET /v1/runtime/manifest — runtime hash inspection

  • Removes handleRuntimeManifest handler (server.go) and route registration
  • Removes runtime_manifest:v1 cache invalidation from release_handlers.go
  • Runtime manifest infrastructure (SyncRuntimeManifest, SetRuntimeManifest, knownRuntimeManifest) kept intact — still in active use for provider runtime verification on registration and challenge revalidation
  • Removes now-unused encoding/json import from server.go

Files changed

coordinator/api/billing_earnings_test.go    |  79 -----
coordinator/api/billing_handlers.go         |  55 -----
coordinator/api/billing_integration_test.go |  26 +--- (rewired to account query)
coordinator/api/cache.go                    |   2 +-
coordinator/api/integration_test.go         |   6 +- (rewired to account query)
coordinator/api/release_handlers.go         |   5 +-
coordinator/api/server.go                   |  34 ----
coordinator/store/interface.go              |   6 --
coordinator/store/memory.go                 |  39 -----
coordinator/store/postgres.go               |  55 -----
coordinator/store/store_test.go             |  86 +---- (removed per-provider tests)
11 files changed, 20 insertions(+), 373 deletions(-)

Verification

  • go build ./cmd/coordinator — clean
  • go test ./... — all pass

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Removes three HTTP endpoints and all their exclusive callee functions:

1. GET /v1/provider/node-earnings — per-node earnings history
   - Remove handleNodeEarnings handler
   - Remove GetProviderEarnings and GetProviderEarningsSummary from
     store interface and Postgres/Memory implementations
   - Rewire integration tests to use GetAccountEarnings instead

2. GET /v1/billing/wallet/balance — wallet balance lookup
   - Remove handleWalletBalance handler (billings.Ledger().Balance()
     still used by other endpoints)

3. GET /v1/runtime/manifest — runtime hash inspection
   - Remove handleRuntimeManifest handler
   - Remove runtime_manifest:v1 cache invalidation from release handlers
   - Runtime manifest infrastructure preserved (SyncRuntimeManifest,
     SetRuntimeManifest, knownRuntimeManifest) — still used for
     provider runtime verification

None of these endpoints are consumed by the Swift provider or console UI.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@hankbobtheresearchoor is attempting to deploy a commit to the EigenLabs Team on Vercel.

A member of the Team first needs to authorize it.

@hankbobtheresearchoor
Copy link
Copy Markdown
Contributor Author

I'll take a look at this.

Copy link
Copy Markdown
Contributor Author

@hankbobtheresearchoor hankbobtheresearchoor left a comment

Choose a reason for hiding this comment

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

Review Summary

Clean removal PR — all three endpoints, their handlers, route registrations, and store methods are consistently removed. Build + tests pass.

Two minor cleanup items (see inline):

  • 🟡 Orphaned nodeEarningsResponse struct in test file
  • 🟡 Indentation drift in integration test

Vercel failures are the Authorization required pattern (not a code defect).

t.Fatal("expected at least one provider earning record")
}
// Step 8: Verify account earnings were recorded.
earnings, err := st.GetAccountEarnings(accountID, 10)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🟡 Indentation drifted — these lines have an extra tab compared to the surrounding function body. The // Step 8 comment at line 970 is at the correct level, but lines 971-983 are double-indented. Also expectedPayout{ at line 983 is missing a space before the brace (expectedPayout {).

@hankbobtheresearchoor
Copy link
Copy Markdown
Contributor Author

🟡 Orphaned type: nodeEarningsResponse at billing_earnings_test.go:26 is unused now — the only test that referenced it was removed. Consider removing the struct definition.

… struct

- Dedent lines in billing_integration_test.go Step 8 block
- Fix missing space before brace in expectedPayout {
- Remove unused nodeEarningsResponse type
@hankbobtheresearchoor
Copy link
Copy Markdown
Contributor Author

Done. 51e8a79: fixed indentation drift in billing_integration_test.go Step 8 block plus missing space before brace, and removed orphaned nodeEarningsResponse struct. All tests pass.

@ethenotethan
Copy link
Copy Markdown
Contributor

@hankbobtheresearchoor Coordinator CI tests failing, please fix and rebase

@hankbobtheresearchoor
Copy link
Copy Markdown
Contributor Author

On it — checking the CI failures and will fix + rebase.

@hankbobtheresearchoor
Copy link
Copy Markdown
Contributor Author

Fixed gofmt in billing_earnings_test.go. Commit: 67ab3b6. Tests pass. Force-push blocked for rebase — branch is BEHIND but MERGEABLE.

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.

2 participants