Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up and more liberally free holding cell HTLCs (without re-entrancy) #851

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions fuzz/ci-fuzz.sh
@@ -1,5 +1,6 @@
#!/bin/bash
set -e
set -x

pushd src/msg_targets
rm msg_*.rs
Expand Down
12 changes: 10 additions & 2 deletions fuzz/src/bin/chanmon_consistency_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/chanmon_deser_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/full_stack_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_accept_channel_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_announcement_signatures_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_channel_announcement_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_channel_reestablish_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_channel_update_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_closing_signed_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_commitment_signed_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_decoded_onion_error_packet_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_error_message_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_funding_created_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_funding_locked_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_funding_signed_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_gossip_timestamp_filter_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_init_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}
12 changes: 10 additions & 2 deletions fuzz/src/bin/msg_node_announcement_target.rs
Expand Up @@ -93,10 +93,18 @@ fn run_test_cases() {
}
}
}
let mut failed_outputs = Vec::new();
for (test, thread) in threads.drain(..) {
if let Some(output) = thread.join().unwrap() {
println!("Output of {}:\n{}", test, output);
panic!();
println!("\nOutput of {}:\n{}\n", test, output);
failed_outputs.push(test);
}
}
if !failed_outputs.is_empty() {
println!("Test cases which failed: ");
for case in failed_outputs {
println!("{}", case);
}
panic!();
}
}