Skip to content

Add prestateTracer to debug_traceTransaction #3817

Closed
@konstantinabl

Description

@konstantinabl

As a user, I would like to be able to use the debug_traceTransaction endpoint with the prestateTracer

Problem
Currently, the debug_traceTransaction endpoint doesn't support prestateTracer. Since this tracer type is widespread, its best to include it in order to follow industry standards.

Image

This issue is created after discussion here -> #3739

Solution

Currently, the prestateTracer is implemented as part of the traceBlockByNumber endpoint, however it does not support historical nonces.
The method implementing the tracer can be added to the traceTransaction method
Reference for result format
https://www.alchemy.com/docs/node/debug-api/debug-api-endpoints/debug-trace-transaction

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "0x3ee18b2214aff97000d974cf647e7c347e8fa585": {
      "balance": "0x1de2bddcbc385005",
      "code": "0x60806040523661001357610011610017565b005b6100115b61002761002261005e565b610096565b565b606061004e838360405180606001604052806027815260200161024c602791396100ba565b9392505050565b3b151590565b90565b60006100917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b366.”…..,
      "nonce": 350,
      "storage": {
        "0x0000000000000000000000000000000000000000000000000000000000000000": "0x00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b",
        "0x0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000f00010002",
        "0x000000000000000000000000000000000000000000000000000000000000000c": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "0x1f245ac64242947e58f41e0c74da6346e52e55c3b7aaa984593ab94923e568fc": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x00000000000000000000000076364611e457b1f97cd58ffc332ddc7561a193f6",
        "0x49f94b4a8474e5f2d79309e607b8ef752c9cd6053f7950596c1f47950b798b59": "0x00000000000000000000000000000000000000000000000000001691a9989295"
      }
    },
    "0x5067c042e35881843f2b31dfc2db1f4f272ef48c": {
      "balance": "0x77972249745b6a",
      "nonce": 6
    },

....
}

Metadata

Metadata

Assignees

Labels

Team PromotedIssues to be triaged and discussed by committers, maintainers, to be worked on the following sprintenhancementNew feature or request

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions