Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/core/EntryPoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuard,
bytes32 private constant INNER_REVERT_LOW_PREFUND = hex"deadaa51";

uint256 private constant REVERT_REASON_MAX_LEN = 2048;
uint256 private constant PENALTY_PERCENT = 10;
uint256 private constant PENALTY_PERCENT = 100;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change required to charge gas full limit specified in userOp


/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
Expand Down
2 changes: 1 addition & 1 deletion test/entrypoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ describe('EntryPoint', function () {

// we cannot access internal transaction state, so we have to rely on two separate transactions for estimation
// assuming 10% penalty is charged
const expectedGasPenalty = (veryBigCallGasLimit - callGasLimit.toNumber()) * 0.1
const expectedGasPenalty = (veryBigCallGasLimit - callGasLimit.toNumber())
const actualGasPenalty = gasUsed2 - gasUsed1

console.log(actualGasPenalty / expectedGasPenalty)
Expand Down
2 changes: 1 addition & 1 deletion test/samples/TokenPaymaster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('TokenPaymaster', function () {
assert.equal(actualTokenChargeEvents.toString(), actualTokenCharge.toString())
assert.equal(actualTokenChargeEvents.toString(), expectedTokenCharge.toString())
assert.equal(actualTokenPriceWithMarkup.toString(), expectedTokenPriceWithMarkup.toString())
assert.closeTo(postOpGasCost.div(tx.effectiveGasPrice).toNumber(), 50000, 20000)
assert.closeTo(postOpGasCost.div(tx.effectiveGasPrice).toNumber(), 326000, 20000)
await ethers.provider.send('evm_revert', [snapshot])
})

Expand Down
Loading