-
Notifications
You must be signed in to change notification settings - Fork 615
feat: client flows benchmarks #13007
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 18 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
0f25cd4
wip
Thunkar a5df874
wip
Thunkar 82b207b
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar e918bfc
wip
Thunkar 111bec4
wip
Thunkar ef096f3
first flow working
Thunkar f2e5357
add ECDSAR1 account
Thunkar 30e6cd2
better structure, bridging
Thunkar 52a45bc
transfer flows
Thunkar e3ccaec
wip
Thunkar 20e097f
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar b235696
add to bootstrap
Thunkar 77c0193
cleanup and comments from review
Thunkar f448290
more feedback and fixes
Thunkar 6f0dcf9
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 770ea7f
final cleanup?
Thunkar 7254924
adjusted steps
Thunkar 3d5ad1a
fixes
Thunkar 99d31e5
removed comment
Thunkar f541fd5
fix
Thunkar cbd83ca
attempt to avoid oom
Thunkar f05c3b7
removed bench, added amm
Thunkar a0bbf4c
fmt
Thunkar da2c445
fixes
Thunkar 1895d3c
gated new profiling method
Thunkar 36c9057
gated new profiling method
Thunkar 3938b4c
data
Thunkar c2f1e36
more info on failures
Thunkar 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
42 changes: 42 additions & 0 deletions
42
yarn-project/accounts/src/ecdsa/ecdsa_r/account_contract.ts
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,42 @@ | ||
| import type { AuthWitnessProvider } from '@aztec/aztec.js/account'; | ||
| import { Ecdsa } from '@aztec/foundation/crypto'; | ||
| import type { Fr } from '@aztec/foundation/fields'; | ||
| import { AuthWitness } from '@aztec/stdlib/auth-witness'; | ||
| import { CompleteAddress } from '@aztec/stdlib/contract'; | ||
|
|
||
| import { DefaultAccountContract } from '../../defaults/account_contract.js'; | ||
|
|
||
| /** | ||
| * Account contract that authenticates transactions using ECDSA signatures | ||
| * verified against a secp256r1 public key stored in an immutable encrypted note. | ||
| * This abstract version does not provide a way to retrieve the artifact, as it | ||
| * can be implemented with or without lazy loading. | ||
| */ | ||
| export abstract class EcdsaRBaseAccountContract extends DefaultAccountContract { | ||
| constructor(private signingPrivateKey: Buffer) { | ||
| super(); | ||
| } | ||
|
|
||
| async getDeploymentFunctionAndArgs() { | ||
| const signingPublicKey = await new Ecdsa('secp256r1').computePublicKey(this.signingPrivateKey); | ||
| return { | ||
| constructorName: 'constructor', | ||
| constructorArgs: [signingPublicKey.subarray(0, 32), signingPublicKey.subarray(32, 64)], | ||
| }; | ||
| } | ||
|
|
||
| getAuthWitnessProvider(_address: CompleteAddress): AuthWitnessProvider { | ||
| return new EcdsaRAuthWitnessProvider(this.signingPrivateKey); | ||
| } | ||
| } | ||
|
|
||
| /** Creates auth witnesses using ECDSA signatures. */ | ||
| class EcdsaRAuthWitnessProvider implements AuthWitnessProvider { | ||
| constructor(private signingPrivateKey: Buffer) {} | ||
|
|
||
| async createAuthWit(messageHash: Fr): Promise<AuthWitness> { | ||
| const ecdsa = new Ecdsa('secp256r1'); | ||
| const signature = await ecdsa.constructSignature(messageHash.toBuffer(), this.signingPrivateKey); | ||
| return Promise.resolve(new AuthWitness(messageHash, [...signature.r, ...signature.s])); | ||
| } | ||
| } |
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.
Maybe we can rename the templated methods so they don't have the same name as the WASM export for the k1 curve, it's a bit confusing, looks like recursion
Other than that the c_bind change LGTM!