Skip to content

Commit

Permalink
Merge pull request #761 from bcnmy/integration/gas-estimations-0.2.55
Browse files Browse the repository at this point in the history
Integration/gas estimations 0.2.55
  • Loading branch information
TheDivic authored Jan 17, 2025
2 parents 3fe16cb + b1789a2 commit de226f7
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 148 deletions.
5 changes: 3 additions & 2 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
288, 920637907288165, 1740, 1750, 4202, 1135, 2818
],
"supportedNetworksV07": [
1, 11155420, 84532, 8453, 10, 56, 42161, 137, 100, 80084
1, 11155420, 84532, 8453, 10, 56, 42161, 137, 100, 80084, 168587773, 81457
],
"EIP1559SupportedNetworks": [
1, 137, 42161, 10, 43114, 43113, 8453, 59144, 204, 5611, 421614, 11155111,
Expand Down Expand Up @@ -1026,7 +1026,8 @@
"entryPointV07Data": {
"0x0000000071727De22E5E9d8BAf0edAc6f37da032": {
"supportedChainIds": [
1, 11155420, 84532, 8453, 10, 56, 42161, 137, 100, 80084
1, 11155420, 84532, 8453, 10, 56, 42161, 137, 100, 80084, 168587773,
81457
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@arbitrum/sdk": "^3.1.3",
"@biconomy/gas-estimations": "0.2.51",
"@biconomy/gas-estimations": "0.2.55",
"@slack/web-api": "^6.8.0",
"@types/config": "^3.3.3",
"@types/crypto-js": "^4.1.1",
Expand Down Expand Up @@ -63,7 +63,7 @@
},
"devDependencies": {
"@biconomy/account": "^4.5.7",
"@biconomy/sdk": "^0.0.19",
"@biconomy/sdk": "^0.0.29",
"@eslint/js": "^9.13.0",
"@rhinestone/module-sdk": "^0.1.32",
"@types/amqplib": "^0.8.2",
Expand Down
4 changes: 2 additions & 2 deletions src/common/simulation/BundlerSimulationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class BundlerSimulationService {
gasPriceService,
gasEstimator = createGasEstimator({
chainId: networkService.chainId,
rpc: networkService.provider,
rpc: config.chains.providers[networkService.chainId][0].url,
}),
}: IBundlerSimulationServiceOptions) {
this.networkService = networkService;
Expand Down Expand Up @@ -152,7 +152,7 @@ export class BundlerSimulationService {
unEstimatedUserOperation: userOp,
baseFeePerGas,
stateOverrides: stateOverrideSet,
partialOptions: {
options: {
entryPointAddress: entryPointContract.address,
},
});
Expand Down
23 changes: 10 additions & 13 deletions src/common/simulation/BundlerSimulationService.v7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ import {
getUserOpHash,
packUserOperation,
} from "../entrypoint-v7/PackedUserOperation";
import { GasEstimator } from "@biconomy/gas-estimations";
import { createGasEstimator } from "@biconomy/gas-estimations";
import nodeconfig from "config";
import { CallTracerResult, findErrorsInTrace } from "./trace";
import {
EstimateUserOperationGasResult,
GasEstimator,
createGasEstimator,
isEstimateUserOperationGasResultV7,
EstimateUserOperationGasResult,
toPackedUserOperation,
bumpBigIntPercent,
} from "@biconomy/gas-estimations";
import nodeconfig from "config";
import { CallTracerResult, findErrorsInTrace } from "./trace";
import { toPackedUserOperation } from "@biconomy/gas-estimations";
import { ZodError } from "zod";

const log = logger.child({
module: module.filename.split("/").slice(-4).join("/"),
Expand All @@ -64,7 +64,7 @@ export class BundlerSimulationServiceV07 {
this.gasPriceService = gasPriceService;
this.gasEstimator = createGasEstimator({
chainId: networkService.chainId,
rpc: networkService.provider,
rpc: config.chains.providers[networkService.chainId][0].url,
});
}

Expand Down Expand Up @@ -114,7 +114,7 @@ export class BundlerSimulationServiceV07 {
unEstimatedUserOperation: userOp,
baseFeePerGas,
stateOverrides: stateOverrideSet,
partialOptions: {
options: {
entryPointAddress: entryPointContract.address,
},
});
Expand Down Expand Up @@ -148,9 +148,7 @@ export class BundlerSimulationServiceV07 {
);

callGasLimit += BigInt(Math.ceil(Number(callGasLimit) * 0.1));
verificationGasLimit += BigInt(
Math.ceil(Number(verificationGasLimit) * 0.1),
);
verificationGasLimit = bumpBigIntPercent(verificationGasLimit, 20);
paymasterPostOpGasLimit += BigInt(
Math.ceil(Number(paymasterPostOpGasLimit) * 0.1),
);
Expand Down Expand Up @@ -362,7 +360,6 @@ export class BundlerSimulationServiceV07 {
}
} else if (typeof ethEstimateGasResponse === "string") {
totalGas = Number(ethEstimateGasResponse);
log.info(`totalGas: ${totalGas} on chainId: ${chainId}`);
} else {
return {
code: STATUSES.INTERNAL_SERVER_ERROR,
Expand Down
Loading

0 comments on commit de226f7

Please sign in to comment.