navcoin / navcoin-core

bitcoin-core 0.13 fork ported for NavCoin
MIT License
123 stars 92 forks source link

Fix possible node crash if the stake was stale #900

Closed aguycalled closed 2 years ago

aguycalled commented 2 years ago

This pull request fixes a bug which can cause a node to crash when the stake is stale. This can be easily tested running various instances of a node staking with the same wallet.

mxaddict commented 2 years ago

Away from my main PC right now, will wait for gitian build to test

aguycalled commented 2 years ago

https://build.nav.community/binaries/aguycalled%3Afix-node-crash-stale-stake/

navbuilder commented 2 years ago

A new build of 29e68570608e739c19c6662afda5770170018211 has completed succesfully! Binaries available at https://build.nav.community/binaries/fix-node-crash-stale-stake

mxaddict commented 2 years ago

Testing as follows: Created a devnet wallet.dat Imported into 5 nodes, Have the 5 nodes staking at the same time.

mxaddict commented 2 years ago

@aguycalled would this testing method be a good way to determine if it's working?

aguycalled commented 2 years ago

yep

mxaddict commented 2 years ago

Ack

On Thu, Dec 9, 2021, 19:49 alex v. @.***> wrote:

yep

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/navcoin/navcoin-core/pull/900#issuecomment-989780463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIDAKJL4I2P2KPWVHMLNGTUQCJVHANCNFSM5JRQJBZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mxaddict commented 2 years ago

Tested this scenario and seemed to be fine, for some reason some of the nodes would get orphaned blocks even when the other nodes minted the same inputs into the same block (I guess a slight difference in timestamp for the block caused this)

But I think it's fine, the nodes did not crash while I was running them.

chasingkirkjufell commented 2 years ago

oops, completely missed this one. didn't see a ready for review tag so i thought it's still work in progress.