hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
280 stars 124 forks source link

Move the location of `PlatformState` to a different place in the Merkle Tree #11773

Closed imalygin closed 1 month ago

imalygin commented 6 months ago

The Merkle tree that we have should be re-arranged as follows:

  1. Current MerkleHederaState becomes a root node
  2. PlatformState becomes a leaf of this new root.
  3. State should be deprecated and moved to testFixtures submodule in 0.54 release

To solve optimize the tree for state proofs, n-ary node structure have to be replace with "virtual binary" tree. However, it's outside of the scope of this task.

Here is a link to full Lucid chart

Depends on #11771

imalygin commented 3 months ago

This task also should include re-arranging all the demo apps. The current root state will go away, and MerkleHederaState will replace it

imalygin commented 3 months ago

This ticket requires #13691 to be completed

imalygin commented 1 month ago

Blocked by https://github.com/hashgraph/hedera-services/issues/13274

Current State class represent a root not just for Hedera App but for multiple other demo applications. This platform state migration has to be specific for Hedera App. We do it to simplify the merkle tree and it's just not relevant for the demo apps. To make it this migration specific, we have to move MerkleHederaState to state-api first. Then this class will be visible in State class (as it resides in swirlds-platform-core module), and it will be possible to write migration code that is specific to MerkleHederaState