helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

Don't invalidate h3->region lookups on var nonce change #1385

Closed Vagabond closed 2 years ago

Vagabond commented 2 years ago

Previously all the h3->region lookups would be invalidated when any chain var was changed. This was very expensive when unrelated vars changed.

This patch changes things so that the lookup is keyed by the hash of the h3 region binaries, so as long as those do not change the cache should not be invalidated. It also adds caching for the h3 region binary hashes and for the h3 binaries themselves.