Skip to content

Commit 2d1c2a8

Browse files
0xrlawrenceclaude
authored andcommitted
refactor: drop the external self-call in verifyBatchInclusion
The seven-argument overload delegated to the eight-argument one through this.verifyBatchInclusion(...), which leaves the contract and comes back in via a STATICCALL just to pass address(0). Move the body into an internal _verifyBatchInclusion and have both overloads call it directly. The external ABI is unchanged: both overloads are still present and still view, and onlyWhenNotPaused(2) still guards each entry point. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 2b65191 commit 2d1c2a8

1 file changed

Lines changed: 34 additions & 10 deletions

File tree

‎contracts/src/core/AlignedLayerServiceManager.sol‎

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,29 @@ contract AlignedLayerServiceManager is
266266
uint256 verificationDataBatchIndex,
267267
address senderAddress
268268
) external view onlyWhenNotPaused(2) returns (bool) {
269+
return
270+
_verifyBatchInclusion(
271+
proofCommitment,
272+
pubInputCommitment,
273+
provingSystemAuxDataCommitment,
274+
proofGeneratorAddr,
275+
batchMerkleRoot,
276+
merkleProof,
277+
verificationDataBatchIndex,
278+
senderAddress
279+
);
280+
}
281+
282+
function _verifyBatchInclusion(
283+
bytes32 proofCommitment,
284+
bytes32 pubInputCommitment,
285+
bytes32 provingSystemAuxDataCommitment,
286+
bytes20 proofGeneratorAddr,
287+
bytes32 batchMerkleRoot,
288+
bytes memory merkleProof,
289+
uint256 verificationDataBatchIndex,
290+
address senderAddress
291+
) internal view returns (bool) {
269292
bytes32 batchIdentifier;
270293
if (senderAddress == address(0)) {
271294
batchIdentifier = batchMerkleRoot;
@@ -310,16 +333,17 @@ contract AlignedLayerServiceManager is
310333
bytes memory merkleProof,
311334
uint256 verificationDataBatchIndex
312335
) external view onlyWhenNotPaused(2) returns (bool) {
313-
return this.verifyBatchInclusion(
314-
proofCommitment,
315-
pubInputCommitment,
316-
provingSystemAuxDataCommitment,
317-
proofGeneratorAddr,
318-
batchMerkleRoot,
319-
merkleProof,
320-
verificationDataBatchIndex,
321-
address(0)
322-
);
336+
return
337+
_verifyBatchInclusion(
338+
proofCommitment,
339+
pubInputCommitment,
340+
provingSystemAuxDataCommitment,
341+
proofGeneratorAddr,
342+
batchMerkleRoot,
343+
merkleProof,
344+
verificationDataBatchIndex,
345+
address(0)
346+
);
323347
}
324348

325349

0 commit comments

Comments
 (0)