Skip to content

Filter User Deposits from full node block#69

Open
lukeiannucci wants to merge 4 commits into
mainfrom
li/fixes
Open

Filter User Deposits from full node block#69
lukeiannucci wants to merge 4 commits into
mainfrom
li/fixes

Conversation

@lukeiannucci

@lukeiannucci lukeiannucci commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Closes #<ISSUE_NUMBER>

This PR:

As pointed out by cLabs folks, batches dont include user deposit transactions. We do a byte for byte comparison between the Espresso signed batches, and the retrieved full node block. If there is a transaction deposit, espresso would not have this, causing the verification to fail. To fix this, we simply filter it out from the full node block.

This PR does not:

Key places to review:


@lukeiannucci lukeiannucci changed the title fix user deposit comparison bug + tests Filter User Deposits from full node Jul 2, 2026
@lukeiannucci lukeiannucci changed the title Filter User Deposits from full node Filter User Deposits from full node block Jul 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a mechanism to strip L1-derived user deposits from full node blocks before comparing them with Espresso batches, as Espresso batches do not carry these deposits. This is implemented via a new filterUserDeposits utility function and verified with comprehensive unit tests. The review feedback highlights opportunities to improve consistency by aligning function names with their comments and test names, and suggests adding a defensive nil check to prevent potential nil pointer dereferences.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread verifier/op/utils.go Outdated
Comment thread verifier/op/utils_test.go Outdated
lukeiannucci and others added 2 commits July 2, 2026 10:04
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@philippecamacho

philippecamacho commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Why does filtering user's deposits addresses Piers' concerns "So this means that when a batcher starts they will send ~15 minutes worth of batches where the batcher at the origin block is not the current batcher and the streamer would drop those batches."

@lukeiannucci please describe briefly the problem, and the idea of the solution in the description's PR.

@lukeiannucci

Copy link
Copy Markdown
Contributor Author

Why does filtering user's deposits addresses Piers' concerns "So this means that when a batcher starts they will send ~15 minutes worth of batches where the batcher at the origin block is not the current batcher and the streamer would drop those batches."

@lukeiannucci please describe briefly the problem, and the idea of the solution in the description's PR.

I will, sorry Piers noticed two separate issues. This is addressing this slack comment:
https://espressosys.slack.com/archives/C0A8YG1PMEJ/p1782390990779099?thread_ts=1782217075.043969&cid=C0A8YG1PMEJ

// deposit), so strip them from the full node block before comparison
comparableBlock := filterUserDeposits(fullNodeBlock)

if err := ensureBlocksMatch(espressoBlock, comparableBlock); err != nil {

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.

Suggestion: log also the number of transactions and their types for the espressoBlock and comparableBlock in case there is some issues related to users deposits.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread verifier/op/utils_test.go
// TestEnsureBlocksMatch_EpochBoundaryDeposits checks that an epoch-boundary block
// carrying an L1-derived user deposit verifies against its reconstructed batch
// once user deposits are stripped, and fails to match if they are not.
func TestEnsureBlocksMatch_EpochBoundaryDeposits(t *testing.T) {

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.

Suggestion: Add a test where there are only user deposits in the block (no sequencer txs).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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