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

v0_8 starknet_traceBlockTransactions not working #2457

Open
GMKrieger opened this issue Dec 23, 2024 · 1 comment
Open

v0_8 starknet_traceBlockTransactions not working #2457

GMKrieger opened this issue Dec 23, 2024 · 1 comment
Assignees

Comments

@GMKrieger
Copy link

When calling the starknet_traceBlockTransactions endpoint using rpc version 0_8, it returns this error:

Failed to get block tx traces: Other(TransportError(Json(Error("data did not match any variant of untagged enum JsonRpcResponse", line: 0, column: 0))))

When trying to run the tests, updating the serialize version from 07 to 08 on test_multiple_transactions made the test fail.

async fn test_multiple_transactions() -> anyhow::Result<()> {
let (context, next_block_header, traces) = setup_multi_tx_trace_test().await?;
let input = TraceBlockTransactionsInput {
block_id: next_block_header.hash.into(),
};
let output = trace_block_transactions(context, input).await.unwrap();
let expected = TraceBlockTransactionsOutput {
traces: traces
.into_iter()
.map(|t| (t.transaction_hash, t.trace_root))
.collect(),
include_state_diffs: true,
};
pretty_assertions_sorted::assert_eq!(
output
.serialize(Serializer {
version: RpcVersion::V07,
})
.unwrap(),
expected
.serialize(Serializer {
version: RpcVersion::V07,
})
.unwrap(),
);
Ok(())
}

@t00ts
Copy link
Contributor

t00ts commented Jan 10, 2025

Hey @GMKrieger, I haven't been able to reproduce any errors on this method.

Could you please share your RPC query with us?

Here's an example of a usable format:

POST http://127.0.0.1:9545/rpc/v0_8 HTTP/1.1
Content-Type: application/json

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "starknet_traceBlockTransactions",
    "params": {
        "block_id": "latest"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants