BlockVoting contract Vote event outputs current block.number not height voted for
In the vote function of the BlockVoting contract, the Vote event includes the block number when the vote was recorded.
Vote(msg.sender, block.number, hash);
Shouldn't the Vote event actually include the block height and hash voted for.
Vote(msg.sender, height, hash);
I believe block height is defined as the number of blocks preceding the current block. This means that block height and block number are synonymous. This should close the issue as there is nothing wrong with the way it is coded.
A voting node, votes for a particular block (hash) as the parent of the next block (height + 1). The block.number global variable used in the Vote event is always the number of the block in which the vote transaction was included, which is not necessarily the height in the vote transaction parameter.
@joeb000 The last explanation from @magooster is correct. The height can be a different value from block.number. @magooster, we'll be making an update to the contract to emit both values in the event.
Please see https://github.com/jpmorganchase/quorum/issues/266
➤ Samer Falah commented:
joeb000 The last explanation from magooster is correct. The height can be a different value from block.number. magooster, we'll be making an update to the contract to emit both values in the event.