Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIP-801: Opcode tracer endpoint implementation for eth_debug_traceTransaction #6781

Open
4 tasks
stoqnkpL opened this issue Aug 30, 2023 · 1 comment
Open
4 tasks
Assignees
Labels
enhancement Type: New feature epic Type: Large user story that encompasses multiple tasks limechain Work planned for the LimeChain team web3 Area: Web3 API work package Limechain Work package

Comments

@stoqnkpL
Copy link

stoqnkpL commented Aug 30, 2023

Overview of Package

Definition

Add a new REST POST endpoint in hedera-mirror-web3, that will allow tracing historical transactions and displaying the opcodes that were executed.

Abstract

Add support for debugging historical transactions with the opcodeLogger tracer.

Motivation

Enhancing Mirror Archive Node with debug calls would allow users to replay historical transactions and inspect and analyse them by having detailed information for the execution based on a tracer type that is specified in the request. In addition, this enhancement would improve Hedera interoperability with different ethereum tools and providers, including Remix, Hardhat, Ganache, Geth, Alchemy, etc. This task would cover having an implementation for the opcodeLogger tracer.

Rationale

The JSON-RPC Relay will add a debug_traceTransaction endpoint which in turn will make a request to the Mirror Node REST API.

A new /api/v1/contracts/results/{transactionIdOrHash}/opcodes endpoint needs to be created in order to support handling transaction tracing requests.

User stories

  1. As a user, I want to perform debug_traceTransaction calls to explore the op code traces for a historical transaction.

Specification

  1. Implement a new REST POST endpoint: /api/v1/contracts/results/{transactionIdOrHash}/opcodes
  2. Handling requests should include the following steps:
    1. load information about the historical transaction specified with the {transactionIdOrHash}
    2. load information about the contract state changes that were externalized by the Consensus node during the original transaction execution
    3. instantiate a State that reads from the state changes from the sidecar and the account, contract and token related information that is kept in the different tables
      1. we may also need to read precompile results from the contract actions?
    4. implement the opcode logger tracer (one such does exist in Besu, so try to reuse it)
    5. re-execute the transaction with enabled tracing by the opcode logger tracer
  3. Create and implement a test plan
  4. Disable the endpoint by default (and for production environments)

Backwards compatibility

We’re adding a new endpoint so no impact on backwards compatibility is expected.

Security Implications

Some outputs from tracing transactions (especially with the opcode logger tracer) can be pretty large and could have impact on the performance. This is the reason why this endpoint should not be enabled on production.

References/Dependencies

  1. HIP-584: Mirror EVM Archive Node
  2. EVM Archive Node with Historical block support for eth_call -design doc- [shared]
  3. Draft HIP-XXX for debug_traceTransaction support [shared]

Tasks

  1. enhancement limechain web3
    konstantinabl natanasow
    victor-yanev
  2. enhancement limechain web3
    victor-yanev
  3. enhancement limechain web3 work package
    victor-yanev
  4. limechain
    nickeynikolovv
@stoqnkpL stoqnkpL added epic Type: Large user story that encompasses multiple tasks limechain Work planned for the LimeChain team work package Limechain Work package labels Aug 30, 2023
@steven-sheehy steven-sheehy added the enhancement Type: New feature label Oct 28, 2023
@IvanKavaldzhiev IvanKavaldzhiev added the web3 Area: Web3 API label Dec 7, 2023
@IvanKavaldzhiev IvanKavaldzhiev changed the title EVM transactions DEBUG: opcode tracer endpoint implementation HIP-801: Opcode tracer endpoint implementation for eth_debugTraceTransaction Dec 7, 2023
@IvanKavaldzhiev IvanKavaldzhiev changed the title HIP-801: Opcode tracer endpoint implementation for eth_debugTraceTransaction HIP-801: Opcode tracer endpoint implementation for eth_debug_traceTransaction Dec 7, 2023
@bibitibooo1
Copy link

for Q2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature epic Type: Large user story that encompasses multiple tasks limechain Work planned for the LimeChain team web3 Area: Web3 API work package Limechain Work package
Projects
Status: 📋 Backlog
Status: In Review
Development

No branches or pull requests

8 participants