Skip to content

[Storehouse] 009 Payloadless factory and localnet - #8581

Open
zhangchiqing wants to merge 9 commits into
leo/payloadless-wal-filesfrom
leo/payloadless-remote-ledger-service
Open

[Storehouse] 009 Payloadless factory and localnet#8581
zhangchiqing wants to merge 9 commits into
leo/payloadless-wal-filesfrom
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.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f073a2a0-1cd6-46c1-b3a1-d6610a4d50e8

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch leo/payloadless-remote-ledger-service

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.

@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
//
// triggerCheckpoint is a runtime control signal to trigger checkpoint on
// next segment finish (ignored by the remote client; can be nil).
func NewPayloadlessLedger(config Config, triggerCheckpoint *atomic.Bool) (ledger.PayloadlessLedger, error) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mirrored from NewLedger

Comment thread ledger/factory/factory.go
}

// Use factory to create ledger with internal compactor
factory := complete.NewLocalLedgerFactory(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously this went through a LocalLedgerFactory indirection. That factory's only job was to construct the ledger storage, and nothing else referenced it, so it added no value. We've inlined it here and return the ledger storage directly. Therefore, the ledger/complete/factory.go file was removed in this PR. The payloadless path (newLocalPayloadlessLedger) follows the same pattern.

Comment thread ledger/factory/factory.go
Str("ledger_service_addr", config.LedgerServiceAddr).
Msg("using remote ledger service")

factory := remote.NewRemoteLedgerFactory(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously this went through a RemoteLedgerFactory that only constructed the remote client. The factory abstraction added no value, so we removed it and create the remote ledger client directly here. And the same pattern applied to newRemotePayloadlessLedger.

@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

return dockerServices
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trailing blank line at EOF fails gofmt. Because the file is in the integration/ module, the main-module make lint passes and won't catch it locally, but integration CI lint will fail.

// or a newer numbered one written by the compactor), so no conversion is
// needed at runtime. The os.Stat guard makes a re-run of `make bootstrap`
// idempotent and avoids ConvertCheckpointV6ToV7's "output exists" rejection.
if payloadless {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this conversion isn't guarded on the V6 source existing. If neither a V6 nor a V7 root checkpoint is present, ConvertCheckpointV6ToV7 is still called and panics on the missing source.

Comment on lines +493 to +501
if payloadless {
service.Command = append(service.Command, "--payloadless")
}

// Payloadless mode requires storehouse to store the actual payloads
// (the trie only stores payload hashes)
if payloadless {
service.Command = append(service.Command, "--enable-storehouse")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

join into one if.

@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

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from a46a44d to a7a441c Compare August 18, 2026 15:43
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from a7a441c to 11010fb Compare August 18, 2026 17:25
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 11010fb to 07b2356 Compare August 18, 2026 18:17
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 07b2356 to 2b01b60 Compare August 18, 2026 20:29
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 2b01b60 to 3df3fe1 Compare August 24, 2026 14:01
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 3df3fe1 to 409633a Compare August 25, 2026 02:47
@blacksmith-sh

This comment has been minimized.

@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 409633a to 5a1e23d Compare August 25, 2026 23:00
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.

3 participants