feat: replace ckb-transaction-dumper with ccc-based implementation#420
Merged
feat: replace ckb-transaction-dumper with ccc-based implementation#420
Conversation
- Rewrite src/tools/ckb-tx-dumper.ts to use ccc Client and molecule codecs - Implement dep_group unpacking using ccc.mol - Remove ckb-transaction-dumper from dependencies - Eliminates external npm dependency for transaction dumping
|
✅ Changeset file detected. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the previous ckb-transaction-dumper binary dependency with an in-repo implementation based on @ckb-ccc/core, intended to produce the same mock-tx JSON output for downstream debugging tooling.
Changes:
- Rewrote
src/tools/ckb-tx-dumper.tsto resolve inputs/cell-deps via a ccc RPC client and decodedep_groupvia molecule codecs. - Removed
ckb-transaction-dumperfrom dependencies and updated the lockfile accordingly. - Added a changeset and added
.sisyphus/*plan/session artifacts.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tools/ckb-tx-dumper.ts | Replaces subprocess-based dumping with a ccc-based resolver + JSON writer. |
| package.json | Removes ckb-transaction-dumper dependency. |
| pnpm-lock.yaml | Updates lockfile to reflect dependency removal (and related metadata changes). |
| .changeset/wise-candies-stop.md | Declares a minor release note for the dumper change. |
| .sisyphus/plans/ckb-tx-dumper.md | Adds a plan document describing the migration approach. |
| .sisyphus/boulder.json | Adds a session/state file containing local-path metadata. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove .sisyphus/boulder.json and add to .gitignore - Fix type field serialization: emit null instead of undefined - Fix dep_type format: convert camelCase to snake_case (depGroup -> dep_group) - Fix depGroup error handling: throw error when refCell not found - Fix async race condition: make buildTxFileOptionBy and callers async
- Use cccA.JsonRpcTransformers.transactionTo() to handle snake_case input format - Convert all numeric values to hex format (since, index, version, capacity) - Add missing dep_group cell to mock_info.cell_deps before expansion - Add fs.mkdirSync to ensure output directory exists Fixes issues where debug command failed with 'undefined is not iterable', 'unprovided cell dep', or 'since is not a legal u64' errors.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
src/cmd/debug.ts:17
debugTransactionis nowasync, but thedebugRaw(...)calls inside the loop are not awaited. This causes the function to resolve before the debugger runs/finishes, which can lead to the CLI exiting early and/or unhandled promise rejections. Await eachdebugRawcall (or collect andawait Promise.all(...)if parallel execution is intended).
for (const opt of opts) {
logger.section(opt.name, [], 'info');
debugRaw(`${txFile} ${opt.cmdOption}`);
}
src/cmd/debug.ts:65
debugSingleScriptis nowasync, but thedebugRaw(...)call isn't awaited. This makes the command return before the debugger completes and can cause the process to exit early. Await thedebugRawpromise here.
const txFile = await buildTxFileOptionBy(txHash, network);
let opt = `--cell-index ${cellIndex} --cell-type ${cellType} --script-group-type ${scriptType}`;
if (bin) {
opt = opt + ` --bin ${bin}`;
}
debugRaw(`${txFile} ${opt}`);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Select ClientPublicTestnet/Mainnet based on RPC URL pattern - Use proper error type checking with instanceof Error
RetricSu
added a commit
that referenced
this pull request
Apr 10, 2026
) (#431) * feat: replace ckb-transaction-dumper with ccc-based implementation - Rewrite src/tools/ckb-tx-dumper.ts to use ccc Client and molecule codecs - Implement dep_group unpacking using ccc.mol - Remove ckb-transaction-dumper from dependencies - Eliminates external npm dependency for transaction dumping * chore: add changeset for ckb-transaction-dumper replacement * fix: address PR review comments for ckb-tx-dumper - Remove .sisyphus/boulder.json and add to .gitignore - Fix type field serialization: emit null instead of undefined - Fix dep_type format: convert camelCase to snake_case (depGroup -> dep_group) - Fix depGroup error handling: throw error when refCell not found - Fix async race condition: make buildTxFileOptionBy and callers async * fix: fix CCC-based transaction dumper for debug command - Use cccA.JsonRpcTransformers.transactionTo() to handle snake_case input format - Convert all numeric values to hex format (since, index, version, capacity) - Add missing dep_group cell to mock_info.cell_deps before expansion - Add fs.mkdirSync to ensure output directory exists Fixes issues where debug command failed with 'undefined is not iterable', 'unprovided cell dep', or 'since is not a legal u64' errors. * fix: address Copilot PR review comments for ccc-based tx dumper - Select ClientPublicTestnet/Mainnet based on RPC URL pattern - Use proper error type checking with instanceof Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace ckb-transaction-dumper npm package with a pure ccc-based implementation.
Closes #194
Changes
Verification
Breaking Changes
None. The DumpOption interface and dumpTransaction() function signature remain unchanged.