-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CHECKCOLDSTAKEVERIFY_LOF for coldstakingoutput #38
Conversation
This is interesting! 👀 I will run some delegations with your PR however and see if this hits anything (should stake within 2-3 days maximum); I suggest we make some small modifications so that the switchover post-v6 is automatic rather than manual (MPW is aware of block heights). So we pass the height and a chainparams UPGRADE_V6_0 to Thanks for the time with investigating, a bounty of course shall be attached to this PR for your research/debugging efforts. 💜 |
4dc9014
to
6d08526
Compare
With automatic switchover to CHECKCOLDSTAKEVERIFY on Consensus::UPGRADE_V6_0
6d08526
to
4d5fbf6
Compare
I've been trying to test this for a solid week on my PIVX v5.5.0rc cold pool, and unfortunately no luck: which is incredibly weird, since staking the same amount with Allnodes resulted in stakes every 2-4-ish days very consistently for many months. I've switched the Labz pool back to PIVX v5.4.0, and will continue testing. 🙏 |
The PIVX version isn't the issue. The issue is the Let me elaborate on that a little bit more In PIVX-Project/PIVX#2275 On 2021-09-19 in 14701c8
And the value for coldstaking outputs was changed from
to the name
As you can see, the coldstaking output now uses the value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to merge this, since the explorer doesn't recognize our current way of delegating. With Peter's changes everything works as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK, I just solved merge conflicts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK: Awesome, we really needed this to fix cold staking, thanks Peter!
utACK |
🪙 405 PIV bounty fulfilled and sent |
Issue being fixed: discord
Any clue why a cold staking node would get this? The input is unspent (and delegated to my Cold Staking node), it's attempted to stake many times and it always fails with this message.
analysis
vout[1] has
OP_CHECKCOLDSTAKEVERIFY
.OP_CHECKCOLDSTAKEVERIFY
will be the standard when V6 is enforced, for nowOP_CHECKCOLDSTAKEVERIFY_LOF
is. WhenOP_CHECKCOLDSTAKEVERIFY
is used all outputs must have the same pubKeyScript. Pre V6 the masternode payment is in the last output, it doesn't have the same pubKeyScript so the check fails.What was done?
The OP_CODE used for coldstakingoutput was changed from
OP_CHECKCOLDSTAKEVERIFY
toOP_CHECKCOLDSTAKEVERIFY_LOF
How Has This Been Tested?
At GitHub:PIVX-Project/PIVX:/src/script/interpreter.cpp#L1388 was checked if CheckColdStake failed.
It did for coldstakeoutputs with
OP_CHECKCOLDSTAKEVERIFY
, it didn't for coldstakeoutputs withOP_CHECKCOLDSTAKEVERIFY_LOF
.Breaking Changes
TODO: Change back to CHECKCOLDSTAKEVERIFY on Consensus::UPGRADE_V6_0
Checklist: