Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
forshtat committed Oct 3, 2023
1 parent 083936f commit 8c64462
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/bundler/src/modules/MempoolManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,15 @@ export class MempoolManager {

const isPaymasterSenderViolation = knownSenders.includes(paymaster?.toLowerCase() ?? '')
const isFactorySenderViolation = knownSenders.includes(factory?.toLowerCase() ?? '')

requireCond(
!isPaymasterSenderViolation,
`A Paymaster at ${paymaster} in this UserOperation is used as a sender entity in another UserOperation currently in mempool.`,
ValidationErrors.OpcodeValidation
)
requireCond(
!isPaymasterSenderViolation && !isFactorySenderViolation,
`An entity in this UserOperation is used as a sender entity in another UserOperation currently in mempool. (${paymaster}:${isPaymasterSenderViolation};${factory}:${isFactorySenderViolation})`,
!isPaymasterSenderViolation,
`A Factory at ${factory} in this UserOperation is used as a sender entity in another UserOperation currently in mempool. (${paymaster}:${isPaymasterSenderViolation};${factory}:${isFactorySenderViolation})`,
ValidationErrors.OpcodeValidation
)
}
Expand Down Expand Up @@ -260,7 +266,7 @@ export class MempoolManager {
* Returns all addresses that are currently known to be "senders" according to the current mempool.
*/
getKnownSenders (): string[] {
return this.getSortedForInclusion().map(it => {
return this.mempool.map(it => {
return it.userOp.sender.toLowerCase()
})
}
Expand Down

0 comments on commit 8c64462

Please sign in to comment.