-
Notifications
You must be signed in to change notification settings - Fork 266
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
refactor: no calls to pedersen from TS #2724
Conversation
2f52953
to
d0d7fa0
Compare
e8099cc
to
45b61e6
Compare
@@ -10,6 +10,7 @@ import { deserializeArrayFromVector, deserializeField, serializeBufferArrayToVec | |||
* @param lhs - The first hash. | |||
* @param rhs - The second hash. | |||
* @returns The new 32-byte hash. | |||
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. |
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.
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. | |
* @deprecated Don't call pedersen directly in production code. Instead, create suitably-named functions for specific purposes. |
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.
Addressed in 4b722a5
@@ -3208,7 +3208,7 @@ export function abisComputeGlobalsHash(wasm: IWasmModule, arg0: GlobalVariables) | |||
export function abisComputePublicDataTreeValue(wasm: IWasmModule, arg0: Fr): Fr { | |||
return Fr.fromBuffer(callCbind(wasm, 'abis__compute_public_data_tree_value', [toBuffer(arg0)])); | |||
} | |||
export function abisComputePublicDataTreeIndex(wasm: IWasmModule, arg0: Fr, arg1: Fr): Fr { | |||
export function abisComputePublicDataTreeIndex(wasm: IWasmModule, arg0: Address, arg1: Fr): Fr { |
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.
Is this Address
or AztecAddress
?
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 is correct because of this alias. There is no AztecAddress on the C++ side so I guess Adam set it up like this to make it work.
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.
Got it
@@ -9,22 +9,35 @@ import { Hasher } from '@aztec/types'; | |||
|
|||
/** | |||
* A helper class encapsulating Pedersen hash functionality. | |||
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. |
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.
Same suggestion as above.
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.
Addressed in 4b722a5
Fixes #435
This PR doesn't really address the original issue that much. I have reasons for this:
I marked the pedersen functions as deprecated with a message to not use it in production code. I think that's the best way to go about this at this point.
Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.