ava-labs / hypersdk

Opinionated Framework for Building Hyper-Scalable Blockchains on Avalanche
https://hypersdk.xyz/
Other
193 stars 100 forks source link

Partition HyperSDK and Application managed state #1218

Open joshua-kim opened 1 month ago

joshua-kim commented 1 month ago

HyperVMs are currently able to define their own state keys during execution on-the-fly. This means that HyperSDK can't sanity-check state keys in advance at the time of initialization, so it's possible for the HyperVM to touch state managed by the HyperSDK (fees, consensus state, etc). Some solutions would be to create separate merkledb instances for the SDK vs the VM, or to create a single partitioned merkledb instance that each component has a dedicated prefix for.

aaronbuchwald commented 1 month ago

ref https://github.com/ava-labs/hypersdk/blob/354c5f2cb71ab4bf10f93099ec43bd557dab87a4/chain/dependencies.go#L183