polytope-labs / hyperbridge

Hyperbridge is a hyperscalable coprocessor for verifiable, cross-chain interoperability
https://docs.hyperbridge.network/
Apache License 2.0
104 stars 33 forks source link

OffchainDB MMR pruning #187

Open seunlanlege opened 4 months ago

seunlanlege commented 4 months ago

With #184 merged, we now store mmr nodes fully offchain. With the peaks stored on-chain. This is great but as the mmr grows, so does the storage requirements for node runners (See #185).

It's clear that long-term we will need to introduce pruning for the mmr stored in the offchaindb. Luckily, MMRs are very amenable to pruning. More so, we will be focusing on pruning ancient subtrees whose leaves (requests) have already timed out. Meaning knowledge of their intermediate nodes are infact useless to relayers. Relayers & Users will only care about more recent subtrees in the MMR. This should keep the storage requirements for hyperbridge low enough that it can remain a radically inclusive & decentralized network.