Skip to content

Conversation

@Oppen
Copy link
Contributor

@Oppen Oppen commented Jan 22, 2025

The batcher could be brought to a stalemate by how it estimates the serialized size of a batch.
Currently, it misses the type and length indicator in the CBOR format when building the array of proofs to verify, so it sends batches bigger than operators had agreed on accepting.
See #1746

An accurate fix would be to use the whole array size by serializing the batch completely. However, that involves the following sources of complexity:

  • We would need to either move the proofs to an array from the queue or use a custom serializer;
  • We would need to do the whole serialization at each step of the loop, as the size of the indicator is variable (from 1 to 9 bytes).

Instead, we go for a little over-estimation in the estimation, assuming it will always be the biggest marker (9 bytes).

We also add an assertion at startup to make sure configuration is consistent: if you won't send batches bigger than N bytes, you can't accept proofs bigger than N-9 bytes.

Type of change

  • Bug fix

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change batcher/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@MauroToscano MauroToscano merged commit 986b8ed into testnet Jan 28, 2025
3 checks passed
@MauroToscano MauroToscano deleted the hotfix/batch_size_miscalculation branch January 28, 2025 19:09
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.

4 participants