Code Monkey home page Code Monkey logo

saltivka's People

Contributors

fiatjaf avatar viktorvsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

saltivka's Issues

Rate limiting on different platforms

Use different redis instances

Currently single Redis backend is used for all operations. However, workload may be split among different instances (each potentially having different settings and topology):

  • Relay Redis
  • Sidekiq Redis
  • Cache Redis (in future when caching functionality is added)
  • Misc Redis (i.e. rate limiting, HyperLogLog to count events and other stats, settings (i.e. maintenance)

Consider how `LIMIT` should apply to `UNION` queries

Currently if RELAY_CONFIG.max_limit is set to 100 and REQ command is sent by a client with 5 different filters (i.e. ["REQ", "subscription", {...}, {...}, {...}, {...}, {...}] the response in theory will contain 500 records maximum (100 per filter). Also, in case filters have #authors filter, NIP-26 delegation will trigger another UNION to each subquery.

We could limit resulting set, but it could be not clear for clients, so the best and the most obvious solution should be defined and enforced.

Efficient storage of #e and #p tags

According to NIP-01 e tags must have valid Event#sha256 in the second value and this value should be searchable by predicate and p tags must have valid Author#pubkey as the second value.

Currently it works in the same way NIP-12 is supported β€” all single letter tags are added as SearchableTag. However, it means those values are stored as is, having duplicates and occupying a lot of space. SearchableTags on e and p tags require the most memory among all indexes currently.

It would be great to store references to other tables instead.

It is pretty straightforward for p tag since we can just create an Author record before saving an event if it does not exist and leave this record in database even if Event is not valid (given that pubkey is valid).

However for e tag it's not as straightforward. Because it may happen e tag refers to the Event we don't know. And currently events table expects valid events and no drafts.

Immediate response to REQ for recent/popular events

  • Create Redis structure to hold latest (or the most popular?) events, say, for 1-3 days
  • On REQ command find if any of recent/popular cached events match
  • Consider how to handle LIMIT in this case (can we avoid database request at all?)
  • TBD

Improve NIP-05 support

Implement some handy features for relay operators who may want to sell names on exclusive domains:

  • ENV variable to set one of 3 levels of configuration for users: free, `pay-with-day', 'subscribers-only'
  • Enforce those levels
  • ENV variable to set price in days for registering a name
  • Define how to release registered names in case payment strategy changed
  • Cache /.well-known/nostr.json endpoint aggressively since it may experience huge amount of requests
  • Improve UI of handling errors on /profile page
  • Make NIP-05 UI more user-friendly and add details on how and why to use it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.