Skip to content

Commit

Permalink
Use Slightly More Gas For 4337 Test
Browse files Browse the repository at this point in the history
Under certain conditions, an E2E test can fail because it uses slightly
more gas. This PR adds a larger gas buffer to the E2E test to prevent
intermittent failures.
  • Loading branch information
nlordell committed Jul 18, 2024
1 parent 3f0e7b5 commit 68dd15d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions modules/4337/certora/harnesses/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract Account is Safe {
* The canonical format ensures the signatures are tightly packed one after the other in order.
*
* For more details on signature encoding: https://docs.safe.global/advanced/smart-account-signatures
*/
*/
function canonicalSignature(bytes calldata signatures, uint256 safeThreshold) public pure returns (bytes memory canonical) {
uint256 dynamicOffset = safeThreshold * 0x41;
bytes memory staticPart = signatures[:dynamicOffset];
Expand All @@ -75,7 +75,7 @@ contract Account is Safe {
uint256 signatureOffset = uint256(bytes32(signatures[ptr + 0x20:]));

uint256 signatureLength = uint256(bytes32(signatures[signatureOffset:]));
bytes memory signature = signatures[signatureOffset+0x20:][:signatureLength];
bytes memory signature = signatures[signatureOffset + 0x20:][:signatureLength];

// Make sure to update the static part so that the smart contract signature
// points to the "canonical" signature offset (i.e. that all contract
Expand All @@ -91,7 +91,7 @@ contract Account is Safe {
}
}
canonical = abi.encodePacked(staticPart, dynamicPart);
}
}
}

// @notice This is a harness contract for the rule that verfies the validation data
Expand Down
2 changes: 1 addition & 1 deletion modules/4337/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@
"@account-abstraction/contracts": "0.7.0",
"@safe-global/safe-contracts": "1.4.1-build.0"
}
}
}
5 changes: 4 additions & 1 deletion modules/4337/test/e2e/SingletonSigners.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ describe('Singleton Signers [@4337]', () => {
await entryPoint.getAddress(),
false,
false,
{ initCode },
{
initCode,
verificationGasLimit: 600000,
},
)
const opHash = await validator.getOperationHash(
buildPackedUserOperationFromSafeUserOperation({
Expand Down

0 comments on commit 68dd15d

Please sign in to comment.