Skip to content

[Storehouse] 006 Payloadless execution builder#8577

Open
zhangchiqing wants to merge 2 commits into
leo/payloadless-view-committerfrom
leo/payloadless-execution-builder
Open

[Storehouse] 006 Payloadless execution builder#8577
zhangchiqing wants to merge 2 commits into
leo/payloadless-view-committerfrom
leo/payloadless-execution-builder

Conversation

@zhangchiqing

@zhangchiqing zhangchiqing commented Jun 8, 2026

Copy link
Copy Markdown
Member
  • Add --payloadless=true|false flag to execution node (not working when payloadless=true yet, only works for the default value false)
  • Integrate the payloadless ledger to execution builder

@coderabbitai

coderabbitai Bot commented Jun 8, 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: d618a39b-46f7-4afe-9367-6f2b61afe628

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-execution-builder

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 marked this pull request as ready for review June 9, 2026 21:51
@zhangchiqing zhangchiqing requested a review from a team as a code owner June 9, 2026 21:51
@zhangchiqing zhangchiqing force-pushed the leo/payloadless-view-committer branch from 5d35e82 to d4f7065 Compare June 18, 2026 23:16
@zhangchiqing zhangchiqing force-pushed the leo/payloadless-execution-builder branch from d7dea94 to fcc22e5 Compare June 18, 2026 23:18
@zhangchiqing zhangchiqing force-pushed the leo/payloadless-view-committer branch from d4f7065 to a66eeaa Compare June 19, 2026 00:00
@zhangchiqing zhangchiqing force-pushed the leo/payloadless-execution-builder branch from fcc22e5 to f138980 Compare June 19, 2026 00:00
// ledger storage.
func NewExecutionState(
ls ledger.Ledger,
ls LedgerStateChecker,

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.

I'm not a fan of this signature!
I think I would just keep snapshotLedger ledger.Ledger, then inside of the method check if snapshotLedger is the type of ledger that has state or not when this is relevant.

@zhangchiqing zhangchiqing Jun 29, 2026

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.

Good question.

The reason we introduce the LedgerStateChecker interface is because payloadless ledger does not implement the ledger.Ledger interface, instead, it implement ledger.PayloadlessLedger interface.

We tried to be more strict by creating more interface and types for the payloadless feature in order to leverage the static compiler checks. The approach you suggest could work, but relies on runtime type check, so we would have to give up the safety from static type check.

The ledger.Ledger can query register value by key, and ledger.PayloadlessLedger can only query register leaf hash by key, because it does not store payload, but only the hash. But they can both support checking if they have a certain trie root hash.

However, we don't want to create a NewPayloadlessExecutionState, because that would duplicate lots of code. In order to reuse the NewExecutionState for both full node and payloadless node, we would have to change the ledger.Ledger input. And I found that interface is mostly used to check if the ledger has certain trie root hash, which ledger.PayloadlessLedger also supports. And the only case specifically for the ledger.Ledger interface is the NewLedgerStorageSnapshot function where the ledger.Ledger is only needed when storehouse is enabled. Since we know payloadless mode must work with storehouse, it's ok that if storehouse is not enabled, then we don't use payloadless interface, but only the ledger.Ledger.

That's why it's better take two inputs (ledger.Ledger and LedgerStateChecker): the ledger.Ledger (snapshotLedger) is only used by NewPayloadlessExecutionState, whereas LedgerStateChecker is used everywhere else.

@zhangchiqing zhangchiqing force-pushed the leo/payloadless-view-committer branch from a66eeaa to 553a243 Compare July 2, 2026 18:01
@zhangchiqing zhangchiqing force-pushed the leo/payloadless-execution-builder branch from f138980 to fc173be Compare July 2, 2026 18:01
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