You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, getSortedForInclusion() performs copy.sort((a, b) => cost(a.userOp) - cost(b.userOp)), which sorts the operations so that those with lower maxPriorityFeePerGas values come first.
getSortedForInclusion(): MempoolEntry[]{constcopy=Array.from(this.mempool)functioncost(op: OperationBase): number{// TODO: need to consult basefee and maxFeePerGasreturnBigNumber.from(op.maxPriorityFeePerGas).toNumber()}copy.sort((a,b)=>cost(a.userOp)-cost(b.userOp))returncopy}
To maximize profits for the Bundler, it should process gas prices in descending order. Therefore, it should be changed to copy.sort((a, b) => cost(b.userOp) - cost(a.userOp)).
The text was updated successfully, but these errors were encountered:
In https://github.com/eth-infinitism/bundler/blob/master/packages/bundler/src/modules/BundleManager.ts#L206,
createBundle()
callsthis.mempoolManager.getSortedForInclusion()
to obtain sorted UserOperations from mempool.However,
getSortedForInclusion()
performscopy.sort((a, b) => cost(a.userOp) - cost(b.userOp))
, which sorts the operations so that those with lowermaxPriorityFeePerGas
values come first.To maximize profits for the Bundler, it should process gas prices in descending order. Therefore, it should be changed to
copy.sort((a, b) => cost(b.userOp) - cost(a.userOp))
.The text was updated successfully, but these errors were encountered: