Skip to content

Commit 0939623

Browse files
authored
Merge pull request #39 from etherspot/disable-eip-1559
disable eip1559 for fuse
2 parents 19ff75e + 372d803 commit 0939623

15 files changed

Lines changed: 72 additions & 40 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.7",
7+
"version": "0.0.8",
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.7",
4+
"version": "0.0.8",
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.7",
3+
"version": "0.0.8",
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.7",
38+
"executor": "^0.0.8",
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.7"
43+
"types": "^0.0.8"
4444
},
4545
"devDependencies": {
4646
"@types/connect": "3.4.35"

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.7",
3+
"version": "0.0.8",
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.7",
35-
"db": "^0.0.7",
36-
"executor": "^0.0.7",
34+
"api": "^0.0.8",
35+
"db": "^0.0.8",
36+
"executor": "^0.0.8",
3737
"find-up": "5.0.0",
3838
"got": "12.5.3",
3939
"js-yaml": "4.1.0",
40-
"types": "^0.0.7",
40+
"types": "^0.0.8",
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.7",
3+
"version": "0.0.8",
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.7"
40+
"types": "^0.0.8"
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.7",
3+
"version": "0.0.8",
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.7",
37-
"types": "^0.0.7"
36+
"params": "^0.0.8",
37+
"types": "^0.0.8"
3838
}
3939
}

packages/executor/src/executor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export class Executor {
6767
this.provider,
6868
this.reputationService,
6969
this.network,
70-
this.config
70+
this.config,
71+
this.logger
7172
);
7273
this.mempoolService = new MempoolService(
7374
this.db,

packages/executor/src/modules/eth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ export class Eth {
8080
}
8181
const userOpComplemented: UserOperationStruct = {
8282
paymasterAndData: userOp.paymasterAndData ?? "0x",
83+
verificationGasLimit: 10e6,
8384
maxFeePerGas: 0,
8485
maxPriorityFeePerGas: 0,
8586
preVerificationGas: 0,
86-
verificationGasLimit: 10e6,
8787
...userOp,
8888
};
8989
const preVerificationGas = this.calcPreVerificationGas(userOp);

packages/executor/src/services/BundlingService.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2-
import { BigNumber, ethers, providers } from "ethers";
2+
import { BigNumber, BigNumberish, ethers, providers } from "ethers";
33
import { NetworkName } from "types/lib";
44
import { EntryPoint__factory } from "types/lib/executor/contracts/factories";
55
import { EntryPoint } from "types/lib/executor/contracts/EntryPoint";
66
import { Mutex } from "async-mutex";
77
import { SendBundleReturn } from "types/lib/executor";
88
import { IMulticall3__factory } from "types/lib/executor/contracts/factories/IMulticall3__factory";
9+
import { chainsWithoutEIP1559 } from "params/lib";
910
import { getAddr } from "../utils";
1011
import { MempoolEntry } from "../entities/MempoolEntry";
1112
import { ReputationStatus } from "../entities/interfaces";
@@ -71,27 +72,27 @@ export class BundlingService {
7172
"handleOps",
7273
[bundle.map((entry) => entry.userOp), beneficiary]
7374
);
74-
this.logger.debug(
75-
JSON.stringify(
76-
{
77-
to: entryPoint,
78-
data: txRequest,
79-
type: 2,
80-
maxPriorityFeePerGas: gasFee.maxPriorityFeePerGas ?? 0,
81-
maxFeePerGas: gasFee.maxFeePerGas ?? 0,
82-
},
83-
undefined,
84-
2
85-
)
86-
);
8775

88-
const gasLimit = await this.estimateBundleGas(bundle);
89-
const tx = await wallet.sendTransaction({
76+
const transaction = {
9077
to: entryPoint,
9178
data: txRequest,
9279
type: 2,
93-
maxPriorityFeePerGas: gasFee.maxPriorityFeePerGas ?? 0,
94-
maxFeePerGas: gasFee.maxFeePerGas ?? 0,
80+
maxPriorityFeePerGas: gasFee.maxPriorityFeePerGas,
81+
maxFeePerGas: gasFee.maxFeePerGas,
82+
gasPrice: undefined as BigNumberish | undefined,
83+
};
84+
if (chainsWithoutEIP1559.some((network) => network === this.network)) {
85+
transaction.type = 1;
86+
transaction.gasPrice = gasFee.gasPrice;
87+
delete transaction.maxPriorityFeePerGas;
88+
delete transaction.maxFeePerGas;
89+
}
90+
91+
this.logger.debug(JSON.stringify(transaction, undefined, 2));
92+
93+
const gasLimit = await this.estimateBundleGas(bundle);
94+
const tx = await wallet.sendTransaction({
95+
...transaction,
9596
gasLimit,
9697
});
9798

packages/executor/src/services/UserOpValidation.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
import { BannedContracts } from "params/lib";
1717
import { NetworkName } from "types/lib";
1818
import { getAddr } from "../utils";
19-
import { TracerCall, TracerResult } from "../interfaces";
19+
import { Logger, TracerCall, TracerResult } from "../interfaces";
2020
import { Config } from "../config";
2121
import { ReputationService } from "./ReputationService";
2222
import { GethTracer } from "./GethTracer";
@@ -56,7 +56,8 @@ export class UserOpValidationService {
5656
private provider: providers.Provider,
5757
private reputationService: ReputationService,
5858
private network: NetworkName,
59-
private config: Config
59+
private config: Config,
60+
private logger: Logger
6061
) {
6162
this.gethTracer = new GethTracer(
6263
this.provider as providers.JsonRpcProvider
@@ -76,12 +77,27 @@ export class UserOpValidationService {
7677
.catch((e: any) => this.nethermindErrorHandler(entryPointContract, e));
7778

7879
if (errorResult.errorName === "FailedOp") {
80+
this.logger.debug({
81+
to: entryPoint,
82+
data: entryPointContract.interface.encodeFunctionData(
83+
"simulateValidation",
84+
[userOp]
85+
),
86+
});
7987
throw new RpcError(
8088
errorResult.errorArgs.at(-1),
8189
RpcErrorCodes.VALIDATION_FAILED
8290
);
8391
}
92+
8493
if (errorResult.errorName !== "ValidationResult") {
94+
this.logger.debug({
95+
to: entryPoint,
96+
data: entryPointContract.interface.encodeFunctionData(
97+
"simulateValidation",
98+
[userOp]
99+
),
100+
});
85101
throw errorResult;
86102
}
87103

0 commit comments

Comments
 (0)