This PR refactors the merkle mountain range overlay tree to a separate pallet that stores nodes in the offchain db in a fork-aware manner (indexing_prefix + pos + parent_hash => node). This avoids corrupting the tree whenever forks happen and the chain re-orgs. This didn't used to be an issue until async-backing was introduced.
This new pallet is paired with an offchain task that "canonicalizes" (indexing_prefix + pos => node) the mmr nodes in the offchaindb by removing the parent hash part of the key when finality notifications are observed. This subsystem has been integration tested with simnode.
This PR refactors the merkle mountain range overlay tree to a separate pallet that stores nodes in the offchain db in a fork-aware manner (indexing_prefix + pos + parent_hash => node). This avoids corrupting the tree whenever forks happen and the chain re-orgs. This didn't used to be an issue until async-backing was introduced.
This new pallet is paired with an offchain task that "canonicalizes" (indexing_prefix + pos => node) the mmr nodes in the offchaindb by removing the parent hash part of the key when finality notifications are observed. This subsystem has been integration tested with simnode.