[Storehouse] 009 Payloadless factory and localnet#8581
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| // | ||
| // 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) { |
There was a problem hiding this comment.
mirrored from NewLedger
| } | ||
|
|
||
| // Use factory to create ledger with internal compactor | ||
| factory := complete.NewLocalLedgerFactory( |
There was a problem hiding this comment.
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.
| Str("ledger_service_addr", config.LedgerServiceAddr). | ||
| Msg("using remote ledger service") | ||
|
|
||
| factory := remote.NewRemoteLedgerFactory( |
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.