-
Notifications
You must be signed in to change notification settings - Fork 22
Cached hashes #63
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
Cached hashes #63
Conversation
10fefe4
to
28153df
Compare
c700b59
to
85b6ae6
Compare
3dcead2
to
4d2809e
Compare
This removes the following executables from the binary gitian release: - test_bitcoin-qt[.exe] - bench_bitcoin[.exe] @jonasschnelli and me discussed this on IRC a few days ago - unlike the normal `bitcoin_tests` which is useful to see if it is safe to run bitcoin on a certain OS/environment combination, there is no good reason to include these. Better to leave them out to reduce the download size. Sizes from the 0.12 release: ``` 2.4M bitcoin-0.12.0/bin/bench_bitcoin.exe 22M bitcoin-0.12.0/bin/test_bitcoin-qt.exe ``` Github-Pull: bitcoin#7776 Rebased-From: f063863
07e0bfd
to
2d7ffaa
Compare
New languages: - `af` Afrikaans - `es_AR` Spanish (Argentina) - `es_CO` Spanish (Colombia) - `ro` Romanian - `ta` Tamil - `uz@Latn` Uzbek in Latin script
2d7ffaa
to
382aeff
Compare
A few issues:
|
@theuni this is not out of bound as https://github.com/sipa/bitcoin/blob/segwit/src/primitives/transaction.h#L298 resize the witscript to the length of inputs. I'll think today about a way to remove the lock out of the consensus path. There may be a way. |
@NicolasDorier There's an out-of-bounds somewhere: https://travis-ci.org/sipa/bitcoin/jobs/120930116#L5390 Maybe it's caused by a new test? |
Wow very strange the tests passed on my machine. I will add a check just to be sure. Is there any compile debug flag which would have make me catch such error ? |
0c78964
to
06bda69
Compare
@theuni I addressed both of your concern. Can you check if it is ok for you now ? For people wanting to benchmark the time difference with and without cache, you can check with the following code in big witnesss test:
|
@NicolasDorier By default, libc does not do bounds checks for vector
accesses.
|
06bda69
to
3c7074f
Compare
I am thinking about adding an overload to VerifyScript of libconsensus to provide a way to the user to specify CachedHashes so libconsensus user can protect themselves against the O(n²) problem. What do you think ? should I do it ? if yes, in this PR ? |
Two-line patch to make it possible to shut down bitcoind cleanly during the initial ActivateBestChain. Fixes bitcoin#6459 (among other complaints). To reproduce: - shutdown bitcoind - copy chainstate - start bitcoind - let the chain sync a bit - shutdown bitcoind - copy back old chainstate - start bitcoind - bitcoind will catch up with all blocks during Init() (the `boost::this_thread::interruption_point` / `ShutdownRequested()` dance is ugly, this should be refactored all over bitcoind at some point when moving from boost::threads to c++11 threads, but it works...) Github-Pull: bitcoin#7821 Rebased-From: 07398e8
Currently, we're keeping a timeout for each requested block, starting from when it is requested, with a correction factor for the number of blocks in the queue. That's unnecessarily complicated and inaccurate. As peers process block requests in order, we can make the timeout for each block start counting only when all previous ones have been received, and have a correction based on the number of peers, rather than the total number of blocks. Conflicts: src/main.cpp src/main.h Self check after the last peer is removed Github-Pull: bitcoin#7804 Rebased-From: 2d1d658 0e24bbf
Now that bitcoin#7804 fixed the timeout handling, reduce the block timeout from 20 minutes to 10 minutes. 20 minutes is overkill. Conflicts: src/main.h Github-Pull: bitcoin#7832 Rebased-From: 62b9a55
a807f42
to
3c7074f
Compare
I gave up changing libconsensus for now I did this: a807f42 which can be useful for later. (after first release of segwit)
|
Before activation, such transactions might not be mined, so don't allow into the mempool. - Tests: move get_bip9_status to util.py - Test relay of version 2 transactions Github-Pull: bitcoin#7835 Rebased-From: e4ba9f6 5cb1d8a da5fdbb
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.
Includes support for pushkeyhash wit v0 by Alex Morcos.
Amended by Pieter Wuille to use multisig 1-of-1 for P2WSH tests, and BIP9 based switchover logic.
...with the four types of segwit payment, as well as all sighash combinaisons.
3c7074f
to
596e1f3
Compare
rebased on segwit4 #70 |
I am using a shared
map<txid,cachedhashes>
protected by a lock.A hash may be calculated several time because there is no lock at the transaction level.