Commit graph

20599 commits

Author SHA1 Message Date
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
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
Steven Roose
607cfc3df7
Remove another mention of Liquid-Qt 2020-04-07 23:31:55 +01:00
Steven Roose
9f10f78d28
Change the logo file from Liquid to Elements 2020-04-07 20:37:10 +01:00
Steven Roose
599f3c469d
Merge #844: Fix some Bitcoin mentions in Qt
5e3019570 Add parameter for chain name in initial download string (Philippe McLean)
f5aa08f53 Replace some Bitcoin mentions with Elements (Steven Roose)

Pull request description:

  Solves https://github.com/ElementsProject/elements/issues/667.

Tree-SHA512: fdee9fe38cfef9946bd2672f6f13317f5ebc6874b16bb87027e39130fe8d46e7cd04d6cb01ea1d1e203188be93ecdf8b027a81344f033a15e40c586cd485d140
2020-04-06 22:21:37 +01:00
Philippe McLean
5e3019570f
Add parameter for chain name in initial download string 2020-04-06 17:05:41 +01:00
Steven Roose
f5aa08f530
Replace some Bitcoin mentions with Elements 2020-04-02 17:42:51 +01:00
Steven Roose
51f62dcbbf
Merge #846: [RFC] Remove GetNumIssuance from BlindTransaction assert
34ef25072 Move GetNumIssuances to issuance.cpp (Steven Roose)
f9925853c Remove the GetNumIssuances in the assertion (Steven Roose)

Pull request description:

  This is in response to @dgpv 's https://github.com/ElementsProject/elements/issues/842.

  I'm not 100% confident this is correct, but it seems so. It also passed all tests on my machine.

Tree-SHA512: 65206ac5e464a222b379043ca7943e9764382d25db6afc3ade89a1c637404c9f902d9ac21e1671722f1a29592a135b69c2c9164932958929d6a6588a12a14ac2
2020-04-01 16:46:32 +01:00
Steven Roose
b47d087356
Merge #843: Support fee estimation for fees lower than 1 sat/byte
8aab8a24c Optimize size estimation in FundTransaction (Steven Roose)
6939a7248 Support fee estimation for fees lower than 1 sat/byte (Steven Roose)

Pull request description:

  The fee estimation buckets also have a minimum of 1000 sat/kB.

  This PR lowers that limit and also discards old estimates files.

