flashbots / ethers-provider-flashbots-bundle

Flashbots provider for ethers.js
545 stars 213 forks source link

getConflictingBundle compares gas used, but should it be comparing effective gas price instead? #64

Open midas-glitch opened 2 years ago

midas-glitch commented 2 years ago

https://github.com/flashbots/ethers-provider-flashbots-bundle/blob/2b98fbe4b1f11ea4d3d13f82e1e5aeeaa5e39561/src/index.ts#L658

After trying to troubleshoot some tx of mine that weren't included:

From the docs: Effective Priority Fee - A bundle cannot significantly reduce its priority fee between simulating at the top of the block and when it is selected for inclusion. This commonly occurs when a bundle is operating on an arbitrage for which it pays a % of the profit to the miner, with an earlier bundle taking part, but not all, of the arbitrage opportunity.

It seems that getConflictingBundle should be comparing effective gas price, but instead its comparing gas used. getConflictingBundle will give me an error when the initial sim shows that the tx used a certain amount of gas, and uses less gas when simulated after another bundle? Is this the correct behavior?