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

Show softfork status in getblockchaininfo #6353

Merged
merged 1 commit into from Jul 1, 2015

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Jun 29, 2015

  "softforks": [            (array) status of softforks in progress
     {
        "id": "xxxx",        (string) name of softfork
        "version": xx,         (numeric) block version
        "enforce": {           (object) progress toward enforcing the softfork rules
           "status": xx,       (boolean) true if threshold reached
           "found": xx,        (numeric) number of blocks with the new version found
           "required": xx,     (numeric) number of blocks required to trigger
           "window": xx,       (numeric) size of examined window of recent blocks
        },
        "reject": { ... }      (object) progress toward rejecting pre-softfork blocks (same fields as for "enforce")
     }, ...
  ]

@btcdrak
Copy link
Contributor

btcdrak commented Jun 29, 2015

Tested ACK

@petertodd
Copy link
Contributor

Tested ACK.

One minor nit is the way the "found" bit caps out at found==required. I think removing the "&& nFound < nRequired" clause in the for loop should be safe; the nFound > nRequired part at the end should never be triggered. But just documenting it would be safer.

@laanwj
Copy link
Member Author

laanwj commented Jun 29, 2015

One minor nit is the way the "found" bit caps out at found==required. I think removing the "&& nFound < nRequired" clause in the for loop should be safe; the nFound > nRequired part at the end should never be triggered. But just documenting it would be safer.

I've thought about cloning the IsSuperMajority in rpcblockhain.cpp, with that change, leaving the original one as-is. It is only a few lines. Then it also doesn't need to be exported from main anymore.

@btcdrak
Copy link
Contributor

btcdrak commented Jun 29, 2015

@laanwj Sounds like a good solution.

@petertodd
Copy link
Contributor

@laanwj ACK that.

@jtimon
Copy link
Contributor

jtimon commented Jun 29, 2015

ut ACK

@CodeShark
Copy link
Contributor

tACK

@@ -469,6 +469,36 @@ UniValue verifychain(const UniValue& params, bool fHelp)
return CVerifyDB().VerifyDB(pcoinsTip, nCheckLevel, nCheckDepth);
}

/* Implementation of IsSuperMajority with better feedback */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: /**

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@fanquake
Copy link
Member

fanquake commented Jul 1, 2015

utACK

@laanwj laanwj merged commit 5ed1079 into bitcoin:master Jul 1, 2015
laanwj added a commit that referenced this pull request Jul 1, 2015
5ed1079 Show softfork status in getblockchaininfo (Wladimir J. van der Laan)
@@ -501,6 +544,14 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(Params().Checkpoints(), chainActive.Tip())));
obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex()));
obj.push_back(Pair("pruned", fPruneMode));

const Consensus::Params& consensusParams = Params().GetConsensus();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have the soft fork states between pruned and prunehight which looks a bit sandwiched.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants