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

Projects
None yet
7 participants
@laanwj
Member

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")
     }, ...
  ]

@laanwj laanwj added the RPC/REST/ZMQ label Jun 29, 2015

@btcdrak

This comment has been minimized.

Show comment
Hide comment
@btcdrak

btcdrak Jun 29, 2015

Member

Tested ACK

Member

btcdrak commented Jun 29, 2015

Tested ACK

@petertodd

This comment has been minimized.

Show comment
Hide comment
@petertodd

petertodd Jun 29, 2015

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.

Contributor

petertodd commented Jun 29, 2015

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

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jun 29, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@btcdrak

btcdrak Jun 29, 2015

Member

@laanwj Sounds like a good solution.

Member

btcdrak commented Jun 29, 2015

@laanwj Sounds like a good solution.

@petertodd

This comment has been minimized.

Show comment
Hide comment
@petertodd

petertodd Jun 29, 2015

Contributor

@laanwj ACK that.

Contributor

petertodd commented Jun 29, 2015

@laanwj ACK that.

@jtimon

This comment has been minimized.

Show comment
Hide comment
@jtimon

jtimon Jun 29, 2015

Member

ut ACK

Member

jtimon commented Jun 29, 2015

ut ACK

@CodeShark

This comment has been minimized.

Show comment
Hide comment
@CodeShark

CodeShark Jul 1, 2015

Contributor

tACK

Contributor

CodeShark commented Jul 1, 2015

tACK

@fanquake

View changes

Show outdated Hide outdated src/rpcblockchain.cpp
@@ -469,6 +469,36 @@ UniValue verifychain(const UniValue& params, bool fHelp)
return CVerifyDB().VerifyDB(pcoinsTip, nCheckLevel, nCheckDepth);
}
/* Implementation of IsSuperMajority with better feedback */

This comment has been minimized.

@fanquake

fanquake Jul 1, 2015

Member

nit: /**

@fanquake

fanquake Jul 1, 2015

Member

nit: /**

This comment has been minimized.

@laanwj

laanwj Jul 1, 2015

Member

Fixed

@laanwj

laanwj Jul 1, 2015

Member

Fixed

@fanquake

This comment has been minimized.

Show comment
Hide comment
@fanquake

fanquake Jul 1, 2015

Member

utACK

Member

fanquake commented Jul 1, 2015

utACK

@laanwj laanwj merged commit 5ed1079 into bitcoin:master Jul 1, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

laanwj added a commit that referenced this pull request Jul 1, 2015

Merge pull request #6353
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();

This comment has been minimized.

@jonasschnelli

jonasschnelli Jul 20, 2015

Member

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

@jonasschnelli

jonasschnelli Jul 20, 2015

Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment