[DEVREL-1425] fix: chunk setConfig to avoid calldata limits on L2s#1935
[DEVREL-1425] fix: chunk setConfig to avoid calldata limits on L2s#1935
Conversation
PR SummaryLow Risk Overview Adds a small local Written by Cursor Bugbot for commit a225538. Configure here. |
🧪 E2E Test StatusE2E tests are non-blocking and validate real blockchain interactions. Failures may occur due to network issues, RPC rate limits, or external service downtime. Test Runs (Newest First):
|
|
Why Two reasons. The calldata per entry is much smaller: compact On top of that, |
| const CONFIG_TYPE_EXECUTOR = 1 | ||
| const CONFIG_TYPE_ULN = 2 | ||
| const CONFIG_TYPE_READ_LIB_CONFIG = 1 | ||
| const CONFIG_BATCH_SIZE = 10 |
There was a problem hiding this comment.
It'd be great to have this overridable by env var, such as in https://github.com/LayerZero-Labs/devtools/blob/main/packages/devtools/src/transactions/signer.ts#L180-L183.
There was a problem hiding this comment.
Perhaps we can mark it as a follow up PR? Trying to minimize package surfaces that I need to bump to unblock USDT0.
There was a problem hiding this comment.
I agree, this should be configurable via env vars must be the easiest way
What does this PR do?
Chunks
SetConfigParam[]into batches of 10 inEndpointV2.setConfig(), producing multiple smaller transactions instead of one large one. This prevents calldata/gas limit failures when wiring OApps across 20+ destination chains on L2s.Why is this change needed?
When wiring OApps to many destinations, all config params (ULN + executor per chain) are encoded into a single
setConfigcalldata. With 20+ chains this exceeds calldata/gas limits on certain EVM L2s (Arbitrum, Optimism, etc.), causinglz:oapp:wireto fail.The return type is already
Promise<OmniTransaction[]>and the upstream consumer inua-devtoolsalready handles arrays withArray.isArray, so this is a zero-interface-change fix scoped to a single package.How was this tested?
pnpm buildpasses across all packages (protocol-devtools-evm+ downstream consumers)chunkArrayhandles all edge cases (empty, undersized, exact multiples)buildOmniTransactions) already spreadsOmniTransaction[]setUlnConfig,setUlnReadConfig,setExecutorConfigall delegate tosetConfignpx hardhat lz:oapp:wire --oapp-config <config> --dry-runChecklist
@layerzerolabs/protocol-devtools-evm