-
Notifications
You must be signed in to change notification settings - Fork 615
chore!: Replace computing hashes in circuits wasm, with computing them in ts via bb.js pedersen call. #3114
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 34 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
d137366
Initial work at replacing wasm hashing with pure TS.
charlielye 26ac28a
Plumbing.
charlielye 13569e6
wip
charlielye 78c3933
Add abis tests.
charlielye e90614d
Merge branch 'cl/more_abis_tests' into cl/ts_use_new_pedersen
charlielye 5e92b49
wip
charlielye 017ad81
Merge remote-tracking branch 'origin/master' into cl/ts_use_new_pedersen
charlielye 7a5b7dc
Wip
charlielye 3357fb8
wip
charlielye 42cad25
Merge remote-tracking branch 'origin/master' into cl/ts_use_new_pedersen
charlielye db10fbd
wip
charlielye a35beff
Fix
charlielye 6861c58
We have a serious circular dependency problem.
charlielye 39c1c67
one less circular.
charlielye 9607656
fix
charlielye fdc1145
Remove awaits.
charlielye 8b3289a
Try to colorise output.
charlielye 92d3260
fix
charlielye 55be313
remove test.
charlielye 0f1e439
fix
charlielye 6eb96b8
Merge remote-tracking branch 'origin/master' into cl/ts_use_new_pedersen
charlielye 42c1d84
Cleanup
charlielye 36d226e
Fixes.
charlielye 880acb7
Fixes.
charlielye e83961a
timestamps on compose runs [ci rebuild end-to-end]
charlielye 34b82fb
Update cond_spot_run_compose [ci rebuild end-to-end]
charlielye 96fb209
Update cond_spot_run_compose [ci rebuild end-to-end]
charlielye ccdd2be
use printf in add_timestamps as I got paranoid about performance. [ci…
charlielye fe50556
Merge branch 'cl/ts_use_new_pedersen' of github.com:aztecprotocol/azt…
charlielye 4bad573
[ci rebuild end-to-end]
charlielye d5ee8cc
pedersenCommit shouldn't have hashIndex.
charlielye 6bbb4c0
fix
charlielye e061ce0
Merge branch 'master' into cl/ts_use_new_pedersen
charlielye 14186a4
Merge branch 'master' into cl/ts_use_new_pedersen
charlielye 1714d46
Fix field change oops. Remove c_bind_new for schnorr.
charlielye fdfb0ef
Merge branch 'master' into cl/ts_use_new_pedersen
charlielye d3d42bf
Formatting.
charlielye 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
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
3 changes: 1 addition & 2 deletions
3
...nberg/cpp/src/barretenberg/common/mem.cpp → .../cpp/src/barretenberg/common/bbmalloc.cpp
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #pragma once | ||
| #include "./wasm_export.hpp" | ||
| #include <cstddef> | ||
|
|
||
| WASM_EXPORT void* bbmalloc(size_t size); | ||
|
|
||
| WASM_EXPORT void bbfree(void* ptr); |
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
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
15 changes: 10 additions & 5 deletions
15
barretenberg/cpp/src/barretenberg/crypto/pedersen_commitment/c_bind.hpp
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,12 @@ | ||
| #pragma once | ||
| #include "barretenberg/common/mem.hpp" | ||
| #include "barretenberg/common/serialize.hpp" | ||
| #include "barretenberg/common/streams.hpp" | ||
| #include "barretenberg/common/timer.hpp" | ||
| #include "barretenberg/common/wasm_export.hpp" | ||
| #include "barretenberg/ecc/curves/bn254/fr.hpp" | ||
| #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" | ||
|
|
||
| WASM_EXPORT void pedersen__commit(uint8_t const* inputs_buffer, uint8_t* output); | ||
| extern "C" { | ||
|
|
||
| using namespace barretenberg; | ||
| using affine_element = grumpkin::g1::affine_element; | ||
|
|
||
| WASM_EXPORT void pedersen_commit(fr::vec_in_buf inputs_buffer, affine_element::out_buf output); | ||
| } |
18 changes: 0 additions & 18 deletions
18
barretenberg/cpp/src/barretenberg/crypto/pedersen_commitment/c_bind_new.cpp
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
barretenberg/cpp/src/barretenberg/crypto/pedersen_commitment/c_bind_new.hpp
This file was deleted.
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
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
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
17 changes: 0 additions & 17 deletions
17
barretenberg/cpp/src/barretenberg/crypto/pedersen_hash/c_bind_new.cpp
This file was deleted.
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
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp
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
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
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
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
File renamed without changes.
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
This file was deleted.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind tl;dr'ing why we're switching field types?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an oopsie. Fixed. It was actually another api call that was meant to become Fq.
Typescript didnt raise error due to Fq and Fr being structurally the same, although this PR changes that as I optimised Fr slightly (made it Uint8Array under the hood rather than bigint as the conversion seriously impacts performance when doing lots of hashing).