quorum icon indicating copy to clipboard operation
quorum copied to clipboard

BlockVoting contract Vote event outputs current block.number not height voted for

Open magooster opened this issue 9 years ago • 5 comments

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);

magooster avatar Dec 06 '16 14:12 magooster

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.

joeb000 avatar Dec 10 '16 18:12 joeb000

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.

magooster avatar Dec 12 '16 13:12 magooster

@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.

jpmsam avatar Dec 12 '16 14:12 jpmsam

Please see https://github.com/jpmorganchase/quorum/issues/266

patrickmn avatar Jan 25 '18 21:01 patrickmn

➤ 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.

Krish1979 avatar May 21 '19 17:05 Krish1979