-
Notifications
You must be signed in to change notification settings - Fork 256
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: Remove commitment key copy out of instance #4893
Conversation
8babc5b
to
a8ca2ae
Compare
Benchmark resultsNo metrics with a significant change found. 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.
|
…c-packages into lx/ck-out-of-instance
@@ -41,7 +41,7 @@ template <typename BuilderType> class GoblinUltraRecursiveFlavor_ { | |||
using NativeVerificationKey = NativeFlavor::VerificationKey; | |||
|
|||
// Note(luke): Eventually this may not be needed at all |
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.
not sure what this comment means, but this PR makes sure that we use it
@@ -41,7 +41,7 @@ template <typename BuilderType> class GoblinUltraRecursiveFlavor_ { | |||
using NativeVerificationKey = NativeFlavor::VerificationKey; | |||
|
|||
// Note(luke): Eventually this may not be needed at all | |||
using VerifierCommitmentKey = bb::VerifierCommitmentKey<Curve>; |
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.
previously was using the wrong Curve. We want to use the native curve here.
@@ -114,6 +114,7 @@ template <typename BuilderType> class GoblinUltraRecursiveFlavor_ { | |||
*/ | |||
VerificationKey(CircuitBuilder* builder, const std::shared_ptr<NativeVerificationKey>& native_key) |
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.
Question: is there any point in keeping the other constructor here? It seems dangerous to not set up the verification key with the pcs_verification_key...
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.
Feel free to investigate and resolve here though it may make sense to resolve in a broader PR related to the non-use of copy constructors in the Pg code.
@@ -17,7 +17,7 @@ DeciderProver_<Flavor>::DeciderProver_(const std::shared_ptr<Instance>& inst, | |||
const std::shared_ptr<Transcript>& transcript) | |||
: accumulator(std::move(inst)) | |||
, transcript(transcript) | |||
, commitment_key(inst->commitment_key) | |||
, commitment_key(inst->proving_key->commitment_key) |
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.
storing commitment_key is really only useful because now we don't have to write instance->proving_key->commitment_key
everywhere we want to use the commitment_key, but this should probably be changed to a reference instead of a shared_ptr
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.
Makes sense, feel free resolve in a future PR.
inst_vk = vk.get_value(); | ||
} | ||
|
||
VerifierInstance inst(inst_verification_key); | ||
inst.pub_inputs_offset = pub_inputs_offset; | ||
inst.public_input_size = public_input_size; | ||
inst.log_instance_size = log_instance_size; |
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.
not sure if some of these are unnecessary or not
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
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.
LGTM
@@ -114,6 +114,7 @@ template <typename BuilderType> class GoblinUltraRecursiveFlavor_ { | |||
*/ | |||
VerificationKey(CircuitBuilder* builder, const std::shared_ptr<NativeVerificationKey>& native_key) |
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.
Feel free to investigate and resolve here though it may make sense to resolve in a broader PR related to the non-use of copy constructors in the Pg code.
@@ -17,7 +17,7 @@ DeciderProver_<Flavor>::DeciderProver_(const std::shared_ptr<Instance>& inst, | |||
const std::shared_ptr<Transcript>& transcript) | |||
: accumulator(std::move(inst)) | |||
, transcript(transcript) | |||
, commitment_key(inst->commitment_key) | |||
, commitment_key(inst->proving_key->commitment_key) |
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.
Makes sense, feel free resolve in a future PR.
inst_vk = vk.get_value(); | ||
} | ||
|
||
VerifierInstance inst(inst_verification_key); | ||
inst.pub_inputs_offset = pub_inputs_offset; | ||
inst.public_input_size = public_input_size; | ||
inst.log_instance_size = log_instance_size; |
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
🤖 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).
This PR removes the duplicated commitment key or PCS verification key in the prover instance and verifier instance. It instead moves the commitment keys to the proving/verification keys. As a result, the recursive verification keys must be updated to actually be used, while they were previously unused and uninstantiated.