Skip to content

[Storehouse] 009 Payloadless factory and localnet - #8581

Merged
zhangchiqing merged 44 commits into
masterfrom
leo/payloadless-remote-ledger-service
Sep 24, 2026
Merged

zhangchiqing merged 44 commits into
masterfrom
leo/payloadless-remote-ledger-service

Conversation

@zhangchiqing

@zhangchiqing zhangchiqing commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

The previous PR #8598 can startup a payloadless mode EN with a payloadless checkpoint file, and replay wal files to resume execution. But the localnet doesn't work, because localnet is bootstrapping with a v6 checkpoint, no v7 checkpoint. So a automatic conversion from v6 to v7 checkpoint is required during bootstrapping. And after this PR, we can startup a payloadless mode EN in localnet.

  • Added Payloadless factory method
  • Removed the Factory interface. Instead, inlined the ledger client creation for remote ledger service, and inlined the ledger storage creation for local ledger mode.

Summary by CodeRabbit

  • New Features

    • Added payloadless ledger mode for local and remote deployments.
    • Added a payloadless option to localnet setup, including automatic execution-node and ledger configuration.
    • Startup reporting now indicates whether payloadless mode is active.
    • Localnet bootstrapping now prepares the required V7 checkpoint for payloadless operation.
  • Bug Fixes

    • Remote-ledger configurations now correctly avoid unnecessary local checkpoint conversion.
    • Payloadless ledgers require a valid V7 root checkpoint before starting, preventing initialization from incomplete state.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

The saved review history does not include the base for the last reviewed commit. This saved history cannot establish the base for an incremental review. Comment @coderabbitai full review to establish a new review baseline. No full review was started, and the last reviewed checkpoint was preserved.

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
📝 Walkthrough

Walkthrough

The change adds payloadless ledger mode across ledger construction, service startup, WAL checkpoint handling, and localnet bootstrap. It also removes ledger factory interfaces and routes local and remote ledger creation through direct constructors.

Changes

Payloadless ledger integration

Layer / File(s) Summary
Ledger construction dispatch
ledger/factory.go, ledger/factory/factory.go, ledger/complete/factory.go, ledger/remote/factory.go, ledger/mock/factory.go, ledger/factory/factory_test.go
Factory interfaces and implementations are removed. Local and remote ledgers use direct constructors. NewPayloadlessLedger selects a local ledger or remote client from LedgerServiceAddr.
Payloadless checkpoint startup
ledger/complete/wal/*, ledger/complete/payloadless_ledger_with_compactor_test.go
Payloadless startup now requires a numbered or root V7 checkpoint. WAL replay returns an error when no V7 checkpoint exists. Tests seed valid V7 roots and verify the missing-checkpoint error.
Ledger service mode selection
cmd/ledger/main.go
The ledger command adds --payloadless, selects the matching ledger and gRPC service, shares lifecycle handling, and validates state through a common inspection interface.
Localnet payloadless bootstrap
integration/localnet/Makefile, integration/localnet/builder/bootstrap.go, cmd/execution_builder.go
Localnet accepts and propagates payloadless mode. It converts available V6 root checkpoints to V7, creates V7 links, and avoids local conversion when a remote ledger service is configured.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant LocalnetBuilder
  participant ExecutionNode
  participant LedgerCommand
  participant LedgerFactory
  participant LedgerService
  LocalnetBuilder->>ExecutionNode: start with payloadless and storehouse flags
  LocalnetBuilder->>LedgerService: start with payloadless flag and V7 checkpoint
  LedgerCommand->>LedgerFactory: select local or remote payloadless ledger
  LedgerFactory-->>LedgerCommand: return ledger and service registration
  LedgerCommand->>LedgerService: register selected gRPC service
Loading

Suggested reviewers: janezpodhostnik

Merge Risk: 🔵 Low · up to 542c5

Remote payloadless startup is newly supported but untested; add the focused configuration test before broad reliance on this mode.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main changes: payloadless factory support and localnet integration.
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
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch leo/payloadless-remote-ledger-service

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

@zhangchiqing zhangchiqing changed the title [Storehouse] Add remote ledger / local ledger factory for payloadless trie [Storehouse] Add payloadless mode to ledger factory and localnet Jun 11, 2026
@zhangchiqing zhangchiqing changed the title [Storehouse] Add payloadless mode to ledger factory and localnet [Storehouse] 009 Add payloadless mode to ledger factory and localnet Jun 11, 2026
@zhangchiqing zhangchiqing changed the title [Storehouse] 009 Add payloadless mode to ledger factory and localnet [Storehouse] 009 Payloadless factory and localnet Jun 12, 2026
Comment thread ledger/factory/factory.go
Comment thread ledger/factory/factory.go
Comment thread ledger/factory/factory.go
@zhangchiqing
zhangchiqing marked this pull request as ready for review June 12, 2026 23:38
@zhangchiqing
zhangchiqing requested a review from a team as a code owner June 12, 2026 23:38
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 059892d to 08074ba Compare June 18, 2026 02:52
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 08074ba to 4f1f09d Compare June 18, 2026 23:19
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 0955ccb to 8177757 Compare June 19, 2026 00:00
Base automatically changed from leo/payloadless-wal-files to leo/payloadless-checkpoint-v7 July 2, 2026 18:06
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 8177757 to efd0192 Compare July 2, 2026 18:43
@zhangchiqing
zhangchiqing changed the base branch from leo/payloadless-checkpoint-v7 to leo/payloadless-wal-files July 13, 2026 17:25
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from efd0192 to fba2a36 Compare July 13, 2026 17:26
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from fba2a36 to dd25d6c Compare July 14, 2026 19:26
Comment thread integration/localnet/builder/bootstrap.go Outdated
Comment thread integration/localnet/builder/bootstrap.go Outdated
Comment thread integration/localnet/builder/bootstrap.go
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from dd25d6c to 3e9115e Compare July 31, 2026 03:38
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 5c5ad9b to a46a44d Compare August 18, 2026 01:55
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter

codecov-commenter commented Aug 18, 2026 •

Copy link
Copy Markdown

@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 542c523 to 4f8b2a9 Compare September 16, 2026 16:12
@zhangchiqing
zhangchiqing added this pull request to the merge queue Sep 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because a pull request earlier in the stack was removed Sep 23, 2026
Base automatically changed from leo/payloadless-wal-files to master September 24, 2026 21:35
@zhangchiqing
zhangchiqing added this pull request to the merge queue Sep 24, 2026
Merged via the queue into master with commit 6908570 Sep 24, 2026
62 checks passed
@zhangchiqing
zhangchiqing deleted the leo/payloadless-remote-ledger-service branch September 24, 2026 23:02
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.

5 participants