navcoin / navcoin-core

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

cold staking with imported keys failing #499

Closed rocket-pig closed 3 years ago

rocket-pig commented 5 years ago

i made two new vanity addresses. (note: ..i successfully cold staked before this with nonimported keys (as to rule out just plain incompetence :D ) imported each to two diff wallets. created a cold staking address via normal process with those two addresses. sent 25k nav to generated cold staking address. All was confirmed and visible on explorer. Staking was true, I was not forked, no discernible issues elsewhere. three days passed with nothing when usually 25k gets 4-6 stakes /day. i tried a number of things afterwards, including letting coins stake once on spending addresss before sending them to cold address. also leaving spending wallet online as well as coldstaking wallet. i grepped the debug.log for 'stake' and found this. I dont know enough to know if it's related. Notice how close together the timestamps are also?

2019-05-22 13:31:46 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:46 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:46 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:47 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:47 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:47 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:47 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:48 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:48 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:48 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:48 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:49 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:49 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:49 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:49 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:50 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:50 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:50 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:50 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:51 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac
2019-05-22 13:31:51 ERROR: CheckBlock() : bad proof-of-stake block signature
2019-05-22 13:31:51 CheckStake() : new proof-of-stake block found hash: 02f29f8717763cc9ba70a4dde714e5c7d2d21af4ffb0958853fba84b4b078eac

4.6.0 self compiled

aguycalled commented 5 years ago

I have not been able to replicate it on devnet.

Node 1:

image

Node 2:

image

image

mxaddict commented 5 years ago

@aguycalled Could the issue be related to the way the key was generated?

The key that @rocket-pig imported I think was from the vanity-plus vanity address generator

aguycalled commented 5 years ago

i doubt it, if the key was correctly imported. but will have a try

mxaddict commented 5 years ago

i doubt it, if the key was correctly imported. but will have a try

Incase you need it: https://github.com/exploitagency/vanitygen-plus/pull/187

aguycalled commented 5 years ago
$ ./vanitygen -C NAV mu
Decrypting NAV Address
Difficulty: 23
NAV Pattern: mu                                                                
NAV Address: mugoXhWCvP9tRDbe2tUxmoH8C5doBeFFgC
NAV Privkey: 92W8BssHiT8SBFjNNo2APtrTJzhRicSUjaFoPuwhywiqzocEECN

Node 1:

image

Node 2:

image

image

Effectively it's related to the vanitygen

mxaddict commented 5 years ago

Hmmm, but why are the addresses being imported successfully? I'm confused, haha

mxaddict commented 5 years ago

And they are usable for spending and receiving as well (Normal transactions)

aguycalled commented 5 years ago

not sure tbh, this requires more investigation

rocket-pig commented 5 years ago

yes I can confirm the addresses can both spend and stake. They just wont cold stake. Dont want to link my main address here, but its a vanity one and has been staking fine all week. I've had one orphan in a week's time, and many successful stakes

rocket-pig commented 5 years ago

...5 months later, the wallet.dat with these vanitygen addresses essentially became unusable. Would crash any navcoind i used it with. I tried three different versions of wallet, 4.6 4.7 and 4.7.1. It couldn't even complete a full sync to begin with. Bootstrapping would work for a while and then something would get corrupted somehow. I eventually jumped ship by doing yet another bootstrap and shipping coins off to new wallet.dat.

mxaddict commented 5 years ago

If possible, since you've already cleared the coins out, could you give us a copy of the bad wallet.dat (make sure it's empty ofcourse)

So we can try and debug it.

On Tue, Nov 5, 2019, 12:40 rocket-pig notifications@github.com wrote:

...5 months later, the wallet.dat with these vanitygen addresses essentially became unusable. Would crash any navcoind i used it with. I tried three different versions of wallet, 4.6 4.7 and 4.7.1. It couldn't even complete a full sync to begin with. Bootstrapping would work for a while and then something would get corrupted somehow. I eventually jumped ship by doing yet another bootstrap and shipping coins off to new wallet.dat.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/navcoin/navcoin-core/issues/499?email_source=notifications&email_token=AAIDAKPOKC4AIUWHLOSYWR3QSD2NJA5CNFSM4HP5TT6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDBSLSY#issuecomment-549660107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIDAKJDOCRQZ3WGXUWWUVLQSD2NJANCNFSM4HP5TT6A .

mxaddict commented 4 years ago

I can confirm that this is still an issue, but I don't have the expertise to fix 😄

mxaddict commented 3 years ago

I can confirm that this is still an issue, but have yet to find out what the cause if for the vanity address not working with cold staking.

I think since it's a very niche issue, we might not want to spend time on fixing this.

I'll close the issue for now, we can reopen in the future if we want to work on this issue.