Skip to content

Latest commit

 

History

History
831 lines (712 loc) · 47.6 KB

CHANGELOG.md

File metadata and controls

831 lines (712 loc) · 47.6 KB

Changelog

Summary

Add support to NIP17 relay list in SDK (when gossip option is enabled), add NIP22 and NIP73 support, fix Swift Package, many performance improvements and bug fixes and more!

From this release all the rust features are be disabled by default (except std feature in nostr crate).

Breaking changes

  • Use RelayUrl struct instead of Url for relay urls (Yuki Kishimoto)
  • nostr: change EventBuilder::gift_wrap (and linked methods) args to take extra_tags instead of expiration (erskingardner)
  • nostr: change EventBuilder::gift_wrap (and linked methods) args to take an EventBuilder rumor instead of UnsignedEvent (Yuki Kishimoto)
  • nostr: change EventBuilder::private_msg_rumor arg to take extra_tags instead of reply_to (Yuki Kishimoto)
  • nostr: remove tags arg from EventBuilder::new (Yuki Kishimoto)
  • nostr: remove tags arg from EventBuilder::text_note (Yuki Kishimoto)
  • nostr: remove tags arg from EventBuilder::long_form_text_note (Yuki Kishimoto)
  • nostr: remove tags arg from EventBuilder::job_request (Yuki Kishimoto)
  • nostr: disable all default features except std (Yuki Kishimoto)
  • nostr: change Timestamp::to_human_datetime method signature (Yuki Kishimoto)
  • nostr: change Tag::parse arg from slice to iterator (Yuki Kishimoto)
  • nostr: change TagStandard::Relay variant inner type (Yuki Kishimoto)
  • nostr: remove UncheckedUrl struct (Yuki Kishimoto)
  • nostr: update NostrConnectURI::relays to return slice (Yuki Kishimoto)
  • nostr: update NostrConnectURI::secret to return string slice (Yuki Kishimoto)
  • nostr: remove -Params and -Result suffix from NIP47 structs (Yuki Kishimoto)
  • pool: switch from async to sync message sending for Relay (Yuki Kishimoto)
  • connect: refactor NostrConnectRemoteSigner to use distinct keys for signer and user (Yuki Kishimoto)
  • connect: refactor NostrConnectRemoteSigner to use synchronous constructors (Yuki Kishimoto)
  • nwc: update NWC::pay_invoice method signature (Yuki Kishimoto)
  • sdk: disable all default features (Yuki Kishimoto)
  • sdk: set Client::from_builder as private (Yuki Kishimoto)
  • ffi: convert NostrSigner trait to an object (Yuki Kishimoto)
  • ffi: remove NostrConnectURI::as_string (Yuki Kishimoto)

Changed

Added

Fixed

  • nostr: fix TagStandard de/serialization unit tests (Yuki Kishimoto)
  • nostr: fix NIP90 kind ranges (Janek)
  • pool: fix relay can't manually connect if reconnection is disabled (Yuki Kishimoto)
  • pool: fix reconnect loop not break if relay is disconnected while calling Relay::disconnect (Yuki Kishimoto)

Removed

Deprecated

Summary

Many, many improvements to Relay and RelayPool performance (reduced atomic operations and switched to async concurrency), add NostrSigner trait, better methods and struct names (fetch_events instead of get_events_of, sync instead of reconcile, NostrConnect instead of Nip46Signer and so on), add LocalRelay and allow to easily serve it as hidden onion service with the embedded tor client, allow to keep track of negentropy sync progress, almost halved the weight of JavaScript SDK bindings (from ~6.3MB to ~3.6MB), some fixes and many more!

Note for Python, Kotlin, Swift and JavaScript devs: unfortunately I can't mark things as deprecated in bindings, so this release have many breaking changes, sorry :( Note for devs who are using nostr-protocol (Python), org.rust-nostr:nostr (Kotlin), nostr-swift (Swift) or @rust-nostr/nostr (JavaScript) libraries: these packages are now deprecated. Only the nostr-sdk library will be released, which include everything that was in the nostr library.

