Skip to content

Commit 8128da2

Browse files
authored
Merge pull request #34 from etherspot/fix-gas-estimation
Fix error parsing & introduce eip1559
2 parents 81594a5 + 58182f0 commit 8128da2

12 files changed

Lines changed: 33 additions & 25 deletions

File tree

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": "0.0.4",
7+
"version": "0.0.5",
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": "0.0.4",
4+
"version": "0.0.5",
55
"engines": {
66
"node": ">=12.9.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": "0.0.1",
3+
"version": "0.0.5",
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": "^0.0.1",
38+
"executor": "^0.0.5",
3939
"fastify": "4.14.1",
4040
"pino": "8.11.0",
4141
"pino-pretty": "10.0.0",
4242
"reflect-metadata": "0.1.13",
43-
"types": "^0.0.1"
43+
"types": "^0.0.5"
4444
},
4545
"devDependencies": {
4646
"@types/connect": "3.4.35"

packages/api/src/app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ export class ApiApp {
9595
const { method, params, jsonrpc, id } = req.body as any;
9696

9797
// ADMIN METHODS
98-
if (this.testingMode || req.ip === "localhost") {
98+
if (
99+
this.testingMode ||
100+
req.ip === "localhost" ||
101+
req.ip === "127.0.0.1"
102+
) {
99103
switch (method) {
100104
case BundlerRPCMethods.debug_bundler_setBundlingMode:
101105
result = await debugApi.setBundlingMode(params[0]);

packages/cli/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cli",
3-
"version": "0.0.1",
3+
"version": "0.0.5",
44
"description": "> TODO: description",
55
"author": "zincoshine <psramanuj@gmail.com>",
66
"homepage": "https://https://github.com/etherspot/skandha#readme",
@@ -31,13 +31,13 @@
3131
"url": "https://https://github.com/etherspot/skandha/issues"
3232
},
3333
"dependencies": {
34-
"api": "^0.0.1",
35-
"db": "^0.0.1",
36-
"executor": "^0.0.1",
34+
"api": "^0.0.5",
35+
"db": "^0.0.5",
36+
"executor": "^0.0.5",
3737
"find-up": "5.0.0",
3838
"got": "12.5.3",
3939
"js-yaml": "4.1.0",
40-
"types": "^0.0.1",
40+
"types": "^0.0.5",
4141
"yargs": "17.6.2"
4242
},
4343
"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": "0.0.1",
3+
"version": "0.0.5",
44
"description": "The DB module of Etherspot bundler client",
55
"author": "Etherspot",
66
"homepage": "https://github.com/etherspot/etherspot-bundler#readme",
@@ -37,6 +37,6 @@
3737
"devDependencies": {
3838
"@types/rocksdb": "3.0.1",
3939
"prettier": "^2.8.4",
40-
"types": "^0.0.1"
40+
"types": "^0.0.5"
4141
}
4242
}

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": "0.0.1",
3+
"version": "0.0.5",
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": "^0.0.1",
37-
"types": "^0.0.1"
36+
"params": "^0.0.5",
37+
"types": "^0.0.5"
3838
}
3939
}

packages/executor/src/modules/eth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class Eth {
8080
}
8181
const userOpComplemented: UserOperationStruct = {
8282
...userOp,
83-
paymasterAndData: "0x",
83+
paymasterAndData: userOp.paymasterAndData ?? "0x",
8484
maxFeePerGas: 0,
8585
maxPriorityFeePerGas: 0,
8686
preVerificationGas: 0,

packages/executor/src/services/BundlingService.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,17 @@ export class BundlingService {
6565
const wallet = this.config.getRelayer(this.network)!;
6666
const beneficiary = await this.selectBeneficiary();
6767
try {
68+
const feeData = await this.provider.getFeeData();
6869
const txRequest = entryPointContract.interface.encodeFunctionData(
6970
"handleOps",
7071
[bundle.map((entry) => entry.userOp), beneficiary]
7172
);
7273
const tx = await wallet.sendTransaction({
7374
to: entryPoint,
7475
data: txRequest,
76+
type: 2,
77+
maxPriorityFeePerGas: feeData.maxPriorityFeePerGas ?? 0,
78+
maxFeePerGas: feeData.maxFeePerGas ?? 0,
7579
});
7680

7781
this.logger.debug(`Sent new bundle ${tx.hash}`);

packages/executor/src/services/UserOpValidation.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ export class UserOpValidationService {
137137
}
138138

139139
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
140-
const errorResult = entryPointContract.interface.parseError(lastCall.data!);
141-
const validationResult = this.parseErrorResult(userOp, {
142-
errorName: errorResult.name,
143-
errorArgs: errorResult.args,
144-
});
140+
const errorResult = await entryPointContract.callStatic
141+
.simulateValidation(userOp, { gasLimit: 10e6 })
142+
.catch((e: any) => e);
143+
// const errorResult = entryPointContract.interface.parseError(lastCall.data!);
144+
const validationResult = this.parseErrorResult(userOp, errorResult);
145145
const stakeInfoEntities = {
146146
factory: validationResult.factoryInfo,
147147
account: validationResult.senderInfo,

0 commit comments

Comments
 (0)