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

debug_traceBlockByHash: Invalid state-sync tx hash returned #1184

Closed
dylanHarville opened this issue Mar 11, 2024 · 5 comments
Closed

debug_traceBlockByHash: Invalid state-sync tx hash returned #1184

dylanHarville opened this issue Mar 11, 2024 · 5 comments

Comments

@dylanHarville
Copy link

Bor client version: [v1.2.7]

OS & Version: Linux

Environment: Polygon Mainnet

Type of node: Archive

Overview of the problem

An invalid state-sync hash is returned from a debug_traceBlockByHash call to Bor archive node.

Expected behavior: state-sync transaction hash for block 54529760 should be 0x9825781be0f282df3b4384c3f8973dd52e827b71a4dbc80d995d8728ad35cb25

Actual Behavior: state-sync transaction hash returned is 0xe79e4719c6770b41405f691c18be3346b691e220d730d6b61abb5dd3ac9d71f0

Reproduction Steps

curl <BOR_ARCHIVE> \
--header 'Content-Type: application/json' \
--data '{"method":"debug_traceBlockByHash","params":["0x6e49a6de48a0c9c5d973802b7a061067fdd128573b5d482ab46723b6d1eb5860", {"timeout": "30s", "tracer": "callTracer", "borTraceEnabled": true}],"id":1,"jsonrpc":"2.0"}' | jq '.result[].txHash'

The last transaction returned is the state-sync (0xe79e4719c6770b41405f691c18be3346b691e220d730d6b61abb5dd3ac9d71f0); however, it does not exist on the explorer. Confirmed with debug_traceTransaction

curl <BOR_ARCHIVE> \
--header 'Content-Type: application/json' \
--data '{"method":"debug_traceTransaction","params":["0xe79e4719c6770b41405f691c18be3346b691e220d730d6b61abb5dd3ac9d71f0", {"timeout": "30s", "tracer": "callTracer", "borTraceEnabled": true}],"id":1,"jsonrpc":"2.0"}' | jq

Returns ->
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "transaction not found"
  }
} 

When making the same call against an Erigon archive node, the correct state-sync tx is returned -> 0x9825781be0f282df3b4384c3f8973dd52e827b71a4dbc80d995d8728ad35cb25

Additional Information

This appears to be a bug in the tracing. Calling eth_getTransactionByBlockHashAndIndex against the same bor archive node returns the correct tx hash.

curl -s -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0", "id": 1, "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x6e49a6de48a0c9c5d973802b7a061067fdd128573b5d482ab46723b6d1eb5860", "0x82"]}' <BOR_ARCHIVE> | jq

Returns ->

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0x6e49a6de48a0c9c5d973802b7a061067fdd128573b5d482ab46723b6d1eb5860",
    "blockNumber": "0x3400ee0",
    "from": "0x0000000000000000000000000000000000000000",
    "gas": "0x0",
    "gasPrice": "0x0",
    "hash": "0x9825781be0f282df3b4384c3f8973dd52e827b71a4dbc80d995d8728ad35cb25",
    "input": "0x",
    "nonce": "0x0",
    "to": "0x0000000000000000000000000000000000000000",
    "transactionIndex": "0x82",
    "value": "0x0",
    "type": "0x0",
    "v": "0x0",
    "r": "0x0",
    "s": "0x0"
  }
}
@manav2401
Copy link
Contributor

Hey, thanks for reporting. We've identified this issue and it looks like the transaction hash of the state-sync transaction is wrongly calculated which is causing the hash to differ. We're testing the fix internally and will roll out a hotfix release soon for the same. Thanks again!

@manav2401
Copy link
Contributor

Also, note that the call for debug_traceTransaction doesn't work in bor for state-sync transactions but it does work in erigon. So it is expected that even if you use the correct tx hash, it might not generate a trace. Having it in bor is in our pipeline but for now, only erigon supports it. Thanks!

@anshalshukla
Copy link
Contributor

We have released a new version v1.2.8-beta with the fix

@tobidae-cb
Copy link

Is this hotfix a main release or a beta release? Should we be using it in our production nodes?

@anshalshukla
Copy link
Contributor

I think it is safe to have it on production nodes, we will be releasing a main release soon with the same changes

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

4 participants