chore: remove deprecated perspectives from the SDK - #93
Conversation
euler-interfaces is removing the deprecated perspective, registry and eUSD address keys (everything except escrowedCollateralPerspective, evkFactoryPerspective and eulerEarnFactoryPerspective). Align the SDK: - StandardEVaultPerspectives: drop GOVERNED and EDGE (their address keys disappear from EulerChains.json, resolution would always throw) - StandardEulerEarnPerspectives: drop GOVERNED, keep FACTORY - prune removed keys from the Deployment type (feeFlowControllerUtil and the governor keys stay - still published and consumed) - update examples, docs and tests accordingly
📝 WalkthroughWalkthroughThe SDK replaces retired governed and edge perspective usage with factory and escrow discovery. Examples and documentation apply label, deprecation, and escrow filters. Deployment address types and read-path tests now reflect the updated perspective APIs. ChangesPerspective-based vault discovery
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DiscoveryExample
participant EVaultService
participant EulerEarnService
DiscoveryExample->>EVaultService: Fetch factory and escrow perspective addresses
DiscoveryExample->>EulerEarnService: Fetch factory perspective addresses
EVaultService-->>DiscoveryExample: Return EVault addresses and metadata
EulerEarnService-->>DiscoveryExample: Return Euler Earn addresses and metadata
DiscoveryExample->>DiscoveryExample: Apply label, deprecation, and escrow filters
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
The removed governedPerspective was the curated on-chain whitelist; the factory perspectives only prove deployment provenance and anyone can deploy through the factories. The previous commit substituted GOVERNED with FACTORY in examples and docs, silently relabeling the permissionless factory set as 'verified'. - examples now enumerate the universe via the factory perspectives and derive trust from euler-labels (product-listed vaults / earn entries) plus the escrow perspective; the FeeFlow example restricts the buy universe accordingly since the plan interacts with selected vaults - docs gain an explicit 'verified is not trusted' note and a trusted subset recipe - enum doc comments spell out provenance-only semantics
'Verified' in the perspective methods meant 'passed the perspective's on-chain checks', which reads as a trust claim it never was - for the factory perspectives it is provenance only. With the curated governed perspectives retired there is no on-chain trusted list left, so the naming is actively misleading. - fetchVerifiedVaultAddresses -> fetchPerspectiveVaultAddresses - fetchVerifiedVaults -> fetchPerspectiveVaults - adapter fetchVerifiedVaultsAddresses -> fetchPerspectiveVaultsAddresses Applied across services (EVault, EulerEarn, Securitize, vault meta), adapters, buildSDK wiring, tests, examples and docs.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/euler-v2-sdk/src/services/vaults/vaultMetaService/vaultMetaService.ts (1)
353-384: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftPartition standard perspectives before service fan-out.
Line 360 sends every perspective to every registered service.
EVaultServiceandEulerEarnServicethrow when a perspective key is absent from their local deployment addresses. The documented mixed EVault and EulerEarn request therefore rejects before it can return addresses.Route each standard perspective enum only to its owning service. Preserve explicit address perspectives for applicable services. Add a regression test with mixed EVault and EulerEarn perspectives.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/euler-v2-sdk/src/services/vaults/vaultMetaService/vaultMetaService.ts` around lines 353 - 384, Update fetchPerspectiveVaultAddresses to partition standard VaultMetaPerspective values by their owning service before calling vaultServices, while continuing to pass explicit address perspectives to applicable services. Ensure EVaultService and EulerEarnService only receive supported perspective keys, merge and deduplicate returned addresses as before, and add a regression test covering a mixed EVault and EulerEarn request.packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/securitizeVaultService.ts (1)
285-302: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftImplement or explicitly reject Securitize perspective discovery. The public service and adapter both discard the supplied perspectives and return an empty list. Callers cannot distinguish “no matching vaults” from an unsupported operation.
packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/securitizeVaultService.ts#L285-L302: resolve supported perspectives through the adapter, or throw an explicit unsupported error.packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/adapters/securitizeVaultOnchainAdapter.ts#L196-L201: implement the on-chain perspective query, or throw the same explicit unsupported error.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/securitizeVaultService.ts` around lines 285 - 302, Implement perspective discovery instead of silently returning an empty list: update SecuritizeVaultService.fetchPerspectiveVaultAddresses to resolve the supplied perspectives through its adapter and return the resulting addresses, and update SecuritizeVaultOnchainAdapter’s corresponding perspective-query method to perform the on-chain lookup. If unsupported, both sites must throw the same explicit unsupported-operation error rather than returning an empty result; apply the service change in packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/securitizeVaultService.ts:285-302 and the adapter change in packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/adapters/securitizeVaultOnchainAdapter.ts:196-201.
🧹 Nitpick comments (1)
packages/euler-v2-sdk/test/readPathServices.test.ts (1)
746-748: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRename the remaining
verified*locals.The renamed API still uses
verifiedAddresses,verifiedVaults,verified, andverifiedErrors. Rename these locals to perspective-based names so the tests do not imply that a perspective establishes trust.As per path instructions, factory perspectives establish deployment provenance, not trust.
Also applies to: 1240-1240, 1323-1323
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/euler-v2-sdk/test/readPathServices.test.ts` around lines 746 - 748, Rename the remaining trust-implying locals in the affected tests: verifiedAddresses, verifiedVaults, verified, and verifiedErrors. Use perspective-based names consistently at the referenced locations and update all corresponding assertions and usages, while leaving the renamed API calls unchanged.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/euler-v2-sdk/docs/basic-usage.md`:
- Around line 250-255: Update the trusted-subset example around
StandardEVaultPerspectives.FACTORY to also fetch the ESCROW perspective and
retain its vault addresses separately. Change the trusted filter so a vault is
included when it has a non-deprecated product label or its address belongs to
the fetched escrow set, while preserving the existing universe query and label
validation behavior.
In `@packages/euler-v2-sdk/test/readPathServices.test.ts`:
- Around line 1236-1238: Update the rejection test around
directPerspectiveService.fetchPerspectiveVaultAddresses to pass a genuinely
unsupported perspective name, so it covers unknown-name handling rather than
missing deployment configuration. Add a separate successful assertion verifying
the supported evkFactoryPerspective mapping and its factory deployment
provenance without treating it as trusted.
---
Outside diff comments:
In
`@packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/securitizeVaultService.ts`:
- Around line 285-302: Implement perspective discovery instead of silently
returning an empty list: update
SecuritizeVaultService.fetchPerspectiveVaultAddresses to resolve the supplied
perspectives through its adapter and return the resulting addresses, and update
SecuritizeVaultOnchainAdapter’s corresponding perspective-query method to
perform the on-chain lookup. If unsupported, both sites must throw the same
explicit unsupported-operation error rather than returning an empty result;
apply the service change in
packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/securitizeVaultService.ts:285-302
and the adapter change in
packages/euler-v2-sdk/src/services/vaults/securitizeVaultService/adapters/securitizeVaultOnchainAdapter.ts:196-201.
In
`@packages/euler-v2-sdk/src/services/vaults/vaultMetaService/vaultMetaService.ts`:
- Around line 353-384: Update fetchPerspectiveVaultAddresses to partition
standard VaultMetaPerspective values by their owning service before calling
vaultServices, while continuing to pass explicit address perspectives to
applicable services. Ensure EVaultService and EulerEarnService only receive
supported perspective keys, merge and deduplicate returned addresses as before,
and add a regression test covering a mixed EVault and EulerEarn request.
---
Nitpick comments:
In `@packages/euler-v2-sdk/test/readPathServices.test.ts`:
- Around line 746-748: Rename the remaining trust-implying locals in the
affected tests: verifiedAddresses, verifiedVaults, verified, and verifiedErrors.
Use perspective-based names consistently at the referenced locations and update
all corresponding assertions and usages, while leaving the renamed API calls
unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: euler-xyz/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 06faccaa-28a6-4d61-8206-2496a9cde45e
📒 Files selected for processing (19)
packages/euler-v2-sdk/docs/basic-usage.mdpackages/euler-v2-sdk/docs/entity-diagnostics.mdpackages/euler-v2-sdk/examples/execution/fee-flow-example.tspackages/euler-v2-sdk/examples/react-sdk-example/src/queries/sdkQueries.tspackages/euler-v2-sdk/examples/vaults/fetch-apys-example.tspackages/euler-v2-sdk/examples/vaults/fetch-top-verified-vaults-example.tspackages/euler-v2-sdk/src/sdk/buildSDK.tspackages/euler-v2-sdk/src/services/deploymentService/deploymentService.tspackages/euler-v2-sdk/src/services/vaults/IVaultService.tspackages/euler-v2-sdk/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultOnchainAdapter.tspackages/euler-v2-sdk/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3Adapter.tspackages/euler-v2-sdk/src/services/vaults/eVaultService/eVaultService.tspackages/euler-v2-sdk/src/services/vaults/eulerEarnService/adapters/eulerEarnOnchainAdapter.tspackages/euler-v2-sdk/src/services/vaults/eulerEarnService/adapters/eulerEarnV3Adapter.tspackages/euler-v2-sdk/src/services/vaults/eulerEarnService/eulerEarnService.tspackages/euler-v2-sdk/src/services/vaults/securitizeVaultService/adapters/securitizeVaultOnchainAdapter.tspackages/euler-v2-sdk/src/services/vaults/securitizeVaultService/securitizeVaultService.tspackages/euler-v2-sdk/src/services/vaults/vaultMetaService/vaultMetaService.tspackages/euler-v2-sdk/test/readPathServices.test.ts
💤 Files with no reviewable changes (1)
- packages/euler-v2-sdk/src/services/deploymentService/deploymentService.ts
LeonardEulerXYZ
left a comment
There was a problem hiding this comment.
Reviewed exact head feb301360bc5a5b7ffe68d0513d76d012060e57b against main@1a4d6f96d6735e2906a66f19fc4cab2965fe599b.
Verdict
Non-blocking review. The breaking rename and deployment-type pruning are internally consistent, the trust/provenance distinction is materially improved, and I found no correctness or security blocker.
Two non-blocking documentation inconsistencies remain in docs/basic-usage.md:
- Lines 250-255: the comment says the trusted subset includes label-listed or escrow vaults, but the snippet queries only
FACTORYand filters only on product labels, so an unlabelled escrow vault is omitted. CodeRabbit already anchored the precise fix at #93 (comment); I am not duplicating the thread. - Lines 302-313: “Across all vault types” queries only the EVault
FACTORYandESCROWperspectives. It never includesStandardEulerEarnPerspectives.FACTORY, so the result cannot contain EulerEarn vaults despite the section’s claim and union return comment. A live mainnet probe returned 876 addresses from the documented query and omitted all 46 addresses from the EulerEarn factory perspective.
Checks
pnpm --filter @eulerxyz/euler-v2-sdk test— 34 files, 513 tests, type tests cleanpnpm --filter @eulerxyz/euler-v2-sdk typecheck— passedpnpm --filter @eulerxyz/euler-v2-sdk build— passedpnpm --filter @eulerxyz/euler-v2-sdk lint— exit 0; only pre-existing warnings/infos outside the diffpnpm --filter react-sdk-example build— passedgit diff --check origin/main...HEAD— passed- whole-diff dependency/workflow/secret/executable-surface sweep — no relevant changes or indicators
Runtime and sequencing evidence
- Mainnet retained perspectives are live: EVK factory 876 addresses, EulerEarn factory 46, escrow 57.
- The exact-head SDK successfully executed the documented mixed
vaultMetaService.fetchPerspectiveVaultAddressesrequest and returned 922 unique addresses. This disproves the automated claim that mixed standard perspectives necessarily throw: both services resolve the retained keys from the shared deployment address map and call the commonverifiedArray()interface. euler-interfaces#226is still open/draft and retainsevkFactoryPerspective,eulerEarnFactoryPerspective, andescrowedCollateralPerspectivewhile removing the enum/type keys pruned here.- Euler Lite
masteranddevelopmentare pinned to SDK1.2.5and still use the old method name. That is not an immediate runtime break because the package is locked and Lite only queries retainedESCROW; it is a required mechanical migration when Lite takes this breaking SDK release. - No committed package-version change is missing: this repository derives the npm version from the release tag and temporarily writes it during publish.
The Securitize perspective methods still return an empty result, but that behavior predates this PR and the service explicitly has no standard perspectives; the patch only renames that existing surface. I would not make this migration PR carry an unrelated API-behavior change.
- basic-usage: the trusted-subset recipe now includes unlabelled escrow vaults, matching the surrounding prose (fetch the escrow set and allow product label OR escrow membership) - basic-usage: the 'across all vault types' recipe includes StandardEulerEarnPerspectives.FACTORY - the meta service only discovers addresses the given perspectives return, so EulerEarn vaults were missing from the result - test: the unknown-perspective rejection uses a genuinely unsupported name instead of a supported member with a missing address, and the factory perspective gains a positive resolution assertion
|
Both review findings (plus the test nit) addressed in b7fa1e7:
Typecheck clean, 513/513 tests pass including type tests. |
LeonardEulerXYZ
left a comment
There was a problem hiding this comment.
Reviewed exact head b7fa1e745a5b315bff1143d3ef20c955d124ca4a, superseding my review of feb3013.
Finding
P2 — shipped euler-sdk agent guidance still calls the removed API
skills/euler-sdk/AGENTS.md:62 still says:
For batch vault reads (`fetchVaults`, `fetchVerifiedVaults`) ...
This head removes fetchVerifiedVaults; the replacement is fetchPerspectiveVaults. The repository advertises this as an installable euler-sdk skill from the root README, and SKILL.md points users to AGENTS.md as the full compiled guide. Agents following the shipped guidance after the breaking SDK release will therefore generate a call that no longer typechecks or exists at runtime.
Please update the method name and apply the skill's versioning procedure in skills/euler-sdk/VERSIONING.md (version fields/header plus changelog). A whole-repository search found no other old fetchVerifiedVault* API reference outside test-local variable names.
Recheck of b7fa1e7
The new commit correctly resolves the earlier review findings:
- the trusted-subset recipe now unions factory and escrow discovery and retains active label-listed or escrow vaults;
- the all-vault-types recipe now includes
StandardEulerEarnPerspectives.FACTORY; - the perspective test now positively resolves
evkFactoryPerspectiveand uses a genuinely unknown name for the rejection path.
Validation at the exact head:
- SDK tests: 34 files, 513 tests, 2 type tests — passed;
- SDK typecheck and build — passed;
- SDK lint — exit 0, only pre-existing warnings/infos outside the diff;
- React example build — passed;
git diff --check feb3013..b7fa1e7— passed;- checkout remained clean.
Release-order gate
Separate from this PR's code: do not merge euler-interfaces#226 until this breaking SDK is merged and published and direct-manifest consumers are ready. euler-data-v3#475 remains an open prerequisite; npm latest is still SDK 1.2.5. Euler Lite's removed-address-key preparation has landed, but its eventual SDK bump must rename four source locations plus corresponding mocks, not merely three call sites.
…ods (1.3.1) skills/euler-sdk/AGENTS.md still instructed agents to call the removed fetchVerifiedVaults; agents following the shipped guidance would generate code that no longer compiles against this release. Renamed to fetchPerspectiveVaults and bumped the skill to 1.3.1 in all four locations mandated by VERSIONING.md (SKILL.md frontmatter, metadata.json, AGENTS.md header, CHANGELOG.md).
|
Remaining P2 addressed in 54718ac: Repo-wide grep confirms zero remaining |
LeonardEulerXYZ
left a comment
There was a problem hiding this comment.
Verified exact head 54718ac64009cd19cd67b70891932ca732ef5ba2.
The remaining P2 is resolved:
skills/euler-sdk/AGENTS.mdnow usesfetchPerspectiveVaults;- skill version
1.3.1is consistent acrossSKILL.md,metadata.json, and theAGENTS.mdheader; - the changelog has the dated breaking-rename entry;
- the metadata/header date is August 2026;
- a repository-wide stale-name sweep finds only the intentional changelog reference.
PATCH is consistent with VERSIONING.md: this corrects existing guidance without adding sections or materially expanding workflow. JSON parsing, version-consistency assertions, git diff --check, and clean-tree verification passed. The prior exact-head SDK tests, typecheck, build, lint, React example build, and live perspective checks remain applicable because 54718ac changes only these four skill files.
Approved. The separate release-order gate remains: publish the SDK and land consumer readiness before merging euler-interfaces#226.
|
Heads-up from preparing euler-lite's migration for this PR (euler-lite#800): the deployment-type diff removes more than the perspective surface — If that's intentional (pruning fields absent from euler-interfaces data), all good — euler-lite's usages of |
…ive methods (1.3.1)" This reverts commit 54718ac.
The perspective contracts themselves expose isVerified()/verifiedArray(), so "verified" is the perspective vocabulary, not a trust claim; the rename added a breaking change without changing semantics. The docs and enum comments keep the 'verified is provenance, not trust' guidance.
|
Reverted the This also moots the remaining P2: the skill guidance at Validation on head 389a711: vitest 513/513 with type tests clean; zero |
|
|
Summary
euler-interfaces is removing the deprecated perspective, registry and eUSD address keys (euler-xyz/euler-interfaces#226); everything except
escrowedCollateralPerspective,evkFactoryPerspectiveandeulerEarnFactoryPerspectivegoes. Align the SDK — two concerns:1. Remove dead perspective enum members
StandardEVaultPerspectives: dropGOVERNEDandEDGE— their address keys disappear fromEulerChains.json, so resolution would always throwStandardEulerEarnPerspectives: dropGOVERNED, keepFACTORYDeploymenttype (feeFlowControllerUtiland the governor keys stay — still published and consumed byFeeFlowService)2. Stop presenting factory perspectives as a trust signal
governedPerspectivewas the curated on-chain whitelist; the factory perspectives only prove deployment provenance and anyone can deploy through the factories. The SDK never fell back toGOVERNEDinternally (enum-only, callers opt in), but the first commit had substitutedGOVERNED→FACTORYin examples/docs, relabeling the permissionless factory set as "verified". Fixed:convertFeeson selected vaults)Naming:
fetchVerifiedVault*staysAn earlier revision of this PR renamed the methods to
fetchPerspectiveVault*on the grounds that "verified" implies trust. That rename is reverted: verified is the perspectives' own on-chain vocabulary (BasePerspective.isVerified()/verifiedArray()), so the names accurately describe perspective verification — the trust caveat belongs in the docs (point 2), not in a breaking rename. The public method surface is now byte-identical to master.Release sequencing
Publish before euler-xyz/euler-interfaces#226 merges (the SDK fetches
EulerChains.jsonfrommasterat runtime; the removed enum members would become guaranteed runtime throws the moment it merges). Still a breaking release — the enum members andDeploymentkeys vanish from the public types, a compile-time break for anyone referencing them. Consumers that only use the surviving surface compile unchanged (euler-lite's threefetchVerifiedVaultAddresses(ESCROW)call sites need no migration).Test plan
tsc --noEmitcleanfetchPerspectiveVault*occurrences left anywhere; per-filefetchVerifiedVault*usage identical to the pre-rename baselineSummary by CodeRabbit
New Features
Documentation
Breaking Changes