Commit graph

20626 commits

Author SHA1 Message Date
Steven Roose
b9ee263ef6
Merge #966: Update the copyright year to 2021
77349c16a5 Update the copyright year to 2021 (Philippe McLean)

Pull request description:

Tree-SHA512: edb5bab1bc9a06aea52eb71bc889a51da75ef213a1ae7c6e0cd1fe56a51cc5213b7a730a223db76f1d9ad3de9ec9c5a4c755b8312510b876469966736e708ddb
2021-03-15 17:28:41 +00:00
Steven Roose
0c82c2743b
Merge #970: Specify the dynafed epoch length for liquidv1
70390ee638 Specify the dynafed epoch length for liquidv1 (Steven Roose)

Pull request description:

Tree-SHA512: edea8187c41a7ecfd8e3dea58dc28ede6fa34082b2ff74bdadcd67ac53b5f4fb165dbd5d1776e8d3c811b3bd49cabf1abb037236def1f7372e794d459ed44de4
2021-03-15 17:27:25 +00:00
Steven Roose
70390ee638
Specify the dynafed epoch length for liquidv1 2021-03-11 17:34:37 +00:00
Philippe McLean
77349c16a5 Update the copyright year to 2021 2021-03-04 07:57:00 -08:00
Steven Roose
8c834f7da1
Merge #959: Make it clear that the CRangeCheck is not called on explicit values
a8a1a933d Make it clear that the CRangeCheck is not called on explicit values (Steven Roose)

Pull request description:

  That is enforced by the `VerifyAmounts` method for regular transactions
  and by the `VerifyIssuanceAmounts` method for issuance values.

Tree-SHA512: 69064ca21dbe3a574f38ba8ea9a13cc2d4b6d0ac2b306fad59ff6fa92e63e08c8f4607da82c31731dcf91044eb47c8d79ced2ff49c7c0843343f438eb8bac943
2021-03-02 16:26:55 +00:00
Steven Roose
3b8e4070c8
Merge #958: Some minor dynafed improvements
14a42a018 Add two missing dynafed fields to getblockchaininfo (Steven Roose)
fe0372933 dynafed: Support changing mainnet dynafed activation (Steven Roose)
ce7a93d93 dynafed: Only verify proposed parameters if they differ from current (Steven Roose)

Pull request description:

  - support blocksigners specifying their own activation to make coordination a bit more flexible
  - don't force fedpeg script to change in order to change the block signing script

Tree-SHA512: 8dd66440261f910b083f7ed461e1930c9380350e3648f6aca44726c39dcca3bb7e62c36d36ae56c2717827fbaee2b9046c6ce0b05441c1d8d1b54f3c284bc4d7
2021-03-02 16:25:46 +00:00
Steven Roose
a993a7c675
Merge #960: Add SIGHASH_RANGEPROOF support
b888f4227 tests: Add test feature_sighash_rangeproof.py (Steven Roose)
691040a63 Add SIGHASH_RANGEPROOF support (Steven Roose)
236f0b176 tests: Replace CECKey with new ECKey impl from Bitcoin master (Steven Roose)

Pull request description:

  Add a new sighash flag that includes the rangeproof information in the signature. This avoids certain kinds of malleability in PSBT scenarios.

Tree-SHA512: 60b52ca88a64d81a38f5c70bae810e477f69e6402553b24fa22e59b9a8491c077168576187e7da88e525591933907ea77e937242af6d248908bfedbb8532bb33
2021-03-02 15:37:50 +00:00
Steven Roose
14a42a0187
Add two missing dynafed fields to getblockchaininfo 2021-02-24 15:23:09 +00:00
Steven Roose
b888f42270
tests: Add test feature_sighash_rangeproof.py 2021-02-22 15:19:10 +00:00
Steven Roose
691040a63d
Add SIGHASH_RANGEPROOF support 2021-02-22 15:19:09 +00:00
Steven Roose
236f0b1762
tests: Replace CECKey with new ECKey impl from Bitcoin master
Somehow the CECKey impl is really broken if you want to set
a raw private key. Core master already has a new impl so I just
took that one and replaces the usages. This will probably be equivalent
with what would be rebased in at a later stage.
2021-02-22 13:45:37 +00:00
Steven Roose
a8a1a933dc
Make it clear that the CRangeCheck is not called on explicit values
That is enforced by the `VerifyAmounts` method for regular transactions
and by the `VerifyIssuanceAmounts` method for issuance values.
2021-02-18 11:12:59 +00:00
Steven Roose
fe03729338
dynafed: Support changing mainnet dynafed activation
This should obviously only be done by blocksigners. The flag used is not
documented.
2021-02-10 14:07:06 +01:00
Steven Roose
ce7a93d933
dynafed: Only verify proposed parameters if they differ from current
This allows the initial relaxed restriction on non-segwit fedpeg
programs to be extended as long as the fedpeg program is not changed
while the block signing parameters can be changed.
2021-02-10 14:07:05 +01:00
Steven Roose
88067ddbe4
Merge #912: Specify BIP9 deployment for DynaFed
afcb71f87 Speficy dynafed deployment for Liquidv1 (Steven Roose)
7208d5b6f Add comment to BIP9 time fields (Steven Roose)
fa3a74b75 Move dynafed bit into the ELEMENTS fields (Steven Roose)

