feat(core): sync Registry ABI and actions to SuperPaymaster ticket model#20
feat(core): sync Registry ABI and actions to SuperPaymaster ticket model#20fanhousanbu wants to merge 2 commits into
Conversation
Registry v5.0 (ticket model) renames entryBurn → ticketPrice in RoleConfig and adds isOperatorRole flag for operator-vs-enduser role distinction. - Registry.json ABI: ticketPrice replaces entryBurn in configureRole, getRoleConfig, roleConfigs, and RoleConfigured event; adds syncExitFees function, InvalidProposalId and NoStakeToExit errors; removes stale accountToUser, executedProposals, proposedRoleNames, roleLockDurations, and roleOwners (all dropped from contract in ticket model refactor) - registry.ts: rename entryBurn → ticketPrice throughout; add syncExitFees action; remove dropped view functions from type and implementation - staking.ts: rename lockStake parameter entryBurn → ticketPrice - roles.ts: rename RoleConfig.entryBurn → ticketPrice; add optional isOperatorRole; update JSDoc and INITIAL_ROLE_STAKES constants - registry.test.ts / staking.test.ts: align with renamed parameter
🤖 Round 1 — Claude Code Review (Local Model)
🔴 CriticalNone. 🟠 HighH1 —
Required: Confirm that the positional mapping in both 🟡 MediumM1 — Downstream breakage from removed functions not confirmed Three functions removed from the type and implementation: A compile-time grep should confirm no monorepo code uses them: grep -r "accountToUser\|roleOwners\|roleLockDurations" packages/ --include="*.ts" -lM2 — async syncExitFees({ roles, account }) {
validateRequired(roles, 'roles');
...args: [roles]
🔵 LowL1 —
L2 — // @requirement minStake: 30 GT, ticketPrice: 3 GT (line 99)Hardcoded contract source line numbers in JSDoc will drift silently as the contract evolves. ✅ VerdictApprove with requests. This is a clean, mechanical rename with good test coverage. H1 ( Round 2 (Codex) will follow. |
🤖 Round 2 — Codex Review
🔴 CriticalC-1 —
Result: every call to Fix: Change C-2 —
Fix: Either (a) add 🟠 HighH-1 — New Fix: Regenerate ABI from the correct contract source. If H-2 — // staking.ts ~line 405
return { amount: res[0], entryBurn: res[1], ... };
Fix: Rename H-3 —
🟡 MediumM-1 — PR summary claims M-2 —
M-3 — Duplicate Extract to a shared 🔵 LowL-1 — Test mocks ❌ VerdictRequest Changes. Two runtime-breaking issues must be resolved before merge:
H-1 ( Round 1 (Claude) is in the preceding comment. |
⚔️ PK 对比 — Claude vs Codex (PR #20)
🏆 PK 结论Codex 大赢这局。找到了 Claude 完全忽略的两个 Critical 运行时 bug:
加上 H-2 Claude 误判为"clean rename",这轮明显不够彻底。 📋 必须修复后才能 merge(Codex 确认的阻塞项)
|
🔄 Re-Review Round 2 — PR #20 (feat/registry-ticket-model-sync)Claude Round 2基于 entryBurn → ticketPrice 重命名 ✅ 完整 syncExitFees 新增 ✅ 正确 已删除函数清理 ✅ 完整 Codex Round 2[Medium]
请确认以下情况之一:
[Low] syncExitFees 缺少单元测试 关于上一轮 Codex 的错误 findings本次已确认:
PK Summary
主体改动质量良好。Medium 问题( |
jhfnetboy
left a comment
There was a problem hiding this comment.
主体重命名质量良好。请澄清 isOperatorRole 字段来源(ABI 中不存在该字段),确认后可合并。
…ole, guard syncExitFees - adminConfigureRole: remove from RegistryActions type, implementation, and test. The function has no ABI backing in Registry.json (only configureRole exists); every call would revert with a selector-not-found error. - isOperatorRole: remove from RoleConfigDetailed type and roles.ts RoleConfig. Field is absent from on-chain RoleConfig struct (12 fields, ends at roleLockDuration); always returned undefined when reading from contract. - syncExitFees: add pre-try empty-array guard; add two new tests covering the happy path and the empty-array rejection.
🔄 Re-Review Round 2 — PR #20 (feat/registry-ticket-model-sync)Claude Round 2Fix commit [Critical — fix commit 主动修复] adminConfigureRole 无 ABI 支持 ✅ FIXED [Medium] isOperatorRole ABI/Type 不同步 ✅ FIXED [Low] syncExitFees 缺少测试 ✅ FIXED
同时新增空数组 guard: 其余改动确认:
Codex Round 2
PK Summary
所有 issue 已解决,无新问题。 ✅ |
Summary
entryBurn→ticketPriceinRoleConfigstruct acrossconfigureRole,getRoleConfig,roleConfigs, andRoleConfiguredevent; addssyncExitFees,InvalidProposalId,NoStakeToExit; removes staleaccountToUser,executedProposals,proposedRoleNames,roleLockDurations,roleOwnerssyncExitFeesaction, removed dropped functions from type and implementationlockStakeparameterentryBurn→ticketPriceRoleConfiginterface and all constants updated; added optionalisOperatorRoleContract Reference
SuperPaymaster HEAD (after tag
v5.3.0-dev) — ticket model commit8074c2b:Test plan
pnpm --filter @aastar/core test— unit tests passpnpm tsc --noEmit— no type errors in packages/pnpm exec tsx scripts/06_local_test_v3_admin.tsagainst Anvil