Commit 51866cdb authored by pcw109550's avatar pcw109550 Committed by protolambda

Update spec for span batch field limit

parent c0d92e66
...@@ -144,6 +144,14 @@ Where: ...@@ -144,6 +144,14 @@ Where:
[EIP-1559]: https://eips.ethereum.org/EIPS/eip-1559 [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 ## Optimization Strategies
### Truncating information and storing only necessary data ### Truncating information and storing only necessary data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment