FuelLabs / fuel-specs

📝 Specifications for the Fuel protocol and the FuelVM, a blazingly fast blockchain VM.
https://fuellabs.github.io/fuel-specs/master
Apache License 2.0
1.78k stars 709 forks source link

Block header spec #284

Closed adlerjohn closed 2 years ago

adlerjohn commented 2 years ago

Fields:

  1. MMR of previous block header hashes (binary Merkle tree is an MMR)
  2. Coinbase address
  3. Fuel block height
  4. Ethereum block number (!) (current, not finalized)
  5. timestamp (!) (current)
  6. Transactions root (binary Merkle tree, not MST)
  7. number of txs
  8. next validator set root
  9. next voting power
  10. Hash of Tendermint commit for previous block (>2/3 of voting power) (canonical commit, client needs to broadcast this with proposal)
  11. root of withdrawal IDs

Separate from block header:

  1. Tendermint Commit for current block (verified by the contract)

Note: consider wrapping core, consensus, and Ethereum specific fields

adlerjohn commented 2 years ago

Q brought up by @Voxelot: can we avoid posting intermediate block headers to the base layer, and instead only post the latest block with a Commit/signature? Need to watch for messages and how to prove messages/past headers.

Voxelot commented 2 years ago

@adlerjohn Do transaction receipts need a separate root as well?

bvrooman commented 2 years ago

I see that this spec doesn't list contract balance/state roots or a storage root. But I understand we will be Merklizing contract balances and state across blocks (https://github.com/FuelLabs/fuel-core/issues/527). Are these roots going to be part of the header?

adlerjohn commented 2 years ago

Do transaction receipts need a separate root as well?

No, since they're committed to in a field in each tx.