File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 ],
55 "npmClient" : " yarn" ,
66 "useWorkspaces" : true ,
7- "version" : " 0.0.9 " ,
7+ "version" : " 0.0.10 " ,
88 "stream" : " true" ,
99 "command" : {
1010 "version" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " root" ,
33 "private" : true ,
4- "version" : " 0.0.9 " ,
4+ "version" : " 0.0.10 " ,
55 "engines" : {
66 "node" : " >=18.0.0"
77 },
Original file line number Diff line number Diff line change 11{
22 "name" : " api" ,
3- "version" : " 0.0.9 " ,
3+ "version" : " 0.0.10 " ,
44 "description" : " The API module of Etherspot bundler client" ,
55 "author" : " Etherspot" ,
66 "homepage" : " https://https://github.com/etherspot/skandha#readme" ,
3535 "class-transformer" : " 0.5.1" ,
3636 "class-validator" : " 0.14.0" ,
3737 "ethers" : " 5.7.2" ,
38- "executor" : " ^0.0.9 " ,
38+ "executor" : " ^0.0.10 " ,
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.9 "
43+ "types" : " ^0.0.10 "
4444 },
4545 "devDependencies" : {
4646 "@types/connect" : " 3.4.35"
Original file line number Diff line number Diff line change 11{
22 "name" : " cli" ,
3- "version" : " 0.0.9 " ,
3+ "version" : " 0.0.10 " ,
44 "description" : " > TODO: description" ,
55 "author" : " zincoshine <psramanuj@gmail.com>" ,
66 "homepage" : " https://https://github.com/etherspot/skandha#readme" ,
3131 "url" : " https://https://github.com/etherspot/skandha/issues"
3232 },
3333 "dependencies" : {
34- "api" : " ^0.0.9 " ,
35- "db" : " ^0.0.9 " ,
36- "executor" : " ^0.0.9 " ,
34+ "api" : " ^0.0.10 " ,
35+ "db" : " ^0.0.10 " ,
36+ "executor" : " ^0.0.10 " ,
3737 "find-up" : " 5.0.0" ,
3838 "got" : " 12.5.3" ,
3939 "js-yaml" : " 4.1.0" ,
40- "types" : " ^0.0.9 " ,
40+ "types" : " ^0.0.10 " ,
4141 "yargs" : " 17.6.2"
4242 },
4343 "devDependencies" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " db" ,
3- "version" : " 0.0.9 " ,
3+ "version" : " 0.0.10 " ,
44 "description" : " The DB module of Etherspot bundler client" ,
55 "author" : " Etherspot" ,
66 "homepage" : " https://github.com/etherspot/etherspot-bundler#readme" ,
3737 "devDependencies" : {
3838 "@types/rocksdb" : " 3.0.1" ,
3939 "prettier" : " ^2.8.4" ,
40- "types" : " ^0.0.9 "
40+ "types" : " ^0.0.10 "
4141 }
4242}
Original file line number Diff line number Diff line change 11{
22 "name" : " executor" ,
3- "version" : " 0.0.9 " ,
3+ "version" : " 0.0.10 " ,
44 "description" : " The Relayer module of Etherspot bundler client" ,
55 "author" : " Etherspot" ,
66 "homepage" : " https://https://github.com/etherspot/skandha#readme" ,
3333 "dependencies" : {
3434 "async-mutex" : " 0.4.0" ,
3535 "ethers" : " 5.7.2" ,
36- "params" : " ^0.0.9 " ,
37- "types" : " ^0.0.9 "
36+ "params" : " ^0.0.10 " ,
37+ "types" : " ^0.0.10 "
3838 }
3939}
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ import {
1414} from "types/lib/api/interfaces" ;
1515import { EntryPoint__factory } from "types/lib/executor/contracts/factories" ;
1616import { NetworkName } from "types/lib" ;
17- import { estimateArbitrumPVG } from "params/lib/gas-estimation/arbitrum" ;
1817import { IPVGEstimator } from "params/lib/types/IPVGEstimator" ;
18+ import { estimateOptimismPVG , estimateArbitrumPVG } from "params/lib" ;
1919import { NetworkConfig } from "../config" ;
2020import { deepHexlify , packUserOp } from "../utils" ;
2121import { UserOpValidationService , MempoolService } from "../services" ;
@@ -41,6 +41,10 @@ export class Eth {
4141 ) {
4242 this . pvgEstimator = estimateArbitrumPVG ( this . provider ) ;
4343 }
44+
45+ if ( [ "optimism" , "optimismGoerli" ] . includes ( this . networkName ) ) {
46+ this . pvgEstimator = estimateOptimismPVG ( this . provider ) ;
47+ }
4448 }
4549
4650 /**
Original file line number Diff line number Diff line change 11{
22 "name" : " params" ,
3- "version" : " 0.0.9 " ,
3+ "version" : " 0.0.10 " ,
44 "description" : " Various bundler parameters" ,
55 "author" : " Etherspot" ,
66 "homepage" : " https://github.com/etherspot/skandha#readme" ,
2121 "url" : " https://github.com/etherspot/skandha/issues"
2222 },
2323 "dependencies" : {
24- "types" : " ^0.0.9" ,
24+ "@arbitrum/sdk" : " 3.1.4" ,
25+ "@eth-optimism/sdk" : " 3.0.0" ,
2526 "ethers" : " 5.7.2" ,
26- "@arbitrum/sdk " : " 3.1.4 "
27+ "types " : " ^0.0.10 "
2728 },
2829 "scripts" : {
2930 "clean" : " rm -rf lib && rm -f *.tsbuildinfo" ,
Original file line number Diff line number Diff line change 1+ export * from "./arbitrum" ;
2+ export * from "./optimism" ;
Original file line number Diff line number Diff line change 1+ import { UserOperationStruct } from "types/lib/executor/contracts/EntryPoint" ;
2+ import { BigNumber , BigNumberish , ethers } from "ethers" ;
3+ import { EntryPoint__factory } from "types/lib/executor/contracts" ;
4+ import { estimateL1Gas } from "@eth-optimism/sdk" ;
5+ import { IPVGEstimator , IPVGEstimatorWrapper } from "../types/IPVGEstimator" ;
6+
7+ export const estimateOptimismPVG : IPVGEstimatorWrapper = (
8+ provider
9+ ) : IPVGEstimator => {
10+ const dummyWallet = ethers . Wallet . createRandom ( ) ;
11+ return async (
12+ entryPointAddr : string ,
13+ userOp : UserOperationStruct ,
14+ initial : BigNumberish
15+ ) : Promise < BigNumber > => {
16+ const entryPoint = EntryPoint__factory . connect ( entryPointAddr , provider ) ;
17+ const handleOpsData = entryPoint . interface . encodeFunctionData ( "handleOps" , [
18+ [ userOp ] ,
19+ dummyWallet . address ,
20+ ] ) ;
21+
22+ try {
23+ const l1GasEstimated = await estimateL1Gas ( provider , {
24+ to : entryPointAddr ,
25+ data : handleOpsData ,
26+ } ) ;
27+ return l1GasEstimated . add ( initial ) ;
28+ } catch ( err ) {
29+ // eslint-disable-next-line no-console
30+ console . error ( "Error while estimating optimism PVG" , err ) ;
31+ return BigNumber . from ( initial ) ;
32+ }
33+ } ;
34+ } ;
You can’t perform that action at this time.
0 commit comments