ethereum / execution-apis

Collection of APIs provided by Ethereum execution layer clients
Creative Commons Zero v1.0 Universal
908 stars 352 forks source link

feat: add returndata to tx receipts #542

Open charles-cooper opened 2 months ago

charles-cooper commented 2 months ago

right now, returndata is not part of the tx receipt. this means that consumers of the API need to find alternative ways to fetch the returndata from a transaction, the most common being debug_traceTransaction. however, this is non-standard and not universally supported. it would be helpful if the returndata were simply part of the transaction receipt.

LukaszRozmej commented 1 month ago

I prefer either:

  1. mandatory storage of this data and changing eth/XX protocol to be able to sync it OR
  2. separate method as it allows for better separation of optional and mandatory data and better balance load of the calls as re-runing transaction is more costly than reading from receipt database.
charles-cooper commented 1 month ago

I prefer either:

  1. mandatory storage of this data and changing eth/XX protocol to be able to sync it OR

how feasible is it to change the receipt database?

LukaszRozmej commented 1 month ago

I prefer either:

  1. mandatory storage of this data and changing eth/XX protocol to be able to sync it OR

how feasible is it to change the receipt database?

way less than the alternative, it would have to be hardforked and wouldn't apply to previous receipts. So am for adding new method like eth_call but for historical transactions only.

s1na commented 1 month ago

So am for adding new method like eth_call but for historical transactions only.

Perhaps eth_replayTransaction.

I would be for adding tx-boundary state to eth_call (e.g. eth_call({}, "latest", 2) where 2 is the tx index). The challenge is that geth has extra optional parameters to override state and block fields. So to make this tx index compatible across clients we'd first need to standardize those 2 fields.

Because of this eth_replayTransaction seems the path of least resistance.

charles-cooper commented 1 month ago

So am for adding new method like eth_call but for historical transactions only.

Perhaps eth_replayTransaction.

what does eth_replayTransaction do? basically eth_call but with a transaction hash?

s1na commented 1 month ago

what does eth_replayTransaction do? basically eth_call but with a transaction hash?

Yep, that is the idea that Lukasz proposed. I just suggested a name :)