Repository navigation
smite-scenarios: simplify channel_ready key-reuse tests - #291
Merged
Merged
Conversation
erickcestari
approved these changes
Oct 16, 2026
Comment on lines
+1692
to
1696
| // The target's `channel_ready` reuses a static pubkey it revealed in its | ||
| // `accept_channel`. | ||
| let accept_channel = funded_accept_channel(); | ||
| let reused = accept_channel.funding_pubkey; | ||
|
|
Member
There was a problem hiding this comment.
nit:
These changes made this mutant alive:
diff --git a/smite-scenarios/src/executor.rs b/smite-scenarios/src/executor.rs
--- a/smite-scenarios/src/executor.rs
+++ b/smite-scenarios/src/executor.rs
@@ -1444,7 +1444,7 @@ fn record_recv_accept_channel(
let channel = accept_channel.temporary_channel_id;
// Static pubkeys may recur across channels, so keep the first origin.
- for (field, pubkey) in accept_channel.static_pubkeys() {
+ for (field, pubkey) in accept_channel.static_pubkeys().into_iter().take(1) {
revealed_pubkeys
.entry(pubkey)
.or_insert(KeyOrigin::TargetStatic { channel, field });
Suggested change
| // The target's `channel_ready` reuses a static pubkey it revealed in its | |
| // `accept_channel`. | |
| let accept_channel = funded_accept_channel(); | |
| let reused = accept_channel.funding_pubkey; | |
| // The target's `channel_ready` reuses a static pubkey it revealed in its | |
| // `accept_channel`. A distinct key in a non-first field shows every static | |
| // pubkey is recorded, not just `funding_pubkey`. | |
| let accept_channel = AcceptChannel { | |
| delayed_payment_basepoint: sample_pubkey(11), | |
| ..funded_accept_channel() | |
| }; | |
| let reused = accept_channel.delayed_payment_basepoint; |
morehouse
force-pushed
the
simplify_key_reuse_tests
branch
from
October 16, 2026 21:06
1654cf4 to
a106656
Compare
The injected funding negotiation used a hand-built PendingChannel that AcceptChannelOracle would reject: - neither message had a channel_type - the acceptor's first_per_commitment_point matched its static pubkeys As a result, we couldn't actually create the same negotiation without injecting it. Since we want to move away from injecting negotiations, change the problematic parameters to pass the oracle. Additionally, give the PendingChannel messages their own helper functions so that they can be used in programs too.
Now that we have funded_open_channel() and funded_accept_channel() helpers that can be used in programs, we can drop the unnecessary injected negotiation from the channel_ready key-reuse tests.
morehouse
force-pushed
the
simplify_key_reuse_tests
branch
from
October 16, 2026 21:28
a106656 to
714ad7d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The two tests had an unnecessary injected negotiation that was only there because we weren't able to use the actual
open_channelandaccept_channelmessages from the negotiation on the wire.Addresses #260 (comment).
Depends on #288.