Tree-SHA512: a097915b4f8f31cb2185afbbf6a247816945f1bfe01469260a1f4c90fed36eea2b7ec63b85143c35e335f9fc6877d7392b8969fc2ab1811c27e67bc94b4d6133
2020-03-31 12:42:10 +01:00
Steven Roose
34ef250721
Move GetNumIssuances to issuance.cpp 2020-03-31 12:28:34 +01:00
Steven Roose
f9925853c5
Remove the GetNumIssuances in the assertion 2020-03-31 12:28:15 +01:00
Steven Roose
c84e718e59
Merge pull request #811 from FrancisPouliot/master
Add link to RPC docs in readme
2020-03-31 11:09:16 +01:00
Steven Roose
4df8f458b3
Merge pull request #845 from philippem/update-build-osx
Update macOS build instructions to support building dmg
2020-03-31 10:58:35 +01:00
Steven Roose
8aab8a24c8
Optimize size estimation in FundTransaction 2020-03-30 23:53:56 +01:00
Phil McLean
366befb0aa Add homebrew tools required for image manipulation
- libicns provides png2icon
- imagemagick provides convert
2020-03-30 14:24:44 -07:00
Steven Roose
6939a7248f
Support fee estimation for fees lower than 1 sat/byte 2020-03-30 21:28:26 +01:00
Steven Roose
3c029f42bd
Merge #840: Remove the min(max( construction for the ct_exponent argument
edfa40eb6 Remove the min(max( construction for the ct_exponent argument (Steven Roose)

Pull request description:

  As per @dgpv's suggestion here: https://github.com/ElementsProject/elements/pull/834#discussion_r396333202

  @dgpv could you review?

Tree-SHA512: 6c91a0a86a593f22ff42fb617aa96aeb97e2e5225e2b5b6980aa470f45ee613dab53de49dbbae20aecf7a4bf21cc005839be770917d55cfb2c9afd821c2d0231
2020-03-25 14:39:12 +00:00
Steven Roose
ac5a435247
Merge #838: Index the genesis block with txindex
fd4dcf9c7 Improve coinbase and issuance tx testing for txindex (Steven Roose)
ac9966f65 Index the genesis block with txindex (Steven Roose)

Pull request description:

  This reverts commit ed12d5df1b in which Core removed the genesis txs from the txindex.

  Since they are spendable in Elements (as opposed to Core), they should be added to the index as well.

Tree-SHA512: a9067032f80a78f5393437d287022756816a4baa6bfb8fc382d04dc7831a536dc68959a039636aa4b1bb268b2b849e67a0d4ca59abe835c2834ac358f8175e9e
2020-03-24 17:15:55 +00:00
Steven Roose
edfa40eb69
Remove the min(max( construction for the ct_exponent argument
We removed the similar construction for ct_bits in an earlier commit.
The construction is to keep the value between -1 and 18. This kind of
means that a user that inputs a value outside that range will not get an
error, but will use the value on the edge of the range instead.

It's probably better to return an error (generated by secp256k1) in the
case of invalid input.
2020-03-24 14:15:15 +00:00
Steven Roose
fd4dcf9c7c
Improve coinbase and issuance tx testing for txindex 2020-03-23 18:02:02 +00:00
Steven Roose
ac9966f655
Index the genesis block with txindex 2020-03-23 18:02:01 +00:00
Francis Pouliot
d80c228dd6
Update README.md 2020-03-17 14:27:39 -04:00
Steven Roose
95602ec21f
Merge #834: Switch default bits of hiding to 52
c780a5186 nit: Comment in blind_tests.cpp was wrong (Steven Roose)
e87b39040 Some readability improvements in blind.cpp (Steven Roose)
26e5490e8 Switch default bits of hiding to 52 (Gregory Sanders)

Pull request description:

  Replaces https://github.com/ElementsProject/elements/pull/793 and is basically that MR but rebased. (I can't rebase on Greg's branch.)

Tree-SHA512: 2c321d7f50d1c16f73e9eafc905b3a21a1aa7a4c44a2da39b1adda7f7c12d74c0f49379c7995afe605b5c07410e8e2f0e3468826e4d246c91c8a1c2c8a03e5dc
2020-03-17 17:40:05 +00:00
Steven Roose
71d00ba8df
Merge #835: Reduce mintxfee to 0.1 sat/vbyte and fallback fee to 2 sat/vb
bfb77ad44 Reduce mintxfee to 0.1 sat/vbyte and fallback fee to 2 sat/vb (Steven Roose)

Pull request description:

  This follows the reduction of the `minrelaytxfee` in the previous release to the same value. Using this value, the wallet will be able to make transactions with a 0.1 sat/vbyte fee by default.

Tree-SHA512: a8a977e48abdb103f4514cfe92014be4e7d720d7d1626c4648d021f0cdad55ff839d0bb146158186676f4d72515b7b6112140b041de2d86f765c8f443e567560
2020-03-17 17:35:24 +00:00
Steven Roose
c780a51864
nit: Comment in blind_tests.cpp was wrong 2020-03-17 17:32:41 +00:00
Steven Roose
f6748b39a6
Merge #795: Remove outdated information about peg-in address creation pre-HD
e2a5d8adf Remove outdated information about peg-in address creation pre-HD (Gregory Sanders)

Pull request description:

  resolves https://github.com/ElementsProject/elements/issues/794

Tree-SHA512: e7d94779f9cc7a41b1300c977b4f6dc125cb7b00abdf85b77f99fdeaeabe0ca463105aaaeb56ba8ad2f6cd799e0d813d8f84136e307d240a9c04251aacb5a4ba
2020-03-17 16:08:49 +00:00
Steven Roose
ad27fddd1f
Merge #796: Trivial: fix typo in error message when mainchain daemon is unavailable
5489e602f Trivial: fix typo in error message when mainchain daemon is unavailable (Philippe McLean)

Pull request description:

Tree-SHA512: 84c00897122e67305f6147266eca92d9794662bb386fc957a2dbe92ac044db781993fe65a8f8b5d69e0aba87d40184678e535c1364210fd8c0f729b56675e731
2020-03-17 16:07:40 +00:00
Steven Roose
bfb77ad44d
Reduce mintxfee to 0.1 sat/vbyte and fallback fee to 2 sat/vb 2020-03-17 12:47:03 +00:00
Steven Roose
e87b390409
Some readability improvements in blind.cpp 2020-03-16 20:55:42 +00:00