Commit Graph
100 Commits
Author SHA1 Message Date
Oliver Gugger 85c42b0b79 scripts: add more verbose error messages to verification
We want to be more precise in what exactly went wrong and what the cause
could be.
2021-02-15 10:47:46 +01:00
Oliver Gugger 99ba272822 docs+scripts: switch to detached signatures
Due to a misunderstanding of how the gpg command line options work, we
didn't actually create detached signatures because the --clear-sign
flag would overwrite that. We update our verification script to now only
download the detached signatures and verify them against the main
manifest file.
We also update the signing instructions.
2021-02-15 10:33:20 +01:00
Oliver Gugger 132d23c964 scripts: verify hash length
To make sure we've actually calculated the hash correctly, we make sure
it's 64 characters long.
2021-02-15 10:26:17 +01:00
Oliver Gugger 644424296b scripts: use shasum instead of sha256sum
Because the sha256sum binary isn't available on MacOS we instead use the
shasum -a 256 command that was used before.
2021-02-15 10:26:15 +01:00
Oliver Gugger aca93199cf scripts: allow verification of custom binary
Instead of only allowing the installed versions of lnd and lncli to be
verified, we now also support specifying explicit paths to binaries that
we want to verify.
2021-02-12 13:22:13 +01:00
Oliver Gugger 1a2cb9b975 config: clean and expand backup file path
Because the CleanAndExpandPath function wasn't applied to the backup
file path, any path that contained a tilde for the home directory didn't
work.
2021-02-12 11:14:36 +01:00
Oliver Gugger 3ddb92d99b make: clean mobile stubs before building release
To fix an issue where the vendor.tar.gz in a release build had a
different hash if the mobile RPC stubs were in the mobile/ folder, we
clean those out first.

The culprit was the `google.golang.org/grpc/test/bufconn` package which
is currently only used in the mobile RPC stubs and nowhere else.
Therefore the vendor/module.txt was different when vendoring with the
generated mobile RPC stubs being around.
2021-02-05 13:11:35 +01:00
Oliver Gugger 688a8045f0 Merge pull request #4963 from guggero/verify-no-key-fix
scripts: don't fail signature verification on missing public key
2021-01-28 14:52:22 +01:00
Oliver Gugger aff1a0334e ci: check mobile compilation in same step as RPC
Because we now build a docker image for the RPC compilation, we can save
some execution minutes if we run the mobile RPC and code compilation check in the
same step of the CI workflow.
2021-01-28 10:29:02 +01:00
Oliver Gugger 3bcfe931f9 make+lnrpc: compile mobile RPC with docker too
Now that we have a base docker image that has all our RPC compilation
dependencies installed, we can also run the mobile RPC compilation
there. This removes the need to install falafel and goimports on the
local machine.
2021-01-28 10:29:02 +01:00
Oliver Gugger 19f7670a5b mobile: remove grpc-gateway import
Because we compile the REST code from the rest-annotations.yaml and no
longer import the annotations in the proto files, we don't need to
specify the custom import path anymore.
2021-01-28 10:29:02 +01:00
Oliver Gugger 9c6e208797 multi: remove proto install script 2021-01-28 10:29:01 +01:00
Oliver Gugger e9a0f36786 make+lnrpc: use docker to compile protos
This commit aims to make it easier for developers to compile our
protobuf definitions. They now only need to have docker installed
instead of a whole set of binaries and libraries all pinned to very
specific versions.
2021-01-28 10:27:09 +01:00
Oliver Gugger 91364056f7 Merge pull request #4952 from guggero/gh-actions
GitHub: use vendored actions for steps with sensitive info
2021-01-28 10:12:58 +01:00
Oliver Gugger 734441d6c0 scripts: don't fail on missing public key
When verifying the release signatures, we don't want to fail if a
signer's signature is not available in the gpg key ring. Instead we just
don't want to count the signature for now and still succeed if there's
at least one other good sig with a known key.
2021-01-27 11:12:04 +01:00
Oliver Gugger 1abf3e7847 GitHub: use vendored actions for steps with sensitive info
To avoid leaking any sensitive information like Docker Hub credentials
because of compromised actions repositories, we use our own, vendored
actions for all steps that potentially touch sensitive information.
2021-01-25 14:16:00 +01:00
Oliver Gugger 9642012643 docs: clean up code contribution guideline syntax 2021-01-22 09:14:12 +01:00
Oliver Gugger 02267565fe multi: unify code blocks in READMEs 2021-01-22 09:14:11 +01:00
Oliver Gugger 2c634bfaf3 docs: unify code and shell cmd blocks 2021-01-22 09:14:09 +01:00
Oliver Gugger 356fdb82f8 docs+build: explain how to verify docker images 2021-01-14 21:48:32 +01:00
Oliver Gugger 97a141e7af docker: add verification script to production image
The verification script makes sure the hashes of the binaries inside of
a docker image match those of an official release.
The script first downloads all signatures, validates them, then compares
the hashes of the installed binaries to those contained in the detached
signature files.
2021-01-14 21:48:32 +01:00
Oliver Gugger 25ac071300 build: add release-install goal, hash individual binaries
We add a new make goal called release-install that creates the same
reproducible binaries as the release script would create, but only for
the current OS/architecture. It then installs those binaries to the
system's GOBIN directory.
To allow easy verification of individual binaries (instead of just the
packag tarballs/zips), we also add the hashes of lnd and lncli binaries
to the manifest. We do the same in the docker build.
2021-01-13 15:36:11 +01:00
Oliver Gugger 5b8a3eb72f doc: update INSTALL.md, recommend installing releases
To prevent novice users from running non-release versions, we update the
installation instructions to point them towards our release binaries.
We also document the new Docker build helper that allows you to compile
lnd without needing to install golang.
2021-01-11 10:21:03 +01:00
Oliver Gugger 236294622e config+lncfg+sample-lnd.conf: fix feeurl documentation
A new top level feeurl option was added recently to replace the neutrino.feeurl
option. The new option was never added to the sample config file and the
text was never updated to reflect that the option is required for
neutrino on mainnet. We fix this and also add a valid mainnet example
URL to the sample config file.
2021-01-11 09:27:19 +01:00
Oliver Gugger 4c56f3cacb multi: add release helper docker file 2021-01-08 16:14:24 +01:00
Oliver Gugger 2686391c31 scripts: package release artifacts deterministically
A number of tricks need to be applied to the tar and zip commands
respectively to make sure they always produce deterministic archives.
This includes setting the file timestamps to a fixed date and setting
specific ownership attributes (tar) or no attributes at all (zip).
2021-01-08 15:03:20 +01:00
Oliver Gugger 330f3c4dd0 make: use --tags to describe commit 2021-01-08 11:27:46 +01:00
Oliver Gugger ae4a1908dd GitHub: fetch full history for release build
To make sure git has the full history, including all annotated tags, we
need to explicitly fetch everything on checkout.
2021-01-05 10:41:34 +01:00
Oliver Gugger faa399f942 Merge pull request #4883 from yyforyongyu/small-fix
trivial: fix make rpc-format
2021-01-04 09:59:07 +01:00
Oliver Gugger 49edb2b524 rpcserver: fix log statement in channelbalance
Fixes a typo and missing format 'verb' in the RPCS debug log.
2020-12-22 09:39:43 +01:00
Oliver Gugger 03a21367d3 lnd+walletunlocker: move history drop to unlocker
Apparently dropping the wallet transaction history only fully takes
effect after opening the wallet from scratch again. To do this cleanly,
we need to do it in the unlocker instead of lnd.
2020-12-15 21:34:12 +01:00
Oliver Gugger 0c6cc71f86 walletunlocker: use noFreeListSync param 2020-12-15 21:21:29 +01:00
Oliver Gugger 693d0f61b7 chanrestore: flip case logic
If a channel backup from an old node is restored and a channel contained
within that file was unconfirmed at the time of the backup, the whole
channel short ID is 0:0:0. Unfortunately we got stuck in just the first
case and didn't fall through to the second one. To avoid that, we flip
the case logic because for the second case, the block height in the
short channel ID cannot be zero.
2020-12-14 21:59:49 +01:00
Oliver Gugger 91ed4d811e GitHub+Travis: update to latest golang patch version 2020-12-12 11:26:00 +01:00
Oliver Gugger e68c0bf18f docker: update to latest golang base image 2020-12-12 11:25:22 +01:00
Oliver Gugger 71c19b480d Merge pull request #4797 from Crypt-iQ/zpay32_fflags
make: add zpay32 to fuzz_flags.mk
2020-12-12 11:14:59 +01:00
Oliver Gugger 094545a300 itest: add neutrino errors to whitelist 2020-12-11 08:55:45 +01:00
Oliver Gugger a2d4998962 GitHub: specify docker image platforms
To enable building docker images for ARM64 platforms as well,
we just need to specify the desired target platforms and the Docker
Buildx service will do the job for us (provided the base images support
the given platforms, which is the case for golang).
2020-12-11 08:51:33 +01:00
Oliver Gugger 304a25691f Merge pull request #4849 from guggero/etcd-port-fix
etcd: increment port for embedded etcd server
2020-12-09 16:28:55 +01:00
Oliver Gugger b3c1f29560 Merge pull request #4828 from guggero/fix-log-check
itest: fix error whitelist script
2020-12-09 11:08:19 +01:00
Oliver Gugger c9ab713f59 etcd: increment port for embedded etcd server
Instead of letting the OS pick a random port for us in a way that wasn't
concurrency safe, we use an atomically incremented port to avoid
collisions.
2020-12-09 09:54:23 +01:00
Oliver Gugger a08d6c469f itest: update and sort error whitelist 2020-12-09 09:06:14 +01:00
Oliver Gugger af0f39f4a6 itest: fix log whitelist check
Because a previous PR changed the location of the itest log files, we
also need to update the script that looks for non-whitelisted errors.
2020-12-09 08:06:16 +01:00
Oliver Gugger 9de659ea4f itest: use require.Eventually where tick speed matters
To not waste a lot of time with the adjusted longer tick interval, we
use a short interval with require.Eventually where we can save some
time.
2020-12-08 21:40:37 +01:00
Oliver Gugger a436618e43 lntest: fix linter errors for changed code 2020-12-08 21:40:36 +01:00
Oliver Gugger 809d238364 itest: wait for server to start when restoring
To avoid running into the "server is still starting" error when trying
to close a channel, we first wait for the error to disappear before we
try closing the actual channel.
2020-12-08 21:40:31 +01:00
Oliver Gugger cdcbc0376d lntest: replace hard coded timeouts
This commit replaces most of the hard coded 10, 15, 20 and 30 second
timeouts with the default timeout. This should allow darwin users to
successfully run the parallel itests locally as well.
2020-12-08 21:37:12 +01:00
Oliver Gugger dfb131f82f make: reduce itest parallelism from 6 to 4
It seems that our itests don't perform correctly in a high CPU usage
scenario such as running 6 tests in parallel. Some goroutines don't get
enough execution time and causes check to time out.
By reducing the total number of parallel tests, we hope to give all
goroutines some more breathing room.
2020-12-08 21:37:12 +01:00
Oliver Gugger 3823315820 lntest: go easy on goroutines when polling
In high CPU usage scenarios such as our parallel itests, it seems that
some goroutines just don't get any CPU time before our test timeouts
expire. By polling 10 times less frequently, we hope to reduce the
overall number of goroutines that are spawned because of the RPC
requests within the polling code.
2020-12-08 21:37:11 +01:00
Oliver Gugger 4d2a12e552 itest: fix incorrect error message 2020-12-08 21:37:10 +01:00
Oliver Gugger b42c5e5fad make+scripts: use pre-compiled btcd in itest
To make sure we build the exact version of btcd that is referenced in
the project's go.mod file and to not overwrite any binary the user might
already have installed on the system, we compile btcd into an explicit
file in the itest directory.
This should also speed up invocations of "make itest-only" because the
test harness doesn't always compile btcd on its own.

We also fix a bug with the version parsing where adding a "replace"
directive in the go.mod would result in the awk commands to extract the
wrong version. Because we no longer use the DEPGET goal to build and
install btcd, using a replace directive now actually works for itests.
2020-12-03 23:23:49 +01:00
Oliver Gugger 8829960b1a make+Travis: use EXEC_SUFFIX for Windows, remove explicit goal
To remove the need to have an extra make goal for the Windows itests, we
instead add the flag windows=1 that sets the make variable EXEC_SUFFIX
to properly add the ".exe" suffix to all executable names.
2020-12-03 23:23:49 +01:00
Oliver Gugger b91b7434f6 make: replace ITEST goal with script
To make the Makefile a bit easier to understand, we remove the implicit
ITEST goal/command variable and switch all itest execution over to
explicit goals in the main Makefile.
2020-12-03 23:23:44 +01:00
Oliver Gugger 36756c012d lntest: use nextAvailablePort for miner and btcd backend
With the new btcd version we can specify our own listen address
generator function for any btcd nodes. This should reduce flakiness as
the previous way of getting a free port was based on just picking a
random number which lead to conflicts.
We also double the default values for connection retries and timeouts,
effectively waiting up to 4 seconds in total now.
2020-12-03 11:30:23 +01:00
Oliver Gugger 2edc3cf98f multi: update to latest btcd version
With this commit we update btcd to the latest version which allows us to
specify the btcd binary we want to use when spinning up a new node.
2020-12-03 11:30:22 +01:00
Oliver Gugger 0a4962a18e itest: run sub itests correctly
To avoid the "Error outside of test" log and to properly terminate the
test if a sub test fails, we need to correctly invoke them using the
RunTestCase method.
2020-12-01 22:24:03 +01:00
Oliver Gugger 76d2c49a17 lnd: fix Onion v2 support for Neutrino backends
With this commit we make it possible to use an Onion v2 hidden service
address as the Neutrino backend.
This failed before because an .onion address cannot be looked up and
converted into an IP address through the normal DNS resolving process,
even when using a Tor socks proxy.
Instead, we turn any v2 .onion address into a fake IPv6 representation
before giving it to Neutrino's address manager and turn it back into an
Onion host address when actually dialing.
2020-11-30 22:42:57 +01:00
Oliver Gugger 6f3c8611f4 tor: convert onion v2 addrs into fake tcp6
If we use a chain backend that only understands IP addresses (like
Neutrino for example), we need to turn any Onion v2 host addresses into
a fake IPv6 representation, otherwise it would be resolved incorrectly.
To do this, we use the same fake IPv6 address format that bitcoind and
btcd use internally to represent Onion v2 hidden service addresses.
2020-11-30 22:42:57 +01:00
Oliver Gugger 94183e0f52 docker+docs: move dev Dockerfile to root, document dev build
To finally end the discussion what Dockerfile should be used for what
and whether we should build from local source or check out from git, we
place both Dockerfiles next to each other and explicitly document their
purpose.
2020-11-23 14:48:45 +01:00
Oliver Gugger 8fea653c61 release: skip version check in automated builds 2020-11-19 12:35:58 +01:00
Oliver Gugger 4246238ff5 GitHub: build release binaries and upload to release
This commit adds another GitHub workflow that is activated for each
pushed tag. The release binaries are compiled from that tag for all
supported architectures. A new release in the GitHub repository is then
drafted for the tag and the finished binary packages are uploaded to
that release.
2020-11-19 12:35:53 +01:00
Oliver Gugger 9494ad6fb1 GitHub: add workflow for building tagged docker images
We add a GitHub workflow that is triggered whenever a new version tag is
pushed. It will trigger a docker image build for that version and
automatically push it to the specified repo.
2020-11-17 20:30:35 +01:00
Oliver Gugger 30c2c0addc make: remove arch darwin-386 that is unsupported by go 1.15
As of go version 1.15.x, the darwin-386 architecture is no longer
supported. Because we use that go version on Travis to assert all
architectures can be built successfully, we have to remove this
architecture from the list.
2020-11-13 10:19:52 +01:00
Oliver Gugger 9bd8784ae8 GitHub: run cross compilation for all architectures
Because we now have conditionally compiled code that depends on the
architecture it is built for, we want to make sure we can build all
architectures that we also release. Since GitHub builds are very fast,
we can easily do this instead of only compiling for certain select
architectures.
2020-11-13 10:19:51 +01:00
Oliver Gugger 32ee527f6b server+htlcswitch: auto compact sphinx DB too 2020-11-13 10:19:51 +01:00
Oliver Gugger a8ef4fc158 channeldb: store and evaluate last compaction time 2020-11-13 10:19:51 +01:00
Oliver Gugger 505be0d8bc channeldb: implement compaction
This commit adds the compaction feature of the bbolt compact to our bolt
backend. This will try to open the DB in read-only mode and create a
compacted copy in a temporary file. Once the compaction was successful,
the temporary file and the old source file are swapped atomically.
2020-11-13 10:19:50 +01:00
Oliver Gugger 35c1fad517 server+healthcheck: rename function, add absolute disk space function
With this commit we rename the existing AvailableDiskSpace function to
its correct name AvailableDiskSpaceRatio as it only returns a ratio. We
then go ahead and add a new function that returns the actual number of
free bytes available on a file system.

This also fixes some comments and always returns an error instead of
panicking.
2020-11-13 10:19:50 +01:00
Oliver Gugger f8907fdb47 multi: add AutoCompact option to bolt backend
With this commit we thread the new AutoCompact flags all the way through
to the bolt backend.
2020-11-13 10:19:49 +01:00
Oliver Gugger 6131a53eb4 lncfg+channeldb: add autocompact flags to BoltConfig 2020-11-13 10:19:49 +01:00
Oliver Gugger 08042405c7 server: allow overwriting of DNS seeds 2020-11-13 10:07:03 +01:00
Oliver Gugger 1548528a3f lncfg+sample-lnd.conf: add DNS seed flag to chain cfg 2020-11-13 09:49:18 +01:00
Oliver Gugger c7eea13f95 Merge pull request #4763 from carlaKC/fix-build
lnd: return missing shutdown parameter
2020-11-12 08:16:38 +00:00
Oliver Gugger f51f247a1c docs: describe new itest make commands 2020-11-10 13:57:31 +01:00
Oliver Gugger 47e8882480 make+itest: allow the same test to be run in parallel 2020-11-10 13:57:31 +01:00
Oliver Gugger 72cacb9c5e Merge pull request #1288 from guggero/stateless-init
walletunlocker+lnd: add command line flag to allow passing admin macaroon after wallet creation
2020-11-07 12:39:04 +00:00
Oliver Gugger 0b9b7def15 docs: describe stateless wallet initialization 2020-11-07 11:24:35 +01:00
Oliver Gugger 24adf475ce lnd_test: add integration tests for stateless init 2020-11-07 11:24:35 +01:00
Oliver Gugger e7aa9256ab walletunlocker+lnd: implement stateless wallet initialization 2020-11-07 11:24:34 +01:00
Oliver Gugger 4b0b20c98b walletunlocker: use require library, fix linter issues
To prepare for new tests to be added, we first rewrite the existing
tests to use the require library and get rid of some smaller linter
issues.
2020-11-07 11:24:34 +01:00
Oliver Gugger b685a97fcd lnd: shutdown wallet unlocker after macaroon creation
Because we'll need to return the macaroon through the wallet unlocker
we cannot shut down its service before we have done so, otherwise
we'll end up in a deadlock. That's why we collect all shutdown
tasks and return them as a function that can be called after we've
initialized the macaroon service.
2020-11-07 11:24:34 +01:00
Oliver Gugger 71ba2a8e60 lnd: prepare for proper wallet unlocker cleanup
As a preparation for the next commit where we add proper wallet unlocker
shutdown handling, we move the calls that require cleanup down after the
creation of the wallet unlocker service itself.
2020-11-07 11:24:33 +01:00
Oliver Gugger 294cb4a966 macaroons: remember stateless init
To make sure no macaroons are created anywhere if the stateless
initialization was requested, we keep the requested initialization mode
in the memory of the macaroon service.
2020-11-07 11:24:33 +01:00
Oliver Gugger ae71d60715 macaroons: add ability to change the password or create a new root key 2020-11-07 11:24:33 +01:00
Oliver Gugger cd85e17b19 macaroons: use require for tests 2020-11-07 11:18:52 +01:00
Oliver Gugger 10673b9dfa lncli: add flags for stateless init to wallet unlocker commands 2020-11-07 11:18:52 +01:00
Oliver Gugger 4c8d374007 lnrpc: add arguments for stateless wallet initialization to wallet unlocker
This commit adds the --stateless_init flag to all three wallet unlocker
operations. Once you initialize a wallet stateless, you need to set
this flag for every further wallet unlocker operation. Otherwise you
risk non-encrypted macaroon information to leak to the underlying
system.
2020-11-07 11:18:52 +01:00
Oliver Gugger a606f462bc itest: move longest test to beginning
To make sure the test that takes the longest overall time is always
started first, independent of the number of test tranches we run, we
move it to the beginning of the list. Because that test involves a lot
of waiting, it allows us to play around with the number of tranches more
efficiently.
2020-11-04 11:03:37 +01:00
Oliver Gugger e6c47294fb itest: fix typo and formatting 2020-11-04 11:03:36 +01:00
Oliver Gugger ea4bb5dc5c itest: fix chanbackup restore flake
Updating the fee of the mock estimator _after_ starting carol turned out
to be flaky and could lead to the new fee not being picked up in time
for the force close. That lead to carol not cpfp'ing the force closed
transaction.
2020-11-04 11:03:34 +01:00
Oliver Gugger d4068e9892 travis+make: execute test groups in parallel 2020-11-04 11:03:33 +01:00
Oliver Gugger ca7564e4b4 itest: add flags for lnd executable 2020-11-04 11:03:31 +01:00
Oliver Gugger f358a4474d lntest: add log dir flag 2020-11-04 11:03:30 +01:00
Oliver Gugger 9bbf134237 itest: split tests into dynamic tranches 2020-11-04 11:03:29 +01:00
Oliver Gugger 891eb0d63d lntest: use nextAvailablePort for bitcoind 2020-11-04 11:03:27 +01:00
Oliver Gugger 5c04449dfd lntest: use nextAvailablePort for fee service 2020-11-04 11:03:26 +01:00
Oliver Gugger a50d337e42 lntest: lower initial port, add ApplyPortOffset function
To allow running multiple test tranches in parallel, we need a way to
make sure the TCP ports don't collide. We'll work with offsets for the
ports, using a different offset for each tranche.
2020-11-04 11:03:25 +01:00
Oliver Gugger eaf60a63e3 docs: update in-place rescan section 2020-11-04 09:12:24 +01:00
Oliver Gugger a7c81eb595 lnd: drop wallet transactions if flag is set
To force a full chain rescan, the wallet can now be instructed to drop
its full transaction history on startup.
2020-11-04 09:12:24 +01:00
Oliver Gugger 37817f192e config: add reset-wallet-transactions flag 2020-11-04 09:12:24 +01:00