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

why there are 3 transactions in Block 0, but there no transactionReceipts of these 3 transactions? #6156

Open
PikaZ76 opened this issue Jan 27, 2025 · 12 comments

Comments

@PikaZ76
Copy link

PikaZ76 commented Jan 27, 2025

I'm new guy and very interesting in Tron, but I notice there are 3 transactions in block 0, but can't get transactionReceipts for these transactions,

so what happend for transactions in block 0? why the transaction receipts or transaction Info were missed in api ?
jsonrpc call:

{
	"jsonrpc": "2.0",
	"method": "eth_getBlockByNumber",
	"params": [0, true],
	"id": 1
}

we can see there are 3 transactions in this block:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "baseFeePerGas": "0x0",
        "difficulty": "0x0",
        "extraData": "0x",
        "gasLimit": "0x0",
        "gasUsed": "0x0",
        "hash": "0x00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0x0000000000000000000000000000000000000000",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x0",
        "parentHash": "0xe58f33f9baf9305dc6f82b9f1934ea8f0ade2defb951258d50167028c780351f",
        "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "size": "0x216",
        "stateRoot": "0x",
        "timestamp": "0x0",
        "totalDifficulty": "0x0",
        "transactions": [
            "0x788b4d0ca432b3d07f895dffe80429bf58398d0e86222460b07f9db38e238803",
            "0xdfb4a633165cb85963ec1edfb4c9283644a3e136b77c063f4ba2e39307863a75",
            "0x25b18a55f86afb10e7aca38d0073d04c80397c6636069193953fdefaea0b8369"
        ],
        "transactionsRoot": "0x8ef446bf3f395af929c218014f6101ec86576c5f61b2ae3236bf3a2ab5e2fecd",
        "uncles": []
    }
}

but there are no result for method eth_getTransactionReceipt:

{
	"jsonrpc": "2.0",
	"method": "eth_getTransactionReceipt",
	"params": ["0x788b4d0ca432b3d07f895dffe80429bf58398d0e86222460b07f9db38e238803"],
	"id": 1
}

{
	"jsonrpc": "2.0",
	"method": "eth_getTransactionReceipt",
	"params": ["0xdfb4a633165cb85963ec1edfb4c9283644a3e136b77c063f4ba2e39307863a75"],
	"id": 1
}

{
	"jsonrpc": "2.0",
	"method": "eth_getTransactionReceipt",
	"params": ["0x25b18a55f86afb10e7aca38d0073d04c80397c6636069193953fdefaea0b8369"],
	"id": 1
}

they all get this...


{
    "jsonrpc": "2.0",
    "id": 1,
    "result": null
}

also empty for wallet/gettransactioninfobyblocknum by post {"num":0}:

{}
@ferdinand026
Copy link

@PikaZ76 transactionReceipts feature was not there at the beginning, so if one node is started using the snapshot, it is possible that there is no transactionReceipts for the earliest blocks. If you want to get the receipt of transaction in all blocks. you need to start a node and make it sync and process from the very first block, and it will take lots of time.

@PikaZ76
Copy link
Author

PikaZ76 commented Feb 4, 2025

thanks~

@PikaZ76 PikaZ76 closed this as completed Feb 4, 2025
@PikaZ76
Copy link
Author

PikaZ76 commented Feb 5, 2025

@ferdinand026
I deploied a node without any snapshot, it's sync from Block-0, it should be right to get txReceipts for 3 transactions in Block-0, but I just still get same response with empty transaction reciepts and transactionInfo Block-0

post: /wallet/gettransactioninfobyblocknum
data: {"num":	0}

response:
{}

but other blocks get empty response of

post: /wallet/gettransactioninfobyblocknum
data: {"num":	1}

response:
[]

@PikaZ76 PikaZ76 reopened this Feb 5, 2025
@King31T
Copy link

King31T commented Feb 5, 2025

@ferdinand026 I deploied a node without any snapshot, it's sync from Block-0, it should be right to get txReceipts for 3 transactions in Block-0, but I just still get same response with empty transaction reciepts and transactionInfo Block-0