Changed

  • Bump toolchain channel to 1.82.0
  • Convert nostr-signer crate to nostr-connect (Yuki Kishimoto)
  • nostr: move TagsIndexes into Tags struct (Yuki Kishimoto)
  • nostr: use OnceCell implementation from std lib instead of once_cell (Yuki Kishimoto)
  • nostr: remove redundant public key from repost events (Yuki Kishimoto)
  • nostr: change impl Ord for Event behaviour (descending order instead of ascending) (Yuki Kishimoto)
  • nostr: change TagStandard::Relays variant value from Vec<UncheckedUrl> to Vec<Url> (Yuki Kishimoto)
  • nostr: reserve capacity for tags when POW is enabled in EventBuilder (Yuki Kishimoto)
  • nostr: add sign, sign_with_keys, sign_with_ctx, build and build_with_supplier methods to EventBuilder (Yuki Kishimoto)
  • nostr: deprecate to_event, to_event_with_ctx and to_unsigned_event methods (Yuki Kishimoto)
  • relay-builder: refactor Session::check_rate_limit method (Yuki Kishimoto)
  • relay-builder: return error if event was deleted (Yuki Kishimoto)
  • pool: changes in RelayPool::remove_relay behavior (Yuki Kishimoto)
  • pool: allow multi-filter reconciliation (Yuki Kishimoto)
  • pool: increase negentropy frame size limit to 60_000 (Yuki Kishimoto)
  • pool: set default max relay message size to 5MB (Yuki Kishimoto)
  • pool: return error when receive RelayNotification::Shutdown variant (Yuki Kishimoto)
  • pool: rename NegentropyOptions and NegentropyDirection to SyncOptions and SyncDirection (Yuki Kishimoto)
  • pool: join futures instead of spawning threads in RelayPool methods (Yuki Kishimoto)
  • pool: reduce overhead by maintaining only one atomic reference count for RelayConnectionStats and RelayFiltering structs (Yuki Kishimoto)
  • pool: switch to atomic operations for RelayStatus (Yuki Kishimoto)
  • pool: replace RwLock with OnceCell for external_notification_sender (Yuki Kishimoto)
  • pool: convert InternalRelay::send_notification and linked methods to sync (Yuki Kishimoto)
  • pool: avoid RelayNotification cloning when not needed in InternalRelay::send_notification (Yuki Kishimoto)
  • pool: avoid full InnerRelay clone when requesting NIP11 document (Yuki Kishimoto)
  • pool: rework relay connection methods and auto-connection logic (Yuki Kishimoto)
  • pool: increase MAX_ADJ_RETRY_SEC to 120 secs (Yuki Kishimoto)
  • pool: return reference instead of cloned structs for some getter methods of Relay and RelayPool (Yuki Kishimoto)
  • pool: removed unnecessary timeout during the shutdown notification process (Yuki Kishimoto)
  • pool: deprecate RelaySendOptions::skip_disconnected (Yuki Kishimoto)
  • pool: deprecate RelayConnectionStats::uptime (Yuki Kishimoto)
  • pool: better error for health check if relay status is Initialized (Yuki Kishimoto)
  • pool: connect in chunks if too many relays (Yuki Kishimoto)
  • pool: dynamic channel size for streaming of events (Yuki Kishimoto)
  • pool: allow to define a limit of relays allowed in RelayPool (Yuki Kishimoto)
  • pool: refactor Relay::batch_event and Relay::auth (Yuki Kishimoto)
  • pool: deprecate RelaySendOptions (Yuki Kishimoto)
  • sdk: deprecate Client::get_events_of and Client::get_events_from methods (Yuki Kishimoto)
  • sdk: use Events instead of Vec<Event> in fetch and query methods (Yuki Kishimoto)
  • sdk: rename stream_events_of to stream_events (Yuki Kishimoto)
  • sdk: deprecate Client::reconcile and Client::reconcile_with (Yuki Kishimoto)
  • sdk: use by default tor for onion relays if tor feature is enabled on non-mobile targets (Yuki Kishimoto)
  • sdk: return reference to RelayPool instead of clone in Client:pool (Yuki Kishimoto)
  • sdk: immediately return error if gossip filters are empty (Yuki Kishimoto)
  • signer: auto enable nip44 feature if nip59 is enabled (Yuki Kishimoto)
  • connect: rename Nip46Signer to NostrConnect (Yuki Kishimoto)
  • database: improve BTreeCappedSet (Yuki Kishimoto)
  • database: not save invalid event deletion (Yuki Kishimoto)
  • lmdb: not save event deletion (Yuki Kishimoto)
  • lmdb: return iterator instead of vector in Lmdb::single_filter_query (Yuki Kishimoto)
  • lmdb: mark event as deleted only if database have the target event (Yuki Kishimoto)
  • signer: bootstrap NIP46 signer on demand (Yuki Kishimoto)
  • bindings(nostr): adj. tag module (Yuki Kishimoto)
  • ffi: merge nostr-ffi in nostr-sdk-ffi (Yuki Kishimoto)
  • js: merge nostr-js into nostr-sdk-js (Yuki Kishimoto)
  • js: change opt-level to z (Yuki Kishimoto)

