Skip to content

Use SQLITE_MAX_VARIABLE_NUMBER for chunking limit#20843

Open
emlowe wants to merge 1 commit intomainfrom
EL.fix-chunk-limit
Open

Use SQLITE_MAX_VARIABLE_NUMBER for chunking limit#20843
emlowe wants to merge 1 commit intomainfrom
EL.fix-chunk-limit

Conversation

@emlowe
Copy link
Copy Markdown
Contributor

@emlowe emlowe commented Apr 29, 2026

Wallet code was using the old 900 limit for chunking with trusted node - this change uses the SQLITE_MAX_VARIABLE_NUMBER var which sets the limit much highter in newer sqlite versions

Note, the untrusted limit remains unchanged


Note

Low Risk
Low risk: only adjusts the trusted sync batch size constant used for SQLite queries, with untrusted behavior unchanged; main concern is potential performance/memory impact from larger batches on some environments.

Overview
Updates wallet coin-state ingestion to size trusted-mode DB batches using SQLITE_MAX_VARIABLE_NUMBER (instead of a hardcoded 900) to match the SQLite host parameter limit on newer versions.

Untrusted-mode batching remains at 10, preserving existing validation/throughput behavior for untrusted peers.

Reviewed by Cursor Bugbot for commit d5d996a. Bugbot is set up for automated code reviews on this repo. Configure here.

@emlowe emlowe requested a review from a team as a code owner April 29, 2026 14:40
@emlowe emlowe added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Apr 29, 2026
@coveralls-official
Copy link
Copy Markdown

Coverage Report for CI Build 25115513192

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.09%) to 91.206%

Details

  • Coverage decreased (-0.09%) from the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • 107 coverage regressions across 29 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

107 previously-covered lines in 29 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
chia/_tests/core/util/test_lockfile.py 22 77.42%
chia/timelord/timelord.py 13 73.08%
chia/server/node_discovery.py 10 80.56%
chia/daemon/server.py 7 80.62%
chia/_tests/core/server/test_event_loop.py 6 89.04%
chia/wallet/wallet_node.py 6 87.16%
chia/full_node/full_node.py 5 87.59%
chia/introducer/introducer.py 4 83.62%
chia/server/server.py 4 86.1%
chia/simulator/setup_services.py 3 96.3%

Coverage Stats

Coverage Status
Relevant Lines: 117961
Covered Lines: 107753
Line Coverage: 91.35%
Relevant Branches: 11747
Covered Branches: 10548
Branch Coverage: 89.79%
Branches in Coverage %: Yes
Coverage Strength: 1.83 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changed Required label for PR that categorizes merge commit message as "Changed" for changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant