-
Notifications
You must be signed in to change notification settings - Fork 0
[FreshEyes] Segregated witness rebased #77
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
base: bitcoin-fresheyes-staging-master-8149
Are you sure you want to change the base?
[FreshEyes] Segregated witness rebased #77
Conversation
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
Includes a fix by Suhas Daftuar and LongShao007
Service bit logic by Nicolas Dorier. Only download blocks from witness peers after fork.
This is a preparation for BIP143 support.
Includes simplifications by Eric Lombrozo.
Includes RPC field name changes by Luke-jr.
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set Rename internal method + make it static trim bitcoinconsensus_ prefix Add SERIALIZE_TRANSACTION_WITNESS flag
Includes logic for dealing with pruning by Suhas Daftuar.
Includes support for pushkeyhash wit v0 by Alex Morcos.
Including BIP143 P2WSH examples by jl2012.
Contains fix by Johnson Lau.
Amended by Pieter Wuille to use multisig 1-of-1 for P2WSH tests, and BIP9 based switchover logic. Fixes and py3 conversion by Marco Falke.
mininode now supports witness transactions/blocks, blocktools has a helper for adding witness commitments to blocks, and script has a function to calculate hashes for signature under sigversion 1, used by segwit. Py3 conversion by Marco Falke Test to make sure upgraded nodes don't ask for non-wit blocks by Gregory Sanders.
Add tests that witness signatures cover value
|
There were 15 comments left by 11 reviewers and the author for this pull request |
| { | ||
| ScriptError error; | ||
| CTransaction inputi(input); | ||
| bool ret = VerifyScript(inputi.vin[0].scriptSig, output.vout[0].scriptPubKey, inputi.wit.vtxinwit.size() > 0 ? &inputi.wit.vtxinwit[0].scriptWitness : NULL, flags, TransactionSignatureChecker(&inputi, 0, output.vout[0].nValue), &error); |
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.
An author commented here with:
- comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r66020110at 2016/06/07, 07:14:49 UTC.
| } | ||
|
|
||
| void MaybeSetPeerAsAnnouncingHeaderAndIDs(const CNodeState* nodestate, CNode* pfrom) { | ||
| if (nLocalServices & NODE_WITNESS) { |
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.
2 authors commented here with:
- comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76172305at 2016/08/25, 02:35:48 UTC - comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76187086at 2016/08/25, 06:32:22 UTC.
|
|
||
| uint32_t GetFetchFlags(CNode* pfrom, CBlockIndex* pprev, const Consensus::Params& chainparams) { | ||
| uint32_t nFetchFlags = 0; | ||
| if (IsWitnessEnabled(pprev, chainparams) && State(pfrom->GetId())->fHaveWitness) { |
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.
2 authors commented here with:
- comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76216046at 2016/08/25, 10:10:41 UTC - comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76216704at 2016/08/25, 10:13:27 UTC.
| if((pfrom->nServices & NODE_WITNESS)) | ||
| { | ||
| LOCK(cs_main); | ||
| State(pfrom->GetId())->fHaveWitness = true; |
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.
An author commented here with:
- comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76397641at 2016/08/26, 10:24:02 UTC.
| nodestate->nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) { | ||
| if (nodestate->fProvidesHeaderAndIDs) | ||
| nodestate->nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER && | ||
| (!IsWitnessEnabled(chainActive.Tip(), chainparams.GetConsensus()) || State(pfrom->GetId())->fHaveWitness)) { |
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.
3 authors commented here with:
- comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76398254at 2016/08/26, 10:30:13 UTC - comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76398705at 2016/08/26, 10:34:35 UTC - comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r76400290at 2016/08/26, 10:51:44 UTC.
| nLocalServices = ServiceFlags(nLocalServices | NODE_WITNESS); | ||
| // Only care about others providing witness capabilities if there is a softfork | ||
| // defined. | ||
| nRelevantServices = ServiceFlags(nRelevantServices | NODE_WITNESS); |
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.
An author commented here with:
- comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r79103769at 2016/09/16, 04:05:51 UTC.
| if (chain.Contains(pindex)) | ||
| return pindex; | ||
| if (pindex->GetAncestor(chain.Height()) == chain.Tip()) { | ||
| return chain.Tip(); |
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.
An author commented here with:
- comment link
https://github.com/bitcoin/bitcoin/pull/8149#discussion_r86138998at 2016/11/02, 13:23:26 UTC.
The author sipa wrote the following PR called Segregated witness rebased, issue number 8149 in bitcoin/bitcoin cloned by FreshEyes below:
This PR is a rebased and squashed version of
#7910. As this is the form (in pieces or in whole) that we expect it to be merged in, I'm opening a separate pull request for it. I will leave the old one open for discussion and history.The tree here is identical to the resulting tree there:
Where 3cb46c1 is
#7910's tip commit, and 17389dc is this PR's tip commit.Please make comments on
#7910, so the history can be tracked, and everything stays in one place.