fuel-core icon indicating copy to clipboard operation
fuel-core copied to clipboard

Correctly implement merkle storage

Open Voxelot opened this issue 2 years ago • 3 comments

  • [ ] #629
  • [ ] #626
  • [ ] #627
  • [ ] #628
  • [ ] #633
  • [ ] #634
  • [ ] https://github.com/FuelLabs/fuel-merkle/issues/113
  • [ ] https://github.com/FuelLabs/fuel-merkle/issues/114

Voxelot avatar Aug 02 '22 02:08 Voxelot

Based on discussions with @adlerjohn, the current list of merkle trees that span data across blocks would be:

  • Contract Balances (SMT)
  • Contract State (SMT)
  • Block IDs MMR (binary tree)
    • Unlike other chains that just include a hash of the previous block into the current block header, Fuel will use a merkle mountain range of block ids and store the current root on each header. This allows L1 proofs about data in previous block headers without needing to maintain the state of all headers in L1.

The areas we can use ephemeral trees would be the following block header fields:

  • Transactions Root (BMT)
  • Output Messages Root (BMT)

Voxelot avatar Sep 12 '22 20:09 Voxelot

On going research document: https://hackmd.io/@bvrooman/merklized_data_on_disk

bvrooman avatar Sep 13 '22 03:09 bvrooman

The areas we can use ephemeral trees would be the following block header fields:

  • Transactions Root (BMT)
  • Output Messages Root (BMT)

According to the WIP spec, there is a field for Withdrawals Root (root of withdrawal IDs). I do not see Output Messages Root mentioned. Are these the same thing, just different terminology? Or is there a discrepancy?

Edit: As mentioned in the sync today, "Message" is the updated terminology for "Withdrawal". "Message" has replaced "Withdrawal" based on discussion with the bridging team.

bvrooman avatar Sep 19 '22 07:09 bvrooman