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

fix(rpc): apply beacon root contract call in debug_traceTransaction #11845

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Oct 17, 2024

fixes #11735

We did not apply the beacon root contract call in debug_traceTransaction, but we do in trace_transaction:

self.spawn_with_state_at_block(parent_block.into(), move |state| {
let mut db = CacheDB::new(StateProviderDatabase::new(state));
let block_txs = block.transactions_with_sender();
// apply relevant system calls
let mut system_caller = SystemCaller::new(
Trace::evm_config(&this).clone(),
LoadState::provider(&this).chain_spec(),
);
system_caller
.pre_block_beacon_root_contract_call(
&mut db,
&cfg,
&block_env,
parent_beacon_block_root,
)
.map_err(|_| {
EthApiError::EvmCustom(
"failed to apply 4788 beacon root system call".to_string(),
)
})?;

This now does the same thing before replaying transactions

@Rjected Rjected added C-bug An unexpected or incorrect behavior A-rpc Related to the RPC implementation labels Oct 17, 2024
@Rjected Rjected force-pushed the dan/debug-trace-transaction-system-call branch from 4c21ebc to e2bd40b Compare October 17, 2024 17:21
@Rjected
Copy link
Member Author

Rjected commented Oct 17, 2024

new output of the command:

curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0x395c82b4fd16307eb98d7d96be21f043d36ff5f1247c43bdbe643dbd296163d4",{"tracer": "callTracer"}],"id":1}' -H 'Content-Type: application/json' http://localhost:8545 | jq .
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "from": "0xc13ced137e90bc695cb77288962280516a2f9b8b",
    "gas": "0x30d40",
    "gasUsed": "0x906f",
    "to": "0x897a96deb94291b785faff64088f7202a019f38e",
    "input": "0x9103de44000000000000000000000000000000000000000000000000008094a18c072485",
    "calls": [
      {
        "from": "0x897a96deb94291b785faff64088f7202a019f38e",
        "gas": "0x297fb",
        "gasUsed": "0x10e0",
        "to": "0x000f3df6d732807ef1319fb7b8bb8522d0beac02",
        "input": "0x000000000000000000000000000000000000000000000000000000006708306b",
        "output": "0x1c941b19e43f340e1f9d433fdb84f4b6aad556cb8db9f4afb096bcfdc9c8ac6f",
        "value": "0x0",
        "type": "CALL"
      },
      {
        "from": "0x897a96deb94291b785faff64088f7202a019f38e",
        "gas": "0x8fc",
        "gasUsed": "0x0",
        "to": "0xc13ced137e90bc695cb77288962280516a2f9b8b",
        "input": "0x",
        "value": "0x2386f26fc10000",
        "type": "CALL"
      }
    ],
    "value": "0x0",
    "type": "CALL"
  }
}

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah rip, with new executor we can finally do something about this soon

@mattsse mattsse added this pull request to the merge queue Oct 17, 2024
Merged via the queue into main with commit 76edc38 Oct 17, 2024
39 checks passed
@mattsse mattsse deleted the dan/debug-trace-transaction-system-call branch October 17, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency between debug_ and trace_ API
2 participants