celo-org / op-geth

GNU Lesser General Public License v3.0
0 stars 0 forks source link

Fix debug_getBadBlock panic #272

Open piersy opened 2 weeks ago

piersy commented 2 weeks ago

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