2020-04-21 20:24:39 +10:00
|
|
|
name: Continuous Integration Checks
|
|
|
|
|
2020-04-24 16:22:44 -04:00
|
|
|
on: [push, pull_request]
|
2020-04-21 20:24:39 +10:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
2021-07-29 17:40:14 +00:00
|
|
|
fail-fast: false
|
2020-04-21 20:24:39 +10:00
|
|
|
matrix:
|
2020-09-17 14:22:55 -04:00
|
|
|
platform: [ ubuntu-latest ]
|
2020-04-21 20:24:39 +10:00
|
|
|
toolchain: [ stable,
|
|
|
|
beta,
|
2023-03-15 18:08:35 +00:00
|
|
|
# 1.48.0 is the MSRV for all LDK crates except lightning-transaction-sync and Windows
|
|
|
|
1.48.0]
|
2020-04-21 20:24:39 +10:00
|
|
|
include:
|
|
|
|
- toolchain: stable
|
|
|
|
build-net-tokio: true
|
2021-05-27 04:04:20 +00:00
|
|
|
build-no-std: true
|
2022-10-10 14:47:18 -04:00
|
|
|
build-futures: true
|
2023-01-19 11:45:46 -06:00
|
|
|
build-tx-sync: true
|
|
|
|
coverage: true
|
2020-09-17 14:22:55 -04:00
|
|
|
- toolchain: stable
|
|
|
|
platform: macos-latest
|
|
|
|
build-net-tokio: true
|
2021-05-27 04:04:20 +00:00
|
|
|
build-no-std: true
|
2022-10-10 14:47:18 -04:00
|
|
|
build-futures: true
|
2023-01-19 11:45:46 -06:00
|
|
|
build-tx-sync: true
|
2023-02-01 21:35:38 -06:00
|
|
|
- toolchain: stable
|
|
|
|
test-custom-message: true
|
2021-08-02 14:52:02 +00:00
|
|
|
- toolchain: beta
|
|
|
|
platform: macos-latest
|
|
|
|
build-net-tokio: true
|
|
|
|
build-no-std: true
|
2022-10-10 14:47:18 -04:00
|
|
|
build-futures: true
|
2023-01-19 11:45:46 -06:00
|
|
|
build-tx-sync: true
|
2020-09-17 14:22:55 -04:00
|
|
|
- toolchain: stable
|
|
|
|
platform: windows-latest
|
|
|
|
build-net-tokio: true
|
2021-05-27 04:04:20 +00:00
|
|
|
build-no-std: true
|
2022-10-10 14:47:18 -04:00
|
|
|
build-futures: true
|
2023-01-19 11:45:46 -06:00
|
|
|
build-tx-sync: false
|
2021-08-02 14:52:02 +00:00
|
|
|
- toolchain: beta
|
|
|
|
platform: windows-latest
|
|
|
|
build-net-tokio: true
|
|
|
|
build-no-std: true
|
2022-10-10 14:47:18 -04:00
|
|
|
build-futures: true
|
2023-01-19 11:45:46 -06:00
|
|
|
build-tx-sync: false
|
2020-04-21 20:24:39 +10:00
|
|
|
- toolchain: beta
|
|
|
|
build-net-tokio: true
|
2021-05-27 04:04:20 +00:00
|
|
|
build-no-std: true
|
2022-10-10 14:47:18 -04:00
|
|
|
build-futures: true
|
2023-01-19 11:45:46 -06:00
|
|
|
build-tx-sync: true
|
2023-02-01 21:35:38 -06:00
|
|
|
- toolchain: beta
|
|
|
|
test-custom-message: true
|
2023-03-15 18:08:35 +00:00
|
|
|
- toolchain: 1.48.0
|
2022-10-10 14:47:18 -04:00
|
|
|
build-futures: true
|
2021-12-16 02:21:48 +00:00
|
|
|
build-no-std: true
|
2023-01-19 11:45:46 -06:00
|
|
|
build-tx-sync: false
|
2020-09-17 14:22:55 -04:00
|
|
|
runs-on: ${{ matrix.platform }}
|
2020-04-21 20:24:39 +10:00
|
|
|
steps:
|
|
|
|
- name: Checkout source code
|
2022-03-02 17:35:18 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-04-21 20:24:39 +10:00
|
|
|
- name: Install Rust ${{ matrix.toolchain }} toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
2021-12-16 02:10:09 +00:00
|
|
|
- name: Pin tokio to 1.14 for Rust 1.45
|
|
|
|
if: "matrix.build-net-old-tokio"
|
|
|
|
run: cargo update -p tokio --precise "1.14.0" --verbose
|
2022-08-23 09:20:35 +02:00
|
|
|
env:
|
|
|
|
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
|
2023-03-10 22:24:39 +01:00
|
|
|
- name: Pin tokio to 1.26 for Windows
|
|
|
|
if: "matrix.platform == 'windows-latest'"
|
|
|
|
run: cargo update -p tokio --precise "1.26.0" --verbose
|
|
|
|
env:
|
|
|
|
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
|
2023-02-27 17:32:07 +00:00
|
|
|
- name: Build on Rust ${{ matrix.toolchain }} with net-tokio
|
|
|
|
if: "matrix.build-net-tokio && !matrix.coverage"
|
2020-09-17 14:10:41 -04:00
|
|
|
run: cargo build --verbose --color always
|
2023-02-27 17:32:07 +00:00
|
|
|
- name: Build on Rust ${{ matrix.toolchain }} with net-tokio, and full code-linking for coverage generation
|
2020-09-17 14:10:41 -04:00
|
|
|
if: matrix.coverage
|
2020-04-24 15:06:15 +10:00
|
|
|
run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always
|
2020-04-21 20:24:39 +10:00
|
|
|
- name: Build on Rust ${{ matrix.toolchain }}
|
|
|
|
if: "! matrix.build-net-tokio"
|
2021-05-27 04:04:20 +00:00
|
|
|
run: |
|
|
|
|
cargo build --verbose --color always -p lightning
|
|
|
|
cargo build --verbose --color always -p lightning-invoice
|
|
|
|
cargo build --verbose --color always -p lightning-persister
|
2021-11-23 23:03:34 +00:00
|
|
|
- name: Build on Rust ${{ matrix.toolchain }} with all Log-Limiting features
|
|
|
|
if: matrix.test-log-variants
|
|
|
|
run: |
|
|
|
|
cd lightning
|
|
|
|
for FEATURE in $(cat Cargo.toml | grep '^max_level_' | awk '{ print $1 }'); do
|
|
|
|
cargo build --verbose --color always --features $FEATURE
|
|
|
|
done
|
2021-01-11 10:50:54 -08:00
|
|
|
- name: Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features
|
|
|
|
if: "matrix.build-net-tokio && !matrix.coverage"
|
|
|
|
run: |
|
|
|
|
cd lightning-block-sync
|
|
|
|
cargo build --verbose --color always --features rest-client
|
|
|
|
cargo build --verbose --color always --features rpc-client
|
|
|
|
cargo build --verbose --color always --features rpc-client,rest-client
|
|
|
|
cargo build --verbose --color always --features rpc-client,rest-client,tokio
|
|
|
|
- name: Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
|
|
|
|
if: matrix.coverage
|
|
|
|
run: |
|
|
|
|
cd lightning-block-sync
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rest-client
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client,tokio
|
2023-01-19 11:45:46 -06:00
|
|
|
- name: Build Transaction Sync Clients on Rust ${{ matrix.toolchain }} with features
|
|
|
|
if: "matrix.build-tx-sync && !matrix.coverage"
|
|
|
|
run: |
|
|
|
|
cd lightning-transaction-sync
|
|
|
|
cargo build --verbose --color always --features esplora-blocking
|
|
|
|
cargo build --verbose --color always --features esplora-async
|
2023-03-08 12:05:57 +01:00
|
|
|
cargo build --verbose --color always --features esplora-async-https
|
2023-01-19 11:45:46 -06:00
|
|
|
- name: Build transaction sync clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
|
|
|
|
if: "matrix.build-tx-sync && matrix.coverage"
|
|
|
|
run: |
|
|
|
|
cd lightning-transaction-sync
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features esplora-blocking
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features esplora-async
|
2023-03-08 12:05:57 +01:00
|
|
|
RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features esplora-async-https
|
2023-01-19 11:45:46 -06:00
|
|
|
- name: Test transaction sync clients on Rust ${{ matrix.toolchain }} with features
|
|
|
|
if: "matrix.build-tx-sync"
|
|
|
|
run: |
|
|
|
|
cd lightning-transaction-sync
|
|
|
|
cargo test --verbose --color always --features esplora-blocking
|
|
|
|
cargo test --verbose --color always --features esplora-async
|
2023-03-08 12:05:57 +01:00
|
|
|
cargo test --verbose --color always --features esplora-async-https
|
2022-01-13 01:00:43 +00:00
|
|
|
- name: Test backtrace-debug builds on Rust ${{ matrix.toolchain }}
|
2022-12-14 19:46:19 +00:00
|
|
|
if: "matrix.toolchain == 'stable'"
|
2023-02-24 20:29:45 +00:00
|
|
|
shell: bash # Default on Winblows is powershell
|
2022-01-13 01:00:43 +00:00
|
|
|
run: |
|
2023-02-24 20:29:45 +00:00
|
|
|
cd lightning && RUST_BACKTRACE=1 cargo test --verbose --color always --features backtrace
|
2020-04-21 20:24:39 +10:00
|
|
|
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio
|
2023-02-27 17:32:07 +00:00
|
|
|
if: "matrix.build-net-tokio && !matrix.coverage"
|
2020-09-17 14:10:41 -04:00
|
|
|
run: cargo test --verbose --color always
|
2023-02-27 17:32:07 +00:00
|
|
|
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio, and full code-linking for coverage generation
|
2020-09-17 14:10:41 -04:00
|
|
|
if: matrix.coverage
|
2020-04-24 15:06:15 +10:00
|
|
|
run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
|
2022-10-10 14:47:18 -04:00
|
|
|
- name: Test no-std builds on Rust ${{ matrix.toolchain }}
|
2021-05-27 04:04:20 +00:00
|
|
|
if: "matrix.build-no-std && !matrix.coverage"
|
2022-01-04 22:34:15 +00:00
|
|
|
shell: bash # Default on Winblows is powershell
|
2021-05-27 04:04:20 +00:00
|
|
|
run: |
|
2022-10-06 15:41:58 +00:00
|
|
|
for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
|
|
|
|
cd $DIR
|
|
|
|
cargo test --verbose --color always --no-default-features --features no-std
|
|
|
|
# check if there is a conflict between no-std and the default std feature
|
|
|
|
cargo test --verbose --color always --features no-std
|
|
|
|
# check that things still pass without grind_signatures
|
|
|
|
# note that outbound_commitment_test only runs in this mode, because of hardcoded signature values
|
|
|
|
cargo test --verbose --color always --no-default-features --features std
|
|
|
|
# check if there is a conflict between no-std and the c_bindings cfg
|
|
|
|
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --no-default-features --features=no-std
|
|
|
|
cd ..
|
|
|
|
done
|
2022-03-03 23:59:44 -08:00
|
|
|
# check no-std compatibility across dependencies
|
|
|
|
cd no-std-check
|
2023-03-03 05:14:04 +00:00
|
|
|
cargo check --verbose --color always --features lightning-transaction-sync
|
2022-10-06 15:44:03 +00:00
|
|
|
- name: Build no-std-check on Rust ${{ matrix.toolchain }} for ARM Embedded
|
|
|
|
if: "matrix.build-no-std && matrix.platform == 'ubuntu-latest'"
|
|
|
|
run: |
|
|
|
|
cd no-std-check
|
|
|
|
rustup target add thumbv7m-none-eabi
|
|
|
|
sudo apt-get -y install gcc-arm-none-eabi
|
|
|
|
cargo build --target=thumbv7m-none-eabi
|
2021-08-03 09:38:44 +02:00
|
|
|
- name: Test on no-std builds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
|
2021-05-27 04:04:20 +00:00
|
|
|
if: "matrix.build-no-std && matrix.coverage"
|
|
|
|
run: |
|
|
|
|
cd lightning
|
2021-08-03 09:38:44 +02:00
|
|
|
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features no-std
|
2022-10-10 14:47:18 -04:00
|
|
|
- name: Test futures builds on Rust ${{ matrix.toolchain }}
|
|
|
|
if: "matrix.build-futures && !matrix.coverage"
|
|
|
|
shell: bash # Default on Winblows is powershell
|
|
|
|
run: |
|
|
|
|
cd lightning-background-processor
|
|
|
|
cargo test --verbose --color always --no-default-features --features futures
|
|
|
|
- name: Test futures builds on Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
|
|
|
|
if: "matrix.build-futures && matrix.coverage"
|
|
|
|
shell: bash # Default on Winblows is powershell
|
|
|
|
run: |
|
|
|
|
cd lightning-background-processor
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features futures
|
2020-04-21 20:24:39 +10:00
|
|
|
- name: Test on Rust ${{ matrix.toolchain }}
|
|
|
|
if: "! matrix.build-net-tokio"
|
2021-05-27 04:04:20 +00:00
|
|
|
run: |
|
2022-10-10 14:47:18 -04:00
|
|
|
cargo test --verbose --color always -p lightning
|
|
|
|
cargo test --verbose --color always -p lightning-invoice
|
|
|
|
cargo test --verbose --color always -p lightning-rapid-gossip-sync
|
|
|
|
cargo test --verbose --color always -p lightning-persister
|
|
|
|
cargo test --verbose --color always -p lightning-background-processor
|
2021-11-21 22:29:48 +00:00
|
|
|
- name: Test C Bindings Modifications on Rust ${{ matrix.toolchain }}
|
|
|
|
if: "! matrix.build-net-tokio"
|
|
|
|
run: |
|
|
|
|
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always -p lightning
|
|
|
|
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always -p lightning-invoice
|
|
|
|
RUSTFLAGS="--cfg=c_bindings" cargo build --verbose --color always -p lightning-persister
|
|
|
|
RUSTFLAGS="--cfg=c_bindings" cargo build --verbose --color always -p lightning-background-processor
|
2021-01-11 10:50:54 -08:00
|
|
|
- name: Test Block Sync Clients on Rust ${{ matrix.toolchain }} with features
|
|
|
|
if: "matrix.build-net-tokio && !matrix.coverage"
|
|
|
|
run: |
|
|
|
|
cd lightning-block-sync
|
|
|
|
cargo test --verbose --color always --features rest-client
|
|
|
|
cargo test --verbose --color always --features rpc-client
|
|
|
|
cargo test --verbose --color always --features rpc-client,rest-client
|
|
|
|
cargo test --verbose --color always --features rpc-client,rest-client,tokio
|
|
|
|
- name: Test Block Sync Clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
|
|
|
|
if: matrix.coverage
|
|
|
|
run: |
|
|
|
|
cd lightning-block-sync
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rest-client
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client,rest-client
|
|
|
|
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client,rest-client,tokio
|
2023-02-01 21:35:38 -06:00
|
|
|
- name: Test Custom Message Macros on Rust ${{ matrix.toolchain }}
|
|
|
|
if: "matrix.test-custom-message"
|
|
|
|
run: |
|
|
|
|
cd lightning-custom-message
|
|
|
|
cargo test --verbose --color always
|
2020-04-21 20:24:39 +10:00
|
|
|
- name: Install deps for kcov
|
|
|
|
if: matrix.coverage
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
|
|
|
|
- name: Install kcov
|
|
|
|
if: matrix.coverage
|
|
|
|
run: |
|
|
|
|
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
|
|
|
|
tar xzf master.tar.gz
|
|
|
|
cd kcov-master && mkdir build && cd build
|
|
|
|
cmake ..
|
|
|
|
make
|
|
|
|
make install DESTDIR=../../kcov-build
|
|
|
|
cd ../.. && rm -rf kcov-master master.tar.gz
|
|
|
|
- name: Generate coverage report
|
|
|
|
if: matrix.coverage
|
|
|
|
run: |
|
2021-01-26 17:17:01 -05:00
|
|
|
for file in target/debug/deps/lightning*; do
|
2020-04-21 20:24:39 +10:00
|
|
|
[ -x "${file}" ] || continue;
|
|
|
|
mkdir -p "target/cov/$(basename $file)";
|
|
|
|
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
|
|
|
|
done
|
|
|
|
- name: Upload coverage
|
|
|
|
if: matrix.coverage
|
2022-04-05 17:32:54 +00:00
|
|
|
uses: codecov/codecov-action@v3
|
2020-04-21 20:24:39 +10:00
|
|
|
with:
|
2020-08-03 16:48:58 -04:00
|
|
|
# Could you use this to fake the coverage report for your PR? Sure.
|
|
|
|
# Will anyone be impressed by your amazing coverage? No
|
|
|
|
# Maybe if codecov wasn't broken we wouldn't need to do this...
|
|
|
|
token: f421b687-4dc2-4387-ac3d-dc3b2528af57
|
2020-04-21 20:24:39 +10:00
|
|
|
fail_ci_if_error: true
|
|
|
|
|
2021-02-15 16:49:44 -05:00
|
|
|
benchmark:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2022-10-31 18:46:31 +00:00
|
|
|
TOOLCHAIN: stable
|
2021-02-15 16:49:44 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout source code
|
2022-03-02 17:35:18 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-02-15 16:49:44 -05:00
|
|
|
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.TOOLCHAIN }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: Cache routing graph snapshot
|
|
|
|
id: cache-graph
|
2022-03-21 17:38:00 +00:00
|
|
|
uses: actions/cache@v3
|
2021-02-15 16:49:44 -05:00
|
|
|
with:
|
Update the lightning graph snapshot used in benchmarks
The previous copy was more than one and a half years old, the
lightning network has changed a lot since!
As of this commit, performance on my Xeon W-10885M with a
SK hynix Gold P31 storing a BTRFS volume is as follows:
```
test ln::channelmanager::bench::bench_sends ... bench: 5,896,492 ns/iter (+/- 512,421)
test routing::gossip::benches::read_network_graph ... bench: 1,645,740,604 ns/iter (+/- 47,611,514)
test routing::gossip::benches::write_network_graph ... bench: 234,870,775 ns/iter (+/- 8,301,775)
test routing::router::benches::generate_mpp_routes_with_probabilistic_scorer ... bench: 166,155,032 ns/iter (+/- 30,206,162)
test routing::router::benches::generate_mpp_routes_with_zero_penalty_scorer ... bench: 136,843,661 ns/iter (+/- 67,111,218)
test routing::router::benches::generate_routes_with_probabilistic_scorer ... bench: 52,954,598 ns/iter (+/- 11,360,547)
test routing::router::benches::generate_routes_with_zero_penalty_scorer ... bench: 37,598,126 ns/iter (+/- 17,262,519)
test bench::bench_sends ... bench: 37,760,922 ns/iter (+/- 5,179,123)
test bench::bench_reading_full_graph_from_file ... bench: 25,615 ns/iter (+/- 1,149)
```
2023-01-19 04:41:02 +00:00
|
|
|
path: lightning/net_graph-2023-01-18.bin
|
|
|
|
key: ldk-net_graph-v0.0.113-2023-01-18.bin
|
2021-02-15 16:49:44 -05:00
|
|
|
- name: Fetch routing graph snapshot
|
|
|
|
if: steps.cache-graph.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
Update the lightning graph snapshot used in benchmarks
The previous copy was more than one and a half years old, the
lightning network has changed a lot since!
As of this commit, performance on my Xeon W-10885M with a
SK hynix Gold P31 storing a BTRFS volume is as follows:
```
test ln::channelmanager::bench::bench_sends ... bench: 5,896,492 ns/iter (+/- 512,421)
test routing::gossip::benches::read_network_graph ... bench: 1,645,740,604 ns/iter (+/- 47,611,514)
test routing::gossip::benches::write_network_graph ... bench: 234,870,775 ns/iter (+/- 8,301,775)
test routing::router::benches::generate_mpp_routes_with_probabilistic_scorer ... bench: 166,155,032 ns/iter (+/- 30,206,162)
test routing::router::benches::generate_mpp_routes_with_zero_penalty_scorer ... bench: 136,843,661 ns/iter (+/- 67,111,218)
test routing::router::benches::generate_routes_with_probabilistic_scorer ... bench: 52,954,598 ns/iter (+/- 11,360,547)
test routing::router::benches::generate_routes_with_zero_penalty_scorer ... bench: 37,598,126 ns/iter (+/- 17,262,519)
test bench::bench_sends ... bench: 37,760,922 ns/iter (+/- 5,179,123)
test bench::bench_reading_full_graph_from_file ... bench: 25,615 ns/iter (+/- 1,149)
```
2023-01-19 04:41:02 +00:00
|
|
|
curl --verbose -L -o lightning/net_graph-2023-01-18.bin https://bitcoin.ninja/ldk-net_graph-v0.0.113-2023-01-18.bin
|
|
|
|
echo "Sha sum: $(sha256sum lightning/net_graph-2023-01-18.bin | awk '{ print $1 }')"
|
|
|
|
if [ "$(sha256sum lightning/net_graph-2023-01-18.bin | awk '{ print $1 }')" != "${EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM}" ]; then
|
2021-02-15 16:49:44 -05:00
|
|
|
echo "Bad hash"
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-11-03 10:50:08 -07:00
|
|
|
env:
|
Update the lightning graph snapshot used in benchmarks
The previous copy was more than one and a half years old, the
lightning network has changed a lot since!
As of this commit, performance on my Xeon W-10885M with a
SK hynix Gold P31 storing a BTRFS volume is as follows:
```
test ln::channelmanager::bench::bench_sends ... bench: 5,896,492 ns/iter (+/- 512,421)
test routing::gossip::benches::read_network_graph ... bench: 1,645,740,604 ns/iter (+/- 47,611,514)
test routing::gossip::benches::write_network_graph ... bench: 234,870,775 ns/iter (+/- 8,301,775)
test routing::router::benches::generate_mpp_routes_with_probabilistic_scorer ... bench: 166,155,032 ns/iter (+/- 30,206,162)
test routing::router::benches::generate_mpp_routes_with_zero_penalty_scorer ... bench: 136,843,661 ns/iter (+/- 67,111,218)
test routing::router::benches::generate_routes_with_probabilistic_scorer ... bench: 52,954,598 ns/iter (+/- 11,360,547)
test routing::router::benches::generate_routes_with_zero_penalty_scorer ... bench: 37,598,126 ns/iter (+/- 17,262,519)
test bench::bench_sends ... bench: 37,760,922 ns/iter (+/- 5,179,123)
test bench::bench_reading_full_graph_from_file ... bench: 25,615 ns/iter (+/- 1,149)
```
2023-01-19 04:41:02 +00:00
|
|
|
EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM: da6066f2bddcddbe7d8a6debbd53545697137b310bbb8c4911bc8c81fc5ff48c
|
2021-11-03 10:50:08 -07:00
|
|
|
- name: Fetch rapid graph sync reference input
|
|
|
|
run: |
|
2022-07-25 20:35:51 +02:00
|
|
|
curl --verbose -L -o lightning-rapid-gossip-sync/res/full_graph.lngossip https://bitcoin.ninja/ldk-compressed_graph-285cb27df79-2022-07-21.bin
|
2021-11-03 10:50:08 -07:00
|
|
|
echo "Sha sum: $(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')"
|
|
|
|
if [ "$(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')" != "${EXPECTED_RAPID_GOSSIP_SHASUM}" ]; then
|
|
|
|
echo "Bad hash"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
env:
|
2022-07-25 20:35:51 +02:00
|
|
|
EXPECTED_RAPID_GOSSIP_SHASUM: e0f5d11641c11896d7af3a2246d3d6c3f1720b7d2d17aab321ecce82e6b7deb8
|
2021-03-26 21:50:54 -04:00
|
|
|
- name: Test with Network Graph on Rust ${{ matrix.toolchain }}
|
|
|
|
run: |
|
|
|
|
cd lightning
|
|
|
|
RUSTFLAGS="--cfg=require_route_graph_test" cargo test
|
2021-05-27 04:04:20 +00:00
|
|
|
RUSTFLAGS="--cfg=require_route_graph_test" cargo test --features hashbrown
|
2021-03-26 21:50:54 -04:00
|
|
|
cd ..
|
2021-02-15 16:49:44 -05:00
|
|
|
- name: Run benchmarks on Rust ${{ matrix.toolchain }}
|
|
|
|
run: |
|
2022-10-31 18:46:31 +00:00
|
|
|
RUSTC_BOOTSTRAP=1 cargo bench --features _bench_unstable
|
2021-02-15 16:49:44 -05:00
|
|
|
|
2020-09-15 14:39:44 -04:00
|
|
|
check_commits:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2022-03-27 17:11:22 +00:00
|
|
|
TOOLCHAIN: 1.57.0
|
2020-09-15 14:39:44 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout source code
|
2022-03-02 17:35:18 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-09-15 14:39:44 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.TOOLCHAIN }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: Fetch full tree and rebase on upstream
|
|
|
|
run: |
|
2021-12-26 22:53:16 -05:00
|
|
|
git remote add upstream https://github.com/lightningdevkit/rust-lightning
|
2020-09-15 14:39:44 -04:00
|
|
|
git fetch upstream
|
2020-10-02 16:32:32 -04:00
|
|
|
export GIT_COMMITTER_EMAIL="rl-ci@example.com"
|
|
|
|
export GIT_COMMITTER_NAME="RL CI"
|
2020-09-15 14:39:44 -04:00
|
|
|
git rebase upstream/main
|
|
|
|
- name: For each commit, run cargo check (including in fuzz)
|
|
|
|
run: ci/check-each-commit.sh upstream/main
|
|
|
|
|
2022-06-10 10:45:57 +02:00
|
|
|
check_release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
TOOLCHAIN: stable
|
|
|
|
steps:
|
|
|
|
- name: Checkout source code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.TOOLCHAIN }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: Run cargo check for release build.
|
|
|
|
run: |
|
|
|
|
cargo check --release
|
|
|
|
cargo check --no-default-features --features=no-std --release
|
2022-10-10 14:47:18 -04:00
|
|
|
cargo check --no-default-features --features=futures --release
|
2022-06-10 10:45:57 +02:00
|
|
|
cargo doc --release
|
|
|
|
|
2020-04-21 20:24:39 +10:00
|
|
|
fuzz:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
TOOLCHAIN: stable
|
|
|
|
steps:
|
|
|
|
- name: Checkout source code
|
2022-03-02 17:35:18 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-02-25 22:09:30 +00:00
|
|
|
- name: Install Rust 1.58 toolchain
|
2020-04-21 20:24:39 +10:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-02-25 22:09:30 +00:00
|
|
|
toolchain: 1.58
|
2020-04-21 20:24:39 +10:00
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: Install dependencies for honggfuzz
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install build-essential binutils-dev libunwind-dev
|
2020-04-24 14:22:31 -04:00
|
|
|
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
|
2021-02-19 15:07:28 -05:00
|
|
|
run: cd fuzz && RUSTFLAGS="--cfg=fuzzing" cargo test --verbose --color always
|
2020-04-24 14:22:31 -04:00
|
|
|
- name: Run fuzzers
|
2021-04-07 13:04:29 -04:00
|
|
|
run: cd fuzz && ./ci-fuzz.sh && cd ..
|
|
|
|
- name: Run lightning-invoice fuzzers
|
|
|
|
run: cd lightning-invoice/fuzz && RUSTFLAGS="--cfg=fuzzing" cargo test --verbose && ./ci-fuzz.sh
|
2020-05-10 20:09:42 -04:00
|
|
|
|
2020-10-08 10:47:49 -07:00
|
|
|
linting:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-01-19 11:45:46 -06:00
|
|
|
TOOLCHAIN: stable
|
2020-10-08 10:47:49 -07:00
|
|
|
steps:
|
|
|
|
- name: Checkout source code
|
2022-03-02 17:35:18 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-10-08 10:47:49 -07:00
|
|
|
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.TOOLCHAIN }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
- name: Install clippy
|
|
|
|
run: |
|
|
|
|
rustup component add clippy
|
|
|
|
- name: Run default clippy linting
|
|
|
|
run: |
|
2021-08-02 10:30:01 -05:00
|
|
|
cargo clippy -- -Aclippy::erasing_op -Aclippy::never_loop -Aclippy::if_same_then_else -Dclippy::try_err
|