parallelchain-io / parallelchain-protocol

Specification for the ParallelChain (and ParallelChain Mainnet) blockchain protocols.
https://parallelchain.io
1 stars 1 forks source link

The order of fields in block headers is different than their order in HotStuff-rs block data #16

Closed lyulka closed 10 months ago

lyulka commented 11 months ago

Background

Protocol blocks can be converted into HotStuff-rs blocks:

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.

lyulka commented 10 months ago

Merged into and will be fixed in #8.