Skip to content

build: bump kwil-db to pick up the block sync fixes - #1437

Merged
MicBun merged 1 commit into
mainfrom
bump-kwil-db-for-block-sync
Sep 26, 2026
Merged

MicBun merged 1 commit into
mainfrom
bump-kwil-db-for-block-sync

Conversation

@MicBun

@MicBun MicBun commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Part of:

The node has pinned kwil-db at cf061288 since 17-Sep. Twelve commits have landed on kwil-db main since then: the block sync work under the Goal above, and two fixes found along the way. None of them is in a node binary yet. This moves the pin to eb765df9.

What it carries

Worth knowing before the release

Edited block_sync values start to apply. Every shipped default equals the hardcoded value it replaces, so a node on stock values behaves as before. A node whose operator edited one of the nine keys is now obeyed on catch-up. The Truflation mainnet sentry was checked on 17-Sep and runs stock values. Other operators' configs have not been checked.

Prefetch is off. block_sync.prefetch_bytes defaults to 0, which fetches one block at a time as before, and a generated config writes the key commented out. To try it, set prefetch_bytes = 33554432 (32 MB) under [block_sync]. A later release is meant to make that the default.

Two of these ship together, and do here. The first byte budget raised what a peer that hangs costs a catching-up node from 0.5 s to 20 s per request. Asking the fastest peer first, and holding back a peer that fails, is what stops that repeating on every block. Both are in this bump.

A very large block now waits on disk. Postgres used to stream a transaction larger than logical_decoding_work_mem (64 MB) while it ran. It now sends it whole once prepared, and holds it in pg_replslot until then: about 820 MB for a block that changes 3 million rows. Only a heavy migration reaches that size. The node waits for such a block's commit hash while the replication stream keeps delivering data, up to 30 minutes.

The catch-up log lines changed. Block sync completed and Processed blocks now carry network and apply fields. Anything that parses those lines should be checked.

Consensus

A block executes and hashes as before. The two changes that sit next to consensus:

  • A block's commit hash changes only if Postgres streamed it and, while it did, a savepoint rolled back or another connection committed. Neither mainnet nor testnet leader has streamed a transaction since its last restart (pg_stat_replication_slots, checked 24-Sep).
  • A block that fails its checks during catch-up is fetched again from another peer, where it used to stop the node. The commit info's parameter updates are now compared after the app hash, not before. Neither turns away a block the chain committed.

No protocol is added to those a peer must speak, so upgraded and older nodes keep talking to each other. kwil-db/core has no changes in this range; its pin moves with the module.

Verification

  • go build ./... and go vet -tags kwiltest ./... are clean.
  • Three schema suites run the node's own actions through kwil-db's engine against the new pin, and all pass: tests/streams/auth (438 s), tests/streams/aggregation (309 s) and tests/streams/query (922 s). Each opens its database through pg.NewDB, so each also starts the replication monitor that changed in this range.
  • The go.mod diff is the two kwil-db lines and nothing else; go mod tidy pulled in no other changes.

There is no Problem issue for this in node. It delivers work merged under the kwil-db Goal above, so it carries no closing keyword.

Summary by CodeRabbit

  • Chores
    • Updated the Kwil DB dependencies.

@MicBun MicBun self-assigned this Sep 26, 2026
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: feb28b2f-302d-4471-8888-a5c56d8ff5cd

📥 Commits

Reviewing files that changed from the base of the PR and between e746e12 and 7a4fbcc.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Both github.com/trufnetwork/kwil-db dependencies were updated to pseudo-versions based on commit eb765df9c053.

Changes

kwil-db dependency update

Layer / File(s) Summary
Update dependency versions
go.mod
Both kwil-db dependencies now use pseudo-versions based on commit eb765df9c053.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 7a4fb

Both kwil-db dependencies are aligned to the same upstream revision, and no concrete user-facing or operational regression is established. The change is mergeable with normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 7a4fb

The change affects 1 system.

Changed systems: go.mod

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — go.mod (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in go.mod: Updated both kwil-db dependencies from pseudo-versions based on commit cf061288132e to versions based on commit eb765df9c053.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: updating kwil-db to include block sync fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@holdex

holdex Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Time Submission Status

Member # Time Running Total Status Last Update
MicBun 2h ✅ Submitted Sep 26, 2026, 7:06 AM

Submit or update total time with:

@holdex pr submit-time 2h

Add time on top of previous submission with:

@holdex pr add-time 1h30m

See available commands to help comply with our Guidelines.

@MicBun

MicBun commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

@holdex pr submit-time 2h

@MicBun
MicBun merged commit b5f9737 into main Sep 26, 2026
8 checks passed
@MicBun
MicBun deleted the bump-kwil-db-for-block-sync branch September 26, 2026 07:05
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