[INT-454] Add chunking of safe multisig batching + LZ_BATCH_SIZE - #1613
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements chunking functionality for LayerZero's experimental batched multisig transaction sending to prevent gas limit failures when processing large transaction batches. The chunking is controlled by a new LZ_BATCH_SIZE environment variable with a default value of 20.
Key changes include:
- Added configurable batch size chunking with
LZ_BATCH_SIZEenvironment variable (defaults to 20) - Enhanced error handling to halt further batch processing when a batch fails
- Improved logging to show batch progress and completion status
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/devtools/src/transactions/signer.ts | Implements chunking logic in sendBatchedIfAvailable function with configurable batch sizes and early termination on failures |
| packages/devtools/test/transactions/signer.test.ts | Adds comprehensive test coverage for chunking scenarios including edge cases, error handling, and multi-EID batching |
| .changeset/dull-dolphins-share.md | Documents the feature addition for release notes |
shankars99
reviewed
Jul 14, 2025
shankars99
reviewed
Jul 14, 2025
shankars99
pushed a commit
that referenced
this pull request
Jul 20, 2025
mattsse
pushed a commit
to mattsse/devtools
that referenced
this pull request
Aug 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using the LZ_ENABLE_EXPERIMENTAL_BATCHED_SEND feature flag, it will batch all txs together, even if there are 100s of transactions. This can result in exceeding gas limits and reverting, so in practice, users have only been using this feature flag when they are expecting about 7 transactions at once.
Example Queue: https://app.safe.global/transactions/queue?safe=bnb:0x1fBd62569885EDc6b757f6C27699F30aB6b0A05a
Command ran:
LZ_BATCH_SIZE=2 LZ_ENABLE_EXPERIMENTAL_BATCHED_SEND=1 npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts --safe --log-level debugOutput: