forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Add sidechain table & versionbits #9
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add SCDB to track sidechain WT^ work score * Add coinbase cache to track N recent coinbases. Used both to synchronize SCDB and BMM linking data * Add OP_BRIBE and OP_BRIBE activation * Add wallet function to create sidechain desposits which have unique requirements * Miner broadcasts WT^ in block if workscore is made sufficient * CheckWorkScore code * Initialize everything during AppInit * Added sidechain address prefix to be used * Added testing list of valid sidechains test, hivemind, mimble wimble
* receivesidechainwtjoin * listsidechaindeposits * getbmmproof * createbribe * refundbribe
* Add sidechain deposit button to sendcoinsdialog * Add sidechain deposit dialog
Add Drivechains & BMM to bitcoin core
* Add GetBWTHash() function to CTransaction so that we don't have to manually blind the transaction when checking work score. * Update comments to make them more clear and add TODO messages about what still needs to be finished in AcceptToMemoryPoolWorker(). * Update comments & code in connect block where WT^ workscore is verified
* Update rpc client param conversion * Update createbribe rpc function (WIP) * Update IsBribe() * Add BMM ratchet unit tests * Enforce BMM ratchet block number rules
* Refactor SCDB for travis * Refactor SCDB, move WT^ creation to miner * Refactor, remove usage of LogPrintf & EncodeHexTx * Remove util.h dependency from SidechainDB * test * Update BMM ratchet and refactor for travis * Fix initialization bug The code to watch sidechain deposit addresses shouldn't have been compling when wallet support is disabled. * Only create WT^ if ENABLE_WALLET defined * Fix build errors with wallet disabled * Fix watch sidechain scripts bug & SCDB bug
* Update comment in listsidechaindeposits rpc * Remove outdated comments
* BIP 141 style coinbase commitment generators in validation: GenerateSCDBCoinbaseCommitment() GeneratBMMCriticalHashCommitment() * When a block is mined, if SCDB is tracking WT^ or BMM data, the miner will CreateSCDBHashMerkleRootCommit. * Add CScript functions: IsBribeHashCommit() IsSCDBHashMerkleRootCommit() IsWTPrimeHashCommit()
* Update comments * Add std::string GetSidechainName(uint8_t nSidechain) * Add bool Sidechain::operator==(const Sidechain& a) * Add bool SidechainWTJoinState::operator==(const SidechainWTJoinState& a) * Add uint256 SidechainWTJoinState::GetHash(void) * Add bool SCDBIndex::Contains(uint256 hashWT) * Add bool SCDBIndex::GetMember(uint256 hashWT, SidechainWTJoinState& wt) * Update ToString() functions
Update sidechain primitives
Update coinbase commitments and drivechain scripts
* Add additional optional data type to extended transactions (CCriticalData) * Add critical data transaction validation rules * Add critical data transaction unit tests
* Remove old WT^ tracking code * Add SCDB hashMerkleRoot based updates & WT^ update network messages (tested via RPC). When a new block is added to the tip, we look for a SCDB hashMerkleRoot commit and verify the WT^ update messages we have recieved over the network to try and update our local WT^ workscores. * Add receivesidechainwtprimeupdate RPC function to test WT^ update network messages * Remove old unit tests, replaced with updated tests. * Refactoring: - wtxid -> hashWTPrime - wtJoin -> wtPrime * Cleanup: - Fix order of functions - Rename some functions for clarity * WT^ creation performance improvement & rename for clarity: (CTransaction BlockAssembler::CreateWTPrimePayout(uint8_t nSidechain))
Add new optional data to extended transactions
SCDB hashMerkleRoot commits & network updates
…tcoin#47) * Update & cleanup RPC functions * Refactor SidechainNumberValid -> IsSidechainNumberValid * Remove old OP_BRIBE code * Update BMM ratchet * Update h* commit script flag * Update ratchet structure * Add GetBlocksAtop() * Add some ratchet tests (WIP) * Update CCoins, add CriticalData & SpendsBMMRequest() function * Enforce maturity rules for critical data & bmm request txns * Move some sidechain consts from sidechain.h to consensus.h
* changing valid sidechain array to a c++ std::array * remove trailing commas * fixed improper spacing
* Miner adds BMM hashMerkleRoot commitment to coinbase * Add IsBMMHashMerkleRootCommit functions to CScript * Add GetHash() function to SidechainLD * Add GenerateBMMHashMerkleRootCommit() * Update tests
Split up BMM & SCDB hashMerkleRoot commitments
Refactor coinbase commitments & update unit tests
Rebase pull request
Add new keypairs for each sidechain to ValidSidechains
updating nworkscore to 1 instead of 0
Tying sidechain keys to valid sidechain array
* Add files for sidechain withdrawal & escrow DB tables * Add versionbits activation for Drivechains (BIPX & BIPY) * Refactoring: Update IsBMMRequest() function, make it more useful and clean up other parts of the codebase with it. * Add base of sidechain tables (functional but ugly) * Add some of the code to start enforcing versionbits activation of drivechains (TODO: ensure full coverage)
CryptAxe
pushed a commit
that referenced
this pull request
Jan 15, 2018
07947ff Merge #9: [tests] Fix BOOST_CHECK_THROW macro ec849d9 [tests] Fix BOOST_CHECK_THROW macro 31bc9f5 Merge #8: Remove unused Homebrew workaround fa04209 Remove HomeBrew workaround a523e08 Merge #7: Declare single-argument (non-converting) constructors "explicit" a9e53b3 Merge #4: Pull upstream 16a1f7f Merge #3: Pull upstream daf1285 Merge pull request #2 from jgarzik/master f32df99 Merge branch '2016_04_unicode' into bitcoin 280b191 Merge remote-tracking branch 'jgarzik/master' into bitcoin 2740c4f Merge branch '2015_11_escape_plan' into bitcoin git-subtree-dir: src/univalue git-subtree-split: 07947ff
CryptAxe
pushed a commit
that referenced
this pull request
Feb 13, 2020
6f53edb Acquire cs_main before ATMP call in block_assemble bench (James O'Beirne) Pull request description: Calling `bench_bitcoin` currently fails due to calling ATMP without acquiring cs_main first in the recently added block_assemble bench (bitcoin#13219). ``` $ cat <(uname -a) <(gcc --version) Linux james 4.4.0-119-generic bitcoin#143+jamesob SMP Mon Apr 16 21:47:24 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 $ ./src/bench/bench_bitcoin WARNING: This is a debug build - may result in slower benchmarks. # Benchmark, evals, iterations, total, min, max, median Assertion failed: lock cs_main not held in validation.cpp:566; locks held: [1] 19323 abort (core dumped) ./src/bench/bench_bitcoin ``` ``` (gdb) bt #0 0x00007fbdc9cf5428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #1 0x00007fbdc9cf702a in __GI_abort () at abort.c:89 #2 0x0000555a19580dc5 in AssertLockHeldInternal (pszName=pszName@entry=0x555a19834549 "cs_main", pszFile=pszFile@entry=0x555a1988a001 "validation.cpp", nLine=nLine@entry=566, cs=cs@entry=0x555a19ba55c0 <cs_main>) at sync.cpp:157 #3 0x0000555a194b395f in AcceptToMemoryPoolWorker (chainparams=..., pool=..., state=..., ptx=std::shared_ptr (count 1, weak 0) 0x555a1bb819b0, pfMissingInputs=pfMissingInputs@entry=0x0, nAcceptTime=1532964079, plTxnReplaced=0x0, bypass_limits=false, nAbsurdFee=@0x7ffcbc1719d8: 0, coins_to_uncache=std::vector of length 0, capacity 0, test_accept=false) at validation.cpp:566 #4 0x0000555a194ba661 in AcceptToMemoryPoolWithTime (chainparams=..., pool=..., state=..., tx=std::shared_ptr (count 1, weak 0) 0x555a1bb819b0, pfMissingInputs=pfMissingInputs@entry=0x0, nAcceptTime=<optimized out>, plTxnReplaced=0x0, bypass_limits=false, nAbsurdFee=0, test_accept=false) at validation.cpp:998 #5 0x0000555a194ba7ce in AcceptToMemoryPool (pool=..., state=..., tx=std::shared_ptr (count 1, weak 0) 0x555a1bb819b0, pfMissingInputs=pfMissingInputs@entry=0x0, plTxnReplaced=plTxnReplaced@entry=0x0, bypass_limits=bypass_limits@entry=false, nAbsurdFee=0, test_accept=false) at validation.cpp:1014 #6 0x0000555a19363fbe in AssembleBlock (state=...) at bench/block_assemble.cpp:102 #7 0x0000555a193654d3 in std::_Function_handler<void (benchmark::State&), void (*)(benchmark::State&)>::_M_invoke(std::_Any_data const&, benchmark::State&) (__functor=..., __args#0=...) at /usr/include/c++/5/functional:1871 #8 0x0000555a193501d7 in std::function<void (benchmark::State&)>::operator()(benchmark::State&) const (this=this@entry=0x555a1ba2cda0, __args#0=...) at /usr/include/c++/5/functional:2267 #9 0x0000555a1934ec4c in benchmark::BenchRunner::RunAll (printer=..., num_evals=5, scaling=<optimized out>, filter=..., is_list_only=false) at bench/bench.cpp:121 #10 0x0000555a1934ade9 in main (argc=<optimized out>, argv=<optimized out>) at bench/bench_bitcoin.cpp:92 ``` Tree-SHA512: fdd7b28ff123ccea7a4f334d53f735d0c0f94aa9cc52520c2dd34dca45d78c691af64efcd32366fc472fedffbd79591d2be2bb3bfc4a5186e8712b6b452d64e3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.