Skip to content

Commit

Permalink
Remove deprecated 'compare to execution' tests (see AA-498)
Browse files Browse the repository at this point in the history
  • Loading branch information
forshtat committed Dec 25, 2024
1 parent 7404dbb commit 4d252a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
13 changes: 0 additions & 13 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ function getNetwork (name: string): { url: string, accounts: { mnemonic: string
// return getNetwork1(`wss://${name}.infura.io/ws/v3/${process.env.INFURA_ID}`)
}

const optimizedCompilerSettings = {
version: '0.8.28',
settings: {
optimizer: { enabled: true, runs: 1000000 },
evmVersion: 'cancun',
viaIR: true
}
}

// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more

Expand All @@ -53,10 +44,6 @@ const config: HardhatUserConfig = {
optimizer: { enabled: true, runs: 1000000 }
}
}]
// overrides: {
// 'contracts/core/EntryPoint.sol': optimizedCompilerSettings,
// 'contracts/samples/SimpleAccount.sol': optimizedCompilerSettings
// }
},
networks: {
dev: { url: 'http://localhost:8545' },
Expand Down
22 changes: 4 additions & 18 deletions test/entrypointsimulations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ import {
createAccount,
createAccountOwner,
createAddress,
decodeRevertReason,
deployEntryPoint,
findSimulationUserOpWithMin,
fund,
getAccountAddress,
getAccountInitCode,
getBalance, deployEntryPoint, decodeRevertReason, findSimulationUserOpWithMin, findUserOpWithMin
getBalance
} from './testutils'

import { fillAndSign, fillSignAndPack, packUserOp, simulateHandleOp, simulateValidation } from './UserOp'
Expand Down Expand Up @@ -284,23 +287,6 @@ describe('EntryPointSimulations', function () {
await simulateValidation(packUserOp(userOp), entryPoint.address)
.catch(e => { throw new Error(decodeRevertReason(e)!) })
})
describe('compare to execution', () => {
let execVgl: number
let execPmVgl: number
const diff = 2000
before(async () => {
execPmVgl = await findUserOpWithMin(async n => userOpWithGas(1e6, n), false, entryPoint, 1, 500000)
execVgl = await findUserOpWithMin(async n => userOpWithGas(n, execPmVgl), false, entryPoint, 1, 500000)
})
it('account verification simulation cost should be higher than execution', function () {
console.log('simulation account validation', vgl, 'above exec:', vgl - execVgl)
expect(vgl).to.be.within(execVgl + 1, execVgl + diff, `expected simulation verificationGas to be 1..${diff} above actual, but was ${vgl - execVgl}`)
})
it('paymaster verification simulation cost should be higher than execution', function () {
console.log('simulation paymaster validation', pmVgl, 'above exec:', pmVgl - execPmVgl)
expect(pmVgl).to.be.within(execPmVgl + 1, execPmVgl + diff, `expected simulation verificationGas to be 1..${diff} above actual, but was ${pmVgl - execPmVgl}`)
})
})
it('should revert with AA2x if verificationGasLimit is low', async function () {
expect(await simulateValidation(packUserOp(await userOpWithGas(vgl - 1, pmVgl)), entryPoint.address)
.catch(decodeRevertReason))
Expand Down

0 comments on commit 4d252a9

Please sign in to comment.