post: /wallet/gettransactioninfobyblocknum
data: {"num":	0}

response:
{}

but other blocks get empty response of

post: /wallet/gettransactioninfobyblocknum
data: {"num":	1}

response:
[]

Is the data not synchronized properly?

@PikaZ76
Copy link
Author

PikaZ76 commented Feb 5, 2025

@ferdinand026 @King31T I tried this after the node started without snapshot and had synced 2,000 blocks. When I sent a request to check Block-0, the API was able to return the block data, which contained 3 transactions.

Does this mean the transaction receipt didn't take effect immediately and I need to wait for a specific state for them to apply?

@King31T
Copy link

King31T commented Feb 6, 2025

I tried this after the node started without snapshot and had synced 2,000 blocks. When I sent a request to check Block-0, the API was able to return the block data, which contained 3 transactions.

Does this mean the transaction receipt didn't take effect immediately and I need to wait for a specific state for them to apply?

Is it possible that 'eth_getTransactionReceipt' does not support blocks before its implementation?

@Sunny6889
Copy link

@ferdinand026 @King31T I tried this after the node started without snapshot and had synced 2,000 blocks. When I sent a request to check Block-0, the API was able to return the block data, which contained 3 transactions.

Does this mean the transaction receipt didn't take effect immediately and I need to wait for a specific state for them to apply?

@ferdinand026 yes, you do need to wait for java-tron finish syncing the blocks you required.

@Sunny6889
Copy link

@King31T rpc method eth_getTransactionReceipt is equal to http wallet/getTransactionInfoById. As long as the requested fullnode contains the transaction info it should return correctly.

@King31T
Copy link

King31T commented Feb 6, 2025

@Sunny6889 Got it, Thx.

@Sunny6889
Copy link

@King31T To clarify in more detail:

  • wallet/gettransactioninfobyblocknum will return data when the block number is greater than 0 and the block contains transactions. For earlier blocks produced before the year 2019 or blocks with numbers less than 10 million, there is a high chance that the block does not contain transactions, and thus it will return an empty response.
  • wallet/getblockbynum with "num": 0 does return the genesis transaction information, with only basic raw_data info, which initializes certain account balances. However, this is not like a transaction initiated by an external request, as it does not include signature, ref_block, expiration, or contractRet.
  • wallet/gettransactioninfobyid and wallet/gettransactioninfobyid only return transactions initiated by external requests. As a result, if you query the three transactions returned by wallet/getblockbynum with "num": 0, they will return empty.
  • Finally, requests that hit the TRON fullnode(locally or remotely) will only check the server's own database. Therefore, you also need to ensure that the requested blocks are synced. You could verify the data use TronScan.

@King31T
Copy link

King31T commented Feb 7, 2025

  • wallet/gettransactioninfobyblocknum will return data when the block number is greater than 0 and the block contains transactions. For earlier blocks produced before the year 2019 or blocks with numbers less than 10 million, there is a high chance that the block does not contain transactions, and thus it will return an empty response.
  • wallet/getblockbynum with "num": 0 does return the genesis transaction information, with only basic raw_data info, which initializes certain account balances. However, this is not like a transaction initiated by an external request, as it does not include signature, ref_block, expiration, or contractRet.
  • wallet/gettransactioninfobyid and wallet/gettransactioninfobyid only return transactions initiated by external requests. As a result, if you query the three transactions returned by wallet/getblockbynum with "num": 0, they will return empty.
  • Finally, requests that hit the TRON fullnode(locally or remotely) will only check the server's own database. Therefore, you also need to ensure that the requested blocks are synced. You could verify the data use TronScan.

@Sunny6889
Regarding the third pointwallet/gettransactioninfobyid, could you give a more detail explanation about the causal relationship?

@Sunny6889
Copy link

@King31T Sorry I don't get your question. What do you mean causal relationship?

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

No branches or pull requests

6 participants
@PikaZ76 @ferdinand026 @Sunny6889 @King31T and others