Added

Fixed

  • nostr: adj. NostrConnectURI de/serialization according to NIP46 (Yuki Kishimoto)
  • connect: fix NostrConnect according to NIP46
  • lmdb: add missing commit method call in Store::delete (Yuki Kishimoto)
  • lmdb: fix unit tests (Yuki Kishimoto)
  • lmdb: fix Store::save_event issues (Yuki Kishimoto)
  • sdk: fix filters empty error when gossip option is enabled (Yuki Kishimoto)

Removed

Summary

Add gossip model support, deprecate SQLite database in favor of LMDB (fork of pocket database), add support to negentropy v1 (old version is still supported!), add MockRelay (a local disposable relay for tests), allow usage of embedded tor client on mobile devices, many improvements, bugs fix and more!

Changed

Added

Fixed

Removed

Summary

Add embedded tor client support, allow to open databases with a limited capacity (automatically discard old events when max capacity is reached), add Client::stream_events_of as alternative method to Client::get_events_of (stream events instead of waiting for EOSE and collect into a list), add search capability (NIP50) support to Filter::match_event and databases, add NIP31 and NIP70 support, add option to autoconnect relay on Client::add_relay method call (currently disabled by default), rework the get_events_of methods behaviour for better consistency (RelayPool::get_events_of and Relay::get_events_of get events only from remote relay/s while Client::get_events_of allow to choose the source of events: database, relays or both), bugs fix and more!

