Add a --gpo.ignoreprice option to ignore MEV-priced txs#22752
Add a --gpo.ignoreprice option to ignore MEV-priced txs#22752holiman merged 2 commits intoethereum:masterfrom
Conversation
|
This is also being worked on in #22722 |
|
Oops, also pointed to wrong historical gas price RPC commit, this one here supports ignoring txs under a passed-in price, and is the one I used to generate the CSV: ryanschneider@8c6531e |
holiman
left a comment
There was a problem hiding this comment.
Generally lgtm, some nitpicks
There was a problem hiding this comment.
If you set the default to 2 * params.Wei, then we'd keep the current (just merged) behaviour
There was a problem hiding this comment.
Thanks, I rebased off master and applied this change as well as your other suggestions as part of the updated 4096b9aba790b850ad495e560bb56557aaeae31f commit.
4ec1be9 to
c27a158
Compare
There was a problem hiding this comment.
This would bump the current default (2) with nine orders of magnitude. I think it's unintentional?
For sure, 2 might be too low, but let's change these things slowly. I think getting rid of 0 and 1 already will make a big difference. Let's gather some data before bumping it another time
There was a problem hiding this comment.
Ah yes, will fix :)
c27a158 to
1aafa91
Compare
|
@holiman does this need another ✅ to get merged? |
Technically, no. However, since it adds yet another option to the UX, I would like one more ✔️ (or discuss it in a triage) before it gets merged. We don't want to add things only to have to redefine/deprecate them later because we come up with a better way to handle it, or find that we should've named it differently or something. |
ethereum#22752) This adds a cmd line parameter `--gpo.ignoreprice`, to make the gas price oracle ignore transactions below the given threshold.
We had a user report that periodically
eth_gasPricewould return insanely low values, either 6gwei or 10gwei when moments before it was reporting seemingly correct values well over 100gwei.The first step to track down the issue was to reproduce it, which was hard since
eth_gasPriceonly operates on the current block. We had some metrics on gas prices, but were only recording at ~15m granularity, so usually weren't catching these dips.So, to debug the issue, I created this commit (ryanschneider@6acdbb4) that added a
eth_historicalGasPriceRPC for testing. However, to keep the current PR focused, I did NOT include this RPC in this PR; if we feel it has value we can discuss adding it separately.With this change deployed on a client, I was able to find historical blocks where the GPO dipped down drastically, for example around block
12275922where the GPO predicted a 6gwei gas price. I'm not that familiar with the gas price oracle, but it appeared that the issue was caused by MEV txs with 0 or very low gas prices were skewing the results.Then, I scanned all the recent blocks starting at
12200000and created this CSV (https://gist.githubusercontent.com/ryanschneider/001d50cbd73e3b93d70c8a54c4aeb35b/raw/25923cfd54dc95b6cca02530b5ce144dc2b4a44a/mev.csv) that captured every block whereeth_gasPricewould've returned a different value if txs below 10gwei were discarded. As you can see, this gives very different results at some points:At block 12275922, the standard eth_gasPrice would return 6gwei, but would return 304gwei if the txs below 10gwei were ignored.
However, since networks other than mainnet might have totally different gas pricing rules, I think it makes sense to make this cut-off value user configurable, so that's what this PR does, it adds a
--gpo.ignorepriceoption that defaults to0, any txs processed by the GPO with a gas price strictly below the configured value is ignored.It's possible there's something more subtle going on here that adding this exclusion is glossing over, so if someone familiar with the GPO can help provide context I'm happy to dig in deeper to see why a relatively small number of MEV txs are able to skew the results so much.