ethereum-optimism / ethereum-optimism/specs

Dealing with invalid batches in channel reader

Open
#29 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
178
Forks
206
Avg merge
5d 2h
Merged PRs (30d)
6

Description

The spec does not clearly describe the expected behavior for dealing with an invalid batch in the channel reader. The [Channel Reader (Batch Decoding)](https://github.com/ethereum-optimism/specs/blob/598745d96c573ac15c05a1040d27ae021c5a57b2/specs/protocol/derivation.md#channel-reader-batch-decoding) section does not mention anything and only links to the [Batch Format](https://github.com/ethereum-optimism/specs/blob/598745d96c573ac15c05a1040d27ae021c5a57b2/specs/protocol/derivation.md#batch-format) section. There it is mentioned that _unknown versions make the batch invalid (it must be ignored by the rollup node), as do malformed contents_.

However it is unclear what exactly "ignored" means and how other errors are handled. It [seems](https://github.com/ethereum-optimism/optimism/blob/afb204893af0c708b2ed2324cc7725e60b1dfa8d/op-node/rollup/derive/channel_in_reader.go#L88) that in the [op-node](https://github.com/ethereum-optimism/optimism/tree/develop/op-node) reference implementation, after any batch decode error (version or simple RLP error) the entire rest of the channel is skipped.

This behavior should also be described in the specification.

Contributor guide

Open the contributing guide

Research direction

Read the Channel Reader (Batch Decoding) and Batch Format sections in specs/protocol/derivation.md, then compare them with op-node/rollup/derive/channel_in_reader.go at the linked decode-error handling. Confirm how invalid batches and the remaining channel are treated, and document that behavior and error distinctions in the specification.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.