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

V2 whitelist and estimaterpc #270

Merged
merged 6 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages/*"
],
"npmClient": "yarn",
"version": "2.0.24",
"version": "2.0.25",
"stream": "true",
"command": {
"version": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "root",
"private": true,
"version": "2.0.24",
"version": "2.0.25",
"engines": {
"node": ">=18.0.0"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"publishConfig": {
"access": "public"
},
"version": "2.0.24",
"version": "2.0.25",
"description": "The API module of Etherspot bundler client",
"author": "Etherspot",
"homepage": "https://https://github.com/etherspot/skandha#readme",
Expand Down Expand Up @@ -34,10 +34,10 @@
"dependencies": {
"@fastify/cors": "9.0.1",
"@fastify/websocket": "10.0.1",
"@skandha/executor": "^2.0.24",
"@skandha/monitoring": "^2.0.24",
"@skandha/types": "^2.0.24",
"@skandha/utils": "^2.0.24",
"@skandha/executor": "^2.0.25",
"@skandha/monitoring": "^2.0.25",
"@skandha/types": "^2.0.25",
"@skandha/utils": "^2.0.25",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"ethers": "5.7.2",
Expand Down
23 changes: 0 additions & 23 deletions packages/api/src/dto/EstimateUserOperation.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,6 @@ export class EstimateUserOperation {
@IsString()
signature!: BytesLike;

/**
* Optional properties
*/
@IsBigNumber()
@IsOptional()
callGasLimit?: BigNumberish;

@IsBigNumber()
@IsOptional()
verificationGasLimit?: BigNumberish;

@IsBigNumber()
@IsOptional()
preVerificationGas?: BigNumberish;

@IsBigNumber()
@IsOptional()
maxFeePerGas?: BigNumberish;

@IsBigNumber()
@IsOptional()
maxPriorityFeePerGas?: BigNumberish;

/**
* EntryPoint v7 Properties
*/
Expand Down
14 changes: 7 additions & 7 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"publishConfig": {
"access": "public"
},
"version": "2.0.24",
"version": "2.0.25",
"description": "> TODO: description",
"author": "zincoshine <psramanuj@gmail.com>",
"homepage": "https://https://github.com/etherspot/skandha#readme",
Expand Down Expand Up @@ -40,12 +40,12 @@
"@libp2p/peer-id-factory": "2.0.1",
"@libp2p/prometheus-metrics": "1.1.3",
"@multiformats/multiaddr": "12.1.3",
"@skandha/api": "^2.0.24",
"@skandha/db": "^2.0.24",
"@skandha/executor": "^2.0.24",
"@skandha/monitoring": "^2.0.24",
"@skandha/node": "^2.0.24",
"@skandha/types": "^2.0.24",
"@skandha/api": "^2.0.25",
"@skandha/db": "^2.0.25",
"@skandha/executor": "^2.0.25",
"@skandha/monitoring": "^2.0.25",
"@skandha/node": "^2.0.25",
"@skandha/types": "^2.0.25",
"find-up": "5.0.0",
"got": "12.5.3",
"js-yaml": "4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"publishConfig": {
"access": "public"
},
"version": "2.0.24",
"version": "2.0.25",
"description": "The DB module of Etherspot bundler client",
"author": "Etherspot",
"homepage": "https://github.com/etherspot/etherspot-bundler#readme",
Expand Down Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"@chainsafe/ssz": "0.10.1",
"@farcaster/rocksdb": "5.5.0",
"@skandha/types": "^2.0.24"
"@skandha/types": "^2.0.25"
},
"devDependencies": {
"@types/rocksdb": "3.0.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"publishConfig": {
"access": "public"
},
"version": "2.0.24",
"version": "2.0.25",
"description": "The Relayer module of Etherspot bundler client",
"author": "Etherspot",
"homepage": "https://https://github.com/etherspot/skandha#readme",
Expand Down Expand Up @@ -35,10 +35,10 @@
},
"dependencies": {
"@flashbots/ethers-provider-bundle": "0.6.2",
"@skandha/monitoring": "^2.0.24",
"@skandha/params": "^2.0.24",
"@skandha/types": "^2.0.24",
"@skandha/utils": "^2.0.24",
"@skandha/monitoring": "^2.0.25",
"@skandha/params": "^2.0.25",
"@skandha/types": "^2.0.25",
"@skandha/utils": "^2.0.25",
"async-mutex": "0.4.0",
"ethers": "5.7.2",
"strict-event-emitter-types": "2.0.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/executor/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class Config {
/**
* validate whitelist addresses
*/
for (const entity of ["paymaster", "account", "factory"]) {
for (const entity of ["paymaster", "account", "factory", "external"]) {
config.whitelistedEntities[entity as IEntity] = fromEnvVar(
`WL_${entity.toUpperCase()}`,
config.whitelistedEntities[entity as IEntity],
Expand Down Expand Up @@ -393,7 +393,12 @@ const bundlerDefaultConfigs: BundlerConfig = {
enforceGasPriceThreshold: 1000,
eip2930: false,
useropsTTL: 300, // 5 minutes
whitelistedEntities: { paymaster: [], account: [], factory: [] },
whitelistedEntities: {
paymaster: [],
account: [],
factory: [],
external: [],
},
bundleGasLimitMarkup: 25000,
bundleInterval: 10000, // 10 seconds
bundleSize: 4, // max size of bundle (in terms of user ops)
Expand Down
3 changes: 3 additions & 0 deletions packages/executor/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ export interface UserOpValidationResult {
aggregatorInfo?: StakeInfo;
referencedContracts?: ReferencedCodeHashes;
storageMap?: StorageMap;

belongsToCanonicalMempool: boolean;
mempoolId?: string;
}

export interface ExecutionResult {
Expand Down
4 changes: 3 additions & 1 deletion packages/executor/src/modules/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
SendUserOperationGasArgs,
} from "./interfaces";
import { Skandha } from "./skandha";
import { hexlifyUserOp } from "../utils/hexlifyUserop";

export class Eth {
private pvgEstimator: IPVGEstimator | null = null;
Expand Down Expand Up @@ -133,6 +134,7 @@ export class Eth {
if (nodeApi) {
const { canonicalEntryPoint, canonicalMempoolId } = this.config;
if (
validationResult.belongsToCanonicalMempool &&
canonicalEntryPoint.toLowerCase() == entryPoint.toLowerCase() &&
canonicalMempoolId.length > 0
) {
Expand Down Expand Up @@ -408,7 +410,7 @@ export class Eth {
transaction = await this.provider.getTransaction(entry.transaction);
}
return {
userOperation: entry.userOp,
userOperation: hexlifyUserOp(entry.userOp),
entryPoint: entry.entryPoint,
transactionHash: transaction.hash,
blockHash: transaction.blockHash,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ export class EntryPointV7Service implements IEntryPointService {
decoded.aggregatorInfo.aggregator,
decoded.aggregatorInfo.stakeInfo
),
belongsToCanonicalMempool: true,
};
}

Expand Down
Loading
Loading