Skip to content

Commit 4ab7b9f

Browse files
committed
Update net_graph used for benchmarks to use new ser format.
1 parent 4cc2ae5 commit 4ab7b9f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ jobs:
143143
id: cache-graph
144144
uses: actions/cache@v2
145145
with:
146-
path: lightning/net_graph-2021-02-12.bin
147-
key: ldk-net_graph-05f0c5a0d772-2020-02-12.bin
146+
path: lightning/net_graph-2021-05-26.bin
147+
key: ldk-net_graph-2138c80ccaa5-2021-05-26.bin
148148
- name: Fetch routing graph snapshot
149149
if: steps.cache-graph.outputs.cache-hit != 'true'
150150
run: |
151-
wget -O lightning/net_graph-2021-02-12.bin https://bitcoin.ninja/ldk-net_graph-05f0c5a0d772-2020-02-12.bin
152-
if [ "$(sha256sum lightning/net_graph-2021-02-12.bin | awk '{ print $1 }')" != "7116fca78551fedc714a604cec0ad1ca66caa77bb4d0051290258e7a10e0c6e7" ]; then
151+
wget -O lightning/net_graph-2021-05-26.bin https://bitcoin.ninja/ldk-net_graph-2138c80ccaa5-2021-05-26.bin
152+
if [ "$(sha256sum lightning/net_graph-2021-05-26.bin | awk '{ print $1 }')" != "71ca4fa8eb1561b6d544cd9f834292a948528e333bd3cb24f5f9a8ad1d1faad7" ]; then
153153
echo "Bad hash"
154154
exit 1
155155
fi

lightning/src/routing/router.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3857,8 +3857,8 @@ mod tests {
38573857
use util::ser::Readable;
38583858
/// Tries to open a network graph file, or panics with a URL to fetch it.
38593859
pub(super) fn get_route_file() -> Result<std::fs::File, std::io::Error> {
3860-
let res = File::open("net_graph-2021-02-12.bin") // By default we're run in RL/lightning
3861-
.or_else(|_| File::open("lightning/net_graph-2021-02-12.bin")) // We may be run manually in RL/
3860+
let res = File::open("net_graph-2021-05-26.bin") // By default we're run in RL/lightning
3861+
.or_else(|_| File::open("lightning/net_graph-2021-05-26.bin")) // We may be run manually in RL/
38623862
.or_else(|_| { // Fall back to guessing based on the binary location
38633863
// path is likely something like .../rust-lightning/target/debug/deps/lightning-...
38643864
let mut path = std::env::current_exe().unwrap();
@@ -3867,7 +3867,7 @@ mod tests {
38673867
path.pop(); // debug
38683868
path.pop(); // target
38693869
path.push("lightning");
3870-
path.push("net_graph-2021-02-12.bin");
3870+
path.push("net_graph-2021-05-26.bin");
38713871
eprintln!("{}", path.to_str().unwrap());
38723872
File::open(path)
38733873
});
@@ -3890,7 +3890,7 @@ mod tests {
38903890
let mut d = match get_route_file() {
38913891
Ok(f) => f,
38923892
Err(_) => {
3893-
eprintln!("Please fetch https://bitcoin.ninja/ldk-net_graph-05f0c5a0d772-2020-02-12.bin and place it at lightning/net_graph-2021-02-12.bin");
3893+
eprintln!("Please fetch https://bitcoin.ninja/ldk-net_graph-2138c80ccaa5-2021-05-26.bin and place it at lightning/net_graph-2021-05-26.bin");
38943894
return;
38953895
},
38963896
};
@@ -3917,7 +3917,7 @@ mod tests {
39173917
let mut d = match get_route_file() {
39183918
Ok(f) => f,
39193919
Err(_) => {
3920-
eprintln!("Please fetch https://bitcoin.ninja/ldk-net_graph-05f0c5a0d772-2020-02-12.bin and place it at lightning/net_graph-2021-02-12.bin");
3920+
eprintln!("Please fetch https://bitcoin.ninja/ldk-net_graph-2138c80ccaa5-2021-05-26.bin and place it at lightning/net_graph-2021-05-26.bin");
39213921
return;
39223922
},
39233923
};
@@ -3955,7 +3955,7 @@ mod benches {
39553955
#[bench]
39563956
fn generate_routes(bench: &mut Bencher) {
39573957
let mut d = tests::get_route_file()
3958-
.expect("Please fetch https://bitcoin.ninja/ldk-net_graph-05f0c5a0d772-2020-02-12.bin and place it at lightning/net_graph-2021-02-12.bin");
3958+
.expect("Please fetch https://bitcoin.ninja/ldk-net_graph-2138c80ccaa5-2021-05-26.bin and place it at lightning/net_graph-2021-05-26.bin");
39593959
let graph = NetworkGraph::read(&mut d).unwrap();
39603960

39613961
// First, get 100 (source, destination) pairs for which route-getting actually succeeds...
@@ -3987,7 +3987,7 @@ mod benches {
39873987
#[bench]
39883988
fn generate_mpp_routes(bench: &mut Bencher) {
39893989
let mut d = tests::get_route_file()
3990-
.expect("Please fetch https://bitcoin.ninja/ldk-net_graph-05f0c5a0d772-2020-02-12.bin and place it at lightning/net_graph-2021-02-12.bin");
3990+
.expect("Please fetch https://bitcoin.ninja/ldk-net_graph-2138c80ccaa5-2021-05-26.bin and place it at lightning/net_graph-2021-05-26.bin");
39913991
let graph = NetworkGraph::read(&mut d).unwrap();
39923992

39933993
// First, get 100 (source, destination) pairs for which route-getting actually succeeds...

0 commit comments

Comments
 (0)