Skip to content

Commit

Permalink
Merge pull request #227 from pimlicolabs/kinto-prod/kinto-e2e
Browse files Browse the repository at this point in the history
add kinto-e2e to kinto-prod
  • Loading branch information
mouseless0x authored May 30, 2024
2 parents 9f06c97 + 339c2b8 commit 7d75aad
Show file tree
Hide file tree
Showing 11 changed files with 659 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Install dependencies"
description: "Prepare repository and all dependencies"

runs:
using: "composite"
steps:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 8.15.4+sha256.cea6d0bdf2de3a0549582da3983c70c92ffc577ff4410cbf190817ddc35137c2
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Run E2E Tests
on:
push:
branches:
- main
- kinto-production
pull_request:
branches:
- main
- kinto-production

jobs:
docker:
Expand Down
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:
- kinto-production
pull_request:
branches:
- kinto-production

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 7d75aad

Please sign in to comment.