Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast verify header.Root while syncing block data from squencer #2302

Closed
renlulu opened this issue May 14, 2024 · 1 comment
Closed

Fast verify header.Root while syncing block data from squencer #2302

renlulu opened this issue May 14, 2024 · 1 comment

Comments

@renlulu
Copy link
Contributor

renlulu commented May 14, 2024

Is your feature request related to a problem? Please describe.
Hi team, while walking through fullnode's syncing logic from sequencer, I realize that (maybe i am wrong):

  1. broadcastclient received batch item from sequencer/feedrelay
  2. broadcastclient calls TransactionStreamer.AddBroadcastMessages then the batch item/messages would be stored into ethdb
  3. TransactionStreamer also has a timing function executeMessages which consumes messages from step 2, and the roughly call stack is executeMessages -> ExecuteNextMsg -> ExecutionEngine.DigestMessage -> digestMessageWithBlockMutex -> createBlockFromNextMessage -> arbos.ProduceBlock -> ProduceBlockAdvanced
  4. inside ProduceBlockAdvanced, it calls FinalizeBlock which get us a headerRoot of this block

So i wonder, is it possible to verify the computed headerRoot with the one synced from sequencer? That will give us some more confidence that the block data we get from sequencer is valid even before going to block validation (sometimes we disable it for some reason or we want check the block validity immediately while block validation is a bit slow behind the block creation)

Describe the solution you'd like

Add one more filed into L1IncomingMessage, it can be like:

type L1IncomingMessage struct {
	Header *L1IncomingMessageHeader `json:"header"`
	L2msg  []byte                   `json:"l2Msg"`
	L2HeaderRoot common.hash `json:"l2HeaderRoot"` <---- to add

	// Only used for `L1MessageType_BatchPostingReport`
	BatchGasCost *uint64 `json:"batchGasCost,omitempty" rlp:"optional"`
}

Then check L2HeaderRoot with header.Root

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Feel free to let me know if I misunderstood the codebase, appreciated!

@PlasmaPower
Copy link
Collaborator

We're working on something similar to pass the full block hash through the feed to check it: #2289

@renlulu renlulu closed this as completed Sep 11, 2024
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

No branches or pull requests

2 participants