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

Reduce number of runtime allocations #5

Merged
merged 7 commits into from
Dec 21, 2022

Conversation

AllFi
Copy link

@AllFi AllFi commented Dec 14, 2022

This PR tries to reduce the number of runtime memory allocations during state syncing. The following was done:

  1. Note, account, and shared secret decryption can now be executed in place if the preallocated buffer size is enough.
  2. ecdh.x serialization doesn't allocate anything anymore.
  3. Note hashes deserialization occurs only when it is necessary.

There are still a lot of allocations in try_from_slice and rayon but it isn't something that could be easily fixed. There is some PR: near/borsh-rs#115 that tries to implement heapless deserialization but it's not ready yet.

@AllFi AllFi mentioned this pull request Dec 14, 2022
@AllFi AllFi marked this pull request as ready for review December 19, 2022 13:29
@EvgenKor EvgenKor merged commit 786e16d into multicore-wasm Dec 21, 2022
@EvgenKor EvgenKor deleted the enhancement/reduce_runtime_allocations branch December 21, 2022 19:02
EvgenKor added a commit that referenced this pull request Feb 15, 2023
…ts) (#12)

* use the multicore version of fawkes-crypto

* Reduce number of runtime allocations (#5)

* Replace try_to_vec with serialize

* Try to decrypt not in place

* Implement decrypt account, note and ss in place

* Deserialize only necessary note hashes

* Fix Cargo.toml

* Refactor symcipher_decode

* Bump version

Co-authored-by: Evgen <evgen2k7@yandex.ru>

* Set fawkes-crypto version: 4.3.4 (#6)

* Uses https instead of ssh for fawkes-crypto (#7)

* Feature/delegated deposits v2 (#11)

* Add snark for verifying delegated deposits

* delegated deposits fix & tests covered

* change number of delegated deposits to 16

* add 0xffffffff prefix for message

* join all snarks into one for delegated deposits

* remove tree update from delegated deposit snark

* Fix dependencies

* remove out_commitment from dd secret inputs

---------

Co-authored-by: Igor Gulamov <igor.gulamov@gmail.com>
Co-authored-by: Vladimir Popov <rowdyme0@gmail.com>
Co-authored-by: Alexander Filippov <aleksander.fill@gmail.com>

* Renaming package (libzeropool-zkbob)

* Updating gitignore

* Changing fawkes-crypto branch

---------

Co-authored-by: vms <michail.vms@gmail.com>
Co-authored-by: Alexander Filippov <aleksander.fill@gmail.com>
Co-authored-by: Igor Gulamov <igor.gulamov@gmail.com>
Co-authored-by: Vladimir Popov <rowdyme0@gmail.com>
EvgenKor added a commit that referenced this pull request May 11, 2023
* use the multicore version of fawkes-crypto

* Reduce number of runtime allocations (#5)

* Replace try_to_vec with serialize

* Try to decrypt not in place

* Implement decrypt account, note and ss in place

* Deserialize only necessary note hashes

* Fix Cargo.toml

* Refactor symcipher_decode

* Bump version

Co-authored-by: Evgen <evgen2k7@yandex.ru>

* Set fawkes-crypto version: 4.3.4 (#6)

* Uses https instead of ssh for fawkes-crypto (#7)

* Improve cipher native lib: add methods to retrieve decryption keys, unit tests

* Comment format

* Exposing routine for nullifier intermediate hash computing

* Refactoring tasks

* Exposing routines to decrypt note and keys without validation

* Increasing version (1.2.0)

---------

Co-authored-by: vms <michail.vms@gmail.com>
Co-authored-by: Alexander Filippov <aleksander.fill@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants