fix: enforce EVC subaccount boundary - #76
Conversation
Document ID 0 as the primary account and assert that default discovery only returns IDs 1-255.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: euler-xyz/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe SDK now treats account families as 256 EVC addresses with IDs 0–255. Sub-account utilities enforce the upper bound, tests cover boundary and out-of-family behavior, and the basic usage documentation reflects the updated account model. ChangesAccount family boundary
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Leonard review walkthroughVerdict: clean at This fixes the shared boundary at the correct abstraction:
Validation
Scalability / maintainability hygieneThe account, portfolio, account-service candidate selection, and execution simulation paths already consume these shared helpers rather than carrying sibling limits, so the fix propagates without a second local abstraction. Repository-wide searches found no remaining hardcoded 256-as-maximum behavior on Euler Lite’s current consumers use the exported address/ID helpers and contain no parallel 256 boundary. No additional reusable utility or sibling-flow patch is needed here. CodeRabbit reported no actionable findings; I found no material bot false positive to call out. No screenshots were applicable because this is a non-UI SDK invariant fix. |
LeonardEulerXYZ
left a comment
There was a problem hiding this comment.
Approved at 91d204b31aee7b7d66f6423ffaebfcd234dba652.
The EVC first-19-byte family invariant, helper behavior, default discovery range, public package export, sibling consumers, and Activity PR #66 sequencing were checked. Focused tests (28), full package tests (404), package/workspace typechecks, package/workspace builds, changed-source Biome, and git diff --check passed. No blocking correctness, compatibility, security, or maintainability findings.
Summary
Changes
SUB_ACCOUNT_MAX_IDto255, so account-family IDs are limited to0–255and default free-sub-account discovery returns IDs1–255.getSubAccountAddress,getSubAccountId,isSubAccount, andgetFreeSubAccounts, including acceptance of255and rejection of256.0plus sub-account IDs1–255.Test plan
pnpm --filter @eulerxyz/euler-v2-sdk exec vitest run test/accountPortfolio.test.tspnpm --filter @eulerxyz/euler-v2-sdk run testpnpm --filter @eulerxyz/euler-v2-sdk run typecheckpnpm --filter @eulerxyz/euler-v2-sdk exec biome check src/utils/subAccounts.ts test/accountPortfolio.test.tsSummary by CodeRabbit
Documentation
Bug Fixes
Tests