BinGossiper sends out PROPOSE messages with PreviousHash: []

BinGossiper sends out PROPOSE messages with PreviousHash: []

by Stratos Triantafyllou -
Number of replies: 2

When advertising a PROPOSE message for the first block, are we setting PreviousHash to [] or make([]byte, 32)? I understood from the handout that the latter is true (an empty []byte array is reserved for the empty blocks), but, as far as I can see, the reference gossiper sends out PROPOSE messages with a completely empty array.

I noticed this behavior in TestBinGossiper_No_Contention_Block_TLC_Consensus, where my nodes send TLC messages with PreviousMetahash: [] (as they simply get the value from the other Paxos messages), while the reference nodes seem to introduce the array with zeroes particularly for TLCs. The test asks for an array of zeroes in the TLC.

Should I send PROPOSE messages with PreviousMetahash set to an empty array and then, if the TLC refers to block 0, replace that with an array of zeroes?


In reply to Stratos Triantafyllou

Re: BinGossiper sends out PROPOSE messages with PreviousHash: []

by Olivér Facklam -

Hey there,

I just discovered that I have the exact same issue. I don't think it is normal for the reference implementation to send out Paxos messages with an empty PreviousHash, since the handout stated that the value make([]byte, 32) should be used... However, I might have misinterpreted this, and maybe we should, like you said, replace the empty hash with 32 zeroes only for the TLC?

Best,

Olivér

In reply to Olivér Facklam

Re: BinGossiper sends out PROPOSE messages with PreviousHash: []

by Cristina Basescu -

Hi,

Thanks for the post. This question has already been answered in an older post (Dec 2nd).

The relevant part of that post is: "The short answer is that a node proposing a block to Paxos does not fill in the hash value at the time when it proposes. So the hash field is practically an empty slice. The node will fill in the hash value only when that block reaches consensus, and the hash value will be the hash of the previous block, if such a block exists, or a byte slice with 32 zeros.".

I hope this helps.

Cristina