Skip to content

Remove generic Signer parameter where it can be inferred from KeysInterface #1806

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

Conversation

arik-so
Copy link
Contributor

@arik-so arik-so commented Oct 26, 2022

No description provided.

@arik-so arik-so force-pushed the 2022-10-background-processor-deparametrization branch from e5724a5 to d8082ad Compare October 27, 2022 01:55
@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2022

Codecov Report

Base: 90.72% // Head: 90.68% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (29f4cab) compared to base (2e343e7).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1806      +/-   ##
==========================================
- Coverage   90.72%   90.68%   -0.04%     
==========================================
  Files          87       87              
  Lines       47364    47364              
  Branches    47364    47364              
==========================================
- Hits        42970    42953      -17     
- Misses       4394     4411      +17     
Impacted Files Coverage Δ
lightning-background-processor/src/lib.rs 96.23% <ø> (ø)
lightning-block-sync/src/init.rs 90.90% <ø> (ø)
lightning/src/ln/channel.rs 88.67% <ø> (ø)
lightning/src/onion_message/functional_tests.rs 95.48% <ø> (ø)
lightning/src/onion_message/messenger.rs 89.95% <ø> (ø)
lightning/src/util/events.rs 38.13% <ø> (ø)
lightning/src/util/persist.rs 95.23% <ø> (ø)
lightning-invoice/src/utils.rs 94.43% <100.00%> (-0.75%) ⬇️
lightning-persister/src/lib.rs 93.45% <100.00%> (ø)
lightning/src/chain/channelmonitor.rs 90.65% <100.00%> (-0.06%) ⬇️
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@arik-so arik-so marked this pull request as ready for review October 27, 2022 03:55
@@ -61,16 +61,16 @@ BlockSourceResult<ValidatedBlockHeader> where B::Target: BlockSource {
///
/// async fn init_sync<
/// B: BlockSource,
/// K: KeysInterface<Signer = S>,
/// K: KeysInterface,
/// S: keysinterface::Sign,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this can be dropped

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's so odd. This was literally part of my search string; I'm now paranoid that I missed a bunch of other things.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the doc comments threw it off.

Copy link

@ariard ariard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review ACK d8082ad

@@ -381,7 +380,7 @@ pub async fn process_events_async<
OMH: 'static + Deref + Send + Sync,
EH: 'static + EventHandler + Send,
PS: 'static + Deref + Send,
M: 'static + Deref<Target = ChainMonitor<Signer, CF, T, F, L, P>> + Send + Sync,
M: 'static + Deref<Target = ChainMonitor<<K::Target as KeysInterface>::Signer, CF, T, F, L, P>> + Send + Sync,
Copy link
Collaborator

@TheBlueMatt TheBlueMatt Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than moving to a signer here (and on chain::Watch and Persist and....) let's just parameterize those by KeysInterface directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that be part of this PR or in a followup?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you should just do that first - it would substantially reduce churn here, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think there's a big difference between removing Signer from types that were parametrized by both Signer and KeysInterface, and reparametrizing types from Signer to KeysInterface. I'd much prefer to do the latter in a follow-up PR, if possible.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but it's about the same patch size and reduces churn - if we're gonna do it imminently anyway (which I thought was the point?) we should do it in one go because otherwise we're touching the same (sets of) line(s) of code in repeated PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's ok, I'd rather work a bit more on the Taproot refactors first because I'm starting to be a bit less sure if we wanna convert all the instances from using Signer to using KeysInterface. That's why I'd rather get this out of the way first, but not commit to the rest of the refactor yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. This needs rebase, then.

@arik-so arik-so force-pushed the 2022-10-background-processor-deparametrization branch from 29f4cab to 2298c99 Compare November 9, 2022 23:45
jkczyz
jkczyz previously approved these changes Nov 9, 2022
@TheBlueMatt
Copy link
Collaborator

Can you squash the second commit into the first.

@arik-so arik-so force-pushed the 2022-10-background-processor-deparametrization branch from 2298c99 to 1c8a06c Compare November 10, 2022 00:15
@TheBlueMatt TheBlueMatt merged commit 49c9f18 into lightningdevkit:main Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants