Skip to content

Adopt core protocol libraries#60

Merged
phroi merged 1 commit into
masterfrom
review/core-protocol-libraries
Jul 8, 2026
Merged

Adopt core protocol libraries#60
phroi merged 1 commit into
masterfrom
review/core-protocol-libraries

Conversation

@phroi

@phroi phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member

Why

Continue the migration after the shared utility packages by moving the core protocol surfaces into their package-ready shape before broader SDK, app, and validation follow-ups.

This also removes the custom local CCC fork workflow so the stack builds and tests against mainline published @ckb-ccc/* packages from the workspace catalog and lockfile.

Changes

  • Rework @ickb/core, @ickb/dao, and @ickb/order around explicit package entry points, build configs, API Extractor configs, and package-local tests.
  • Add iCKB completion, DAO output-limit, owned-owner, and order matching coverage needed for the migrated package boundaries.
  • Remove the custom CCC fork tooling/docs/runtime hooks (forks:ccc, local forks/ccc/repo, fork smoke/override checks, and deploy/supervisor CCC build gates).
  • Use mainline published @ckb-ccc/* catalog versions for the migrated protocol packages.
  • Keep current downstream tests compatible with the new protocol package APIs and published CCC ESM behavior.

@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a major refactoring across the @ickb monorepo packages, including core, dao, order, and sdk. Key updates include transitioning relative imports to .ts extensions, adding api-extractor configurations, updating package scripts, and introducing comprehensive JSDoc documentation. Additionally, the IckbUdt class has been refactored to extend ccc.Udt with custom completion logic, and Nervos DAO output limit checks have been streamlined, removing redundant mocks and assertions from the test suites. There are no review comments to address, and the changes appear to be a clean and thorough modernization of the codebase.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

CCC cleanup note: this branch now removes the custom local CCC fork workflow (forks:ccc, local forks/ccc/repo, fork smoke/override checks, and deploy/supervisor CCC build gates). The stack uses mainline published @ckb-ccc/* packages pinned through the workspace catalog and lockfile: @ckb-ccc/ccc@1.2.0, @ckb-ccc/core@1.14.0, and @ckb-ccc/udt@0.2.0.

@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the workspace to simplify dependencies by resolving CCC packages directly through the lockfile, removing the local CCC fork build step, and updating import paths to use .ts extensions. It restructures and modularizes the core, dao, and order packages, introducing API Extractor configurations, robust transaction-shaping helpers, and comprehensive test suites. The review feedback highlights several opportunities to improve debuggability by replacing vague error messages with descriptive, context-rich errors that include transaction hashes, block numbers, or outpoints. Additionally, a critical issue was identified in packages/core/src/udt.ts where a missing input cell could lead to a runtime crash during transaction completion.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/core/src/udt.ts
Comment thread packages/core/src/udt.ts Outdated
Comment thread packages/core/src/cells.ts Outdated
Comment thread packages/dao/src/cells.ts Outdated
Comment thread packages/dao/src/cells.ts Outdated
Comment thread packages/dao/src/cells.ts Outdated
Comment thread packages/dao/src/dao.ts Outdated
Comment thread packages/dao/src/dao.ts Outdated
@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the workspace by removing the local CCC fork build workflow and resolving CCC packages as standard package dependencies. It also refactors and reorganizes the core, dao, and order packages, integrating api-extractor and updating build scripts. Additionally, the matching logic in the order package has been modularized, and IckbUdt in the core package has been refactored to handle transaction completion directly. Feedback on the changes includes a recommendation to use a TypeScript type guard in order_match_sequence.ts to properly narrow the type of filtered order matchers.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/order/src/matching/order_match_sequence.ts Outdated
@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the workspace setup by resolving CCC packages as normal package dependencies, removing the need for a local CCC fork build step. It also refactors the core, dao, and order packages by migrating relative imports to .ts extensions, adding comprehensive JSDoc documentation, extracting internal helper functions, and reorganizing test suites into dedicated test directories. Feedback on the changes suggests avoiding optional chaining when retrieving elements from internal collections using a previously validated index in packages/core/src/owned_owner.ts, recommending throwing an explicit error instead to make invariant breaks visible.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/core/src/owned_owner.ts
@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@phroi

phroi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@phroi phroi force-pushed the review/core-protocol-libraries branch from 811bbd1 to 23ab1d4 Compare July 8, 2026 03:08
@phroi

phroi commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the local CCC fork build workflow, transitioning the workspace to resolve CCC packages as standard package dependencies via pnpm catalogs and the lockfile. It also migrates packages/core, packages/dao, and packages/order to use tsgo and api-extractor for building and API linting, updates relative imports to use .ts extensions, and restructures tests into dedicated directories. Additionally, the codebase is refactored to introduce stricter validation for Nervos DAO cells, receipt payloads, and limit-order matching. As there were no review comments provided, I have no further feedback to offer.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@phroi

phroi commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

LGTM

Phroi %355

@phroi phroi merged commit 17b0b50 into master Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant