Why we sometimes lie to MetaMask
In order to have MetaMask drop your cancelled transactions, we have to do a little tweak by temporarily responding with a very high TX count to the RPC call eth_getTransactionCount
.
Until we build out our documentation on this topic here, please refer to our source of inspiration from Flashbots Protect.