Skip to content

Commit

Permalink
Adding clearMempool, clearReputation debug rpc calls
Browse files Browse the repository at this point in the history
  • Loading branch information
shahafn committed Oct 1, 2023
1 parent ed53cc1 commit ecf7baf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 8 additions & 0 deletions packages/bundler/src/BundlerServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,21 @@ export class BundlerServer {
case 'debug_bundler_dumpMempool':
result = await this.debugHandler.dumpMempool()
break
case 'debug_bundler_clearMempool':
this.debugHandler.clearMempool()
result = 'ok'
break
case 'debug_bundler_setReputation':
await this.debugHandler.setReputation(params[0])
result = 'ok'
break
case 'debug_bundler_dumpReputation':
result = await this.debugHandler.dumpReputation()
break
case 'debug_bundler_clearReputation':
this.debugHandler.clearReputation()
result = 'ok'
break
case 'debug_bundler_setBundlingMode':
await this.debugHandler.setBundlingMode(params[0])
result = 'ok'
Expand Down
8 changes: 8 additions & 0 deletions packages/bundler/src/DebugMethodHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,19 @@ export class DebugMethodHandler {
return this.mempoolMgr.dump()
}

clearMempool (): void {
this.mempoolMgr.clearState()
}

setReputation (param: any): ReputationDump {
return this.repManager.setReputation(param)
}

dumpReputation (): ReputationDump {
return this.repManager.dump()
}

clearReputation (): void {
this.repManager.clearState()
}
}
4 changes: 2 additions & 2 deletions packages/bundler/src/modules/ReputationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export interface ReputationParams {

export const BundlerReputationParams: ReputationParams = {
minInclusionDenominator: 10,
throttlingSlack: 5,
banSlack: 10
throttlingSlack: 10,
banSlack: 50
}

export const NonBundlerReputationParams: ReputationParams = {
Expand Down

0 comments on commit ecf7baf

Please sign in to comment.