Skip to content

Commit e345246

Browse files
authored
feat(validation): update tracer & ban invalid opcode (#96)
* update tracer & ban invalid opcode * chore(release): 1.0.3-alpha * update spec tests workflow
1 parent f9440d0 commit e345246

13 files changed

Lines changed: 38 additions & 38 deletions

File tree

.github/workflows/bundler-spec-tests.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/checkout@v3
2727
with:
2828
repository: eth-infinitism/bundler-spec-tests
29-
ref: e193753db1910fb6d0ee2661d96a8d8f79d6c7d8
29+
ref: 5b611d592fc55004d1e50fe18da6824206f1b72c
3030
path: ./bundler-spec-tests
3131
submodules: true
3232

@@ -36,13 +36,13 @@ jobs:
3636

3737
- name: Install Geth
3838
run: |
39-
wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.12.2-bed84606.tar.gz
40-
tar -xvf geth-linux-amd64-1.12.2-bed84606.tar.gz
39+
sudo add-apt-repository -y ppa:ethereum/ethereum && \
40+
sudo apt-get update && \
41+
sudo apt-get install ethereum
4142
4243
- name: Run Geth
4344
run: |
44-
cd geth-linux-amd64-1.12.2-bed84606 &&
45-
./geth \
45+
geth \
4646
--verbosity 1 \
4747
--http.vhosts '*,localhost,host.docker.internal' \
4848
--http \
@@ -68,8 +68,7 @@ jobs:
6868
6969
- name: Fund bundler
7070
run: |
71-
cd geth-linux-amd64-1.12.2-bed84606 &&
72-
./geth \
71+
geth \
7372
--exec "eth.sendTransaction({from: eth.accounts[0], to: \"0x55082761664aEb8062B3427ba5E0455bFb7b68CB\", value: web3.toWei(4337, \"ether\")})" \
7473
attach http://localhost:8545/
7574

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
],
55
"npmClient": "yarn",
66
"useWorkspaces": true,
7-
"version": "1.0.2-alpha",
7+
"version": "1.0.3-alpha",
88
"stream": "true",
99
"command": {
1010
"version": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "root",
33
"private": true,
4-
"version": "1.0.2-alpha",
4+
"version": "1.0.3-alpha",
55
"engines": {
66
"node": ">=18.0.0"
77
},

packages/api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api",
3-
"version": "1.0.2-alpha",
3+
"version": "1.0.3-alpha",
44
"description": "The API module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -35,12 +35,12 @@
3535
"class-transformer": "0.5.1",
3636
"class-validator": "0.14.0",
3737
"ethers": "5.7.2",
38-
"executor": "1.0.2-alpha",
38+
"executor": "1.0.3-alpha",
3939
"fastify": "4.14.1",
4040
"pino": "8.11.0",
4141
"pino-pretty": "10.0.0",
4242
"reflect-metadata": "0.1.13",
43-
"types": "1.0.2-alpha"
43+
"types": "1.0.3-alpha"
4444
},
4545
"devDependencies": {
4646
"@types/connect": "3.4.35"

packages/cli/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cli",
3-
"version": "1.0.2-alpha",
3+
"version": "1.0.3-alpha",
44
"description": "> TODO: description",
55
"author": "zincoshine <psramanuj@gmail.com>",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -38,14 +38,14 @@
3838
"@libp2p/peer-id-factory": "2.0.1",
3939
"@libp2p/prometheus-metrics": "1.1.3",
4040
"@multiformats/multiaddr": "12.1.3",
41-
"api": "1.0.2-alpha",
42-
"db": "1.0.2-alpha",
43-
"executor": "1.0.2-alpha",
41+
"api": "1.0.3-alpha",
42+
"db": "1.0.3-alpha",
43+
"executor": "1.0.3-alpha",
4444
"find-up": "5.0.0",
4545
"got": "12.5.3",
4646
"js-yaml": "4.1.0",
47-
"node": "1.0.2-alpha",
48-
"types": "1.0.2-alpha",
47+
"node": "1.0.3-alpha",
48+
"types": "1.0.3-alpha",
4949
"yargs": "17.6.2"
5050
},
5151
"devDependencies": {

packages/db/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "db",
3-
"version": "1.0.2-alpha",
3+
"version": "1.0.3-alpha",
44
"description": "The DB module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://github.com/etherspot/etherspot-bundler#readme",
@@ -33,7 +33,7 @@
3333
"dependencies": {
3434
"@chainsafe/ssz": "0.10.1",
3535
"rocksdb": "5.2.1",
36-
"types": "1.0.2-alpha"
36+
"types": "1.0.3-alpha"
3737
},
3838
"devDependencies": {
3939
"@types/rocksdb": "3.0.1",

packages/executor/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "executor",
3-
"version": "1.0.2-alpha",
3+
"version": "1.0.3-alpha",
44
"description": "The Relayer module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -33,7 +33,7 @@
3333
"dependencies": {
3434
"async-mutex": "0.4.0",
3535
"ethers": "5.7.2",
36-
"params": "1.0.2-alpha",
37-
"types": "1.0.2-alpha"
36+
"params": "1.0.3-alpha",
37+
"types": "1.0.3-alpha"
3838
}
3939
}

packages/executor/src/services/UserOpValidation/validators/safe.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const bannedOpCodes = new Set([
5151
"SELFDESTRUCT",
5252
"RANDOM",
5353
"PREVRANDAO",
54+
"INVALID",
5455
]);
5556

5657
// REF: https://github.com/eth-infinitism/bundler/blob/main/packages/bundler/src/modules/ValidationManager.ts

packages/executor/tracer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ function bundlerCollectorTracer() {
6565
if (this.lastThreeOpcodes.length > 3) {
6666
this.lastThreeOpcodes.shift();
6767
}
68-
if (log.getGas() < log.getCost()) {
69-
this.currentLevel.oog = true;
68+
if (log.getGas() < log.getCost() || (opcode === 'SSTORE' && log.getGas() < 2300)) {
69+
this.currentLevel.oog = true
7070
}
7171
if (opcode === 'REVERT' || opcode === 'RETURN') {
7272
if (log.getDepth() === 1) {

packages/node/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node",
3-
"version": "1.0.2-alpha",
3+
"version": "1.0.3-alpha",
44
"description": "The bundler node module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -55,25 +55,25 @@
5555
"@libp2p/tcp": "6.1.0",
5656
"@multiformats/multiaddr": "11.4.0",
5757
"abstract-leveldown": "7.2.0",
58-
"api": "1.0.2-alpha",
58+
"api": "1.0.3-alpha",
5959
"datastore-core": "8.0.1",
60-
"db": "1.0.2-alpha",
60+
"db": "1.0.3-alpha",
6161
"ethers": "5.7.2",
62-
"executor": "1.0.2-alpha",
62+
"executor": "1.0.3-alpha",
6363
"it-filter": "1.0.2",
6464
"it-map": "1.0.5",
6565
"it-sort": "1.0.0",
6666
"it-take": "1.0.1",
6767
"libp2p": "0.42.2",
68-
"params": "1.0.2-alpha",
68+
"params": "1.0.3-alpha",
6969
"prettier": "2.8.4",
7070
"rocksdb": "5.2.1",
7171
"snappy": "7.2.2",
7272
"snappyjs": "0.7.0",
7373
"stream-to-it": "0.2.4",
7474
"strict-event-emitter-types": "2.0.0",
75-
"types": "1.0.2-alpha",
76-
"utils": "1.0.2-alpha",
75+
"types": "1.0.3-alpha",
76+
"utils": "1.0.3-alpha",
7777
"varint": "6.0.0",
7878
"xxhash-wasm": "1.0.2"
7979
},

0 commit comments

Comments
 (0)