helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

Fix subnetwork reward txn hash #1465

Closed vihu closed 1 year ago

vihu commented 1 year ago

Problem

Subnetwork reward txn hashes are not consistent because the signature field was still present when proto encoding the txn.

Solution

Unset the signature before calculating the txn hash.

Caveats

I think this is largely okay and would not cause any chain related problems since we don't technically use the txn hash for any chain consistency. However, APIs may have a tough time querying the few subnetwork reward txns which are already on chain. AFAICT there's no workaround for that other than to manually fix the external database(s) where the inconsistent hashes were stored.