helium / blockchain-core

Apache License 2.0
213 stars 86 forks source link

exclude infos, like blocks, from the internal hash #1234

Closed evanmcc closed 2 years ago

evanmcc commented 2 years ago

they contain maps, so the ordering is going to be different, and they are not properly part of the ledger.

Vagabond commented 2 years ago

You need a clause in hash() line 810 to handle it as well.

Vagabond commented 2 years ago

I tested this by doing the following:

One thing I'm not sure about: can older nodes load a snap that is hashed differently? How did this node load a blessed snap that was hashed under the old rules? Does downloading from s3 bypass hash checking?

jadeallenx commented 2 years ago

downloading from s3 bypass hash checking?

It uses whatever internal hash is encoded in latest-snap.json - that hash comes from the snapshot info cmd line output