Skip to content
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

Follow DCP0012 once activated #2232

Merged
merged 1 commit into from
May 17, 2023
Merged

Follow DCP0012 once activated #2232

merged 1 commit into from
May 17, 2023

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented May 1, 2023

This is currently being done using an extra getblockchaininfo RPC call any time votes may need to be created. While not ideal, and caching of previously observed active and lockedin statuses could be utilized, this is the bare minimum needed to make wallet follow the DCP0012 hard fork if it is approved.

@davecgh
Copy link
Member Author

davecgh commented May 2, 2023

Tested via simnet by applying the following patch to dcrd in order to make the agenda inactive and allow it to be voted in:

diff --git a/chaincfg/simnetparams.go b/chaincfg/simnetparams.go
index ebb261288..1a5c3d3d3 100644
--- a/chaincfg/simnetparams.go
+++ b/chaincfg/simnetparams.go
@@ -473,7 +473,7 @@ func SimNetParams() *Params {
                                                IsNo:        false,
                                        }},
                                },
-                               ForcedChoiceID: "yes",
+                               //ForcedChoiceID: "yes",
                                StartTime:      0,             // Always available for vote
                                ExpireTime:     math.MaxInt64, // Never expires
                        }},

Output of a single vote subsidy at height 1103 (one block before activation) and a vote with the new subsidy in the mempool:

$ ./ctl getblockhash 1103 | ./ctl getblock - true true | jq '.rawstx[1].vin[0].amountin'
73.87865779
$ ./ctl getrawmempool false votes | jq -r '.[0]' | ./ctl getrawtransaction - 1 | jq '.vin[0].amountin'
82.19000679

Output of a single vote subsidy at height 1104 (activation height):

$ ./ctl getblockhash 1104 | ./ctl getblock - true true | jq '.rawstx[1].vin[0].amountin'
82.19000679

This is currently being done using an extra getblockchaininfo RPC call
any time votes may need to be created.  While not ideal, and caching of
previously observed active and lockedin statuses could be utilized, this
is the bare minimum needed to make wallet follow the DCP0012 hard fork
if it is approved.
@davecgh davecgh marked this pull request as ready for review May 17, 2023 01:22
@davecgh davecgh changed the title WIP: Follow DCP0012 once activated Follow DCP0012 once activated May 17, 2023
@jrick jrick merged commit 8374bd5 into decred:master May 17, 2023
@davecgh davecgh deleted the dcp0012 branch May 17, 2023 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants