helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

Only snapshot deterministic h3dex keys, precalc on h3dex load #1485

Closed Vagabond closed 1 year ago

Vagabond commented 1 year ago

This should fix the current snapshot agreement issues.

madninja commented 1 year ago

how the heck did you figure out it was only those two keys!

Vagabond commented 1 year ago

how the heck did you figure out it was only those two keys!

a patched snapshot diff

Vagabond commented 1 year ago

To elaborate, the h3dex cache was calculated at a point in time depending on when a validator upgraded, thus there was some drift. Some hexes, depending on when the validator upgraded, would or would not have a cache associated and the cache key would not be re-calculated until there was "activity" on the hex.

So the change in this PR is to exclude those non-deterministic keys from the snapshot, and force them to be recalculated on snapshot load.

Vagabond commented 1 year ago

Also, I tested this with a drifted light gateway validator and was able to reconcile the drift with the new snapshots (there's still drift when the non-deterministic keys are not excluded).