Changed

  • Bump MSRV to v1.70.0 (Yuki Kishimoto)
  • Bump toolchain channel to 1.80.1 (Yuki Kishimoto)
  • nostr: deprecate Event::author_ref and Event::iter_tags (Yuki Kishimoto)
  • nostr: calculate EventId in EventBuilder::to_unsigned_event_with_supplier (Yuki Kishimoto)
  • nostr: ensure that NIP59 rumor has EventId (Yuki Kishimoto)
  • nostr: update PartialEvent methods (Yuki Kishimoto)
  • nostr: change EventBuilder::award_badge fingerprint (Yuki Kishimoto)
  • nostr: add NIP50 support to Filter::match_event method (Yuki Kishimoto)
  • nostr: remove Arc<T> from OnceCell<T> in Event and Tag (Yuki Kishimoto)
  • nostr: move sig field from PartialEvent to MissingPartialEvent (Yuki Kishimoto)
  • nostr: better Debug trait impl for EventId, PublicKey and Tag (Yuki Kishimoto)
  • nostr: improve SubscriptionId::generate_with_rng (Yuki Kishimoto)
  • pool: take mutex ownership instead of clone in InternalRelayPool::get_events_from (Yuki Kishimoto)
  • pool: remove IDs collection from InternalRelayPool::get_events_from (Yuki Kishimoto)
  • pool: better checks before perform queries or send messages to relays (Yuki Kishimoto)
  • pool: bump async-wsocket to v0.7 (Yuki Kishimoto)
  • pool: get events only from remote relay when calling get_events_of or get_events_from (Yuki Kishimoto)
  • database: avoid to copy EventId in Event::decode (Yuki Kishimoto)
  • database: use Vec instead of BTreeSet as inner value for TagIndexValues (Yuki Kishimoto)
  • database: rework DatabaseIndexes and rename to DatabaseHelper (Yuki Kishimoto)
  • database: allow to set max capacity to DatabaseHelper (Yuki Kishimoto)
  • database: speedup helper bulk load (Yuki Kishimoto)
  • database: set a default logic for NostrDatabase::negentropy_items (Yuki Kishimoto)
  • sdk: rename Proxy and ProxyTarget to Connection and ConnectionTarget (Yuki Kishimoto)
  • sdk: allow to skip slow relays (Yuki Kishimoto)
  • sdk: allow to specify the source of events for Client::get_events_of method (Yuki Kishimoto)
  • sdk: deprecate Client::get_events_of_with_opts (Yuki Kishimoto)
  • sqlite: use ValueRef instead of owned one (Yuki Kishimoto)
  • cli: improve sync command (Yuki Kishimoto)
  • cli: allow to specify relays in open command (Yuki Kishimoto)

Added

Fixed

  • pool: fix Event notification variant sent also for events sent by the SDK (Yuki Kishimoto)
  • database: fix indexes QueryPattern (Yuki Kishimoto)
  • database: fix query issue due to wrong tag value order (Yuki Kishimoto)

Removed

Summary

Better outputs for send/batch/reconcile methods (ex. you can now easily know where a message/event is successfully published and where/why failed), allow to change NIP42 option after client initialization, increase max stack size for JS bindings to prevent "memory access out of bounds" error, expose more objects/methods for JS bindings, dry run option for negentropy reconciliation, get NIP46 relay from NIP05 profile, bug fixes (NIP-42 auth not works correctly, NIP-46 "ACK" message not handled, ...) and more!

Changed

  • Bump uniffi to v0.28.0 (Yuki Kishimoto)
  • nostr: rename NIP-51 EventBuilder set constructors and Kind variants (Yuki Kishimoto)
  • nostr: small adj. to NIP-47 ListTransactionsRequestParams and LookupInvoiceResponseResult structs (Yuki Kishimoto)
  • nostr: add identifier arg to NIP-51 EventBuilder set constructors (Yuki Kishimoto)
  • nostr: change nip65::extract_relay_list fingerprint (Yuki Kishimoto)
  • nostr: avoid allocation where possible in NIP-05 module (Yuki Kishimoto)
  • nostr: get NIP-46 relays from NIP-05 address (DanConwayDev)
  • nostr: deprecate EventBuilder::encrypted_direct_msg (Yuki Kishimoto)
  • pool: use per-purpose dedicated relay channels (Yuki Kishimoto)
  • pool: return relay urls to which messages/events have or not been sent for send_* and batch_* methods (Yuki Kishimoto)
  • pool: return relay urls to which subscription have or not been success for subscribe* methods (Yuki Kishimoto)
  • pool: rename Relay::terminate to Relay::disconnect (Yuki Kishimoto)
  • pool: always send RelayPoolNotification::Message variant (Yuki Kishimoto)
  • pool: return report for negentropy reconciliation (Yuki Kishimoto)
  • signer: use limit(0) instead of since for Nip46Signer subscription filter (Yuki Kishimoto)
  • signer: deprecate NostrConnectRemoteSigner::nostr_connect_uri and Nip46Signer::nostr_connect_uri (Yuki Kishimoto)
  • sdk: allow to change auto authentication to relays option (NIP-42) after client initialization (Yuki Kishimoto)
  • sdk: retrieve contact list public keys only from the latest events (Xiao Yu)
  • sdk: re-subscribe closed subscriptions after NIP-42 authentication (Yuki Kishimoto)
  • bindings(nostr): allow to specify coordinates in EventBuilder::delete constructor (Yuki Kishimoto)
  • ffi(sdk): convert RelayPool::handle_notifications method to async/future (Yuki Kishimoto)
  • js: increase max stack size to 0x1E84800 bytes (32 MiB) (Yuki Kishimoto)
  • js(nostr): adj. method names to camelcase format (Yuki Kishimoto)

Added

Fixed

  • nostr: fix NIP-47 list_transactions response deserialization (Yuki Kishimoto and lnbc1QWFyb24)
  • pool: fix shutdown notification sent to external channel on Relay::terminate method call (Yuki Kishimoto)
  • pool: fix RelayPool::reconcile_advanced method uses database items instead of the passed ones (Yuki Kishimoto)
  • signer: add missing NIP-46 connect "ACK" message handling (Yuki Kishimoto)
  • sdk: fix NIP-42 client authentication (Yuki Kishimoto)
  • js: fix "RuntimeError: memory access out of bounds" WASM error (Yuki Kishimoto)

Removed

Summary

Added async/future support to Python, Kotlin and Swift, added automatic authentication to relays (NIP-42, can be deactivated in client options), improvements to relay limits, many bug fixes (relays not auto reconnect, wrong query order for SQLite, tokio panic when using SQLite database in bindings) and more!

Note for kotlin devs: from this release the packages will be published at org.rust-nostr instead of io.github.rust-nostr.

Changed

Added

Fixed

  • nostr: fix re-serialization of events that contains unknown keys during deserialization (Yuki Kishimoto)
  • nostr: fix Nip21::to_nostr_uri serialization (Yuki Kishimoto)
  • pool: fix relay doesn't auto reconnect in certain cases (Yuki Kishimoto)
  • nostr: add missing TagStandard::PublicKeyLiveEvent variant to Event::public_keys (Yuki Kishimoto)
  • sqlite: fix SQLite database panics when used outside the client context in bindings (Yuki Kishimoto)
  • sqlite: fix wrong event order when querying (Yuki Kishimoto)

Removed

  • nostr: remove verify_blocking and get_profile_blocking functions (Yuki Kishimoto)
  • nostr: remove RelayInformationDocument::get_blocking (Yuki Kishimoto)
  • nostr: remove blocking feature (Yuki Kishimoto)
  • sqlite: removed deadpool-sqlite dep (Yuki Kishimoto)
  • ffi(nostr): remove Keys::from_mnemonic_with_account and Keys::from_mnemonic_advanced (Yuki Kishimoto)

Summary

Reworked Tag, added TagStandard enum, simplified the way to subscribe and/or reconcile to subset of relays (respectively, client.subscribe_to and client.reconcile_with), added blacklist support to mute public keys or event IDs, removed zap split from client.zap method, many improvements and more!

Changed

Added

Fixed

Removed

Summary

Adapted NIP46 to last changes, added NostrConnectRemoteSigner to easily build remote signers (just construct it and call serve method), improved proxy options (allow to specify the proxy target: all relays or only .onion ones), improvements to NWC client, fixed equality operator for bindings (Python, Kotlin and Swift), added nostrdb storage backend, added NIP32 and completed NIP51 support and more!

Changed

Added

Fixed

Removed

v0.29.4

  • pool: fix InternalRelay::get_events_of_with_callback timeout (Yuki Kishimoto)

v0.29.3

  • pool: check filter limit in InternalRelayPool::get_events_from (Yuki Kishimoto)

v0.29.2

Fixed

v0.29.1

Fixed