-
Notifications
You must be signed in to change notification settings - Fork 95
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(zebra-scan): Create a scanner results channel #7906
Comments
@arya2 @oxarbitrage I think there's a design decision we need to make here: Is it ok for all broadcast channel receivers to receive all the results of the scanner task? If we send all results to all receivers, we can filter or split them later if we need to. I'd like to do that outside the scanner task to reduce the complexity of the task, and the assumptions we're making about the rest of the design. (If we assume too much here, we'll have to rewrite the code later if the design changes.) For example, the broadcast channel receiver could store results in the scanner storage. Then the result reading API could check the account ID in the channel or storage before returning results for that ID. |
I changed the title of the ticket because a |
It looks like we'll have a scanner task for new incoming blocks, and multiple tasks for cached state blocks (each new key needs to re-scan the whole cached state). So a |
I feel it would be simpler to split the results by account or client.
We could also send unordered relevant transactions and let clients make a new request with a set of queries that fill the gaps when Zebra restarts. |
Hey team! Please add your planning poker estimate with Zenhub @arya2 @oxarbitrage @teor2345 @upbqdn |
I think it will be simpler to read the results out of storage, and leave the filtering by account or key to the caller of the storage reads. |
This ticket might not be needed, writing results directly to the database seems to work just fine for now. |
This task is about creating a results channel within the zebra-scan crate. The results channel is designed to transmit related transactions for all stored keys over the channel.
To accomplish this task, we need to:
(AccountId [linked to key], block hash/height, Vec<WalletTx>)
.zebra-scan::new()
or similar.If we don't want to drop any results, we should use a
mpsc
channel for results.Out of Scope
If we use a tokio, futures, or std channel, we don't need to do these tests, because those channels are already well-tested:
The output of the scanner task should send data to this channel but this will be done in another ticket.
In a later ticket we can send the results directly to storage, and read results out of storage.
Account filtering - out of scope
Use a separate API to filter results per account.
Have a separate channel and results client for each account:
mpsc
channel for every client (HashMap<Client, Vec<(SaplingIvk, RangeBounds<Height>)>>
)The text was updated successfully, but these errors were encountered: