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: 370e22d6-29c9-48b5-86fa-41b904898a0d

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-wal-files branch from 190a462 to 5953601 Compare June 18, 2026 23:19
@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-wal-files branch from 5953601 to 4a54b42 Compare June 19, 2026 00:00
@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-checkpoint-v7 branch from 1ea0be7 to ea43efc Compare July 2, 2026 18:23
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from 8177757 to efd0192 Compare July 2, 2026 18:43
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-checkpoint-v7 branch from ea43efc to a835d1f Compare July 13, 2026 17:24
@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-wal-files branch from d7bd6df to 96c606b Compare July 14, 2026 18:19
@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-wal-files branch from 96c606b to 5a0946c Compare July 31, 2026 03:20
@zhangchiqing
zhangchiqing force-pushed the leo/payloadless-remote-ledger-service branch from dd25d6c to 3e9115e Compare July 31, 2026 03:38
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.

2 participants