Skip to content

[Storehouse] 009 Payloadless factory and localnet#8581

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

[Storehouse] 009 Payloadless factory and localnet#8581
zhangchiqing wants to merge 6 commits into
leo/payloadless-wal-filesfrom
leo/payloadless-remote-ledger-service

Conversation

@zhangchiqing

@zhangchiqing zhangchiqing commented Jun 11, 2026

Copy link
Copy Markdown
Member
  • 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

Run ID: c1eafa71-b082-47ee-9f3e-899dfd073d89

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 and usage tips.

@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
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