helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

Fix rescue block absorb on lagging ledger #1515

Closed Vagabond closed 1 year ago

Vagabond commented 1 year ago

For historical reasons, rescue blocks have a slightly different absorb path than normal blocks. This alternate path does NOT increment the var nonce. However, due to an oversight, absorbing blocks into the lagging ledger did not track the rescue status of the block, which could lead to rescue blocks incorrectly incrementing the var nonce, thus changing the "var cache" lookup key to incorrectly return the wrong vars for verifying/absorbing transactions. This change tries to make the lagging absorb the same as the leading absorb.