-
Notifications
You must be signed in to change notification settings - Fork 36.5k
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
Segregated witness #7910
Segregated witness #7910
Conversation
Inspired by Jorge Timon's "Testchain: Don't check the genesis block", but restricted to just PoW check. Code by Matt Corallo, originally submitted as a patch to segwit.
Since github shows the commits sorted by author date rather than dependency order, here is a list of all commits:
Code to generate this list:
|
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier.
Service bit logic by Nicolas Dorier.
Includes a fix by Suhas Daftuar
Includes simplifications by Eric Lombrozo.
Includes RPC field name changes by Luke-jr.
Includes changes by Suhas Daftuar and Luke-jr.
…en verify_script receives VERIFY_WITNESS flag 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
Witness blocks can be greater than 2MiB, but cannot be validly greater than 4MB.
8e3310c
to
e847337
Compare
New merge on top of #7600. |
|
||
{ | ||
LOCK(cs_main); | ||
if (!IsWitnessEnabled(chainActive.Tip(), Params().GetConsensus()) && !GetBoolArg("-walletprematurewitness", false)) { |
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.
Do we want to do a similar thing for createwitnessaddress?
// * witness (when witness enabled in flags and excludes coinbase) | ||
nSigOpsCost += GetTransactionSigOpCost(tx, view, flags); | ||
if (nSigOpsCost > MAX_BLOCK_SIGOPS_COST) | ||
return state.DoS(100, error("ConnectBlock(): too many sigops"), |
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.
Upgraded nodes don't ask for blocks from non-upgraded?
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.
Oh, right. Nevermind..
New merge after #8068 and #8179. See the details in #8149 (comment). |
I udpated the sig cache PR (sipa#101) |
Merged as #8149. |
ZIP 239 preparations 3 Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#8080 - bitcoin/bitcoin#8082 - bitcoin/bitcoin#8126 - bitcoin/bitcoin#7910 - This is the unsquashed version of bitcoin/bitcoin#8149 - We take three cleanup commits to the protocol / `CInv` code. - bitcoin/bitcoin#8822 - bitcoin/bitcoin#8880 - Excluding the first commit (we don't have the comment it fixes yet). - bitcoin/bitcoin#19322
This is the complete code for segregated witness on top of master (implementing BIP141, BIP143, BIP144, BIP145). Apart from commentary and merging (see further), the code is never rewritten/squashed/rebased, in order not to invalidate review. A rebased/squashed version is available here: #8149.
See also the detailed and up-to-date list of commits here: #7910 (comment)
There are certainly some items left to do:
Many thanks to all contributors so far (including @jl2012, @NicolasDorier, @CodeShark, @sdaftuar, @morcos, @luke-jr, @afk11, @theuni, @TheBlueMatt, @MarcoFalke, @LongShao007, @jonasnick, @mruddy), the ideas it is based on (by @gmaxwell and @luke-jr), and many reviewers (including @SergioDemianLerner, @instagibbs, @dcousens, and @btcdrak).