flashbots / mev-inspect-rs

Discover historic Miner Extractable Value (MEV) opportunities
MIT License
547 stars 127 forks source link

update ethers-rs to 0.6.1 #63

Open Rjected opened 2 years ago

Rjected commented 2 years ago

Motivation

Older versions of ethers-rs depend on curl, which has issues compiling for M1 macs. Newer versions of ethers-rs do not require curl, so it should be updated.

Solution

Updates to ethers-rs change the type of the gas_price field of Transaction from U256 to Option<U256>, due to the gasPrice field being deprecated for EIP-1559 transactions. As a result, gas_price_txs_from_block has been added to help implement proper gas price calculation for both EIP-1559 transactions and non EIP-1559 transactions. This function follows the advice included in the gasPrice deprecation PR, using effectiveGasPrice from receipts for EIP-1559 transactions, and gasPrice for non EIP-1559 transactions. This solution is meant to work post gasPrice removal for EIP-1559 transactions.

This also updates BlockNumber to BlockId.