Skip to content

Fix cell scan page size handling#55

Merged
phroi merged 1 commit into
masterfrom
review/cell-page-size-single-scan
May 29, 2026
Merged

Fix cell scan page size handling#55
phroi merged 1 commit into
masterfrom
review/cell-page-size-single-scan

Conversation

@phroi
Copy link
Copy Markdown
Member

@phroi phroi commented May 29, 2026

Why

CCC cell scan limit is a per-request page size, not a total-result cap. The stack was treating scan limits as completeness sentinels in several state-loading paths, which could turn valid paginated scans into false incomplete-state errors and forced bot runtime code to re-scan public pool deposits.

Changes

  • Replace scan completeness sentinels with page-size-only collection helpers.
  • Keep SDK-facing scan options as cellPageSize, while lower-level managers use pageSize and pass it positionally to CCC.
  • Load bot pool deposits through the SDK L1 account-state snapshot, then partition that snapshot locally for ready, near-ready, and future pool deposits.
  • Reuse per-scan transaction/header point-read promises for DAO deposit, DAO withdrawal, and receipt conversion paths.
  • Update tests and docs around page-size semantics, bot pool scan policy, and point-read cache reuse.

Copy link
Copy Markdown

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

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 replaces the fail-closed sentinel scanning logic with a per-request page size configuration across the SDK, bot, and core packages, transitioning from collectCompleteScan to collectPagedScan. It also introduces transaction caching to reuse transaction header requests across lock scans. A review comment correctly points out an issue in packages/sdk/src/sdk.ts where findCellsOnChain is called with withData merged into the filter object instead of as a positional argument, which leads to misaligned arguments.

Comment thread packages/sdk/src/sdk.ts
@phroi
Copy link
Copy Markdown
Member Author

phroi commented May 29, 2026

/gemini review

Copy link
Copy Markdown

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

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 replaces the sentinel-based fail-closed scanning limits with a unified, configurable cell query page size (cellPageSize / pageSize) across the SDK and core packages. This simplifies the scanning logic by tuning the paging size without capping the total results. Additionally, it introduces transaction and header caching in LogicManager and DaoManager to reuse requests across lock scans, improving performance. There are no review comments to address, and I have no further feedback to provide.

@phroi
Copy link
Copy Markdown
Member Author

phroi commented May 29, 2026

LGTM

Phroi %198

@phroi phroi merged commit bd4c2bb into master May 29, 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