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.
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 ofTransaction
fromU256
toOption<U256>
, due to thegasPrice
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
toBlockId
.