We found one block which returns an error when we call the GetTxnBodiesForTxBlock API:
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "GetTxnBodiesForTxBlock",
"params": ["175334"]
}' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/"
{"error":{"code":-20,"data":null,"message":"Txn Hash not Present"},"id":"1","jsonrpc":"2.0"}
The issue seems to be that there are 2 txns in that block that are not present in the blockchain:
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "GetTransactionsForTxBlock",
"params": ["175334"]
}' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/"
{
"id": "1",
"jsonrpc": "2.0",
"result": [
[
"93cd69e14e5f624f14a09254c47a729fd2295d69bedfaac03056513b3ff6af29",
"8d702cb302fcb25fe0b33b07bbd11c816815dda5747af24326aeac20ecfd6c73"
],
null,
[],
[
"05bab941d5eeac7ce78b8bc8d890f42675b07975c678ae5184a50df67913ae26",
"078efcf10473251f4a4ba8c4ce18810f06d3cafcf2eb8122a5f4293e9d2bdea3",
"097a0ef43987adcf511c0f140ac316b3f7ac8b1819fdd6a1c44da82fbad541ae",
"0aa3c892a183457dd4b0252e960466635c2508f6a1b6f528e84fbbc7682c6710",
"0b6beb2cea06737a531f02493f5aa788afbde15fd3e87006b65800d463909ee8",
"1355121906ac35972e6b65026b07b427b5c4ae148c225a9a53b026e5749d4705",
"255f44c45f43197cbc53f2b33795093186d4cf12dead77b2e5166a88002f294a",
"2909e3341a97d57ffaccd514cb2e9d6ea402b1be927125774ce9501fb813b25b",
"297a221754dd0b34b43adeadb762d95ee6bdf0a96fbbc42e06f6ab5a47f559e6",
"303908b5ccba037748bb93946092470247192e25c7c0c5f17d55dca19122a9c9",
"35ed1d1e0611b805a5de8b5ffa162192c6a7bfb5b592916cdda8fa856bd86a5b",
"4fdcb5cee42ca7c0f639101c08658019ed55745094d1d0f6abcca2981ee3adc9",
"5161e9eda90904f601d16702586d35bb82db702e88f24b7a36c1691dde6e7f4e",
"61be4d61ec71740f835b2910c182fe35d161cfc1f3b2c4b9debef3b229b90ef3",
"ada4f7b094d718bedffdc4827ab1e0ab2bd14d5fb2840505f81a4ddcf8c1bff3",
"d1b8d0c891e88ea12bea3fb9c58b2fc69a5cdffe46024f6a17f51c4e2cc807b7",
"e0b14cba55e1e1e17e5be24a6b77ab3109ed788360aeb8652f74c817b3e4d365"
]
]
}
The 1st two transactions are not present, e.g.:
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "GetTransaction",
"params": ["8d702cb302fcb25fe0b33b07bbd11c816815dda5747af24326aeac20ecfd6c73"]
}' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/"
{"error":{"code":-20,"data":null,"message":"Txn Hash not Present"},"id":"1","jsonrpc":"2.0"}
Here 2 out of 19 transactions are missing as well https://viewblock.io/zilliqa/block/175334.
We are going to use GetTransactionsForTxBlock instead of GetTxnBodiesForTxBlock in case "Txn Hash not Present" error is returned and retrieve only transactions that are present one by one using the GetTransaction API. For the block itself we will specify only the number of present transactions e.g. 17 for block 175334, so that our consistency verifications pass.