Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: batcher should not be able to build batches too big #1410

Open
wants to merge 6 commits into
base: staging
Choose a base branch
from

Conversation

uri-99
Copy link
Contributor

@uri-99 uri-99 commented Nov 12, 2024

Batcher max_batch_len limit

Description

This PR adds a feature on the Batcher that prevents it from making batches too big, that would revert in ETH due to gas cost limitations.

Type of change

  • New feature
  • Bug fix
  • Optimization
  • Refactor

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

To Test

You can play around with this new max_batch_len variable, set in config-batcher.yaml .
For example, set it at 16, then send a burst of 20.
You should see the batcher correctly sending one batch of 16 and another of 4.

@uri-99 uri-99 self-assigned this Nov 12, 2024
@uri-99 uri-99 linked an issue Nov 12, 2024 that may be closed by this pull request
@uri-99 uri-99 changed the base branch from testnet to staging November 12, 2024 23:32
Copy link

Changes to gas cost

Generated at commit: a41e44d0c5d3223c29381280a41f8103fb854b7e, compared to commit: 7ff5f308b15d50723a25d3ac9a638ce601b1bb8c

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
AlignedLayerServiceManager batchesState
receive
+44 ❌
+2,232 ❌
+6.46%
+4.99%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
AlignedLayerServiceManager 5,335,578 (+564,365) batchesState
createNewTask
disableVerifier
enableVerifier
isVerifierDisabled
receive
setDisabledVerifiers
725 (+44)
56,061 (+2,138)
23,911 (+22)
23,803 (-67)
583 (+44)
23,318 (+2,149)
23,801 (+44)
+6.46%
+3.96%
+0.09%
-0.28%
+8.16%
+10.15%
+0.19%
725 (+44)
76,070 (+2,227)
35,504 (+22)
24,447 (-67)
1,249 (+44)
46,922 (+2,232)
34,808 (+44)
+6.46%
+3.02%
+0.06%
-0.27%
+3.65%
+4.99%
+0.13%
725 (+44)
76,225 (+2,108)
35,504 (+22)
24,447 (-67)
583 (+44)
47,202 (+2,138)
34,808 (+44)
+6.46%
+2.84%
+0.06%
-0.27%
+8.16%
+4.74%
+0.13%
725 (+44)
77,083 (+2,297)
47,097 (+22)
25,092 (-67)
2,583 (+44)
47,202 (+2,138)
45,815 (+44)
+6.46%
+3.07%
+0.05%
-0.27%
+1.73%
+4.74%
+0.10%
256 (0)
256 (0)
2 (0)
2 (0)
3 (0)
256 (0)
2 (0)

Copy link
Collaborator

@MarcosNicolau MarcosNicolau left a comment

Choose a reason for hiding this comment

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

Worked on macos and linux.

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.

feat: batcher should not be able to build batches too big
2 participants