Commit Graph

8694 Commits

Author SHA1 Message Date
Wladimir J. van der Laan 2c82485524
Merge pull request #6945
0af5b8e Squashed 'src/leveldb/' changes from 7d41e6f..20ca81f (Pieter Wuille)
2015-11-05 10:52:19 +01:00
Pieter Wuille 70de437eb4 Update LevelDB 2015-11-04 23:48:07 +01:00
Pieter Wuille 0af5b8ed38 Squashed 'src/leveldb/' changes from 7d41e6f..20ca81f
20ca81f Merge pull request #9
7aa105e leveldb: Win32WritableFile without memory mapping

git-subtree-dir: src/leveldb
git-subtree-split: 20ca81f08fb7fa108923a091668e447dcf5c6b9d
2015-11-04 23:48:07 +01:00
Mark Friedenbach f720c5fc9f
Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints
Transactions are not allowed in the memory pool or selected for inclusion in a block until their lock times exceed chainActive.Tip()->GetMedianTimePast(). However blocks including transactions which are only mature under the old rules are still accepted; this is *not* the soft-fork required to actually rely on the new constraint in production.
2015-10-23 21:33:51 +01:00
Mark Friedenbach a1d3c6fb9d
Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations
The lock-time code currently uses CBlock::nTime as the cutoff point for time based locked transactions. This has the unfortunate outcome of creating a perverse incentive for miners to lie about the time of a block in order to collect more fees by including transactions that by wall clock determination have not yet matured. By using CBlockIndex::GetMedianTimePast from the prior block instead, the self-interested miner no longer gains from generating blocks with fraudulent timestamps. Users can compensate for this change by simply adding an hour (3600 seconds) to their time-based lock times.

If enforced, this would be a soft-fork change. This commit only adds the functionality on an unexecuted code path, without changing the behaviour of Bitcoin Core.
2015-10-23 21:33:31 +01:00
Alex Morcos dfe55bdc32
Do not allow blockfile pruning during reindex.
Also clarify startup message.

Github-Pull: #6856
Rebased-From: d3b09f6bac738958b6bf5711bcb5291049b7466d
2015-10-23 14:42:05 +02:00
Wladimir J. van der Laan fc7f0ee28c
Merge pull request #6707
6af25b0 Add BIP65 to getblockchaininfo softforks list (Peter Todd)
ba1da90 Show softfork status in getblockchaininfo (Wladimir J. van der Laan)
70a427b CLTV: Add more tests to improve coverage (Esteban Ordano)
c5a27f4 Add RPC tests for the CHECKLOCKTIMEVERIFY (BIP65) soft-fork (Peter Todd)
5e82e1c Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic (Peter Todd)
6ea5ca4 Enable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd)
4fa7a04 Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd)
6ec08db Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd)
684636b Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
2015-10-23 13:35:06 +02:00
Gregory Maxwell 95a50390e1
Set TCP_NODELAY on P2P sockets.
Nagle appears to be a significant contributor to latency now that the static
 sleeps are gone.  Most of our messages are relatively large compared to
 IP + TCP so I do not expect this to create enormous overhead.

This may also reduce traffic burstyness somewhat.

Conflicts:
	src/net.cpp

Rebased-From: a4e28b3d1e5c95eb0c87f144851cd65048c3e0bc
Github-Pull: #6867
2015-10-23 10:02:53 +02:00
Daniel Cousens af6edac0bd *: alias -h for --help 2015-10-23 03:24:59 +00:00
Matt Corallo 131d7f997c Change URLs to https in debian/control 2015-10-23 03:24:27 +00:00
Matt Corallo 7ce2c91503 Update debian/changelog and slight tweak to debian/control 2015-10-23 03:24:21 +00:00
Mitchell Cash 4fbfebea5b Correct spelling mistakes in doc folder
- OSX —> OS X
- XCode —> Xcode
- github —> GitHub
- homebrew —> Homebrew
- gitian —> Gitian
- Other miscellaneous obvious spelling fixes and whitespace removal
2015-10-23 03:22:52 +00:00
Alex Morcos 072032448b
Make fee aware of min relay in pruning.py RPC test
Rebased-From: b6d5e32e0e5b038c6ff7e2ab5221b10727722341
Github-Pull: #6841
2015-10-20 13:35:24 +02:00
Wladimir J. van der Laan 21e58b8e35
build: make sure OpenSSL heeds noexecstack
This passes `-Wa,--noexecstack` to the assembler when building
platform-specific assembly files, to signal that a non-executable stack
can be used. This is the same approach as used by Debian
(see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=430583)

Rebased-From: bfcdc21a5da25ec1aa4aecc4cd8960dfa1c11781
Github-Pull: #6852
2015-10-19 15:04:14 +02:00
Micha 09a00a1f7f
Add historical release notes for October 2015 bugfix releases
[skip ci]

Rebased-From: d57586f91c6cfe7480ae87b81a041009776a33af
Github-Pull: #6832
2015-10-15 12:49:01 +02:00
Eric Lombrozo e42bf16ae0 Clarification of unit test build instructions. 2015-10-14 08:21:55 +00:00
Matt Corallo 54f9dee50c Update bluematt-key, the old one is long-since revoked 2015-10-14 08:21:42 +00:00
Chris Kleeschulte bfc6154429 [Trivial] Fixed typo when referring to a previous section in
depends/README.md [skip ci]
2015-10-14 08:20:38 +00:00
Wladimir J. van der Laan 9e45157815 build: disable -Wself-assign
Prevent these warnings in clang 3.6:

    ./serialize.h:96:9: warning: explicitly assigning value of variable of type 'uint64_t' (aka 'unsigned long') to itself [-Wself-assign]
        obj = (obj);
        ~~~ ^  ~~~
2015-10-14 08:20:38 +00:00
Luke Dashjr 33d6825c6f Bugfix: Allow mining on top of old tip blocks for testnet (fixes testnet-in-a-box use case) 2015-10-14 08:20:38 +00:00
Wladimir J. van der Laan 87a797a016 build: Remove dependency of bitcoin-cli on secp256k1
bitcoin-cli (in contrast to bitcoin-tx, which does signing ops)
shouldn't need secp256k1, and indeed it doesn't.
2015-10-14 08:20:38 +00:00
MarcoFalke a33cd5ba86 [trivial] Fix rpc message "help generate" 2015-10-14 08:20:37 +00:00
Zak Wilcox 6fd0019232 Drop "with minimal dependencies" from description
Five boost libs plus libcrypto are needed; I don't think that quite passes for minimal.
2015-10-14 08:20:37 +00:00
Zak Wilcox 2394f4d674 Split bitcoin-tx into its own package
Reverts the change putting it in the bitcoind deb.
2015-10-14 08:20:37 +00:00
Zak Wilcox 1e672ae343 Include bitcoin-tx binary on Debian/Ubuntu
Currently left out of Matt's PPA.  Debian's package for unstable already has it.
2015-10-14 08:20:37 +00:00
MarcoFalke b3eaa301ff [Qt] Raise debug window when requested
* Raise the debug window when hidden behind other windows
* Switch to the debug window when on another virtual desktop
* Show the debug window when minimized

This change is a conceptual copy of 5ffaaba and 382e9e2
2015-10-14 08:20:36 +00:00
Alex Morcos 01878c9c3f Fix locking in GetTransaction.
GetTransaction needs to lock cs_main until ReadBlockFromDisk completes, the data inside CBlockIndex's can change since pruning.  This lock was held by all calls to GetTransaction except rest_tx.
2015-10-14 08:20:36 +00:00
Diego Viola 9b9acc27d2 Fix spelling of Qt 2015-10-14 08:20:36 +00:00
Wladimir J. van der Laan cf33f196e7
doc: Add Luke Dashjr to credits in release notes
Somehow missed...
2015-10-12 20:58:31 +02:00
Wladimir J. van der Laan dad3e98e8f
doc: update release notes for 0.11.1rc2 2015-10-11 10:46:43 +02:00
Wladimir J. van der Laan e7bcc4aac3
Bump minrelaytxfee default
To bridge the time until a dynamic method for determining this fee is
merged.

This is especially aimed at the stable releases (0.10, 0.11) because
full mempool limiting, as will be in 0.12, is too invasive and risky to
backport.

Github-Pull: #6793
Rebased-From: 28e3249e53b8ef7516636df0f1406466a513095d 4e2efb3c5fde4b1e332cc032e3dc4082ec4e3cac
2015-10-11 10:37:52 +02:00
Wladimir J. van der Laan 4dbcec03ab
net: Disable upnp by default
Common sentiment is that the miniupnpc codebase likely contains further
vulnerabilities.

I'd prefer to get rid of the dependency completely, but a compromise for
now is to at least disable it by default.

Github-Pull: #6795
Rebased-From: 21d27ebad5721bc61c62bc72dc3ab3197f9da268
2015-10-10 11:41:54 +02:00
Wladimir J. van der Laan 717152ccba
Bump version to 0.11.1 2015-10-09 18:18:16 +02:00
Wladimir J. van der Laan 17ea542aa6
doc: #6077 was reverted, don't mention in release notes
Reported by sipa
2015-10-09 15:40:34 +02:00
Wladimir J. van der Laan d7d87a1db1
qt: Update translations before 0.11.1 2015-10-09 15:31:04 +02:00
Wladimir J. van der Laan 04d0c27fb0
doc: Update release notes for 0.11.1 2015-10-09 15:19:24 +02:00
Wladimir J. van der Laan b4dc33e9fb
Merge pull request #6785
36f14bf In (strCommand == "tx"), return if AlreadyHave() (Tom Harding)
2015-10-09 14:58:01 +02:00
Wladimir J. van der Laan b4ad73f706
Update miniupnpc to 1.9.20151008
This version of miniupnpc fixes a buffer overflow in the XML (ugh)
parser during initial network discovery.

http://talosintel.com/reports/TALOS-2015-0035/

The commit fixing the vulnerability is:
79cca974a4

Reported by timothy on IRC.

Github-Pull: 6789
Rebased-From: 0cca0248f030ea32bd8de778b5a2782e0d191978
2015-10-09 14:56:22 +02:00
Tom Harding 36f14bf2e7 In (strCommand == "tx"), return if AlreadyHave()
The main effect is to exit processing for recently-rejected hashes,
in case they are pushed to us without prior advertisement.  This
behavior was seen in the wild.

An additional effect is to do early checks for mempool or mapOrphan
existence.  No logging or nDoS tracking is needed for failures of
these checks.
2015-10-08 20:29:02 -07:00
Peter Todd 6af25b0f64
Add BIP65 to getblockchaininfo softforks list
Rebased-From: 54a200ac9ad8909303ccf1ac49c291e0c2b5fb23
2015-10-08 17:50:02 +02:00
Wladimir J. van der Laan ba1da90b33 Show softfork status in getblockchaininfo
Rebased-From: 5ed10793c2df970d07cecd760c42205e68779e83
2015-10-08 17:49:00 +02:00
Esteban Ordano 70a427b2b5 CLTV: Add more tests to improve coverage
Four cases included:

* The CLTV operand type mismatches the tx locktime. In the script it is
  1 (interpreted as block height), but in the tx is 500000000
  (interpreted as date)
* The stack is empty when executing OP_CLTV
* The tx is final by having only one input with MAX_INT sequence number
* The operand for CLTV is negative (after OP_0 OP_1 OP_SUB)

Rebased-From: cb54d17355864fa08826d6511a0d7692b21ef2c9
2015-10-08 17:49:00 +02:00
Peter Todd c5a27f4fb3 Add RPC tests for the CHECKLOCKTIMEVERIFY (BIP65) soft-fork
bip65-cltv.py is based on the earlier BIP66 soft-fork RPC test
implemented by Pieter Wuille's 819bcf9b99

bip65-cltv-p2p.py is based on the earlier BIP66 P2P test by Suhas
Daftuar's d76412b068

Rebased-From: 308257856099e82e91881ba97f741d840184727c
2015-10-08 17:49:00 +02:00
Peter Todd 5e82e1c8f5 Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic
Based on the earlier BIP66 soft-fork logic implemented by Pieter
Wuille's 5a47811da5

Rebased-From: 287f54fc90c29301faede8d4ac2ea24a91441917
2015-10-08 17:48:51 +02:00
Peter Todd 6ea5ca4b4e Enable CHECKLOCKTIMEVERIFY as a standard script verify flag
Transactions that fail CLTV verification will be rejected from the
mempool, making it easy to test the feature. However blocks containing
"invalid" CLTV-using transactions will still be accepted; this is *not*
the soft-fork required to actually enable CLTV for production use.

Rebased-From: ffd75adce01a78b3461b3ff05bcc2b530a9ce994
2015-10-08 17:48:10 +02:00
Peter Todd 4fa7a048d1 Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)
<nLockTime> CHECKLOCKTIMEVERIFY -> <nLockTime>

Fails if tx.nLockTime < nLockTime, allowing the funds in a txout to be
locked until some block height or block time in the future is reached.

Only the logic and unittests are implemented; this commit does not have
any actual soft-fork logic in it.

Thanks to Pieter Wuille for rebase.

Credit goes to Gregory Maxwell for the suggestion of comparing the
argument against the transaction nLockTime rather than the current
time/blockheight directly.

Rebased-From: bc60b2b4b401f0adff5b8b9678903ff8feb5867b
2015-10-08 17:46:55 +02:00
Peter Todd 6ec08db338 Move LOCKTIME_THRESHOLD to src/script/script.h
Will now be needed by CHECKLOCKTIMEVERIFY code.

Rebased-From: 48e9c57cf06352f890eac4285ae022d8746cf3fd
2015-10-08 17:46:55 +02:00
Peter Todd 684636ba67 Make CScriptNum() take nMaxNumSize as an argument
While the existing numeric opcodes are all limited to 4-byte bignum
arguments, new opcodes will need different limits.

Rebased-From: 99088d60d8a7747c6d1a7fd5d8cd388be1b3e138
2015-10-08 17:46:55 +02:00
Gregory Maxwell 71cc9d9fe8
Test LowS in standardness, removes nuisance malleability vector.
This adds SCRIPT_VERIFY_LOW_S to STANDARD_SCRIPT_VERIFY_FLAGS which
 will make the node require the canonical 'low-s' encoding for
 ECDSA signatures when relaying or mining.

Consensus behavior is unchanged.

The rational is explained in a81cd96805ce6b65cca3a40ebbd3b2eb428abb7b:
 Absent this kind of test ECDSA is not a strong signature as given
 a valid signature {r, s} both that value and {r, -s mod n} are valid.
 These two encodings have different hashes allowing third parties a
 vector to change users txids.  These attacks are avoided by picking
 a particular form as canonical and rejecting the other form(s); in
 the of the LOW_S rule, the smaller of the two possible S values is
 used.

If widely deployed this change would eliminate the last remaining
 known vector for nuisance malleability on boring SIGHASH_ALL
 p2pkh transactions.  On the down-side it will block most
 transactions made by sufficiently out of date software.

Unlike the other avenues to change txids on boring transactions this
 one was randomly violated by all deployed bitcoin software prior to
 its discovery.  So, while other malleability vectors where made
 non-standard as soon as they were discovered, this one has remained
 permitted.  Even BIP62 did not propose applying this rule to
 old version transactions, but conforming implementations have become
 much more common since BIP62 was initially written.

Bitcoin Core has produced compatible signatures since a28fb70e in
 September 2013, but this didn't make it into a release until 0.9
 in March 2014; Bitcoinj has done so for a similar span of time.
 Bitcoinjs and electrum have been more recently updated.

This does not replace the need for BIP62 or similar, as miners can
 still cooperate to break transactions.  Nor does it replace the
 need for wallet software to handle malleability sanely[1]. This
 only eliminates the cheap and irritating DOS attack.

[1] On the Malleability of Bitcoin Transactions
Marcin Andrychowicz, Stefan Dziembowski, Daniel Malinowski, Łukasz Mazurek
http://fc15.ifca.ai/preproceedings/bitcoin/paper_9.pdf

Rebased-From: b196b685c9089b74fd4ff3d9a28ea847ab36179b
Github-Pull: #6769
2015-10-07 11:21:03 +02:00
Wladimir J. van der Laan 5ed8d0b37e
Merge pull request #6750
5094a81 Move recentRejects initialization to top of InitBlockIndex (Wladimir J. van der Laan)
ec9b6c3 Keep track of recently rejected transactions (Peter Todd)
6eed52e Only use randomly created nonces in CRollingBloomFilter. (Pieter Wuille)
83671ef Make CRollingBloomFilter set nTweak for you (Peter Todd)
25cf122 Reuse vector hashing code for uint256 (Pieter Wuille)
2983fe0 Add uint256 support to CRollingBloomFilter (Peter Todd)
2015-10-06 16:18:48 +02:00