gridcoin-community / Gridcoin-Research

Gridcoin-Research
MIT License
588 stars 173 forks source link

ProofHash and therefore StakeModifier is mis-calculated #572

Closed tomasbrod closed 6 years ago

tomasbrod commented 7 years ago

Nodes syncing from zero skip PoS kernel check for very old blocks (Grandfather rule) the hashProof field in block index is not set (set to 0) and this affect calculation of the Stake Modifier. For v8 blocks, the kernel is verified always, but Stake Modifier, which is calculated from not only the proofHash, is calculated incorrectly and does not match other nodes. This also affects nodes that synced from Bootstrap.

In v7 blocks (kernel v3), the Stake Modifier was not used so all run smoothly, but failed when kernel v8 became mandatory. This caused many nodes to get stuck on block 1'010'000.

The best fix is to download and apply Snapshot from official Gridcoin site.

tomasbrod commented 7 years ago

AcceptBlock() main.cpp

tomasbrod commented 7 years ago

The snapshot can be downloaded from torrent magnet:?xt=urn:btih:d8107837f8ea5fbb2d24f8cd864b4d9d3ad0b122&tr=udp%3a%2f%2fyuptracker.gaijinent.com%3a27022%2fannounce&ws=http%3a%2f%2fdownload.gridcoin.us%2fdownload%2fdownloadstake%2fsigned%2fsnapshot.zip or from official site

Quezacoatl1 commented 7 years ago

Can we fix this permanently? I think syncing from 0 or boootstrap is important regarding trust.

tomasbrod commented 7 years ago

Yes. I think we can add code to force the modifier to known value on block 1010000 (by hash, not height) so all later modifiers are calculated correct.

tomasbrod commented 6 years ago

User Bouowmx reported that this is still and issue.

debk3141 commented 6 years ago

Downloaded snapshot but still stuck on blocks 1010002

tomasbrod commented 6 years ago

@tomasbrod <- High priority issue!

gridcat commented 6 years ago

This might mean all newcomers are unable to create wallets, isn't it?

nsandersen commented 6 years ago

Yes, or unable to get started. Basically the shallow impression for the last month and a bit has been that it doesn't work. But I understand it is in the lab and under the microscope.

denravonska commented 6 years ago

@tomasbrod Isn't this fixed in the upcoming release?

tomasbrod commented 6 years ago

I think it was fixed in in #686. I never had problems since, so I assume it works now.