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

feat(event-streaming): new streams (orders, swaps, eth_fee_estimation) #2172

Open
wants to merge 134 commits into
base: dev
Choose a base branch
from

Commits on Jul 10, 2024

  1. use a different struct to implement the balance streaming for utxo

    it was confusing why a utxo standard coin was being used instead of the coin we are building, this makes a bit more sense
    mariocynicys committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    7642e69 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8aee75b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    94fd9b0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c6ced79 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fc7e232 View commit details
    Browse the repository at this point in the history
  6. Take event_stream_configuration out of the Option<

    There was no point of the option wrapping. Simplifying stuff.
    mariocynicys committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    876226b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    58d436c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    eaca49b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b893483 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    737de5b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    929279f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4456c74 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1b9aaa5 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. Configuration menu
    Copy the full SHA
    9504df4 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. get rid of error_event_name

    also does some housekeeping, file splitting and renaming
    mariocynicys committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    d113c6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    209df5f View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. new event streaming arch

    mariocynicys committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    4d15a66 View commit details
    Browse the repository at this point in the history
  2. event streamer optimizations and fixmes

    remove the intermediate bridge task and replace it with `filter_map` call.
    also properly implement the shutdown handle
    mariocynicys committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    009d206 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7a6c224 View commit details
    Browse the repository at this point in the history
  4. refuse to add a streamer that is already present

    also wraps the streamermanager mutable data inside Arc<RwLock< so to be used in concurrent code.
    RwLock was chosen here since we should be sending streaming data way more than editing the streamers
    mariocynicys committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    8fa5950 View commit details
    Browse the repository at this point in the history
  5. adapt network and heartbeat streamers to the new interface

    along with some cleanups and simplifications
    mariocynicys committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    38e22c3 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2024

  1. Configuration menu
    Copy the full SHA
    945463f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    700e935 View commit details
    Browse the repository at this point in the history
  3. fix compilation issues

    mariocynicys committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    8af7abc View commit details
    Browse the repository at this point in the history
  4. StreamHandlerInput must be Unpin to call next()

    Also use the `data_rx` for utxo balance events.
    A cleanup for the scripthash notification channels/logic will follow
    mariocynicys committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    3ade9a2 View commit details
    Browse the repository at this point in the history
  5. PoC: utxo balance streaming using the new streaming manager interface

    this is very messy though (because of the current state of electurm code) and will be reverted, just recording this in the history for now
    mariocynicys committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    8972822 View commit details
    Browse the repository at this point in the history
  6. Revert "PoC: utxo balance streaming using the new streaming manager i…

    …nterface"
    
    This reverts commit 8972822.
    mariocynicys committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    bf54981 View commit details
    Browse the repository at this point in the history
  7. hide the Controller inside the StreamingManager

    made more sense to have it inside the manager. also now the manager provides the controller as a parameter in the handle method so different streamers don't have to keep a copy of ctx just to broadcast on the controller.
    mariocynicys committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    cf50389 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. fix wasm compilation

    mariocynicys committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    1783c2c View commit details
    Browse the repository at this point in the history
  2. use fn handle's data_rx in zcoin balance event streaming

    this is still not hooked up though. no data will be received on this rx channel till we do
    `event_stream_manager.send('BALANCE:ZCoin') (or whatever the coin name is)` somewhere.
    mariocynicys committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    5655db6 View commit details
    Browse the repository at this point in the history
  3. rename StreamingSendError -> StreamingManagerError

    also let StreamingManager::add return StreamingManagerError instead of String
    mariocynicys committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    5a780ed View commit details
    Browse the repository at this point in the history
  4. remove context extraction in eth,zcoin,tendermint,utxo balance events

    we only extracted the ctx here to use the controller. since the controller is provided as an argument in EventStreamer::handle already, no need to extract the context in these senarios
    mariocynicys committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    a736f9b View commit details
    Browse the repository at this point in the history
  5. no need for error handling macro in zcoin balance streaming

    looks like there are no more errors that could arise :/
    mariocynicys committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    eea5e02 View commit details
    Browse the repository at this point in the history
  6. remove ctx from UtxoCoinFields (for now)

    no need for the feild. looks like the only use for it was to access the channel controller.
    mariocynicys committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    98f9253 View commit details
    Browse the repository at this point in the history
  7. clear filtered events in sse_handler

    we want to use another type of filter (to enable and disable streams dynamically while keeping the SSE connection open)
    mariocynicys committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    08401d3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c089312 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    dc57896 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. remove eventname

    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    a8439ca View commit details
    Browse the repository at this point in the history
  2. keep streamer id for both normal and error events the same

    change it only when extracting the output out
    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    67348ab View commit details
    Browse the repository at this point in the history
  3. let the controller broadcast only to certain clients

    instead of applying the filter at event level, we will instead filter while broadcasting.
    in here we choose which clients we want the event to be broadcasted to. This should also reduce unnecessary overhead for slow client connections who don't pick up the events quickly (they now won't receive unrelated events, thus keeping extra more space in their channels)
    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    aab0b1c View commit details
    Browse the repository at this point in the history
  4. convert to sub/pub arch

    now clients will subscribe to some streamer.
    if the streamer doesn't yet exist, it will be spawned using the client provided configuration. and the client will be registered with as a listener to that streamer (so every new event from that streamer will be sent to that client).
    on the other hand, if the streamer already exists and a client is trying to add/spawn it, the client will simply be registered to the alraedy runnning streamer and no changes to the streamer configuration is made (even if the clinet's wanted config is different). now new events from this streamer will also be sent to the newly added client.
    
    a client can shut/(stop listening to) a streamer, in this case, if the streamer has no more clients to server, it will be terminated. otherwise, it's kept alive to sever other clients.
    
    a clinet can also terminate the sse connection (remove_client), in which case all of its streamers are shut (same as the shut point above)
    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    620e35e View commit details
    Browse the repository at this point in the history
  5. move the arc<mutex< from the controller one level up

    this will allow us to reason about what feilds must be locked together for atomicity of streaming manager operations.
    
    this also gets rid of the smart channel receiver that removes a channel from the controller when it drops. it's now the responsibilty of who called `create_channel` to call `remove_channel` when the channel is no longer used (that is, the responsibility of the streaming manager)
    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    571b1a4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0ed45e4 View commit details
    Browse the repository at this point in the history
  7. ensure atomicity in streaming manager operations

    This refactor makes sure that we perform write operations on the streaming manager atomically.
    
    We were previouly locking some fields of the manager to edit them then unlock them and lock another field. This clearly isn't atomic since there is a depedency between the data stored in the two fields and they should be set in one step with no operation in between.
    
    One solution could have been to just wrap the whole manager with a mutex and not allow concurrent access to it. This would hurt the read perf though, which is critical for frequent send calls and broadcast calls.
    Another would have been introducing a new field (mutex) called `critical` or something and lock it when we want no other writing method to execute in parallel. This is the approach taken here, but since `clinets` field is already locked with every operation (every operation mutating the state of the streaming manager must involve a client anyway: added, removed, newly listening, etc...), we now lock the `clients` field before any cirtical section till the end so we are sure no other mutating code will run in parallel.
    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    94621f3 View commit details
    Browse the repository at this point in the history
  8. fix lint issues

    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    fb66bf2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    304c179 View commit details
    Browse the repository at this point in the history
  10. abandon the smart Filter object

    since events now pass through the streaming manager (who has all info regarding which clients are interested in what events) we don't need such a filter.
    also this filter won't work with the sub/pub arch anyways
    mariocynicys committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    cb1e1c9 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2024

  1. rename Event::streamer_id -> Event::event_type

    they are the same thing, keeping the two names visible so their equivliance is clear
    mariocynicys committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    4d98d23 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Configuration menu
    Copy the full SHA
    bc32665 View commit details
    Browse the repository at this point in the history
  2. fix compilation for the rest of mm2

    this is still faulty though. we need to only add a streamer on client request and not out of the blue. ctrl+f `add(0,`
    mariocynicys committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    2e95af1 View commit details
    Browse the repository at this point in the history
  3. fix wasm compilation

    mariocynicys committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    7578ddf View commit details
    Browse the repository at this point in the history
  4. breaking: change mm2 event_stream_worker_path config parameter

    changed from:
    'event_streaming_configuration' : { 'worker_path': 'path/to/worker.js', ..other_params }
    to
    'event_stream_worker_path': 'path/to/worker.js'
    mariocynicys committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    ee32fd1 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. bug: make sure the streamer is up before joining a new client along

    If a streamer is down (we wrote an event streamer that doesn't loop forever for some reason, or maybe the streamer paniced) we should start it agian the next time it is activated by any client, so the newly listening client gets the actual stream of events.
    
    Note that we don't keep older clients listening to that streamer, because:
    1- the streamer writer probably wanted this effect, if the streamer is dead, clients should get no more events.
    2- streamer initialization might fail, and if we keep the clients listening we will end up with `clients` & `streamers` maps out of sync. if we remove the clients if the streamer fails (and only if it fails), this will be a highly inconsistent side-effect.
    
    We should make sure streamers never exit (unless this is the wanted logic).
    For other cases like when the spawner used by the streamer is aborted (e.g. utxo balance streamer running on utxo coin spawner and then we disable the coin), we should make sure to use the approbriate spawner to exit only when the streamer's dependecy is no longer present.
    We should expect clients to re-enable the streamer is such cases (e.g. [enable utxo coin, enable blanace streamer, disable utxo coin, enable utxo coin] scenario doesn't re-enable the balance streamer by itself, the client should do [enable balance streamer] one more time)
    mariocynicys committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    35e9686 View commit details
    Browse the repository at this point in the history
  2. properly timeout in data asker

    `ask_for_data` didn't use the timeout that was passed over.
    the only way for it to timeout was for a client to reply for the asked data *after* the timeout
    mariocynicys committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    58e5c72 View commit details
    Browse the repository at this point in the history
  3. move balance network and other streamers to api enabling/disabling

    enabling and disabling streamers now take place in
    mm2_main/rpc/streaming_activations
    
    for modularity, we shouldn't enable streamers elsewhere so not to forget about them
    mariocynicys committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    e3a4113 View commit details
    Browse the repository at this point in the history
  4. Add fee estimation to the streaming API

    I went with removing the fee estimation context and rpc methods but I
    fount that it is used by mm2 itself and not just for API usage.
    
    Maybe with some refactor we could get the mm2 usage decoupled from the
    API one, and abandon the fee context (it looks possible from the
    streaming API side).
    mariocynicys committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    50978af View commit details
    Browse the repository at this point in the history
  5. remove _streaming postfix from streaming fn names

    they are already in a streaming_activations module (already tells what these functions are for), so cut the names short
    mariocynicys committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    8d8d496 View commit details
    Browse the repository at this point in the history
  6. send a non-empty message (success) on successfully rpc call

    also fixes a bug where the eth fee streamer was spawned on the ctx weakspawner
    mariocynicys committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    0859434 View commit details
    Browse the repository at this point in the history
  7. stream swap status in real time

    this only streams the specific event that took place along with the UUID since most events don't embed the UUID. This doesn't work like `swap_v2_rpcs::SwapRpcData` where all the past events are send in a vector
    mariocynicys committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    eec1f15 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6fad6ab View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. breaking: abandon event_stream_configuration config

    access_control_allow_origin config moved from:
    'event_streaming_configuration' : { 'access_control_allow_origin': '*', ..other_params }
    to
    'access_control_allow_origin': '*'
    i.e. moved one scope out in the mm2.json config
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    b9d1218 View commit details
    Browse the repository at this point in the history
  2. ignore utxo scripthash subscriptions fixme for now

    moved to a TODO, we need #1966 first to start working on it, otherwise it's gonna look like this: 8972822
    not removing the ScripthashNotificationSender traces entierly so not to have a lot of merge conflicts with #1966, but it's now disabled (provided always as None).
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    cd831d9 View commit details
    Browse the repository at this point in the history
  3. unify all disable streaming endpoints

    they all share the same request and response and don't depend on the path
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    f54f502 View commit details
    Browse the repository at this point in the history
  4. remove a fixmes

    to show up in review if it's important :)
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    481bf5d View commit details
    Browse the repository at this point in the history
  5. broadcast all from the data asker

    since there is no such a streamer id (the id was made up on the spot in the data asker) the client who should receive this message won't get it (not any client in fact). it seems like we can't somehow know the client, so sending the request to all clients instead.
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    a73a0bc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fb4e1ee View commit details
    Browse the repository at this point in the history
  7. eth balance streaming: attach the address that caused balance fetch e…

    …rror
    
    in the streamed error message
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    d347e4e View commit details
    Browse the repository at this point in the history
  8. let the manager receive reference through send

    and only clone it if the streamer exists (and make sure it injests inputs [data_in], but this really shouldn't happen as this would be a dev error
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    bfb15da View commit details
    Browse the repository at this point in the history
  9. Revert "let the manager receive reference through send"

    This reverts commit bfb15da.
    
    Since we use custom enums for the streamers inputs that encapsulates other mm2 types. We ended up cloning the mm2 types to construct the enum and then clone the enums from the reference if the streamer exists. so we ended up double cloning instead of cloning just one time.
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    4926fff View commit details
    Browse the repository at this point in the history
  10. using partking lot rwlock to not starve writers

    since we expect `StreamingManager::send` & `StreamingManager::broadcast` to be called alot thus holding read locks to `streamers` and/or `controller`, we might end up in a situation where a write upate can't take place because of a queue of readers
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    3f4484d View commit details
    Browse the repository at this point in the history
  11. remove eth gas estimator context

    rely only on the streaming version
    
    `gas_fee_estimator` was removed from coins file and is now set while enabling the streaming for the first time. One can choose to enable it in 'simiple' or 'provider' mode.
    provider mode uses 'gas_api' defined in mm2.json, if not found we always fail back to simple again.
    mariocynicys committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    6c3ce0e View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    d31ebad View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. add send_fn to streaming manager to minimize cloning

    so that we won't create message/notification we want to send to the streamer unless the streamer actually exists and accepts messages (if it doesn't accept messages, i.e. periodic streamer, this would definitely be a dev error)
    mariocynicys committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    3b8876d View commit details
    Browse the repository at this point in the history
  2. add tx (history) streaming

    this adds tx history streaming for tx history supporting coins (except zcoin).
    the streamer is fairly simple, just a forwarder that doesn't do any computation. The tx details are grapped from the tx history state machine and forwared to the streamer right before getting stored in the db.
    
    To be able to access the `event_stream_manager` from the tx history statemachine, `MmArc` was made accessible through the coins (`MmCoin`). Chose the coins here and not directly embedding the MmArc inside the history statemachine since we will probably use the event streamer more and more in different areas of the code, so having it distributed among coins would make adding new streaming functionalies easier.
    We could have also gone for cloning `event_stream_manager` to the coins instead of passing the `ctx`. Went for passing the ctx here since eth & tindermint already pass the ctx, so to avoid redundency and unify coins structure.
    mariocynicys committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    8bb36fc View commit details
    Browse the repository at this point in the history
  3. why use mut & remove?

    mariocynicys committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    5cf1dd7 View commit details
    Browse the repository at this point in the history
  4. fail utxo balance streamer initilization if running on top of native rpc

    and not electrum. This so the error could be reported back to the client and not silently ignored.
    
    P.S. we could support native rpc balance events using a periodic polling technique like the one we have in eth for example
    mariocynicys committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    fe02050 View commit details
    Browse the repository at this point in the history
  5. partial impl of zcoin tx history

    this is still missing the translation from txhash to json tx details (this need to be fetched from the db).
    
    this commit also reactivates the z balance streaming by using the streaming manager to send the balance change notification to the z balance event streamer (instead of sending the notification on the channel which no body was listening to after balance streaming refactor).
    mariocynicys committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    179b76a View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. Configuration menu
    Copy the full SHA
    3269faa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1624a3e View commit details
    Browse the repository at this point in the history
  3. get rid of the controller

    inlined the controller logic right inside the streaming manager. it was simple enough to have it's own struct + having it essentially replicated the clients hashmap for no reason
    mariocynicys committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    a8cd6a6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    896636d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1b8cab7 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. working PoC for zcoin tx (history) streaming

    finally :)
    
    only for native, wasm to come
    mariocynicys committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    a036908 View commit details
    Browse the repository at this point in the history
  2. zombie: fix a couple of pitfalls

    outdated urls, a runtime panic, non-zero scan blocks per iteration
    mariocynicys committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    873c20e View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2024

  1. Configuration menu
    Copy the full SHA
    746277d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1d0a75b View commit details
    Browse the repository at this point in the history
  3. merge with origin/dev

    clean, fmt & clip
    mariocynicys committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    c3a99e4 View commit details
    Browse the repository at this point in the history
  4. merge with origin/dev

    mariocynicys committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    e5acf6e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    329f152 View commit details
    Browse the repository at this point in the history
  6. fix wasm compilation

    impl zcoin activation params with lightmode as default since native won't work on wasm
    mariocynicys committed Aug 30, 2024
    Configuration menu
    Copy the full SHA
    349c5e9 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2024

  1. fix: test_hd_utxo_tx_history

    the ctx wasn't hooked up, unwrap panics when accessing the streaming manager in the background thread
    mariocynicys committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    9f63e6f View commit details
    Browse the repository at this point in the history
  2. fix: activate_z_coin_light_with_changing_height

    i confused min with max when fixing this potential panic. max is the one we want here, so that when we have 0.max(1) we get 1 and not 0
    mariocynicys committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    bcd4e1c View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. merge with origin/dev

    mariocynicys committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    162ed47 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2024

  1. add broadcast_to to send an event to a single client

    without any streamer involved
    mariocynicys committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    3f212c4 View commit details
    Browse the repository at this point in the history
  2. event streaming for task managed API end points

    this is a generic impl (and i think is better), and doesn't require a subscription (because there are no streamers running for it).
    
    the flow goes as follows:
    - the client inits a task managed request
    - the client (all clients actually) receive updates once they happen (either action required, request resolution (ok, err), etc...)
    
    later we should make it so that the client ID is provided in the init request, but optionally, and if the client provides it, only them will receive the updates, otherwise we can choose to broadcast_all or not broadcast at all.
    Note that spawning a streamer for each single task and hooking it up to a single client is tedious, for this we can instead broadcast the udpate rightaway from the rpc task manager knowing the client ID using the new `broadcast_to`.
    mariocynicys committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    2540e83 View commit details
    Browse the repository at this point in the history
  3. stream task status update only to the requesting client

    `task::` API init messages now have an optional `client_id` which can be
    used to stream out task status upadates and results to the client via
    event streaming.
    
    the client must have already done the inital SSE request in case of
    native and they must use the same client_id they used in that SSE init
    request.
    mariocynicys committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    12c5b41 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. Configuration menu
    Copy the full SHA
    5d90387 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5c9dbac View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0ea6367 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2024

  1. move tendermint tokens enabler to a todo

    this was too involved into HD wallet stuff and couldn't add it easily. Defering this as it will take some time/getting familiar with some tendermint & HD wallet constructs
    mariocynicys committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    c051400 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2024

  1. Configuration menu
    Copy the full SHA
    4ca4d69 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    471c5db View commit details
    Browse the repository at this point in the history
  3. merge with origin/dev

    mariocynicys committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    f206ce2 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2024

  1. re-introduce get_eth_estimated_fee_per_gas rpc

    but without the start & stop rpcs. this means if the client wants to use this rpc they should implement the caching themselves and not call this rpc more than necessary.
    mariocynicys committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    d387d1b View commit details
    Browse the repository at this point in the history
  2. remove extra line

    mariocynicys committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    f0f6260 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fc133d7 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2024

  1. re-introduce mm2.json event_streaming_configuration

    grouping relevant options inside it together
    mariocynicys committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    bb90b65 View commit details
    Browse the repository at this point in the history
  2. setting a default to client_id

    this sets a default for the client id from SSE side (to zero) and from rpc enablers (tasks coming soon) as well.
    also a new composition struct is added to the rpc enablers to stop the repitition of client_id in each streaming enabler rpc.
    same technique should be followed with the task manager rpcs
    mariocynicys committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    41b35e1 View commit details
    Browse the repository at this point in the history
  3. set default cliend_id for rpc tasks

    this sets a default client id to zero for rpc managed tasks, so for the default case of single user they don't have to provide an ID to get progress updates.
    this also introduces a new composition struct `RpcInitReq` for init rpcs which that holds the clinet_id instead of having to declare it in each RPC request. also the client_id is not removed from the RpcTask and supplied to the task manager directly so we don't have to store the clinet_id in each task as well.
    mariocynicys committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    91d98ed View commit details
    Browse the repository at this point in the history
  4. resolve fixmes

    mariocynicys committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    868ee2c View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2024

  1. Configuration menu
    Copy the full SHA
    d2e3734 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    547fc2b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3c5b1c6 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2024

  1. don't expose the streamer spawn function

    so not in the trait methods
    mariocynicys committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    6e7c47d View commit details
    Browse the repository at this point in the history
  2. use future::ready right away in streamer::spawn

    since we don't use any async computations here anyway
    mariocynicys committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    8d1cffd View commit details
    Browse the repository at this point in the history
  3. merge with origin/dev

    mariocynicys committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    3835964 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2024

  1. stream orderbook reactively

    this streams out the orderbook to subbed clients as the orders arrive to mm2.
    
    the model used for this case is a different streamer for each coin pair requested for streaming, so (btc, ltc) has a streamer, (btc, kmd) has another, and (ltc, btc) also has another.
    we might want to combine the first and last cases (btc, ltc) & (ltc, btc) into a single streamer? but then we would want the streamer to have a deterministic name/id (based on lexagraphical order), or tolerate different names for the same streamer (might be confusing and also harder to impl).
    mariocynicys committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    c1101c1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a1918ec View commit details
    Browse the repository at this point in the history
  3. auto subscribe for orderbook topic when orderbook streaming is enabled

    this creates a side-effect which might not be favoured.
    mariocynicys committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    590b2a1 View commit details
    Browse the repository at this point in the history
  4. merge base/rel & rel/base orderbook streamers

    into one streamer for their topic
    mariocynicys committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    7fe3e53 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2024

  1. Configuration menu
    Copy the full SHA
    d84bf39 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    52af46f View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. merge with origin/dev

    compiles but streaming hasn't yet been enabled for the electrum coins
    mariocynicys committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    6d6b5a2 View commit details
    Browse the repository at this point in the history
  2. post(1966): enable utxo balance events

    the streaming manager is passed up to ElectrumClientImpl, we could
    thoeretically pass it down the tree to each ElectrumConnection, but
    since these connections already have a ref to ElectrumClientImpl in
    their establish_connecion_loop lifetime, we don't really need to do so.
    mariocynicys committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    25a27b9 View commit details
    Browse the repository at this point in the history
  3. fix: actually (auto) remove the client when they disconnect

    this commit makes it so that the client deletion logic is handled by the
    streaming manager when initializing the client. the return type of
    client initialization has an extra field that will run the client
    delection logic on Drop.
    
    this fixes the problem with clients never getting removed as when the clients disconnect
    and the body stream is no longer drived further thus will not hit the `remove_client` call.
    mariocynicys committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    c2f0244 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2024

  1. Configuration menu
    Copy the full SHA
    c29cf81 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2024

  1. z_coin wasm tx_history streaming test

    ignoring the non-wasm test for now since it needs zcash params
    downloaded which we don't have an auto way to do. would be better if we
    can download them in the same way we do for wasm (right from kdf).
    mariocynicys committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    2a5f66c View commit details
    Browse the repository at this point in the history
  2. fix activate_z_coin_*

    naming was used loosely, pirate was used as if it was zombie, a previous
    fix in the url constants led to this breaking.
    mariocynicys committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    159445b View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. Configuration menu
    Copy the full SHA
    853bbf5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    78cece1 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. review(onur): don't expose ctx from MmCoin

    pass the streaming manager down to where it should be used instead
    
    this does so for utxo balance history, tendermint to come
    mariocynicys committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    65bd662 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e65ace0 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2024

  1. Configuration menu
    Copy the full SHA
    5f775d6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f5dbfdd View commit details
    Browse the repository at this point in the history