Pull request description:

  Bit: 25 (identical to current elementsregtest dynafed bit)
  Start: block 1,000,000 (recent past)
  Timeout: never

Tree-SHA512: 4fb79e7623ffefdc644d1de75d18b368f1cee755a3a9db66d99021f047064e30f10fbcc450a3318f22f2dddd5101a7fe16edd3d888428a1ad68594f718b28750
2020-10-06 17:54:58 +02:00
Steven Roose
e6207229b8
Merge #911: When decoding or signing a PSBT, check blinded values.
8a73f5d24 When decoding or signing a PSBT, check blinded values. (Glenn Willen)

Pull request description:

  When we decode or sign a PSBT given to us via RPC, first check that, if it contains blinded output values, they verifiably match the unblinded output values contained in the original transaction proposal. Otherwise fail.

Tree-SHA512: b674fd261676efaad3197aeee07fcb5ba4cd52469ff875d9abbc086b9bfa8dd1770e84d68cabe3131e1ab30346d4d945758e54c42dda5ceb5f1bcd19628ff440
2020-10-06 12:04:21 +02:00
Glenn Willen
8a73f5d242 When decoding or signing a PSBT, check blinded values.
When we decode or sign a PSBT given to us via RPC, first check that, if
it contains blinded output values, they verifiably match the unblinded
output values contained in the original transaction proposal. Otherwise fail.
2020-10-05 02:21:25 -07:00
Steven Roose
afcb71f87d
Speficy dynafed deployment for Liquidv1
Bit: 25
Start: block 1,000,000 (recent past)
Timeout: never
2020-09-30 18:57:47 +02:00
Steven Roose
7208d5b6fb
Add comment to BIP9 time fields
The semantics of these fields were changed in
6fc3fe04ef.
2020-09-30 18:56:52 +02:00
Steven Roose
fa3a74b75f
Move dynafed bit into the ELEMENTS fields 2020-09-30 18:54:34 +02:00
Steven Roose
ec9b28e089
Merge #910: Fix mainchain RPC warmup message
6b9c31ef8 Fix mainchain RPC warmup message (Steven Roose)

Pull request description:

Tree-SHA512: 357c74b3396e40c39065f7ce4830fd2756731e19d303a0075157d2b1ecef80bacdbfe2693977f16392215481794081b15fec772f946b95cfbec45313309f78c6
2020-09-28 15:00:12 +02:00
Steven Roose
bca68fe713
Merge #906: Add signrawtransactionwithkey test with amount commitments
fbdb9f371 Add signrawtransaction test for input of amountcommitment. (k-matsuzawa)

Pull request description:

  - This test assumes a fix for #904. Before correction, the test will result in an error.
  - I splited the node network in rpc_signrawtransaction.py to do this test.
  - For now, I have only created one test case. Are there any other test cases that should be added?

Tree-SHA512: 842eba8a673e4e7d416de54f8ef40c63aad83b4a33f21401c4fde8c7b66008ac3fc6d87334f1bac22ffa8c0186e0b531f246f1a3a7afa45faaa0ea2336f6f865
2020-09-22 21:41:44 +02:00
Steven Roose
6b9c31ef85
Fix mainchain RPC warmup message 2020-09-21 17:57:15 +02:00
k-matsuzawa
fbdb9f3715 Add signrawtransaction test for input of amountcommitment. 2020-09-05 12:44:04 +09:00
Steven Roose
58bf5653ed
Merge #904: Fix parsing of amount commitments from prevtxs in signrawtrasnactionwithkey
a4045d21e Fix parsing of amount commitments from prevtxs in signrawtransactionwithkey (Glenn Willen)

Pull request description:

Tree-SHA512: 4bc38ac4bcf09c3dc0dd5a5bdcb75a031a6a86a8848390e63c1c466f1788155f6f6456b1aa3b36078c35d62d6093667c70a6895eb1ab59d6704300ebac8bbe56
2020-09-04 17:17:16 +01:00
Glenn Willen
a4045d21e3 Fix parsing of amount commitments from prevtxs in signrawtransactionwithkey 2020-09-03 11:49:31 -07:00
Steven Roose
32b624b0c9
Merge #905: Update shellcheck URL
799ea1533 Update shellcheck URL per https://github.com/koalaman/shellcheck/issues/1871 (Glenn Willen)

Pull request description:

  Update shellcheck URL per  per https://github.com/koalaman/shellcheck/issues/1871 to unbreak CI.

Tree-SHA512: ced455990d11a4bfc6f2587398cef729a73ad212b76c8d6b856922ddbb81beb15a39f09adde9d4ed0bcb30d9bf8cec3e1bd94db356327e665ef1d533e88ff0c4
2020-09-03 14:16:02 +01:00
Glenn Willen
799ea15332 Update shellcheck URL per https://github.com/koalaman/shellcheck/issues/1871 2020-09-02 13:52:02 -07:00
Steven Roose
4e023af58b
Merge #899: Use gitian infrastructure to install librsvg2-2 (in lieu of hard-coded wget)
d8af6598f Use gitian infrastructure to install librsvg2-2 (in lieu of hard-coded wget) (Jeff Frontz)

Pull request description:

  This removes the hardcoded `wget` of libsrvg2-2 package from the internal gitian `script` and instead uses the `packages` capability (the `wget`-based implementation causes unintended dependencies on internet infrastructure; it is also brittle).

Tree-SHA512: 35fb6914e316f40a98e7ca20269a64bbb372423099df0d8faf91217c016d7ea2bcfa3854498141ae1f2c02ccac41b36a7e4f4fd02227e6e41a2eb5710796c37d
2020-08-18 20:58:31 +02:00
Jeff Frontz
d8af6598fe Use gitian infrastructure to install librsvg2-2 (in lieu of hard-coded wget) 2020-08-10 14:37:06 -04:00
Steven Roose
db9f1b9edc
Merge #896: Fix logic issues with randomization of outputs in [re]issueasset_base; minor refactoring.
3386cae45 Make error messages distinct at each failure location. (Glenn Willen)
a4c279e29 Fix logic issues with randomization of outputs in [re]issueasset_base; minor refactoring. (Glenn Willen)

