Skip to content

Commit

Permalink
Remove logs, fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shahafn committed Jan 30, 2025
1 parent 908792c commit 0fe1ee5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions contracts/core/EntryPoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
uint256 executionGasUsed = actualGas - opInfo.preOpGas;
// this check is required for the gas used within EntryPoint and not covered by explicit gas limits
actualGas += _getUnusedGasPenalty(executionGasUsed, mUserOp.callGasLimit);
// console.log("unused execution gas penalty", _getUnusedGasPenalty(executionGasUsed, mUserOp.callGasLimit));
}
uint256 postOpUnusedGasPenalty;
if (paymaster == address(0)) {
Expand All @@ -730,7 +729,6 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
refundAddress = paymaster;
if (context.length > 0) {
actualGasCost = actualGas * gasPrice;
// console.log("actual gas and cost that paymaster gets", actualGas, actualGasCost);
uint256 postOpPreGas = gasleft();
if (mode != IPaymaster.PostOpMode.postOpReverted) {
try IPaymaster(paymaster).postOp{
Expand All @@ -744,13 +742,11 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
}
uint256 postOpGasUsed = postOpPreGas - gasleft();
postOpUnusedGasPenalty = _getUnusedGasPenalty(postOpGasUsed, mUserOp.paymasterPostOpGasLimit);
// console.log("unused postOp gas penalty", _getUnusedGasPenalty(postOpGasUsed, mUserOp.paymasterPostOpGasLimit));
}
}
// Calculating a penalty for unused postOp gas
actualGas += preGas - gasleft() + postOpUnusedGasPenalty;
actualGasCost = actualGas * gasPrice;
// console.log("True actual gas and cost for tx", actualGas, actualGasCost);
uint256 prefund = opInfo.prefund;
if (prefund < actualGasCost) {
if (mode == IPaymaster.PostOpMode.postOpReverted) {
Expand Down
2 changes: 1 addition & 1 deletion test/entrypoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ describe('EntryPoint', function () {
const unpackedOp = {
maxFeePerGas: 1,
maxPriorityFeePerGas: 1,
callGasLimit: 5e4,
callGasLimit: 5e5,
paymaster: paymaster.address,
paymasterVerificationGasLimit: 1e6,
callData: accountExecFromEntryPoint.data,
Expand Down

0 comments on commit 0fe1ee5

Please sign in to comment.