Skip to content

Commit

Permalink
Update spec for span batch field limit
Browse files Browse the repository at this point in the history
  • Loading branch information
pcw109550 authored and protolambda committed Oct 30, 2023
1 parent c0d92e6 commit 51866cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions specs/span-batches.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ Where:

[EIP-1559]: https://eips.ethereum.org/EIPS/eip-1559

Every field size of span batch is limited to `MAX_SPAN_BATCH_FIELD_SIZE` (currently 10,000,000 bytes,
equal to `MAX_RLP_BYTES_PER_CHANNEL`). There can be at least single span batch per channel, and channel size is limited
to `MAX_RLP_BYTES_PER_CHANNEL` and you may think that there is already an implicit limit. However, having an explicit
limit for each field is helpful for several reasons. We may save computation costs by avoiding malicious input while
decoding. For example, lets say bad batcher wrote span batch which `block_count = max.Uint64`. We may early return using
the explicit limit, not trying to consume data until EOF is reached. We can also safely preallocate memory for decoding
because we know the upper limit of memory usage.

## Optimization Strategies

### Truncating information and storing only necessary data
Expand Down

0 comments on commit 51866cd

Please sign in to comment.