Skip to content

Commit

Permalink
Merge pull request #223 from pimlicolabs/feat/kinto-e2e
Browse files Browse the repository at this point in the history
Feat/Kinto-E2E
  • Loading branch information
mouseless0x authored May 27, 2024
2 parents 5f0fb58 + e07d6a9 commit 02e0648
Show file tree
Hide file tree
Showing 9 changed files with 623 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/kinto-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run Kinto-E2E Tests
env:
KINTO_RPC: ${{ secrets.KINTO_RPC }}

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
kinto-e2e:
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Install and build alto
run: pnpm install && pnpm build

- name: Install test dependencies
run: cd test/kinto-e2e && pnpm install .

- name: Start tests
run: cd test/kinto-e2e && pnpm run test
9 changes: 9 additions & 0 deletions test/kinto-e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Kinto E2E Tests

E2E tests for Kinto L2, the tests are performed by re-simulating succesfully mined userOperations. Each test case will setup a Alto and Anvil instance at that block height and resubmit the userOperation using either `eth_sendUserOperation` or `pimlico_sendCompressedUserOperation`.

## Running The Tests

```
pnpm run test
```
19 changes: 19 additions & 0 deletions test/kinto-e2e/kinto-alto-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"dangerous-skip-user-operation-validation": true,
"network-name": "local",
"log-environment": "production",
"enable-debug-endpoints": true,
"entrypoints": "0x2843C269D2a64eCfA63548E8B3Fc0FD23B7F70cb",
"api-version": "v1,v2",
"min-balance": "0",
"bundle-bulker-address": "0x8d2D899402ed84b6c0510bB1ad34ee436ADDD20d",
"per-op-inflator-address": "0xfE3857666264Cf6394eDbAfF8907C2B1448D831b",
"max-block-range": 1000,
"safe-mode": false,
"port": 4337,
"log-level": "info",
"public-client-log-level": "error",
"wallet-client-log-level": "error",
"polling-interval": 100,
"network-name": "0.0.0.0"
}
14 changes: 14 additions & 0 deletions test/kinto-e2e/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "kinto-e2e",
"scripts": {
"test": "ts-node src/index.ts"
},
"dependencies": {
"@viem/anvil": "^0.0.10",
"kinto-e2e": "link:",
"permissionless": "0.0.36",
"ts-node": "^10.9.2",
"viem": "^2.0.0",
"wait-port": "^1.1.0"
}
}
161 changes: 161 additions & 0 deletions test/kinto-e2e/src/abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
export const handleOpsAbi = [
{
inputs: [
{
components: [
{
internalType: "address",
name: "sender",
type: "address"
},
{
internalType: "uint256",
name: "nonce",
type: "uint256"
},
{
internalType: "bytes",
name: "initCode",
type: "bytes"
},
{
internalType: "bytes",
name: "callData",
type: "bytes"
},
{
internalType: "uint256",
name: "callGasLimit",
type: "uint256"
},
{
internalType: "uint256",
name: "verificationGasLimit",
type: "uint256"
},
{
internalType: "uint256",
name: "preVerificationGas",
type: "uint256"
},
{
internalType: "uint256",
name: "maxFeePerGas",
type: "uint256"
},
{
internalType: "uint256",
name: "maxPriorityFeePerGas",
type: "uint256"
},
{
internalType: "bytes",
name: "paymasterAndData",
type: "bytes"
},
{
internalType: "bytes",
name: "signature",
type: "bytes"
}
],
internalType: "struct UserOperation[]",
name: "ops",
type: "tuple[]"
},
{
internalType: "address payable",
name: "beneficiary",
type: "address"
}
],
name: "handleOps",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}
] as const

export const BundleBulkerAbi = [
{
type: "function",
name: "inflate",
inputs: [
{
name: "compressed",
type: "bytes",
internalType: "bytes"
}
],
outputs: [
{
name: "ops",
type: "tuple[]",
internalType: "struct UserOperation[]",
components: [
{
name: "sender",
type: "address",
internalType: "address"
},
{
name: "nonce",
type: "uint256",
internalType: "uint256"
},
{
name: "initCode",
type: "bytes",
internalType: "bytes"
},
{
name: "callData",
type: "bytes",
internalType: "bytes"
},
{
name: "callGasLimit",
type: "uint256",
internalType: "uint256"
},
{
name: "verificationGasLimit",
type: "uint256",
internalType: "uint256"
},
{
name: "preVerificationGas",
type: "uint256",
internalType: "uint256"
},
{
name: "maxFeePerGas",
type: "uint256",
internalType: "uint256"
},
{
name: "maxPriorityFeePerGas",
type: "uint256",
internalType: "uint256"
},
{
name: "paymasterAndData",
type: "bytes",
internalType: "bytes"
},
{
name: "signature",
type: "bytes",
internalType: "bytes"
}
]
},
{
name: "beneficiary",
type: "address",
internalType: "address payable"
}
],
stateMutability: "view"
}
] as const
Loading

0 comments on commit 02e0648

Please sign in to comment.