Skip to content

Commit

Permalink
cleanup markWalletProcessed flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Jan 26, 2025
1 parent 25daacd commit 255ec63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,6 @@ export class Executor {
childLogger.error(
"gas limit simulation encountered unexpected failure"
)
this.markWalletProcessed(wallet)
return {
status: "bundle_failure",
reason: "INTERNAL FAILURE",
Expand All @@ -600,7 +599,6 @@ export class Executor {

if (opsToBundle.length === 0) {
childLogger.warn("all ops failed simulation")
this.markWalletProcessed(wallet)
return {
status: "bundle_failure",
reason: "INTERNAL FAILURE",
Expand Down Expand Up @@ -683,7 +681,6 @@ export class Executor {
{ error: e },
"insufficient funds, not submitting transaction"
)
this.markWalletProcessed(wallet)
return {
status: "bundle_resubmit",
reason: InsufficientFundsError.name,
Expand All @@ -696,7 +693,6 @@ export class Executor {
{ error: JSON.stringify(err) },
"error submitting bundle transaction"
)
this.markWalletProcessed(wallet)
return {
status: "bundle_failure",
reason: "INTERNAL FAILURE",
Expand Down
8 changes: 8 additions & 0 deletions src/executor/executorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ export class ExecutorManager {
break
}

// Free wallet if the wallet did not make a succesful bundle tx.
if (
bundle.status === "bundle_failure" ||
bundle.status === "bundle_resubmit"
) {
this.senderManager.markWalletProcessed(wallet)
}

if (bundle.status === "bundle_resubmit") {
const { userOpsBundled: userOperations, reason } = bundle

Expand Down

0 comments on commit 255ec63

Please sign in to comment.