forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 118
feat(event-streaming): API-driven subscription management #2172
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
Merged
Merged
Changes from 132 commits
Commits
Show all changes
139 commits
Select commit
Hold shift + click to select a range
7642e69
use a different struct to implement the balance streaming for utxo
mariocynicys 8aee75b
rename UtxoBalanceStreaming -> UtxoBalanceEventStreamer
mariocynicys 94fd9b0
add fixme: reminder to send sse in running swap
mariocynicys c6ced79
refactor(mm2_event_stream::controller): use less types for easier und…
mariocynicys fc7e232
add a note about the broadcasting mechanisim
mariocynicys 876226b
Take `event_stream_configuration` out of the `Option<`
mariocynicys 58d436c
don't launch wasm event streamer if there are zero events
mariocynicys eaca49b
don't error if in native mode while balance streaming enabled
mariocynicys b893483
generalize event streaming config to be any json config
mariocynicys 737de5b
rework the current events to work with arbitrary input config
mariocynicys 929279f
add always_send parameter to network event config
mariocynicys 4456c74
balance is a better naming, no need for serde_rename now
mariocynicys 1b9aaa5
use a common empty struct for deser-ing empty config
mariocynicys 9504df4
add smart filter object to events
mariocynicys d113c6f
get rid of `error_event_name`
mariocynicys 209df5f
rename event behavior to event streamer
mariocynicys 4d15a66
new event streaming arch
mariocynicys 009d206
event streamer optimizations and fixmes
mariocynicys 7a6c224
fix not printing streamer id on downcast error
mariocynicys 8fa5950
refuse to add a streamer that is already present
mariocynicys 38e22c3
adapt network and heartbeat streamers to the new interface
mariocynicys 945463f
adapt the rest of the streamers to the new arch
mariocynicys 700e935
abandon CoinFutSpawner & MmFutSpawner in favor of WeakSpawner
mariocynicys 8af7abc
fix compilation issues
mariocynicys 3ade9a2
StreamHandlerInput must be Unpin to call next()
mariocynicys 8972822
PoC: utxo balance streaming using the new streaming manager interface
mariocynicys bf54981
Revert "PoC: utxo balance streaming using the new streaming manager i…
mariocynicys cf50389
hide the Controller inside the StreamingManager
mariocynicys 1783c2c
fix wasm compilation
mariocynicys 5655db6
use `fn handle`'s `data_rx` in zcoin balance event streaming
mariocynicys 5a780ed
rename StreamingSendError -> StreamingManagerError
mariocynicys a736f9b
remove context extraction in eth,zcoin,tendermint,utxo balance events
mariocynicys eea5e02
no need for error handling macro in zcoin balance streaming
mariocynicys 98f9253
remove ctx from UtxoCoinFields (for now)
mariocynicys 08401d3
clear filtered events in sse_handler
mariocynicys c089312
try_send: favor broadcasting quickly over delivering messages to slow…
mariocynicys dc57896
distinguish between SpawnErrors and AddErrors
mariocynicys a8439ca
remove eventname
mariocynicys 67348ab
keep streamer id for both normal and error events the same
mariocynicys aab0b1c
let the controller broadcast only to certain clients
mariocynicys 620e35e
convert to sub/pub arch
mariocynicys 571b1a4
move the arc<mutex< from the controller one level up
mariocynicys 0ed45e4
wrap the clients hashmap with a mutex instead of rwlock
mariocynicys 94621f3
ensure atomicity in streaming manager operations
mariocynicys fb66bf2
fix lint issues
mariocynicys 304c179
adjust only network & core crates to the new changes
mariocynicys cb1e1c9
abandon the smart Filter object
mariocynicys 4d98d23
rename Event::streamer_id -> Event::event_type
mariocynicys bc32665
adapt controller tests to the new arch
mariocynicys 2e95af1
fix compilation for the rest of mm2
mariocynicys 7578ddf
fix wasm compilation
mariocynicys ee32fd1
breaking: change mm2 event_stream_worker_path config parameter
mariocynicys 35e9686
bug: make sure the streamer is up before joining a new client along
mariocynicys 58e5c72
properly timeout in data asker
mariocynicys e3a4113
move balance network and other streamers to api enabling/disabling
mariocynicys 50978af
Add fee estimation to the streaming API
mariocynicys 8d8d496
remove _streaming postfix from streaming fn names
mariocynicys 0859434
send a non-empty message (success) on successfully rpc call
mariocynicys eec1f15
stream swap status in real time
mariocynicys 6fad6ab
add order status streaming
mariocynicys b9d1218
breaking: abandon event_stream_configuration config
mariocynicys cd831d9
ignore utxo scripthash subscriptions fixme for now
mariocynicys f54f502
unify all disable streaming endpoints
mariocynicys 481bf5d
remove a fixmes
mariocynicys a73a0bc
broadcast all from the data asker
mariocynicys fb4e1ee
use a wrapper around StreamingManager in EventStreamer
mariocynicys d347e4e
eth balance streaming: attach the address that caused balance fetch e…
mariocynicys bfb15da
let the manager receive reference through `send`
mariocynicys 4926fff
Revert "let the manager receive reference through `send`"
mariocynicys 3f4484d
using partking lot rwlock to not starve writers
mariocynicys 6c3ce0e
remove eth gas estimator context
mariocynicys d31ebad
add unit tests for steaming manager
mariocynicys 3b8876d
add `send_fn` to streaming manager to minimize cloning
mariocynicys 8bb36fc
add tx (history) streaming
mariocynicys 5cf1dd7
why use mut & remove?
mariocynicys fe02050
fail utxo balance streamer initilization if running on top of native rpc
mariocynicys 179b76a
partial impl of zcoin tx history
mariocynicys 3269faa
review: suggestions by sami 1
mariocynicys 1624a3e
streaming_manager: manage streamers & clients & controller from one lock
mariocynicys a8cd6a6
get rid of the controller
mariocynicys 896636d
explain why tokio is used instead of futures for the channel with cli…
mariocynicys 1b8cab7
impl missing fetch_txs_from_db for zcoin
mariocynicys a036908
working PoC for zcoin tx (history) streaming
mariocynicys 873c20e
zombie: fix a couple of pitfalls
mariocynicys 746277d
abstract the ugly .0 tuple access
mariocynicys 1d0a75b
fix: actually transfer something for order status events
mariocynicys c3a99e4
merge with origin/dev
mariocynicys e5acf6e
merge with origin/dev
mariocynicys 329f152
suggestion from omar: don't nest
mariocynicys 349c5e9
fix wasm compilation
mariocynicys 9f63e6f
fix: test_hd_utxo_tx_history
mariocynicys bcd4e1c
fix: activate_z_coin_light_with_changing_height
mariocynicys 162ed47
merge with origin/dev
mariocynicys 3f212c4
add `broadcast_to` to send an event to a single client
mariocynicys 2540e83
event streaming for task managed API end points
mariocynicys 12c5b41
stream task status update only to the requesting client
mariocynicys 5d90387
not important; fix test compilation - WithdrawRequest
mariocynicys 5c9dbac
bch standalone activation via task manager
mariocynicys 0ea6367
tendermint coin with-tokens-activation via task manager
mariocynicys c051400
move tendermint tokens enabler to a todo
mariocynicys 4ca4d69
try_new -> new & let serde do the erroring job
mariocynicys 471c5db
keep balance error wrapped in MmErrro
mariocynicys f206ce2
merge with origin/dev
mariocynicys d387d1b
re-introduce get_eth_estimated_fee_per_gas rpc
mariocynicys f0f6260
remove extra line
mariocynicys fc133d7
add a fixme: sse endpoint should be authenticated
mariocynicys bb90b65
re-introduce mm2.json event_streaming_configuration
mariocynicys 41b35e1
setting a default to client_id
mariocynicys 91d98ed
set default cliend_id for rpc tasks
mariocynicys 868ee2c
resolve fixmes
mariocynicys d2e3734
let event streaming be off by default
mariocynicys 547fc2b
style & code suggestions by onur 1
mariocynicys 3c5b1c6
style & code suggestions by onur 2
mariocynicys 6e7c47d
don't expose the streamer spawn function
mariocynicys 8d1cffd
use future::ready right away in streamer::spawn
mariocynicys 3835964
merge with origin/dev
mariocynicys c1101c1
stream orderbook reactively
mariocynicys a1918ec
box orderbook update for enum balancing
mariocynicys 590b2a1
auto subscribe for orderbook topic when orderbook streaming is enabled
mariocynicys 7fe3e53
merge base/rel & rel/base orderbook streamers
mariocynicys d84bf39
add a todo regarding orderbook streaming in no-login mode
mariocynicys 52af46f
review(dimxy): fix streamer spawner doc comment
mariocynicys 6d6b5a2
merge with origin/dev
mariocynicys 25a27b9
post(1966): enable utxo balance events
mariocynicys c2f0244
fix: actually (auto) remove the client when they disconnect
mariocynicys c29cf81
tests(streaming-manager): fix client handle dropped early
mariocynicys 2a5f66c
z_coin wasm tx_history streaming test
mariocynicys 159445b
fix activate_z_coin_*
mariocynicys 853bbf5
add a fixme; check me out
mariocynicys 78cece1
review(onur): cross test event streaming crate
mariocynicys 65bd662
review(onur): don't expose ctx from MmCoin
mariocynicys e65ace0
review(onur): do the same for tendermint history state machine
mariocynicys 5f775d6
review(sami): code suggestions
mariocynicys f5dbfdd
review(sami): let event getter return a reference to avoid copying
mariocynicys 4162a8e
super merge with origin/dev
mariocynicys 23ac8a6
convert fixmes to todos
mariocynicys e30a8e6
merge with origin/dev
mariocynicys a508394
fix a typo
mariocynicys 6b5899b
merge with origin/dev
mariocynicys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.