Repository navigation
Conversation
External signer enumeration currently stops when it sees a duplicate fingerprint, so later unique signer entries are not reported. Add coverage for that behavior before changing duplicate handling from stopping enumeration to skipping one entry.
The code says duplicate signer entries are skipped, but it currently breaks out of enumeration at the first duplicate and can hide later unique signers. Use `continue`, so the implementation matches the comment: only the duplicate entry is skipped and later entries still reach the caller. This does not change error handling. A duplicate entry that reports an error before the duplicate check is still reported as an error.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35233. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste |
|
tACK d543f8b Ran the test and did some manual mutation testing to confirm it catches regressions:
|
|
This probably makes sense. @achow101 do you remember under what circumstances HWI returns duplicate signers? |
It should never have duplicates. |
|
@achow101 I vaguely remember something like finding the same device via two different transports. |
|
ACK d543f8b I'm confused why, in the first commit, you added a broken test to fix it in the next commit instead of just a single commit. But I guess it does make sense to have some coverage for enumerating duplicate signers if we ever end up rolling back this change. |
To document the current behavior, so that the next commit shows exactly what changed compared to the current behavior. A single commit would only show the behavior after the fix. |
|
I'll close this one to allow new contributors to continue: #35251 |
Problem
ExternalSigner::Enumerate()says it skips duplicate signers, but the current control flow stops enumeration when it finds the first duplicate fingerprint.This can hide later unique signer entries returned by the same
enumeratecall.Fix
Use
continueinstead ofbreakfor duplicate signer entries, so only the duplicate entry is skipped and later entries are still processed.This does not change error handling: if an enumerate entry reports an error before it reaches the duplicate check, the RPC still reports that error.
Test
The functional test now covers an enumerate result containing one signer, a duplicate of that signer, and a later unique signer.