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

Update nostrdb, switch to local relay model #2121

Draft
wants to merge 116 commits into
base: master
Choose a base branch
from
Draft

Update nostrdb, switch to local relay model #2121

wants to merge 116 commits into from

Commits on Apr 25, 2024

  1. nostrdb/build: fix additional compiler errors

    When trying to build from rust
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    27dcd5f View commit details
    Browse the repository at this point in the history
  2. nostrdb/add "import -"

    Closes: damus-io/nostrdb#21
    Signed-off-by: William Casarin <jb55@jb55.com>
    mattn authored and jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    b669e9f View commit details
    Browse the repository at this point in the history
  3. nostrdb/stream: actually use file pointer in stream api

    Right now it's accidently hardcoded.
    
    Fixes: 8376e5bca05c ("add "import -"")
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    6029db6 View commit details
    Browse the repository at this point in the history
  4. c: move cursor.h to nostrdb subdir

    everything will be in here soon
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f16f71e View commit details
    Browse the repository at this point in the history
  5. nostrdb/api: don't expose many internals, like note

    rust doesn't like packed structures, so hide this from bindgen
    
    This also buttons up the API so less things are exposed which is good.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    a5b0b57 View commit details
    Browse the repository at this point in the history
  6. nostrdb/cursor: fix warning that build.rs is complaining about

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    beb1ee6 View commit details
    Browse the repository at this point in the history
  7. nostrdb/rust: initial api for Ndb and NdbConfig

    This is the start of our rust library for nostrdb. Implement idiomatic
    interfaces for Ndb and NdbConfig.
    
    Changelog-Added: Add initial rust library
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    7fc8003 View commit details
    Browse the repository at this point in the history
  8. nostrdb/build: fix constness on config pointer in ingester thread

    otherwise build fails
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    95e1da2 View commit details
    Browse the repository at this point in the history
  9. nostrdb/re-apply ispunct crash fix

    since it was overwritten when we synced with damus
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    05a23df View commit details
    Browse the repository at this point in the history
  10. c: move compiler to nostrdb dir

    we will be applying a patch here as well
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    8341418 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1e38726 View commit details
    Browse the repository at this point in the history
  12. nostrdb: add supporting files for the bolt11 parser

    A lot of this was pulled from core-lightning. Not sure what is actually
    needed or not.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    778c6ec View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a73eb08 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    47946fb View commit details
    Browse the repository at this point in the history
  15. nostrdb: move everything to src

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    7d4e498 View commit details
    Browse the repository at this point in the history
  16. nostrdb/add initial content parser

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    aecbadd View commit details
    Browse the repository at this point in the history
  17. nostrdb/add libnostrdb.a

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    027b505 View commit details
    Browse the repository at this point in the history
  18. nostrdb/cursor: re-apply infinite loop bug fix

    since I keep overwriting it by accident
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    10b269c View commit details
    Browse the repository at this point in the history
  19. nostrdb/test: disable migrate for now

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    e77553e View commit details
    Browse the repository at this point in the history
  20. nostrdb/varint: switch to 64 bit varints

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    dd89947 View commit details
    Browse the repository at this point in the history
  21. nostrdb/fix build

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    0853163 View commit details
    Browse the repository at this point in the history
  22. nostrdb/fix github action

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    2531744 View commit details
    Browse the repository at this point in the history
  23. nostrdb/make: cleanup a bit, separate bench running

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    add2802 View commit details
    Browse the repository at this point in the history
  24. nostrdb/block: add bolt11 invoice encoding/decoding

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    782bfba View commit details
    Browse the repository at this point in the history
  25. nostrdb/bech32: retab

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    8fd8e91 View commit details
    Browse the repository at this point in the history
  26. nostrdb/nostr_bech32: only parse up to raw bech32 buffers

    We will be storing raw nostr bech32 buffers directly into nostrdb, so
    adapt our bech32 code to reflect this.
    
    When doing our content parsing pass, we will only look for strings and we
    won't allocate any intermediate buffers. Only when we write this string
    block to nostrdb will we actually allocate in our nostrdb output buffer
    (no mallocs!)
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    dde2832 View commit details
    Browse the repository at this point in the history
  27. nostrdb/cursor: add malloc_slice

    This is the same as cursor_slice except we don't memset afterwards
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    67bf632 View commit details
    Browse the repository at this point in the history
  28. nostrdb/cursor: add pull_varint_u32

    This is a varint helper that doesn't pull larger than uint32
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    777f8bb View commit details
    Browse the repository at this point in the history
  29. nostrdb/cursor: fix empty string pushing in push_c_str

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    c4ad3f9 View commit details
    Browse the repository at this point in the history
  30. nostrdb/cursor: fix some warnings

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ea4dbb7 View commit details
    Browse the repository at this point in the history
  31. nostrdb/cursor: add align function

    handy function for padding buffers to some byte alignment
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    71b5b1f View commit details
    Browse the repository at this point in the history
  32. nostrdb/search: switch to cursor_align function

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    b2dc6b6 View commit details
    Browse the repository at this point in the history
  33. nostrdb/Inital embedded content parser

    This adds some initial code for nostrdb content parsing.
    
    We still need to write tests for encoding and decoding, so this is
    likely not working yet.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    2bc4818 View commit details
    Browse the repository at this point in the history
  34. nostrdb/nostr_bech32: parse in one pass

    since we will be decoding these in realtime, let's make sure we can
    decode them in O(1)
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    0886f99 View commit details
    Browse the repository at this point in the history
  35. nostrdb/bech32: add some initial tests

    since we modified this recently, let's add some tests to make sure
    we didn't break anything
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    c3e06ee View commit details
    Browse the repository at this point in the history
  36. nostrdb/content_parser: add initial db decoders

    We need to pull the data out as well! Let's add some initial decoders.
    We still need tests to make sure it's working.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    c2e3571 View commit details
    Browse the repository at this point in the history
  37. nostrdb/parser: handle period at end of url

    Fix parsing URL when encountering a period at the end of the url by
    setting it as disallowed from being present at the end of a
    URL.
    
    Some characters are disallowed to be present at the end of URLs.
    Presently, the period character is the only disallowed character.
    A character is the last character in the URL if it is followed by
    is_whitespace() or if it's the last character in the string.
    
    Signed-off-by: kernelkind <kernelkind@gmail.com>
    Tested-by: William Casarin <jb55@jb55.com>
    Signed-off-by: William Casarin <jb55@jb5.com>
    Signed-off-by: William Casarin <jb55@jb55.com>
    kernelkind authored and jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    320e89b View commit details
    Browse the repository at this point in the history
  38. nostrdb/blocks: add note block iterator

    This adds an api that walks along and pulls compact note block data out of
    nostrdb.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    2a61fcf View commit details
    Browse the repository at this point in the history
  39. nostrdb/bech32: fix big in bech32 size parsing

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    411d17b View commit details
    Browse the repository at this point in the history
  40. nostrdb/parser: fix bech32 block decoding

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    dd04f85 View commit details
    Browse the repository at this point in the history
  41. nostrdb/invoice: fix crash in any-amount invoice parsing

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    aa0ca83 View commit details
    Browse the repository at this point in the history
  42. nostrdb/header: move bech32 around

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ba89629 View commit details
    Browse the repository at this point in the history
  43. nostrdb/blocks: add total_size

    Fix this mistake that we have with ndb_notes where we don't know the
    total size of the object
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    7c426a9 View commit details
    Browse the repository at this point in the history
  44. nostrdb/blocks: add ndb_blocks_free

    In some situations we will need to have owned note blocks. For
    example, when we try to fetch note blocks from the database and it's not
    there yet. We will need to parse the content on the spot and return an
    owned copy, since it will not be immediately available in the database.
    
    Add a new flag field to note blocks that lets us know if it's owned by
    malloc or nostrdb.
    
    We the add a free function that checks this flag and frees the object if
    its set. If it is not set then it doesn nothing because it likely came
    from the database.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    2c20662 View commit details
    Browse the repository at this point in the history
  45. nostrdb/blocks: actually set the note block version

    Version 1 to start
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    e410559 View commit details
    Browse the repository at this point in the history
  46. nostrdb/blocks: write note blocks on ingest

    When ingesting notes, parse text/longform contents and store them in nostrdb.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    e78958e View commit details
    Browse the repository at this point in the history
  47. nostrdb/blocks: expose block iterator internals

    so we don't need heap allocation. we will be calling this a lot in tight
    render loops, we don't want to be allocating on each frame.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f545be7 View commit details
    Browse the repository at this point in the history
  48. nostrdb/fix clang compile issue

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    2749cc8 View commit details
    Browse the repository at this point in the history
  49. nostrdb/fix: don't write the owned flag to the DB

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    cec3f27 View commit details
    Browse the repository at this point in the history
  50. nostrdb/blocks: add ndb_blocks_flags function

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    254097d View commit details
    Browse the repository at this point in the history
  51. nostrdb/disable lmdb download

    since we have this committed now
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    4d66214 View commit details
    Browse the repository at this point in the history
  52. nostrdb/Initial nostrdb relay subscriptions

    This adds some initial code for the nostrdb relay subscription monitor.
    
    When new notes are written to the database, they are checked against
    active subscriptions. If any of the subscriptions are matched, the note
    primary key is written to the inbox queue for that subscription.
    
    We also add an ndb_wait_for_notes() method that simply waits for notes
    to be written by the subscription monitor.
    
    Changelog-Added: Added filter subscriptions
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    22b0d8f View commit details
    Browse the repository at this point in the history
  53. nostrdb/test: switch reaction test to use subscriptions

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ce939fe View commit details
    Browse the repository at this point in the history
  54. nostrdb/search: don't enforce sequential tokens

    This makes it a bit more flexible, but maybe we can add quoting in the
    future that re-enables this. Or maybe a search option
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    b7897ef View commit details
    Browse the repository at this point in the history
  55. nostrdb/subs: subs and monitor cleanup

    We need to free these resources when we're done with them.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    0fa757f View commit details
    Browse the repository at this point in the history
  56. nostrdb/filters: add ndb_filter_group_init function

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    d38c07d View commit details
    Browse the repository at this point in the history
  57. nostrdb/debug: add a few more debug statement

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    1279c79 View commit details
    Browse the repository at this point in the history
  58. nostrdb/subs: notify on profile notes as well

    We missed this in the original subscription code
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    6f55b2f View commit details
    Browse the repository at this point in the history
  59. nostrdb/subs: always fail when calling wait_for_notes on a subid of 0

    this is an invalid subscription id
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    6be340e View commit details
    Browse the repository at this point in the history
  60. nostrdb/filter: sort filter elements

    If they are sorted we can do binary search when matching filters like
    how strfry does it.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    07921c2 View commit details
    Browse the repository at this point in the history
  61. nostrdb/filter: use binary search for large contact list filters

    This is much more efficient than linear scans
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    52236c6 View commit details
    Browse the repository at this point in the history
  62. nostrdb/filters: remove ndb_filter_group from public API

    We can just use a list of filters instead when subscribing
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    1d8a304 View commit details
    Browse the repository at this point in the history
  63. nostrdb/ocd: small cleanup

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    a3b5cb0 View commit details
    Browse the repository at this point in the history
  64. nostrdb/filter: don't allow adding id elements on kinds

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    9abacaa View commit details
    Browse the repository at this point in the history
  65. nostrdb/cursor: remove old array code

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    d0f52aa View commit details
    Browse the repository at this point in the history
  66. nostrdb/query: extract ndb_cursor_start

    This is useful for positioning LMDB cursors at the start of a query. We
    will be re-using this in the upcoming query code
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    d024dcb View commit details
    Browse the repository at this point in the history
  67. nostrdb/cursor: fix bug when pushing last element

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    92e0f35 View commit details
    Browse the repository at this point in the history
  68. nostrdb/Initial nostrdb queries

    Still a lot more work to do, but this is at least a proof of concept for
    querying nostrdb using filters.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    12b0228 View commit details
    Browse the repository at this point in the history
  69. nostrdb/query: implement kind queries

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    c556a14 View commit details
    Browse the repository at this point in the history
  70. nostrdb/Fix typos

    Closes: damus-io/nostrdb#25
    Signed-off-by: William Casarin <jb55@jb55.com>
    shuoer86 authored and jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    05eaa7a View commit details
    Browse the repository at this point in the history
  71. nostrdb/debug: add print_kind_keys helper

    I needed this for debugging kind queries
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f6fcf47 View commit details
    Browse the repository at this point in the history
  72. nostrdb/cleanup: remove old dbscan stuff

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ea18168 View commit details
    Browse the repository at this point in the history
  73. nostrdb/filter: rename FILTER_GENERIC to FILTER_TAG

    it's a bit more intuitive
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    960ebdb View commit details
    Browse the repository at this point in the history
  74. nostrdb/index: make sure kind index is DUPSORT + INTEGERDUP

    We will probably need a migration for this?
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    325932c View commit details
    Browse the repository at this point in the history
  75. nostrdb/Query Plans

    Instead of running queries off filters directly, we do some simple
    heuristics and determine a reasonable query plan for the given filter.
    
    To test this, also add a kind index query plan and add a test for it.
    
    We still need tag, author, and created_at index scans. This is up next!
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    24ceb18 View commit details
    Browse the repository at this point in the history
  76. nostrdb/ndb: add inital query command

    still very early, but works for kinds!
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    56e95d3 View commit details
    Browse the repository at this point in the history
  77. nostrdb/query: support until for kind query plans

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    817a962 View commit details
    Browse the repository at this point in the history
  78. nostrdb/ndb: measure query performance

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    9275ebe View commit details
    Browse the repository at this point in the history
  79. nostrdb/fix macos build

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ce88bf5 View commit details
    Browse the repository at this point in the history
  80. nostrdb/perf: add some flamegraph helpers to makefile

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    a2c5588 View commit details
    Browse the repository at this point in the history
  81. nostrdb/filter: don't end field if we don't have one active

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    81959b2 View commit details
    Browse the repository at this point in the history
  82. nostrdb/query: add tag index and tag queries

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    dbe58e8 View commit details
    Browse the repository at this point in the history
  83. nostrdb/tce: add AUTH to-client-event

    This was committed to damus, but this should be in nostrdb or else we
    will lose it when we update.
    
    Damus: 84cfeb1 ("nip42: add initial relay auth support")
    Link: https://groups.google.com/a/damus.io/g/patches/c/Zx3dk01e0yg/m/t59TsVkXAQAJ
    Signed-off-by: Charlie Fish <contact@charlie.fish>
    Signed-off-by: William Casarin <jb55@jb55.com>
    fishcharlie authored and jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    06cff81 View commit details
    Browse the repository at this point in the history
  84. nostrdb: strblock: add typedef

    I don't technically need this but it helps a lot on the swift side
    of things since I already have code that uses this identifier of a
    similar structure
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    77f199c View commit details
    Browse the repository at this point in the history
  85. nostrdb: header: add ptr helpers for swift

    swift is kind of dumb when it comes to opaque pointers
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ac38513 View commit details
    Browse the repository at this point in the history
  86. nostrdb: blocks: add word count interface

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    c492490 View commit details
    Browse the repository at this point in the history
  87. nostrdb: tce: fix build for previous TCE change

    Fixes: 34093cd ("tce: add AUTH to-client-event")
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    5fbb654 View commit details
    Browse the repository at this point in the history
  88. nostrdb: port kernelkind's to the new bech32 parser

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    624fc38 View commit details
    Browse the repository at this point in the history
  89. nostrdb: queue: switch to prot_queue_try_pop_all

    This allows you to `try pop` multiple items instead of 1
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    5d332c3 View commit details
    Browse the repository at this point in the history
  90. nostrdb: ndb: add ndb_poll_for_notes

    The polling variant of ndb_wait_for_notes. This makes more sense for
    realtime apps like notedeck
    
    Changelog-Added: Add ndb_poll_for_notes
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    cba051b View commit details
    Browse the repository at this point in the history
  91. nostrdb: filters: copy filter metadata into subscription

    This fixes a few ownership issues
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ec30d07 View commit details
    Browse the repository at this point in the history
  92. nostrdb: silence annoying debug

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    78e86cc View commit details
    Browse the repository at this point in the history
  93. nostrdb: return number of items popped when polling

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    6d12e70 View commit details
    Browse the repository at this point in the history
  94. nostrdb: query: include note size in query results

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f13974f View commit details
    Browse the repository at this point in the history
  95. nostrdb: filter: add ndb_filter_end

    This is a pretty scary looking function that realloc our large variable
    filter buffer into a compact one. This saves up a bunch of memory when
    we are done building the filter.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    3e53178 View commit details
    Browse the repository at this point in the history
  96. nostrdb: filter: use relative data offsets for easy cloning

    Instead of storing exact pointers inside of our filter elements, just
    store offsets. This will allow us to clone filters very easily without
    having to mess around with fixing up the pointers afterwards.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f95dcb2 View commit details
    Browse the repository at this point in the history
  97. nostrdb: filter: add ndb_filter_clone

    Clone filters when moving them into subscriptions. This will allow us to
    fix the double free issue on the rust side.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    6e35d8c View commit details
    Browse the repository at this point in the history
  98. nostrdb: filter: make sure to return clone errors

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    99b3a65 View commit details
    Browse the repository at this point in the history
  99. nostrdb: filter: make sure clone copies metadata

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    3b1475b View commit details
    Browse the repository at this point in the history
  100. nostrdb: random: add getrandom fallback for android

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    2d61b86 View commit details
    Browse the repository at this point in the history
  101. nostrdb: fix a few note size compile issues

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    b7a432c View commit details
    Browse the repository at this point in the history
  102. nostrdb: cores: just set to 2 on unknown platforms

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    96b46fa View commit details
    Browse the repository at this point in the history
  103. nostrdb: plan: add created_at query plan

    This introduces the basic created_at query plan. We scan the created_at
    + id index in descending order looking for items that match a filter.
    This is a very general query plan, but might not be very efficient for
    anything other than local timelines.
    
    Changelog-Added: Add general created_at query plan for timelines
    Closes: damus-io/nostrdb#26
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    1d3b6ae View commit details
    Browse the repository at this point in the history
  104. nostrdb: plan: use a less efficient plan for author query plans

    This is less efficient for now but we don't have a small-author-list
    query plan yet.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    d24f1d4 View commit details
    Browse the repository at this point in the history
  105. nostrdb: fix dubious looking parens logic

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    6ad8cef View commit details
    Browse the repository at this point in the history
  106. nostrdb: build: fix compile warning

    A small size_t/uint64 conversion issue
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    e1a105f View commit details
    Browse the repository at this point in the history
  107. nostrdb: add ability to register a subscription callback

    Since Damus iOS is not an immediate-mode UI like android, we would
    rather not poll for results. Instead we need a way to register a
    callback function that is called when we get new subscription results.
    
    This is also useful on the android side, allowing us to request a new
    frame to draw when we have new results, instead of drawing every second.
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    dcdf3d0 View commit details
    Browse the repository at this point in the history
  108. c: re-add damus-only C stuff

    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    ab89ffc View commit details
    Browse the repository at this point in the history
  109. c: remove some unused files from project

    some binding dir stoppers, and configurator
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    8cabe79 View commit details
    Browse the repository at this point in the history
  110. optimized id matching function

    doesn't need to create a copy of the id
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    41a864c View commit details
    Browse the repository at this point in the history
  111. Switch over to use use blocks from nostrdb

    This is still kind of broken until queries are switched over to nostrdb.
    Will do this next
    
    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    265f7ba View commit details
    Browse the repository at this point in the history
  112. Fix relay compile issue

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    d5c6f3d View commit details
    Browse the repository at this point in the history
  113. ndb: add subscription callback initializers

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    656d6c3 View commit details
    Browse the repository at this point in the history
  114. test: fix broken tests

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f81182d View commit details
    Browse the repository at this point in the history
  115. REMOVEME: add assert to catch potential bug

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    d0b449c View commit details
    Browse the repository at this point in the history
  116. wip local relay model

    Signed-off-by: William Casarin <jb55@jb55.com>
    jb55 committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    c476272 View commit details
    Browse the repository at this point in the history