You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: refine research and earlier phase docs with phase-03 findings
Update infoFrom override strategy (single override point, not
getInputsInfo/getOutputsInfo), correct fork-scripts paths in
phase-01 summaries, and incorporate CCC Udt investigation results
into research documents.
provides: "assertDaoOutputLimit utility function and completeFee safety net"
33
32
contains: "assertDaoOutputLimit"
34
33
key_links:
35
34
- from: "packages/dao/src/dao.ts"
36
-
to: "ccc-dev/ccc/packages/core/src/ckb/transaction.ts"
35
+
to: "ccc-fork/ccc/packages/core/src/ckb/transaction.ts"
37
36
via: "import and call assertDaoOutputLimit"
38
37
pattern: "assertDaoOutputLimit"
39
38
- from: "packages/core/src/logic.ts"
40
-
to: "ccc-dev/ccc/packages/core/src/ckb/transaction.ts"
39
+
to: "ccc-fork/ccc/packages/core/src/ckb/transaction.ts"
41
40
via: "import and call assertDaoOutputLimit"
42
41
pattern: "assertDaoOutputLimit"
43
42
- from: "packages/core/src/owned_owner.ts"
44
-
to: "ccc-dev/ccc/packages/core/src/ckb/transaction.ts"
43
+
to: "ccc-fork/ccc/packages/core/src/ckb/transaction.ts"
45
44
via: "import and call assertDaoOutputLimit"
46
45
pattern: "assertDaoOutputLimit"
47
46
---
@@ -51,7 +50,7 @@ Build the 64-output NervosDAO limit check as a CCC core utility and replace all
51
50
52
51
Purpose: Consolidate duplicated DAO output limit logic into a single source of truth in CCC core, preparing for SmartTransaction deletion by removing one of its responsibilities. This is the first feature-slice step (purely additive, nothing breaks).
53
52
54
-
Output: `ErrorNervosDaoOutputLimit` error class + `assertDaoOutputLimit` utility in CCC core; all iCKB packages calling the utility instead of inline checks; ccc-dev pins recorded.
53
+
Output: `ErrorNervosDaoOutputLimit` error class + `assertDaoOutputLimit` utility in CCC core; all iCKB packages calling the utility instead of inline checks; ccc-fork pins recorded.
**Step 1: Add error class to transactionErrors.ts**
91
90
92
-
Read `ccc-dev/ccc/packages/core/src/ckb/transactionErrors.ts`. Add `ErrorNervosDaoOutputLimit` following the existing `ErrorTransactionInsufficientCapacity` pattern:
91
+
Read `ccc-fork/ccc/packages/core/src/ckb/transactionErrors.ts`. Add `ErrorNervosDaoOutputLimit` following the existing `ErrorTransactionInsufficientCapacity` pattern:
@@ -108,7 +107,7 @@ export class ErrorNervosDaoOutputLimit extends Error {
108
107
109
108
**Step 2: Add assertDaoOutputLimit to transaction.ts**
110
109
111
-
Read `ccc-dev/ccc/packages/core/src/ckb/transaction.ts`. Add the standalone utility function as a module-level export (NOT a method on Transaction). Place it after the Transaction class definition. Import `ErrorNervosDaoOutputLimit` from `./transactionErrors.js`, `KnownScript` from the appropriate module, and `Script` if not already imported:
110
+
Read `ccc-fork/ccc/packages/core/src/ckb/transaction.ts`. Add the standalone utility function as a module-level export (NOT a method on Transaction). Place it after the Transaction class definition. Import `ErrorNervosDaoOutputLimit` from `./transactionErrors.js`, `KnownScript` from the appropriate module, and `Script` if not already imported:
112
111
113
112
```typescript
114
113
/**
@@ -154,20 +153,20 @@ In the `completeFee` method of the Transaction class (around line 2183), add a c
154
153
155
154
**Step 4: Export from barrel**
156
155
157
-
Read `ccc-dev/ccc/packages/core/src/ckb/index.ts`. Add exports for `ErrorNervosDaoOutputLimit` (from `./transactionErrors.js`) and `assertDaoOutputLimit` (from `./transaction.js`). Follow existing export patterns in the file.
156
+
Read `ccc-fork/ccc/packages/core/src/ckb/index.ts`. Add exports for `ErrorNervosDaoOutputLimit` (from `./transactionErrors.js`) and `assertDaoOutputLimit` (from `./transaction.js`). Follow existing export patterns in the file.
158
157
159
-
**Step 5: Record ccc-dev pins**
158
+
**Step 5: Record ccc-fork pins**
160
159
161
-
Run: `pnpm ccc:record`
160
+
Run: `pnpm fork:record`
162
161
163
-
This updates `ccc-dev/pins/REFS` and `ccc-dev/pins/HEAD` to reflect the new CCC state.
162
+
This updates `ccc-fork/pins/` to reflect the new CCC state.
164
163
165
-
Verify: `pnpm ccc:status` should exit 0 (no pending work).
164
+
Verify: `pnpm fork:status` should exit 0 (no pending work).
166
165
</action>
167
166
<verify>
168
-
1.`pnpm ccc:status` exits 0
169
-
2.`grep -r "ErrorNervosDaoOutputLimit" ccc-dev/ccc/packages/core/src/ckb/transactionErrors.ts` finds the class
170
-
3.`grep -r "assertDaoOutputLimit" ccc-dev/ccc/packages/core/src/ckb/transaction.ts` finds the function
167
+
1.`pnpm fork:status` exits 0
168
+
2.`grep -r "ErrorNervosDaoOutputLimit" ccc-fork/ccc/packages/core/src/ckb/transactionErrors.ts` finds the class
169
+
3.`grep -r "assertDaoOutputLimit" ccc-fork/ccc/packages/core/src/ckb/transaction.ts` finds the function
171
170
4.`pnpm check:full` passes (purely additive change, nothing should break)
172
171
</verify>
173
172
<done>
@@ -244,9 +243,9 @@ All 7 inline DAO output checks are removed. Every location now calls `await asse
- "Added ccc-dev local patch mechanism (pins/local/*.patch) to support deterministic replay of CCC source modifications"
35
+
- "Added ccc-fork local patch mechanism (pins/local-*.patch) to support deterministic replay of CCC source modifications"
36
36
- "Moved client parameter before optional options in DaoManager.requestWithdrawal and DaoManager.withdraw signatures"
37
37
- "assertDaoOutputLimit uses early return when outputs <= 64 for zero-cost in common case"
38
38
39
39
patterns-established:
40
-
- "Local CCC patches: place .patch files in ccc-dev/pins/local/ for changes applied after standard merge+patch cycle"
40
+
- "Local CCC patches: pins/local-*.patch files applied after standard merge+patch cycle"
41
41
- "DAO output limit: always use ccc.assertDaoOutputLimit(tx, client) instead of inline checks"
42
42
43
43
requirements-completed: [SMTX-06]
@@ -64,7 +64,7 @@ completed: 2026-02-22
64
64
- Built assertDaoOutputLimit utility function that checks both inputs and outputs for DAO type script using full Script.eq() comparison
65
65
- Added completeFee safety net in CCC Transaction class (both return paths)
66
66
- Replaced all 7 inline DAO output checks across 4 files with centralized utility calls
67
-
- Added local patch mechanism to ccc-dev record/replay for deterministic builds of CCC modifications
67
+
- Added local patch mechanism to ccc-fork record/replay for deterministic builds of CCC modifications
68
68
69
69
## Task Commits
70
70
@@ -74,31 +74,30 @@ Each task was committed atomically:
74
74
2.**Task 2: Replace all 7 scattered DAO checks with assertDaoOutputLimit calls** - `2decd06` (refactor)
75
75
76
76
## Files Created/Modified
77
-
-`ccc-dev/ccc/packages/core/src/ckb/transactionErrors.ts` - ErrorNervosDaoOutputLimit error class
78
-
-`ccc-dev/ccc/packages/core/src/ckb/transaction.ts` - assertDaoOutputLimit utility + completeFee safety net
79
-
-`ccc-dev/pins/local/001-dao-output-limit.patch` - Local patch for deterministic replay
80
-
-`ccc-dev/pins/HEAD` - Updated pinned HEAD SHA
81
-
-`ccc-dev/record.sh` - Added local patch preservation and application
82
-
-`ccc-dev/replay.sh` - Added local patch application after standard merge+patch
77
+
-`ccc-fork/ccc/packages/core/src/ckb/transactionErrors.ts` - ErrorNervosDaoOutputLimit error class
78
+
-`ccc-fork/ccc/packages/core/src/ckb/transaction.ts` - assertDaoOutputLimit utility + completeFee safety net
79
+
-`ccc-fork/pins/` - Updated pins for deterministic replay
80
+
-`ccc-fork/record.sh` - Added local patch preservation and application
81
+
-`ccc-fork/replay.sh` - Added local patch application after standard merge+patch
83
82
-`packages/dao/src/dao.ts` - DaoManager.deposit/requestWithdrawal/withdraw now async with client param
84
83
-`packages/core/src/logic.ts` - LogicManager.deposit now async with client param
85
84
-`packages/core/src/owned_owner.ts` - OwnedOwnerManager.requestWithdrawal/withdraw now async with client param
86
85
-`packages/utils/src/transaction.ts` - SmartTransaction.completeFee DAO check replaced
87
86
88
87
## Decisions Made
89
-
- Added ccc-dev local patch mechanism (pins/local/*.patch) because the existing record/replay infrastructure had no way to persist source-level CCC modifications through the clean/replay cycle. This was a necessary blocking-issue fix (Rule 3).
88
+
- Added ccc-fork local patch mechanism (pins/local-*.patch) because the existing record/replay infrastructure had no way to persist source-level CCC modifications through the clean/replay cycle. This was a necessary blocking-issue fix (Rule 3).
90
89
- Placed `client: ccc.Client` parameter before optional `options` parameters in DaoManager signatures for cleaner API design (required params before optional).
91
90
- assertDaoOutputLimit uses early return when `outputs.length <= 64` so the common-case path has zero async overhead.
92
91
93
92
## Deviations from Plan
94
93
95
94
### Auto-fixed Issues
96
95
97
-
**1. [Rule 3 - Blocking] Added ccc-dev local patch mechanism**
96
+
**1. [Rule 3 - Blocking] Added ccc-fork local patch mechanism**
98
97
-**Found during:** Task 1 (CCC core changes)
99
-
-**Issue:** ccc-dev record/replay infrastructure had no way to persist local CCC source modifications. Running `pnpm ccc:record` or `pnpm check:full` would wipe changes because replay clones fresh from upstream.
100
-
-**Fix:** Added `pins/local/` directory for `.patch`files. Modified `record.sh` to preserve local patches during re-recording and apply them after standard merge+patch. Modified `replay.sh` to apply local patches after standard replay. Both use deterministic git identity/timestamps for reproducible HEAD SHAs.
-**Issue:** ccc-fork record/replay infrastructure had no way to persist local CCC source modifications. Running `pnpm fork:record` or `pnpm check:full` would wipe changes because replay clones fresh from upstream.
99
+
-**Fix:** Added `pins/local-*.patch`mechanism. Modified `record.sh` to preserve local patches during re-recording and apply them after standard merge+patch. Modified `replay.sh` to apply local patches after standard replay. Both use deterministic git identity/timestamps for reproducible HEAD SHAs.
Copy file name to clipboardExpand all lines: .planning/phases/01-ickb-utils-smarttransaction-removal/01-02-SUMMARY.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ key-files:
33
33
- packages/sdk/src/sdk.ts
34
34
35
35
key-decisions:
36
-
- "Moved getHeader/HeaderKey to transaction.ts as non-exported internals rather than deleting entirely, since SmartTransaction class still uses them internally until Plan 03 deletion"
36
+
- "Moved getHeader/HeaderKey to transaction.ts as non-exported internals (deleted alongside SmartTransaction in 01-03)"
37
37
- "TransactionHeader moved to utils.ts as canonical location, imported by transaction.ts"
38
38
- "Inlined CCC client calls use explicit null checks with descriptive error messages matching original getHeader throw semantics"
39
39
@@ -84,7 +84,7 @@ Each task was committed atomically:
84
84
-`packages/sdk/src/sdk.ts` - Inlined 1 getHeader call with client.getTransactionWithHeader
85
85
86
86
## Decisions Made
87
-
- Moved getHeader/HeaderKey into transaction.ts as non-exported internals rather than deleting entirely. SmartTransaction's own instance methods (getHeader, encodeHeaderKey, addHeaders) still reference these internally. Deleting them would break SmartTransaction, which is not removed until Plan 03. This keeps the public API clean while maintaining internal consistency.
87
+
- Moved getHeader/HeaderKey into transaction.ts as non-exported internals rather than deleting entirely. SmartTransaction's own instance methods (getHeader, encodeHeaderKey, addHeaders) still reference these internally. Deleting them would break SmartTransaction, which was removed in Plan 01-03. This kept the public API clean while maintaining internal consistency.
88
88
- TransactionHeader placed in utils.ts as the canonical location since it outlives SmartTransaction (used by DaoCell.headers and ReceiptCell.header).
89
89
- Inlined CCC client calls preserve the original error semantics: getHeader always threw on null results, and the inlined code also throws with descriptive messages.
90
90
@@ -95,15 +95,15 @@ Each task was committed atomically:
95
95
**1. [Rule 3 - Blocking] Retained getHeader/HeaderKey as non-exported internals in transaction.ts**
-**Issue:** SmartTransaction class in transaction.ts imports and uses the standalone getHeader function and HeaderKey type internally. Removing them from utils.ts without providing them in transaction.ts would break the class.
98
-
-**Fix:** Moved getHeader function and HeaderKey type into transaction.ts as non-exported (internal) declarations. They are no longer part of the @ickb/utils public API but remain available for SmartTransaction's internal use until Plan 03 deletes the class.
98
+
-**Fix:** Moved getHeader function and HeaderKey type into transaction.ts as non-exported (internal) declarations. They are no longer part of the @ickb/utils public API but remained available for SmartTransaction's internal use until 01-03 deleted the class.
0 commit comments