Skip to content

build: bump kwil-db to keep block apply fast on long chains - #1438

Merged
MicBun merged 1 commit into
mainfrom
bump-kwil-db-block-index
Sep 29, 2026
Merged

MicBun merged 1 commit into
mainfrom
bump-kwil-db-block-index

Conversation

@MicBun

@MicBun MicBun commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Part of:

The node pins kwil-db at eb765df9, which v2.6.0 shipped. One commit has landed on kwil-db main since then, and this moves the pin to it, a206f35b:

Why it matters

A node keeps one index entry in memory for every block it has stored. Testnet is at 12.56 million blocks, so on its leader the index was 85% of a heap already above GOMEMLIMIT. Collection ran back to back, 94% of the leader's CPU went to it, and blocks waited for a CPU 40% of the time they spent executing and committing. That is why the testnet sentry caught up at 5.8 blocks per second on v2.6.0, with the network taking 14 seconds of the 7 hours 39 minutes.

v2.6.0 rebuilt with only this change ran on the testnet sentry for 45 minutes:

Testnet sentry v2.6.0 With this change
Executing an ordinary block, mean 115 ms 63 ms
Executing every 50th block (LP rewards sampling), median 2,944 ms 1,093 ms
Catch-up, apply per block 163 ms 87 ms
Node CPU while following the chain 165% to 171% 2% to 4%

Mainnet nodes have more memory headroom and 2.77 million blocks, so they are not in this state today. Without this change they would get there as the chain grows.

Consensus

Nothing that executes or hashes a block changes. The change is to how the block store holds its index in memory. Best() returns the same height, hashes and time stamp as before, and it has a test for that, including after the index is rebuilt at startup. kwil-db/core has no changes in this range; its pin moves with the module.

Verification

  • The kwil-db tree at a206f35b is identical to the one that ran on the testnet sentry above (git diff between them is empty).
  • go build ./... and go vet -tags kwiltest ./... are clean, with Go 1.25.3 as the Dockerfile uses.
  • No node code or test imports kwil-db's block store, which only kwild's startup opens, so I did not rerun the schema suites for this bump.
  • The go.mod diff is the two kwil-db lines; go mod tidy changed nothing else.

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 application’s underlying platform components. No changes to user-facing features or behavior are included in this release. There are no new capabilities, interface changes, or bug fixes to highlight. The update is limited to behind-the-scenes maintenance and does not change how the application works for end users.

@MicBun MicBun self-assigned this Sep 29, 2026
@holdex

holdex Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Time Submission Status

Member # Time Running Total Status Last Update
MicBun 30min ✅ Submitted Sep 29, 2026, 8:27 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.

@coderabbitai

coderabbitai Bot commented Sep 29, 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: af0cc028-67fe-4956-9e9f-763edadcd246

📥 Commits

Reviewing files that changed from the base of the PR and between b5f9737 and a44b6de.

⛔ 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

The go.mod file updates the github.com/trufnetwork/kwil-db and github.com/trufnetwork/kwil-db/core dependencies to newer pseudo-versions at commit a206f35beb6e.

Changes

Kwil dependency update

Layer / File(s) Summary
Update Kwil dependency versions
go.mod
Both Kwil dependencies now use versions dated 2026-09-29 at commit a206f35beb6e, replacing versions dated 2026-09-25 at commit eb765df9c053.

Priority: ➖ Normal

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

Change: Other

Merge Risk: ⚪ Minimal · up to a44b6

The dependency update preserves the node-visible block-store behavior on supported paths; no specific merge-blocking behavior change was identified.

Architecture Summary

Architecture risk: 🔵 Low · up to a44b6

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: Both Kwil dependencies now use pseudo-versions dated 2026-09-29 at commit a206f35beb6e, replacing versions dated 2026-09-25 at 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 the kwil-db dependency to improve block application performance on long chains.
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.

@MicBun

MicBun commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@holdex pr submit-time 30m

@MicBun
MicBun merged commit 9e7ef82 into main Sep 29, 2026
8 checks passed
@MicBun
MicBun deleted the bump-kwil-db-block-index branch September 29, 2026 08:27
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