Pull request description:

  Fixes #885. This is a more comprehensive alternative to #887.

  One note: The existing code claimed to assume (and mostly did assume) that fee outputs always go at the end. Other code does not necessarily appear to assume that. I have added explicit checks for it, so it should be obvious enough if it causes problems in practice (and with a small fix, the integration tests do pass.) If we're concerned about whether the assumption is valid, I'm willing to relax the assumption (but then the old code makes even less sense.)

  @stevenroose for review? (@jhfrontz also, since #887 was yours so maybe you have opinions.)

Tree-SHA512: 512407922a574f5fcf4a7508f32b0eb9270f93acc2de561ca313bde5d737065e4af743089fcb41943e8f49700c737c84a1658ec1063847c1a086065a01a2ddfb
2020-07-27 15:56:23 +02:00
Glenn Willen
3386cae45b Make error messages distinct at each failure location. 2020-07-24 09:09:01 -07:00
Glenn Willen
a4c279e29a Fix logic issues with randomization of outputs in [re]issueasset_base; minor refactoring. 2020-07-15 01:39:15 -07:00
Steven Roose
78d4ea802a
Merge #888: build: Fix search for brew-installed BDB 4 on OS X (backport of upstream fix)
011cea3e8 build: Fix search for brew-installed BDB 4 on OS X (Glenn Willen)

Pull request description:

  Backport of my upstream fix https://github.com/bitcoin/bitcoin/pull/19356 .

  Net effect is to change the include order slightly for macOS homebrew users with BDB 4.8 installed privately (not linked into system directories) -- our configure scripts will prefer BDB 4.8 if they find it there, even if it is not system default. This fixes a build break that would occur in this situation when some _other_ BDB _is_ installed in system directories. The previous search order would use headers from system directories, but libs from 4.8, causing a crash.

  ----
  On OS X, when searching Homebrew keg-only packages for BDB 4.8, if we find it,
  use BDB_CPPFLAGS and BDB_LIBS instead of CFLAGS and LIBS for the result. This
  is (1) more correct, and (2) necessary in order to give this location
  priority over other directories in the include search path, which may include
  system include directories with other versions of BDB.

Tree-SHA512: ee5425400f8ee9c69268ce9d938c60cc7935e4686f718d6d7ec64aea77383934fd0d8f1553b04eec0aa3ed9ace69cfbd5ba7ee39563b4d9520c913aa3cc259df
2020-07-06 13:20:26 +02:00
Glenn Willen
011cea3e83 build: Fix search for brew-installed BDB 4 on OS X
On OS X, when searching Homebrew keg-only packages for BDB 4.8, if we find it,
use BDB_CPPFLAGS and BDB_LIBS instead of CFLAGS and LIBS for the result. This
is (1) more correct, and (2) necessary in order to give this location
priority over other directories in the include search path, which may include
system include directories with other versions of BDB.
2020-06-29 12:41:52 -07:00
Steven Roose
f28c949f72
Merge #815: Update build docs for FreeBSD 12.1-RELEASE
a9f51d724 Update build docs for FreeBSD 12.1-RELEASE (wiz)

Pull request description:

  Fixes #814 by setting basic build configuration:

  * Use gmake instead of make
  * Use clang instead of gcc
  * Add /usr/local to include path

Tree-SHA512: e65ac047c3281eda67d0514d038523d85168f8da3dd0fa3d194eafe6ccea6d9fbb01e8cbd96a4428612de10df71b118ed4be29122cde80c266cad12a76b6d595
2020-06-15 12:53:10 +01:00
Steven Roose
be2540a4b9
Merge #870: Update copyright year to 2020
9bb467273 Update copyright year to 2020 (Philippe McLean)

Pull request description:

Tree-SHA512: ea13f2c7d90f4c1d320d883bcb43b9c971b4d981ea42bd19fbbccd0ede53a5a3af84f6224d7261bb61987a3694a0ed461cf17dd79a29abc68a3bf6995bddba36
2020-04-22 10:39:11 +01:00
Philippe McLean
9bb4672731 Update copyright year to 2020 2020-04-20 14:36:04 -07:00
Steven Roose
f0d97cdf70
Merge #861: Make issuance fail for invalid addresses
425691623 Add test to make sure issuances to wrong addresses fail (Steven Roose)
1b8bf85d8 Make issuance fail for invalid addresses (Steven Roose)

Pull request description:

  Fixes https://github.com/ElementsProject/elements/issues/853.

Tree-SHA512: fd4e8dbede4c08a52c081abd57d2609ee7057b952b6de60ddc296574400f7488dd5ec33ac4874211cd029b8902a64741e52f1ed40b4a1e565274bacfd67e5075
2020-04-16 22:53:23 +01:00
Steven Roose
18fadbafcc
Merge #863: Fix HasValidFee potential overflow
98e42a0db Fix HasValidFee potential overflow (Steven Roose)

Pull request description:

  Dmitry pointed out this potential overflow. They can't really happen
  because of the `CheckTransaction` check on explicit amounts that
  happens earlier in the verification chain. But it's a good idea to
  add the check here as well so that a potential relaxing of other rules
  cannot accidentally introduce an overflow risk.

Tree-SHA512: 0c6abb7719d4cf84596da5cb31e700bee53d26d6ffc6da0ba8f1300b3357ca3d29fb46e2754d182e64cb5794fd58fa1efed5ebf9c1bd58d08e2fb7841725ca66
2020-04-16 17:51:43 +01:00
Steven Roose
a19c972098
Merge #865: Init: add elementsd.service file
536939e5e init: update the elementsd.service file with some additions found in last Bitcoin Core version, ie PermissionsStartONly=true, ExecStartPre=/bin/chgrp elements /etc/elements, TimeoutStopSec=600 and ProtectHome=true (Sosthene00)
c884cadc7 init: renamed bitcoind.service to elementsd.service (Sosthene00)

Pull request description:

  (This is a cleaned up version of #849 )
  I set up a Bitcoin Core and an Elements node on a Ubuntu machine for testing, and noticed that there was no elementsd.service file available in Elements repo as I expected, but a bitcoind.service file that seems to be an outdated version of the file in the Bitcoin Core repository.

  Since I needed to create a systemd service, I modified the most recent version of bitcoind.service file for elementsd as it seems fit to me.

  Besides replacing all occurrences of bitcoin and bitcoind, I also moved the debug.log file to another dir and the path to the bin is also different (/usr/local/bin/elementsd). This might be too specific to my project though.

  I suggest to add it to the Elements repository along the existing files, as maybe some people might find it useful.

  I'm pretty rookie with systemd too, I tried to stick to the example and recommandation in the Bitcoin Core repository, but I'd be glad if someone had suggestions to improve this.

Tree-SHA512: 8b07203b5e7c44d46fe5a9e6ba399ee44b89e037d000b51a0ecd473c4e924f5f8305369a8c7718d9d058a6d1a299d52fa1a397a264cd4c4e5733e286567caad2
2020-04-16 17:12:01 +01:00
Steven Roose
af23572fe7
Merge #860: Icon fixes
45fb11978 Changing Elements Icon to just the graphic without text, fixing issue with gitian builds on icon, removing color change based on testnet for Elements, and compatible svg with build script. (Allen Piscitello)

Pull request description:

  The icon used previously had text in it, that made it unreadable on most screens.  This has been replaced with just the graphic part of the icon.

  In addition, Gitian builds had an issue where the icon was not formatted correctly. Changes were made to the icon to be more similar of an svg format than the previous one that worked.

  Lastly, the changing of the icon color based on testnet was removed since Elements has many networks and it would not make sense to change for each.

Tree-SHA512: 6dfd93362d37cc6bf6bcd005781ee35750bd1348d322e6b9605ef4f286496254971e493befd54aaa45b93143013afad04bf60999ea61e213dc27d8b8f2ede120
2020-04-16 12:31:38 +01:00
Sosthene00
536939e5ed init: update the elementsd.service file with some additions found in last Bitcoin Core version, ie PermissionsStartONly=true, ExecStartPre=/bin/chgrp elements /etc/elements, TimeoutStopSec=600 and ProtectHome=true 2020-04-14 22:11:10 +02:00
Sosthene00
c884cadc71 init: renamed bitcoind.service to elementsd.service 2020-04-14 22:11:10 +02:00
Steven Roose
98e42a0db1
Fix HasValidFee potential overflow
Dmitry pointed out this potential overflow. They can't really happen
because of the `CheckTransaction` check on explicit amounts that
happens earlier in the verification chain. But it's a good idea to
add the check here as well so that a potential relaxing of other rules
cannot accidentally introduce an overflow risk.
2020-04-14 20:58:16 +01:00
Steven Roose
425691623b
Add test to make sure issuances to wrong addresses fail 2020-04-13 15:20:29 +01:00
Steven Roose
1b8bf85d8b
Make issuance fail for invalid addresses
Without his change, invalid addresses are converted into fee outputs.
2020-04-13 15:20:27 +01:00
Allen Piscitello
45fb119783 Changing Elements Icon to just the graphic without text, fixing issue with gitian builds on icon, removing color change based on testnet for Elements, and compatible svg with build script. 2020-04-10 12:50:22 -05:00
Steven Roose
1427dfd6e7
Merge #855: Remove another mention of Liquid-Qt
607cfc3df Remove another mention of Liquid-Qt (Steven Roose)

Pull request description:

  This should be the last mention of `#if LIQUID` and `Liquid-Qt` that my grep can find.

Tree-SHA512: 75c3675c075787de076fbb3f191b779e9db4afee872aaef229f03eb419ec1fdc0393b41728cf8e3baf5730271f2e76b0fab9000c37a4932bbc439cd7725849ec
2020-04-08 07:15:46 +01:00
Steven Roose
6d259b1446
Merge #854: Change the logo file from Liquid to Elements
9f10f78d2 Change the logo file from Liquid to Elements (Steven Roose)

Pull request description:

Tree-SHA512: f3e50dc0272fbe1bed902fb3c653ff109d146d78efb3ead1c032acdbea73b9435356ce04604b0d98a00b72293d4720a064828b556a552ced45ad3a07272309aa
2020-04-08 07:14:54 +01:00