You may have misunderstood the eth tech stack. Running your own node is not a means to prevent sandwich attacks.
You may have misunderstood the eth tech stack. Running your own node is not a means to prevent sandwich attacks.
There are existing solutions for the narrow use case you seem to have - flashbots and a few others. And they have cost savings to you of not running your tx (saving eth gas fees) if your tx submission does not win.
You may want to look a little further, or not.
https://github.com/flashbots/pm
'... mitigating the negative externalities of Maximal Extractable Value ...'
If you think it's to prevent attacks in some absolute sense, that isn't the goal. Your goal is to make life more difficult for them and/or decrease profit incentives.
You only need to remove some of the profit to make it not worth someone's time to maintain, and at least you're bleeding less money if they do continue. You get to be more strategic in how you place orders and make it really annoying for a botter or force the botter to blacklist your trades from your attacks (something that has happened before). You can also identify flaws in the bot and exploit them to make it bleed money(this has been demonstrated as possible many times).