The code previously assumed that all non pending transactions passed
to newRPCTransaction would have a receipt, but in fact this is not the
case because recorded bad blocks have no receipts.
The only transaction type that relied on having a receipt is the
CeloDynamicFeeTxV2Type which post cel2 stores the base fee in fee
currency in the receipt which allows for calculating the gas price without
state access.
So we fix the panic by simply allowing post cel2 CeloDynamicFeeTxV2Type
to not have a receipt, and if they don't returning nil for the gas price.
Fixes debug_getBadBlocks panic due to no receipt.
The code previously assumed that all non pending transactions passed to
newRPCTransaction
would have a receipt, but in fact this is not the case because recorded bad blocks have no receipts.The only transaction type that relied on having a receipt is the CeloDynamicFeeTxV2Type which post cel2 stores the base fee in fee currency in the receipt which allows for calculating the gas price without state access.
So we fix the panic by simply allowing post cel2 CeloDynamicFeeTxV2Type to not have a receipt, and if they don't returning nil for the gas price.
Closes #747