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

bkpr-listaccountevents filter by id #7536

Merged

Conversation

michael1011
Copy link
Contributor

@michael1011 michael1011 commented Aug 6, 2024

Closes #7518

It's much nicer to ask the database to filter than getting everything and filtering the output.

time ./cli/lightning-cli --regtest -k bkpr-listaccountevents | grep x 
         "payment_id": "x",

real	0m6,908s
user	0m1,745s
sys	0m0,534s
time ./cli/lightning-cli --regtest -k bkpr-listaccountevents payment_id=x 
{
   "events": [
      {
         "payment_id": "x",
         <omitted data>
      }
   ]
}

real	0m0,074s
user	0m0,002s
sys	0m0,000s

@michael1011 michael1011 changed the title Bkpr listaccountevents bkpr-listaccountevents filter by id Aug 6, 2024
@michael1011 michael1011 force-pushed the bkpr-listaccountevents-id branch 2 times, most recently from 1888d07 to bb32877 Compare August 6, 2024 14:52
Copy link
Collaborator

@niftynei niftynei left a comment

Choose a reason for hiding this comment

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

ACK bb32877

two tiny nits that would be nice to fixup but largely optional imo. i think the CI error is a global/master one?

plugins/bkpr/bookkeeper.c Outdated Show resolved Hide resolved
plugins/bkpr/bookkeeper.c Show resolved Hide resolved
@michael1011
Copy link
Contributor Author

michael1011 commented Aug 7, 2024

Addressed the comments.

i think the CI error is a global/master one?

It seems to me like CI is a little flaky. Let's see if the new commit passes that step

Edit: yes, automagically fixed itself

When you have *lots* of events in your bkpr database looking up a
specific event via calling bkpr-listaccountevents and using jq or
grep to filter gets very slow (and wasteful of CPU and disk resources).
This commit adds the paremeter payment_id to the call to filter for a
specific payment id via a where clause in the request to the database of bkpr.

Changelog-Added: Plugins: Add payment_id parameter to bkpr-listaccountevents to filter events.
@niftynei
Copy link
Collaborator

niftynei commented Aug 7, 2024

ACK 843b72d

@ShahanaFarooqui ShahanaFarooqui added this to the v24.08 milestone Aug 12, 2024
@ShahanaFarooqui ShahanaFarooqui merged commit d32433a into ElementsProject:master Aug 12, 2024
37 checks passed
@michael1011 michael1011 deleted the bkpr-listaccountevents-id branch August 14, 2024 11:10
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.

bkpr - get entries by payment id
3 participants