0

I'm testing some stuff on Ropsten network and I've found strange block:

4138624 When I run (using web3 injected in Metamask):

web3.eth.getBlock(4138624,function(err,res){

console.log(res);

})

I'm getting strange result

transactionsRoot and recieptsRoot has same value

I've posted question also on reddit https://www.reddit.com/r/ethdev/comments/9jz5cm/strange_ropsten_bug/

I've noticed them, because for those

                    data = [];
                    data.push(res.parentHash);
                    data.push(res.sha3Uncles);
                    data.push(res.miner);
                    data.push(res.stateRoot);
                    data.push(res.transactionsRoot);
                    data.push(res.receiptsRoot);
                    data.push(res.logsBloom);
                    data.push(addPrefix(parseInt(res.difficulty).toString(16)));
                    data.push(addPrefix(res.number.toString(16)));
                    data.push(addPrefix(res.gasLimit.toString(16)));
                    data.push(addPrefix(res.gasUsed.toString(16)));
                    data.push(addPrefix(res.timestamp.toString(16)));
                    data.push(res.extraData);
                    data.push(res.mixHash);
                    data.push(res.nonce);

if(res.hash==="0x"+utils.keccak256(rlp.encode(data)){ // OK }else{ //Something wrong }

returns incorrect hash (while for most works just fine)

1 Answer 1

2

It is a block without transaction https://ropsten.etherscan.io/block/4138624, so those fields are keccak256 of an empty array of bytes.

If you look at blocks for other networks like rinkeby or mainnet they will have the same value

1
  • Thanks for pointing out, but I also noticed, that when I'm compution blockchash for those blocks it returns incorrect hash Commented Sep 29, 2018 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.