Protocol blocks can be converted into HotStuff-rs blocks:
Block header’s hash, height, justify, and data_hash fields correspond to the identically named fields in HotStuff-rs blocks.
The rest of block header’s fields (along with the block’s transactions and receipts) are packed into HotStuff-rs blocks’ data.
Problem
However, the order of the fields’ packing into HotStuff-rs data does not match the order of the fields in block header. In particular:
Block header
HotStuff-rs data
chain_id
chain_id
proposer
proposer
timestamp
timestamp
base_fee_per_gas
txs_hash
gas_used
state_hash
txs_hash
receipts_hash
receipts_hash
base_fee_per_gas
state_hash
gas_used
logs_bloom
logs_bloom
0-to* transactions
0-to* transactions
0-to* receipts
0-to* receipts
This mismatched order is also used to compute Data Hash.
Proposed resolution
In v0.5, the order of the packed fields will be made to follow the order of the fields in block header. The order the fields in the pre-image of data hashes will also be made to follow this order.
Background
Protocol blocks can be converted into HotStuff-rs blocks:
hash
,height
,justify
, anddata_hash
fields correspond to the identically named fields in HotStuff-rs blocks.Problem
chain_id
chain_id
proposer
proposer
timestamp
timestamp
base_fee_per_gas
txs_hash
gas_used
state_hash
txs_hash
receipts_hash
receipts_hash
base_fee_per_gas
state_hash
gas_used
logs_bloom
logs_bloom
This mismatched order is also used to compute Data Hash.
Proposed resolution
In v0.5, the order of the packed fields will be made to follow the order of the fields in block header. The order the fields in the pre-image of data hashes will also be made to follow this order.