Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: merkle-io integration #152

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into merkle-io
  • Loading branch information
0xSulpiride committed Feb 29, 2024
commit ce878ab0868792c2867501351c3a90b4abcc5c57
27 changes: 27 additions & 0 deletions packages/executor/src/config.ts
Original file line number Diff line number Diff line change
@@ -341,6 +341,30 @@ export class Config {
)
);

conf.skipBundleValidation = Boolean(
fromEnvVar(
network,
"SKIP_BUNDLE_VALIDATION",
conf.skipBundleValidation || bundlerDefaultConfigs.skipBundleValidation
)
);

conf.bundleGasLimit = Number(
fromEnvVar(
network,
"BUNDLE_GAS_LIMIT",
conf.bundleGasLimit || bundlerDefaultConfigs.bundleGasLimit
)
);

conf.userOpGasLimit = Number(
fromEnvVar(
network,
"USEROP_GAS_LIMIT",
conf.userOpGasLimit || bundlerDefaultConfigs.userOpGasLimit
)
);

// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (!conf.whitelistedEntities) {
conf.whitelistedEntities = bundlerDefaultConfigs.whitelistedEntities;
@@ -400,6 +424,9 @@ const bundlerDefaultConfigs: BundlerConfig = {
pvgMarkup: 0,
gasFeeInSimulation: false,
merkleApiURL: "https://pool.merkle.io",
skipBundleValidation: false,
userOpGasLimit: 25000000,
bundleGasLimit: 25000000,
};

const NETWORKS_ENV = (): string[] | undefined => {
4 changes: 4 additions & 0 deletions packages/executor/src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -150,6 +150,10 @@ export interface NetworkConfig {
gasFeeInSimulation: boolean;
// api url of Merkle.io (by default https://pool.merkle.io)
merkleApiURL: string;
// skips bundle validation
skipBundleValidation: boolean;
userOpGasLimit: number; // 25kk by default
bundleGasLimit: number; // 25kk by default
}

export type BundlerConfig = Omit<
9 changes: 7 additions & 2 deletions packages/executor/src/services/BundlingService/service.ts
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ import { getAddr, wait } from "../../utils";
import { MempoolEntry } from "../../entities/MempoolEntry";
import { IRelayingMode } from "./interfaces";
import { ClassicRelayer, FlashbotsRelayer, MerkleRelayer } from "./relayers";
import { getUserOpGasLimit } from "./utils";

export class BundlingService {
private mutex: Mutex;
@@ -126,7 +127,7 @@ export class BundlingService {
maxPriorityFeePerGas: BigNumber.from(0),
};

let gasLimit = BigNumber.from(0);
const gasLimit = BigNumber.from(0);
const paymasterDeposit: { [key: string]: BigNumber } = {};
const stakedEntityCount: { [key: string]: number } = {};
const senders = new Set<string>();
@@ -135,7 +136,11 @@ export class BundlingService {
});

for (const entry of entries) {
if (getUserOpGasLimit(entry.userOp, gasLimit).gt(this.networkConfig.bundleGasLimit)) {
if (
getUserOpGasLimit(entry.userOp, gasLimit).gt(
this.networkConfig.bundleGasLimit
)
) {
this.logger.debug(`${entry.userOpHash} reached bundle gas limit`);
continue;
}
You are viewing a condensed version of this merge commit. You can view the full changes here.