You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing a user account owning a large number of notes, there are two main performance bottlenecks:
adding a note to cache is slow as cache is based on vector while emulating a set behaviour
all notes' nullifiers are calculated before each transaction sent, and there is no cache for nullifiers
The above two issues cause multiple minutes of processing for each transaction, when user has a few thousand notes
Possible solution design or implementation
For 1), base the cache implementation on BTreeSet rather than vector
For 2), introduce cache for nullifiers (consider change of the StateClient trait, which currently has the following method:
EnrichedNote type contains Note and block_height only, but it could also contain a nullifier for a given secret key, so that nullifier is also cached. This would save time if the user performs multiple operations with the same large set of notes.
Additional context
This improvement may also apply to other wallets within Dusk, such wallet-cli/wallet-core and a test wallet in Rusk.
The text was updated successfully, but these errors were encountered:
Summary
When testing a user account owning a large number of notes, there are two main performance bottlenecks:
The above two issues cause multiple minutes of processing for each transaction, when user has a few thousand notes
Possible solution design or implementation
For 1), base the cache implementation on BTreeSet rather than vector
For 2), introduce cache for nullifiers (consider change of the StateClient trait, which currently has the following method:
fn fetch_notes(&self, vk: &ViewKey) -> Result<Vec<EnrichedNote>, Self::Error>;
EnrichedNote
type contains Note and block_height only, but it could also contain a nullifier for a given secret key, so that nullifier is also cached. This would save time if the user performs multiple operations with the same large set of notes.Additional context
This improvement may also apply to other wallets within Dusk, such wallet-cli/wallet-core and a test wallet in Rusk.
The text was updated successfully, but these errors were encountered: