Receipt Proofs do not verify many blocks on main net
Shirikatsu opened this issue · 2 comments
Attempting to do a simple build and verify of receipt proofs fail on blocks that seem to have too many transactions. Transaction trie proofs work completely perfectly but receipt trie proofs only work some of the time.
eP = new EP(new Web3.providers.HttpProvider("https://gmainnet.infura.io"));
web3 = new Web3(new Web3.providers.HttpProvider("https://gmainnet.infura.io"));
block = await web3.eth.getBlock(5992178);
eP.getReceiptProof(block.transactions[0]).then( (proof) => {
verified = EP.receipt(proof.path, proof.value, proof.parentNodes, proof.header, proof.blockHash);
})
This verification fails.
I've forked the repository and added a function that returns the constructed trie root hash and have confirmed that the root node hash does not hash to the value present in the block.
This means that the trie construction must be faulty for some cases. Other blocks that contain few transactions like block 1000002
verify successfully for some reason.
Please attempt to do a receipt verification on any receipt in the block specified in the code above and see if it fails to verify or not.
Seems to be fixed in #6