raft: block timestamp as nanoseconds?
the RPC API output of
web3.eth.getBlock( blockNumber ).timestamp
is usually denominated in seconds, but with RAFT it isn't.
I suppose, raft is reporting the timestamps as nanoseconds? Is that correct?
I had to come up with this special treatment
# quorum raft consensus ... returns not seconds but nanoseconds?
timeunits = 1000000000.0 if CONSENSUS=="raft" else 1.0
blocktimeSeconds = (ts_newBlockNumber - ts_blockNumber) / timeunits
https://gitlab.com/electronDLT/chainhammer/blob/86b5b3cfe59529df97cf7abe165224e3cc32892d/tps.py#L83-91
I have solved it for myself now, but it is a bit non-standard, no?
System information
Geth version: Geth/v1.7.2-stable-ee498061/linux-amd64/go1.9.3
OS & Version: Linux
suggestion:
return seconds, as a float.
Looks like it is generated in nanos. Need to check if this is on purpose, since the block creation time is minimized in raft implementation.
Ref https://github.com/jpmorganchase/quorum/blob/master/raft/minter.go#L232
This is correct for raft given that it has a configurable blocktime in ms.