helium / blockchain-core

Apache License 2.0
214 stars 86 forks source link

Fix h3dex check and bootstrap during snapshot load #1438

Closed PaulVMo closed 2 years ago

PaulVMo commented 2 years ago

In at least some cases, the snapshot load process would fail due to the new inclusion of the random hex targeting lookup in the h3dex. The check of whether the snapshot includes the h3dex was incorrectly triggering the h3dex bootstrapping, and then subsequently the bootstrap process failed because it did not handle the new "random-" and "population" keys in the h3dex used for targeting.

This change switches the check of the whether the snapshot loaded the h3dex to use the ledger_v1 vs. snapshot_v1 call as it better handles the updated h3dex. It also updates the h3dex bootstrap functions (specifically delete_h3dex) to handle the random hex targeting keys.

Thanks to @Vagabond for the assist on coming up with the solution.