Skip to content

Commit

Permalink
Merge pull request #282 from pimlicolabs/fix/alto-bundles-submitted-m…
Browse files Browse the repository at this point in the history
…etrics

fix alto_bundles_submitted_metrics
  • Loading branch information
mouseless-eth authored Aug 27, 2024
2 parents decf0ea + aeb7342 commit d8b5bbf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/executor/executorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export class ExecutorManager {
const ops = mempoolOps
.filter((op) => !isCompressedType(op))
.map((op) => op as UserOperation)

const compressedOps = mempoolOps
.filter((op) => isCompressedType(op))
.map((op) => op as CompressedUserOperation)
Expand All @@ -176,11 +177,23 @@ export class ExecutorManager {
const isBundleSuccess = bundle.every(
(result) => result.status === "success"
)
const isBundleResubmit = bundle.every(
(result) => result.status === "resubmit"
)
const isBundleFailed = bundle.every(
(result) => result.status === "failure"
)
if (isBundleSuccess) {
this.metrics.bundlesSubmitted
.labels({ status: "success" })
.inc()
} else {
}
if (isBundleResubmit) {
this.metrics.bundlesSubmitted
.labels({ status: "resubmit" })
.inc()
}
if (isBundleFailed) {
this.metrics.bundlesSubmitted.labels({ status: "failed" }).inc()
}
}
Expand All @@ -207,14 +220,15 @@ export class ExecutorManager {
res.userOperation.userOperationHash,
res.transactionInfo
)
// this.monitoredTransactions.set(result.transactionInfo.transactionHash, result.transactionInfo)

this.monitor.setUserOperationStatus(
res.userOperation.userOperationHash,
{
status: "submitted",
transactionHash: res.transactionInfo.transactionHash
}
)

txHash = res.transactionInfo.transactionHash
this.startWatchingBlocks(this.handleBlock.bind(this))
this.metrics.userOperationsSubmitted
Expand Down

0 comments on commit d8b5bbf

Please sign in to comment.