Skip to content

feat(toolkit): keep transaction results in lite snapshot - #29

Open
0xbigapple wants to merge 3 commits into
release_v4.8.3from
feature/toolkit-lite-keep-transaction-ret
Open

0xbigapple wants to merge 3 commits into
release_v4.8.3from
feature/toolkit-lite-keep-transaction-ret

Conversation

@0xbigapple

@0xbigapple 0xbigapple commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What does this PR do?

db lite -o split -t snapshot now copies the transactionRetStore entries of the retained blocks into the snapshot, together with the blocks and transactions it already copies.

  • Entries are read from the checkpoint first, the same way as blocks.
  • Empty blocks have no entry and are skipped.
  • engine.properties of transactionRetStore is copied as well.
  • plugins/README.md states what a snapshot contains.

No new option is added.

Why are these changes required?

A lite snapshot held the latest 65,536 blocks without their transaction results, so a lite node started from it could not serve receipts or logs for any of these blocks: eth_getLogs and eth_getBlockReceipts returned 4444, and eth_getTransactionReceipt returned null.

This PR has been tested by:

  • Unit Tests: DbLiteTest writes transaction results into the source database before splitting, and asserts that the snapshot holds exactly those of the retained blocks. All five DbLite* tests pass on JDK 8 / x86_64 (LevelDB and RocksDB); the three RocksDB ones also pass on JDK 17 / arm64.
  • Manual Testing on mainnet: split a snapshot from a mainnet lite node (LevelDB, head 82,859,896) with the default window and started a lite node from it.
    • The snapshot holds 65,536 transaction results (1.4 GiB), one per block of the window, all byte-identical to the source.
    • eth_getBlockReceipts returns one receipt per transaction at the lowest block of the window (237), the middle (328) and the head (460); the block below the window returns 4444.
    • eth_getTransactionReceipt returns the receipt of a transaction in the lowest block; eth_getLogs over the first 100 blocks returns 5,228 logs.
  • Manual Testing on Nile: split a snapshot from a Nile lite node (LevelDB, head 68,820,767) and started a lite node from it. The source node had stopped persisting transaction results after block 68,249,810, so the window was widened to 1,000,000 blocks with DbLite.setRecentBlks() to cover blocks both with and without them.
    • The snapshot holds 398,896 transaction results, the same count as the source in the window; none are outside the window, and all are byte-identical to the source.
    • eth_getBlockReceipts returns one receipt per transaction at the lowest block of the window, in the middle, and at the last block with source results; the block below the window returns 4444.
    • eth_getTransactionReceipt returns the receipt of a transaction in the lowest block; eth_getLogs over the first 1,000 blocks returns 643 logs.

Follow up

  • None

Extra details

  • Size: on mainnet the transaction results of 65,536 blocks take about 1.4 GiB, about 2% of the snapshot.
  • merge is unaffected: it already handles transactionRetStore by block number.
  • Transaction results are copied as far as the source node has them. If the source ran with transHistory.switch = off for part of the window, the gap stays in the snapshot. Results the source never persisted cannot be recovered from its database; the only way to fill a gap is to sync again from an earlier snapshot with the switch on. Both points are documented in plugins/README.md; no recovery is implemented in Toolkit.

Summary by cubic

Lite snapshots created with db lite -o split -t snapshot now include the transaction results of the retained blocks, so a lite node started from a snapshot can serve receipts and logs for those blocks.

  • Copies each block's transactionRetStore entry from the checkpoint alongside blocks and transactions; empty blocks (no entry) are skipped.
  • Copies engine.properties for transactionRetStore and updates plugins/README.md to describe snapshot contents, including the gaps left when storage.transHistory.switch = off.

Written for commit 4338aad. Summary will update on new commits.

View guided diff Turn on auto-fix

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9bd604e-1601-4cd3-bbcf-a121256ab431

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T09:23:17.116554Z 960a2fd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 3 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 960a2fdcde

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/README.md Resolved
@0xbigapple 0xbigapple closed this Nov 18, 2026
@0xbigapple 0xbigapple reopened this Nov 18, 2026

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread plugins/README.md Resolved
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
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