Skip to content

Commit d18cc4e

Browse files
authored
Merge branch 'etherspot:develop' into develop
2 parents 72838d8 + 2397ea2 commit d18cc4e

File tree

26 files changed

+275
-76
lines changed

26 files changed

+275
-76
lines changed

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

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup NodeJS
2323
uses: "actions/setup-node@v3"
2424
with:
25-
node-version: 18.15
25+
node-version: 18.20.6
2626

2727
- name: Setup Bun
2828
uses: oven-sh/setup-bun@v1
@@ -49,6 +49,7 @@ jobs:
4949
working-directory: ./bundler-spec-tests
5050
run: |
5151
export PATH="$PATH:$HOME/.foundry/bin"
52+
pdm fix || true # Fix deprecation warnings (ignore errors if already fixed)
5253
pdm install && \
5354
pdm run update-deps && \
5455
cd @account-abstraction && \
@@ -71,7 +72,7 @@ jobs:
7172
--verbosity 1 \
7273
--http.vhosts '*,localhost,host.docker.internal' \
7374
--http \
74-
--http.api personal,eth,net,web3,debug \
75+
--http.api eth,net,web3,debug \
7576
--http.corsdomain '*' \
7677
--http.addr "0.0.0.0" \
7778
--nodiscover --maxpeers 0 \
@@ -108,12 +109,50 @@ jobs:
108109

109110
- name: Start Skandha
110111
# This private key is for testing only
111-
run: cp config.json.default config.json && jq '.networks.dev.relayer = "0x767b4393f6a5da742b30585428116f0395bee8e61c2da4ae8e67e5633389e2d3"' && ./skandha standalone --testingMode &
112+
run: |
113+
cp config.json.default config.json
114+
jq '.relayers = ["0x767b4393f6a5da742b30585428116f0395bee8e61c2da4ae8e67e5633389e2d3"]' config.json > config.json.tmp && mv config.json.tmp config.json
115+
./skandha standalone --testingMode > skandha.log 2>&1 &
116+
SKANDHA_PID=$!
117+
echo $SKANDHA_PID > skandha.pid
118+
# Wait for bundler to be ready
119+
echo "Waiting for Skandha to start..."
120+
for i in {1..30}; do
121+
if curl -s http://127.0.0.1:14337/rpc/ -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' > /dev/null 2>&1; then
122+
echo "Skandha is ready!"
123+
break
124+
fi
125+
if [ $i -eq 30 ]; then
126+
echo "Skandha failed to start after 30 seconds"
127+
cat skandha.log || true
128+
exit 1
129+
fi
130+
sleep 1
131+
done
112132

113133
- name: Run tests
114134
working-directory: ./bundler-spec-tests
115135
# Change address to the latest EP 8
116-
run: pdm run test -rA -W ignore::DeprecationWarning --url http://127.0.0.1:14337/rpc/ --entry-point 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108 --ethereum-node http://localhost:8545 -k "not p2p"
136+
run: |
137+
pdm fix || true # Fix deprecation warnings before running tests
138+
pdm run test -rA -W ignore::DeprecationWarning --url http://127.0.0.1:14337/rpc/ --entry-point 0x433709009b8330fda32311df1c2afa402ed8d009 --ethereum-node http://localhost:8545 -k "not p2p"
139+
continue-on-error: true
140+
141+
- name: Show Skandha logs on failure
142+
if: failure()
143+
run: |
144+
if [ -f skandha.log ]; then
145+
echo "=== Skandha logs ==="
146+
tail -100 skandha.log || true
147+
fi
148+
if [ -f skandha.pid ]; then
149+
PID=$(cat skandha.pid)
150+
if ps -p $PID > /dev/null 2>&1; then
151+
echo "Skandha process $PID is still running"
152+
else
153+
echo "Skandha process $PID is not running"
154+
fi
155+
fi
117156

118157
- name: Send Slack notification
119158
uses: ravsamhq/notify-slack-action@2.3.0

.github/workflows/release-ep9.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build skandha v4 docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- "develop"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Login to Docker Hub
15+
uses: docker/login-action@v2
16+
with:
17+
username: ${{ secrets.DOCKERHUB_USERNAME }}
18+
password: ${{ secrets.DOCKERHUB_TOKEN }}
19+
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
- name: Get package version
25+
id: get_version
26+
run: echo version=$(node -p "require('./package.json').version") >> $GITHUB_OUTPUT
27+
- name: Build and push
28+
uses: docker/build-push-action@v4
29+
with:
30+
context: .
31+
platforms: linux/amd64,linux/arm64
32+
file: ./Dockerfile
33+
push: true
34+
tags: |
35+
${{ secrets.DOCKERHUB_USERNAME }}/skandha:v4-${{ steps.get_version.outputs.version }}
36+
${{ secrets.DOCKERHUB_USERNAME }}/skandha:v4-latest
37+
- name: Create GitHub release
38+
uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303"
39+
with:
40+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
41+
automatic_release_tag: v4-${{ steps.get_version.outputs.version }}
42+
prerelease: false
43+
title: Release v4-${{ steps.get_version.outputs.version }}
44+
- name: Trigger pipeline
45+
run: ${{ secrets.PIPELINE_TRIGGER }}

bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config.json.default

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,13 @@
88
],
99
"rpcEndpoint": "http://localhost:8545",
1010
"nativeTracer": true,
11-
"eip7702": true
11+
"eip7702": true,
12+
"canonicalMempoolId": "QmcFZKUX9qoo3StwVycJTAhwdiqbEjcwNvQVK246p3z1rk",
13+
"canonicalEntryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
14+
"supportedMempools": [
15+
{
16+
"mempoolId": "QmcFZKUX9qoo3StwVycJTAhwdiqbEjcwNvQVK246p3z1rk",
17+
"entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
18+
}
19+
]
1220
}

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"packages/*"
44
],
55
"npmClient": "yarn",
6-
"version": "3.1.3",
6+
"version": "4.0.0",
77
"stream": "true",
88
"command": {
99
"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": "3.1.3",
4+
"version": "4.0.0",
55
"engines": {
66
"node": ">=18.0.0"
77
},

packages/api/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"publishConfig": {
55
"access": "public"
66
},
7-
"version": "3.1.3",
7+
"version": "4.0.0",
88
"description": "The API module of Etherspot bundler client",
99
"author": "Etherspot",
1010
"homepage": "https://github.com/etherspot/skandha#readme",
@@ -34,10 +34,10 @@
3434
"dependencies": {
3535
"@fastify/cors": "9.0.1",
3636
"@fastify/websocket": "10.0.1",
37-
"@skandha/executor": "^3.1.3",
38-
"@skandha/monitoring": "^3.1.3",
39-
"@skandha/types": "^3.1.3",
40-
"@skandha/utils": "^3.1.3",
37+
"@skandha/executor": "^4.0.0",
38+
"@skandha/monitoring": "^4.0.0",
39+
"@skandha/types": "^4.0.0",
40+
"@skandha/utils": "^4.0.0",
4141
"class-transformer": "0.5.1",
4242
"class-validator": "0.14.1",
4343
"dotenv": "17.2.2",

packages/api/src/app.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,6 @@ export class ApiApp {
258258

259259
if (this.redirectRpc && method in RedirectedRPCMethods) {
260260
const body = await this.redirectApi.redirect(method, params);
261-
if (body.error) {
262-
return { ...body, id };
263-
}
264261
return { jsonrpc, id, ...body };
265262
}
266263

packages/api/src/modules/redirect.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { Config } from "@skandha/executor/lib/config";
3-
import { PublicClient } from "viem";
3+
import { createPublicClient, http, PublicClient } from "viem";
44

55
export class RedirectAPI {
66
private publicClient: PublicClient;
77

88
constructor(private config: Config) {
9-
this.publicClient = this.config.getPublicClient();
9+
// creating a minimal rpc redirect public client
10+
this.publicClient = createPublicClient({
11+
transport: http(this.config.config.rpcEndpoint, {
12+
raw: true
13+
}),
14+
chain: this.config.chain
15+
});
1016
}
1117

1218
async redirect(method: string, params: any[]): Promise<any> {
1319
return await this.publicClient
1420
.request({ method: method as any, params: params as any })
15-
.then((result) => ({ result }))
21+
.then((result) => result )
1622
.catch((err: any) => {
1723
if (err.body) {
1824
try {

packages/cli/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"publishConfig": {
55
"access": "public"
66
},
7-
"version": "3.1.3",
7+
"version": "4.0.0",
88
"description": "> TODO: description",
99
"author": "zincoshine <psramanuj@gmail.com>",
1010
"homepage": "https://github.com/etherspot/skandha#readme",
@@ -40,12 +40,12 @@
4040
"@libp2p/peer-id-factory": "2.0.1",
4141
"@libp2p/prometheus-metrics": "1.1.3",
4242
"@multiformats/multiaddr": "12.1.3",
43-
"@skandha/api": "^3.1.3",
44-
"@skandha/db": "^3.1.3",
45-
"@skandha/executor": "^3.1.3",
46-
"@skandha/monitoring": "^3.1.3",
47-
"@skandha/node": "^3.1.3",
48-
"@skandha/types": "^3.1.3",
43+
"@skandha/api": "^4.0.0",
44+
"@skandha/db": "^4.0.0",
45+
"@skandha/executor": "^4.0.0",
46+
"@skandha/monitoring": "^4.0.0",
47+
"@skandha/node": "^4.0.0",
48+
"@skandha/types": "^4.0.0",
4949
"find-up": "5.0.0",
5050
"got": "12.5.3",
5151
"js-yaml": "4.1.0",

0 commit comments

Comments
 (0)