feat: Choose constructor method in Contract.deploy#4939
Conversation
Benchmark resultsMetrics with a significant change:
Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Values are compared against data from master at commit L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every circuit run across all benchmarks.
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contracts are deployed in the tx.
Transaction processing duration by data writes.
|
| } | ||
|
|
||
| #[aztec(public)] | ||
| #[aztec(noinitcheck)] |
There was a problem hiding this comment.
Just a clarifying question: even if something is flagged noinitcheck, the call will if the instance has not been initialized (and is not in the process of being initialized) right?
There was a problem hiding this comment.
If the instance has not been initialized and the function is flagged noinitcheck, then the call will succeed. So this should be used sparingly, and #4937 removes many of the noinitchecks I added all over the place.
| const constructorArtifact = artifact.functions.find(f => f.name === 'constructor'); | ||
| const constructorArtifact = artifact.functions.find(f => f.name === constructorName); | ||
| if (!constructorArtifact) { | ||
| throw new Error('Cannot find constructor in the artifact.'); |
There was a problem hiding this comment.
Nit: probably helps to include the variable name in the error here.
There was a problem hiding this comment.
Will do in a subsequent PR!
3dd1231 to
4b37252
Compare
2138f39 to
01cdf94
Compare
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-package: 0.26.1</summary> ## [0.26.1](aztec-package-v0.26.0...aztec-package-v0.26.1) (2024-03-06) ### Miscellaneous * **aztec-package:** Synchronize aztec-packages versions </details> <details><summary>barretenberg.js: 0.26.1</summary> ## [0.26.1](barretenberg.js-v0.26.0...barretenberg.js-v0.26.1) (2024-03-06) ### Miscellaneous * **barretenberg.js:** Synchronize aztec-packages versions </details> <details><summary>aztec-cli: 0.26.1</summary> ## [0.26.1](aztec-cli-v0.26.0...aztec-cli-v0.26.1) (2024-03-06) ### Miscellaneous * **aztec-cli:** Synchronize aztec-packages versions </details> <details><summary>aztec-packages: 0.26.1</summary> ## [0.26.1](aztec-packages-v0.26.0...aztec-packages-v0.26.1) (2024-03-06) ### Features * Adding fr compatibility to smt variables api ([#4884](#4884)) ([c085cbb](c085cbb)) * **avm-simulator:** Implement EMITUNENCRYPTEDLOG ([#4926](#4926)) ([5f3304e](5f3304e)) * Choose constructor method in Contract.deploy ([#4939](#4939)) ([e899e56](e899e56)) * Indirect mem flag deserialisation ([#4877](#4877)) ([4c6820f](4c6820f)) ### Miscellaneous * Add missing jobs to CI end ([#4963](#4963)) ([ff4110e](ff4110e)) * **avm-simulator:** Better type env getters ([#4950](#4950)) ([8f97977](8f97977)) * **avm-simulator:** Revive field comparison ([#4957](#4957)) ([ee21374](ee21374)) * **avm-simulator:** Test improvements ([#4946](#4946)) ([f74e6a1](f74e6a1)) * Fix CCI config ([#4974](#4974)) ([40178f0](40178f0)) * Remove commitment key copy out of instance ([#4893](#4893)) ([6eb6778](6eb6778)) * **vscode:** Add avm-transpiler to vscode rust-analyzer settings ([#4952](#4952)) ([db915e5](db915e5)) </details> <details><summary>barretenberg: 0.26.1</summary> ## [0.26.1](barretenberg-v0.26.0...barretenberg-v0.26.1) (2024-03-06) ### Features * Adding fr compatibility to smt variables api ([#4884](#4884)) ([c085cbb](c085cbb)) * Indirect mem flag deserialisation ([#4877](#4877)) ([4c6820f](4c6820f)) ### Miscellaneous * Remove commitment key copy out of instance ([#4893](#4893)) ([6eb6778](6eb6778)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-package: 0.26.1</summary> ## [0.26.1](AztecProtocol/aztec-packages@aztec-package-v0.26.0...aztec-package-v0.26.1) (2024-03-06) ### Miscellaneous * **aztec-package:** Synchronize aztec-packages versions </details> <details><summary>barretenberg.js: 0.26.1</summary> ## [0.26.1](AztecProtocol/aztec-packages@barretenberg.js-v0.26.0...barretenberg.js-v0.26.1) (2024-03-06) ### Miscellaneous * **barretenberg.js:** Synchronize aztec-packages versions </details> <details><summary>aztec-cli: 0.26.1</summary> ## [0.26.1](AztecProtocol/aztec-packages@aztec-cli-v0.26.0...aztec-cli-v0.26.1) (2024-03-06) ### Miscellaneous * **aztec-cli:** Synchronize aztec-packages versions </details> <details><summary>aztec-packages: 0.26.1</summary> ## [0.26.1](AztecProtocol/aztec-packages@aztec-packages-v0.26.0...aztec-packages-v0.26.1) (2024-03-06) ### Features * Adding fr compatibility to smt variables api ([#4884](AztecProtocol/aztec-packages#4884)) ([c085cbb](AztecProtocol/aztec-packages@c085cbb)) * **avm-simulator:** Implement EMITUNENCRYPTEDLOG ([#4926](AztecProtocol/aztec-packages#4926)) ([5f3304e](AztecProtocol/aztec-packages@5f3304e)) * Choose constructor method in Contract.deploy ([#4939](AztecProtocol/aztec-packages#4939)) ([e899e56](AztecProtocol/aztec-packages@e899e56)) * Indirect mem flag deserialisation ([#4877](AztecProtocol/aztec-packages#4877)) ([4c6820f](AztecProtocol/aztec-packages@4c6820f)) ### Miscellaneous * Add missing jobs to CI end ([#4963](AztecProtocol/aztec-packages#4963)) ([ff4110e](AztecProtocol/aztec-packages@ff4110e)) * **avm-simulator:** Better type env getters ([#4950](AztecProtocol/aztec-packages#4950)) ([8f97977](AztecProtocol/aztec-packages@8f97977)) * **avm-simulator:** Revive field comparison ([#4957](AztecProtocol/aztec-packages#4957)) ([ee21374](AztecProtocol/aztec-packages@ee21374)) * **avm-simulator:** Test improvements ([#4946](AztecProtocol/aztec-packages#4946)) ([f74e6a1](AztecProtocol/aztec-packages@f74e6a1)) * Fix CCI config ([#4974](AztecProtocol/aztec-packages#4974)) ([40178f0](AztecProtocol/aztec-packages@40178f0)) * Remove commitment key copy out of instance ([#4893](AztecProtocol/aztec-packages#4893)) ([6eb6778](AztecProtocol/aztec-packages@6eb6778)) * **vscode:** Add avm-transpiler to vscode rust-analyzer settings ([#4952](AztecProtocol/aztec-packages#4952)) ([db915e5](AztecProtocol/aztec-packages@db915e5)) </details> <details><summary>barretenberg: 0.26.1</summary> ## [0.26.1](AztecProtocol/aztec-packages@barretenberg-v0.26.0...barretenberg-v0.26.1) (2024-03-06) ### Features * Adding fr compatibility to smt variables api ([#4884](AztecProtocol/aztec-packages#4884)) ([c085cbb](AztecProtocol/aztec-packages@c085cbb)) * Indirect mem flag deserialisation ([#4877](AztecProtocol/aztec-packages#4877)) ([4c6820f](AztecProtocol/aztec-packages@4c6820f)) ### Miscellaneous * Remove commitment key copy out of instance ([#4893](AztecProtocol/aztec-packages#4893)) ([6eb6778](AztecProtocol/aztec-packages@6eb6778)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Adds a new
deployWithOptsmethod to the autogenerated contract typescript interfaces which allows the caller to choose which constructor method to call during deployment. Arguments are type-checked based on the method chosen.Depends on #4896