getBlock & getBlockNumber produce odd results
See original GitHub issueI’ve got a loom test chain running on AWS (single node).
I can see it and make http calls to it at: http://52.88.113.238:46658/rpc.
Contracts are deployed on it, and I can change their state, but, I can’t see it in the loom block explorer (separate issue, maybe). I can put the block explorer address into a browser and read the json, though.
What’s most odd is that the block height doesn’t seem to match reality. I see web3.eth.getBlockNumber()
returning 2.2million, and both the block explorer json and the web3.eth.getBlock(‘latest’)
giving 210k (210k is correct; it’s been running over the w/e
Also, getBlock doesn’t seem to return a proper “Block” obect - it has blockNumber
, but no number
Further, the returned data from web3.eth.getBlock()
is wrong; I get the following, not a proper Block object: {"blockNumber":"0x34fa2","transactionHash":"0xdee07e7f845caf52c76c0a30e762a03214455ee2","parentHash":"0x625965193b355527ed51550023694249768d091e","logsBloom":"0x","timestamp":1534198065,"transactions":[]}
The data does appear to be correct, just formatted incorrectly.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
More oddness with getBlock: If you try a numerical getBlock in a block with a transaction, the getBlock fails with a BigNumber error (Something’s undefined).
On that same server, the following calls might work or not: loomWeb3.eth.getBlock(217777) > success loomWeb3.eth.getBlock(217778) > fails loomWeb3.eth.getBlock(217779) > success
Error log (we’ve added logging into loom_provider, so line numbers might not match):
Thanks @paulbarclay we’ll going to check