Skip to content

bkpr-listaccountevents filter by id#7536

Merged
ShahanaFarooqui merged 2 commits intoElementsProject:masterfrom
michael1011:bkpr-listaccountevents-id
Aug 12, 2024
Merged

bkpr-listaccountevents filter by id#7536
ShahanaFarooqui merged 2 commits intoElementsProject:masterfrom
michael1011:bkpr-listaccountevents-id

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 requested a review from cdecker as a code owner August 6, 2024 13:01
@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?

@michael1011 michael1011 force-pushed the bkpr-listaccountevents-id branch from bb32877 to a376950 Compare August 7, 2024 11:51
@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.
@michael1011 michael1011 force-pushed the bkpr-listaccountevents-id branch from a376950 to 843b72d Compare August 7, 2024 12:48
@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
@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