From 8a866a810192677f2d6007008ec746ab725735a7 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 18 Jun 2024 02:14:47 +0000 Subject: [PATCH 01/25] git subrepo push --branch=master barretenberg subrepo: subdir: "barretenberg" merged: "08121ebf10" upstream: origin: "https://github.com/AztecProtocol/barretenberg" branch: "master" commit: "08121ebf10" git-subrepo: version: "0.4.6" origin: "???" commit: "???" [skip ci] --- barretenberg/.gitrepo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/barretenberg/.gitrepo b/barretenberg/.gitrepo index ad7fc512688..1a16c028c7e 100644 --- a/barretenberg/.gitrepo +++ b/barretenberg/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/barretenberg branch = master - commit = f0aaa876777a37e99fdb98d5fa2d8a502e67c4a0 - parent = cea0b3b29c2f7c37eb07c226a06534f92518cea6 + commit = 08121ebf109b32b35057048e7679d343b3e6beaf + parent = 6692ac831ab980d9623442236c21b499a7238966 method = merge cmdver = 0.4.6 From 8f7b8656940354df38bb623bc6d8941ab98f3e5d Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 18 Jun 2024 02:15:18 +0000 Subject: [PATCH 02/25] chore: replace relative paths to noir-protocol-circuits --- noir-projects/aztec-nr/aztec/Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir-projects/aztec-nr/aztec/Nargo.toml b/noir-projects/aztec-nr/aztec/Nargo.toml index 7a1f1af5863..3dd071fe90c 100644 --- a/noir-projects/aztec-nr/aztec/Nargo.toml +++ b/noir-projects/aztec-nr/aztec/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = ">=0.18.0" type = "lib" [dependencies] -protocol_types = { path = "../../noir-protocol-circuits/crates/types" } +protocol_types = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.42.0", directory="noir-projects/noir-protocol-circuits/crates/types" } From 847f4fc10c17d030f6868e2304ae9a59ee0b08b0 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 18 Jun 2024 02:15:18 +0000 Subject: [PATCH 03/25] git_subrepo.sh: Fix parent in .gitrepo file. [skip ci] --- noir-projects/aztec-nr/.gitrepo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir-projects/aztec-nr/.gitrepo b/noir-projects/aztec-nr/.gitrepo index 9cf9f8859ca..61e63b2fb7c 100644 --- a/noir-projects/aztec-nr/.gitrepo +++ b/noir-projects/aztec-nr/.gitrepo @@ -9,4 +9,4 @@ commit = 0d11558d6233cab30506b049306388f7f93c0b7c method = merge cmdver = 0.4.6 - parent = 4dddf00ca79a8fe6caf01f6e16c08395c694a4ab + parent = 6b0c4b926c673dd161890167be8afca04096a6bb From fbd382648242659956d2ef45f4cbea3589016db2 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 18 Jun 2024 02:15:21 +0000 Subject: [PATCH 04/25] git subrepo push --branch=master noir-projects/aztec-nr subrepo: subdir: "noir-projects/aztec-nr" merged: "afee776d80" upstream: origin: "https://github.com/AztecProtocol/aztec-nr" branch: "master" commit: "afee776d80" git-subrepo: version: "0.4.6" origin: "???" commit: "???" [skip ci] --- noir-projects/aztec-nr/.gitrepo | 4 ++-- noir-projects/aztec-nr/aztec/Nargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/noir-projects/aztec-nr/.gitrepo b/noir-projects/aztec-nr/.gitrepo index 61e63b2fb7c..f9c964748f8 100644 --- a/noir-projects/aztec-nr/.gitrepo +++ b/noir-projects/aztec-nr/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/aztec-nr branch = master - commit = 0d11558d6233cab30506b049306388f7f93c0b7c + commit = afee776d80f622d89234a9acc8ed07a1d96cd25e method = merge cmdver = 0.4.6 - parent = 6b0c4b926c673dd161890167be8afca04096a6bb + parent = 01d95ce259f37e7eacfade3f15b122ca33cda38f diff --git a/noir-projects/aztec-nr/aztec/Nargo.toml b/noir-projects/aztec-nr/aztec/Nargo.toml index 3dd071fe90c..7a1f1af5863 100644 --- a/noir-projects/aztec-nr/aztec/Nargo.toml +++ b/noir-projects/aztec-nr/aztec/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = ">=0.18.0" type = "lib" [dependencies] -protocol_types = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.42.0", directory="noir-projects/noir-protocol-circuits/crates/types" } +protocol_types = { path = "../../noir-protocol-circuits/crates/types" } From a4d1df6d2900185a9c57af44e6f0c3ca80df7c9b Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 18 Jun 2024 17:58:36 +0900 Subject: [PATCH 05/25] feat(docs): Add uniswap back in as a reference and fix links (#7074) Co-authored-by: josh crites --- .../common_patterns/index.md | 4 +- .../smart_contract_reference/dependencies.md | 2 +- .../examples/_category_.json | 6 ++ .../examples/uniswap/_category_.json | 6 ++ .../examples/uniswap/e2e_tests.md | 13 +++ .../examples/uniswap/index.md | 31 +++++++ .../examples/uniswap/l1_contract.md | 37 ++++++++ .../examples/uniswap/l2_contract.md | 89 +++++++++++++++++++ .../smart_contract_reference/globals.md | 2 +- .../history_lib_reference.md | 2 +- .../portals/_category_.json | 2 +- .../storage/_category_.json | 2 +- .../contracts/uniswap_contract/src/main.nr | 6 +- 13 files changed, 192 insertions(+), 10 deletions(-) create mode 100644 docs/docs/reference/smart_contract_reference/examples/_category_.json create mode 100644 docs/docs/reference/smart_contract_reference/examples/uniswap/_category_.json create mode 100644 docs/docs/reference/smart_contract_reference/examples/uniswap/e2e_tests.md create mode 100644 docs/docs/reference/smart_contract_reference/examples/uniswap/index.md create mode 100644 docs/docs/reference/smart_contract_reference/examples/uniswap/l1_contract.md create mode 100644 docs/docs/reference/smart_contract_reference/examples/uniswap/l2_contract.md diff --git a/docs/docs/guides/smart_contracts/writing_contracts/common_patterns/index.md b/docs/docs/guides/smart_contracts/writing_contracts/common_patterns/index.md index c0d0369c3e8..5e0997a595e 100644 --- a/docs/docs/guides/smart_contracts/writing_contracts/common_patterns/index.md +++ b/docs/docs/guides/smart_contracts/writing_contracts/common_patterns/index.md @@ -117,7 +117,7 @@ Hence, it's necessary to add a "randomness" field to your note to prevent such a ### L1 -- L2 interactions -Refer to [Token Portal tutorial on bridging tokens between L1 and L2](../../../../tutorials/contract_tutorials/advanced/token_bridge/index.md). This example shows how to: +Refer to [Token Portal tutorial on bridging tokens between L1 and L2](../../../../tutorials/contract_tutorials/advanced/token_bridge/index.md) and/or [Uniswap smart contract example that shows how to swap on L1 using funds on L2](../../../../reference/smart_contract_reference/examples/uniswap/index.md). Both examples show how to: 1. L1 -> L2 message flow 2. L2 -> L1 message flow @@ -131,7 +131,7 @@ To send a note to someone, they need to have a key which we can encrypt the note There are several patterns here: 1. Give the contract a key and share it amongst all participants. This leaks privacy, as anyone can see all the notes in the contract. -2. `Unshield` funds into the contract. This works like ethereum - to achieve contract composability, you move funds into the public domain. This way the contract doesn't even need keys. +2. `Unshield` funds into the contract - this is used in the [Uniswap smart contract example where a user sends private funds into a Uniswap Portal contract which eventually withdraws to L1 to swap on L1 Uniswap](../../../../reference/smart_contract_reference/examples/uniswap/index.md). This works like Ethereum - to achieve contract composability, you move funds into the public domain. This way the contract doesn't even need keys. There are several other designs we are discussing through [in this discourse post](https://discourse.aztec.network/t/how-to-handle-private-escrows-between-two-parties/2440) but they need some changes in the protocol or in our demo contract. If you are interested in this discussion, please participate in the discourse post! diff --git a/docs/docs/reference/smart_contract_reference/dependencies.md b/docs/docs/reference/smart_contract_reference/dependencies.md index 0035b3454aa..95232193a9f 100644 --- a/docs/docs/reference/smart_contract_reference/dependencies.md +++ b/docs/docs/reference/smart_contract_reference/dependencies.md @@ -1,6 +1,6 @@ --- title: Importing Aztec.nr -sidebar_position: 4 +sidebar_position: 5 --- On this page you will find information about Aztec.nr libraries and up-to-date paths for use in your `Nargo.toml`. diff --git a/docs/docs/reference/smart_contract_reference/examples/_category_.json b/docs/docs/reference/smart_contract_reference/examples/_category_.json new file mode 100644 index 00000000000..29f159518ad --- /dev/null +++ b/docs/docs/reference/smart_contract_reference/examples/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Smart Contract Examples", + "position": 0, + "collapsible": true, + "collapsed": true +} diff --git a/docs/docs/reference/smart_contract_reference/examples/uniswap/_category_.json b/docs/docs/reference/smart_contract_reference/examples/uniswap/_category_.json new file mode 100644 index 00000000000..4f4e9976ade --- /dev/null +++ b/docs/docs/reference/smart_contract_reference/examples/uniswap/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Uniswap Bridge", + "position": 0, + "collapsible": true, + "collapsed": true +} diff --git a/docs/docs/reference/smart_contract_reference/examples/uniswap/e2e_tests.md b/docs/docs/reference/smart_contract_reference/examples/uniswap/e2e_tests.md new file mode 100644 index 00000000000..055c29a84c1 --- /dev/null +++ b/docs/docs/reference/smart_contract_reference/examples/uniswap/e2e_tests.md @@ -0,0 +1,13 @@ +--- +title: e2e tests (TypeScript) +sidebar_position: 3 +--- + +## Private flow test + +#include_code uniswap_private yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts typescript + +## Public flow test + +#include_code uniswap_public yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts typescript + diff --git a/docs/docs/reference/smart_contract_reference/examples/uniswap/index.md b/docs/docs/reference/smart_contract_reference/examples/uniswap/index.md new file mode 100644 index 00000000000..91dd4fe0194 --- /dev/null +++ b/docs/docs/reference/smart_contract_reference/examples/uniswap/index.md @@ -0,0 +1,31 @@ +--- +title: Overview +sidebar_position: 0 +--- + +import Image from "@theme/IdealImage"; + +# Swap on L1 Uniswap from L2 + +This smart contract example allows someone with funds on L2 to be able to swap using L1 Uniswap and then get the swapped assets back to L2. In this example, L1 will refer to Ethereum and L2 will refer to Aztec. + +The flow will be: + +1. The user withdraws their “input” assets to L1 (i.e. burn them on L2 and create a L2 to L1 message to withdraw) +2. We create an L2 → L1 message to swap on L1 +3. On L1, the user gets their input tokens, consumes the swap message, and executes the swap +4. The user deposits the “output” tokens to the output token portal so it can be deposited into L2 +5. We will assume that token portals and token bridges for the input and output tokens must exist. These are what we built in the [token bridge tutorial](../../../../tutorials/contract_tutorials/advanced/token_bridge/0_setup.md). + +The execution of swap on L1 should be designed such that any 3rd party can execute the swap on behalf of the user. This helps maintain user privacy by not requiring links between L1 and L2 activity. + +This reference will cover: +1. Uniswap Portal - a contract on L1 that talks to the input token portal to withdraw the assets, executes the swap, and deposits the swapped tokens back to L2 +2. Uniswap L2 contract - a contract on L2 that creates the needed messages to perform the swap on L1 + + + +This diagram describes the private flow. + +This code works alongside a token portal that you can learn to build [in this tutorial](../../../../tutorials/contract_tutorials/advanced/token_bridge/0_setup.md). + diff --git a/docs/docs/reference/smart_contract_reference/examples/uniswap/l1_contract.md b/docs/docs/reference/smart_contract_reference/examples/uniswap/l1_contract.md new file mode 100644 index 00000000000..cbb164b26f6 --- /dev/null +++ b/docs/docs/reference/smart_contract_reference/examples/uniswap/l1_contract.md @@ -0,0 +1,37 @@ +--- +title: L1 contracts (EVM) +sidebar_position: 2 +--- + +This page goes over the code in the L1 contract for Uniswap, which works alongside a [token portal](../../../../tutorials/contract_tutorials/advanced/token_bridge/index.md). + +## Setup + +#include_code setup l1-contracts/test/portals/UniswapPortal.sol solidity + +## Public swap + +#include_code solidity_uniswap_swap_public l1-contracts/test/portals/UniswapPortal.sol solidity + +1. It fetches the input and output tokens we are swapping. The Uniswap portal only needs to know the portal addresses of the input and output as they store the underlying ERC20 token address. +2. Consumes the `withdraw` message to get input tokens on L1 to itself. This is needed to execute the swap. + + Before it actually can swap, it checks if the provided swap parameters were what the user actually wanted by creating a message content hash (similar to what we did in the L2 contract) to ensure the right parameters are used. + +3. Executes the swap and receives the output funds to itself. + + The deadline by which the funds should be swapped is `block.timestamp` i.e. this block itself. This makes things atomic on the L1 side. + +4. The portal must deposit the output funds back to L2 using the output token’s portal. For this we first approve the token portal to move Uniswap funds, and then call the portal’s `depositToAztecPublic()` method to transfer funds to the portal and create a L1 → l2 message to mint the right amount of output tokens on L2. + +To incentivize the sequencer to pick up this message, we pass a fee to the deposit message. + +You can find the corresponding function on the [L2 contracts page](l2_contract.md#public-swap). + +## Private swap + +This works very similarly to the public flow. + +#include_code solidity_uniswap_swap_private l1-contracts/test/portals/UniswapPortal.sol solidity + +You can find the corresponding function on the [L2 contracts page](l2_contract.md#private-swap). diff --git a/docs/docs/reference/smart_contract_reference/examples/uniswap/l2_contract.md b/docs/docs/reference/smart_contract_reference/examples/uniswap/l2_contract.md new file mode 100644 index 00000000000..3ead8d76254 --- /dev/null +++ b/docs/docs/reference/smart_contract_reference/examples/uniswap/l2_contract.md @@ -0,0 +1,89 @@ +--- +title: L2 Contracts (Aztec) +sidebar_position: 1 +--- + +This page goes over the code in the L2 contract for Uniswap, which works alongside a [token bridge](../../../../tutorials/contract_tutorials/advanced/token_bridge/0_setup.md). + +## Main.nr + +### Setup and constructor + +#include_code uniswap_setup noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr rust +We just need to store the portal address for the token that we want to swap. + + +### Public swap + +#include_code swap_public noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr rust + +1. We check that `msg.sender()` has appropriate approval to call this on behalf of the sender by constructing an authwit message and checking if `from` has given the approval (read more about authwit [here](../../../../aztec/concepts/accounts/authwit.md)). +2. We fetch the underlying aztec token that needs to be swapped. +3. We transfer the user’s funds to the Uniswap contract. Like with Ethereum, the user must have provided approval to the Uniswap contract to do so. The user must provide the nonce they used in the approval for transfer, so that Uniswap can send it to the token contract, to prove it has appropriate approval. +4. Funds are added to the Uniswap contract. +5. Uniswap must exit the input tokens to L1. For this it has to approve the bridge to burn its tokens on its behalf and then actually exit the funds. We call the [`exit_to_l1_public()` method on the token bridge](../../../../tutorials/contract_tutorials/advanced/token_bridge/index.md). We use the public flow for exiting since we are operating on public state. +6. It is not enough for us to simply emit a message to withdraw the funds. We also need to emit a message to display our swap intention. If we do not do this, there is nothing stopping a third party from calling the Uniswap portal with their own parameters and consuming our message. + +So the Uniswap portal (on L1) needs to know: + +- The token portals for the input and output token (to withdraw the input token to L1 and later deposit the output token to L2) +- The amount of input tokens they want to swap +- The Uniswap fee tier they want to use +- The minimum output amount they can accept (for slippage protection) + +The Uniswap portal must first withdraw the input tokens, then check that the swap message exists in the outbox, execute the swap, and then call the output token to deposit the swapped tokens to L2. So the Uniswap portal must also be pass any parameters needed to complete the deposit of swapped tokens to L2. From the tutorial on building token bridges we know these are: + +- The address on L2 which must receive the output tokens (remember this is public flow) +- The secret hash for consume the L1 to L2 message. Since this is the public flow the preimage doesn’t need to be a secret. + +You can find the corresponding function on the [L1 contracts page](l1_contract.md). + +### Private swap + +#include_code swap_private noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr rust + +This uses a util function `compute_swap_private_content_hash()` - find that [here](#utils) + +This flow works similarly to the public flow with a few notable changes: + +- Notice how in the `swap_private()`, user has to pass in `token` address which they didn't in the public flow? Since `swap_private()` is a private method, it can't read what token is publicly stored on the token bridge, so instead the user passes a token address, and `_assert_token_is_same()` checks that this user provided address is same as the one in storage. Note that because public functions are executed by the sequencer while private methods are executed locally, all public calls are always done after all private calls are done. So first the burn would happen and only later the sequencer asserts that the token is same. Note that the sequencer just sees a request to `execute_assert_token_is_same` and therefore has no context on what the appropriate private method was. If the assertion fails, then the kernel circuit will fail to create a proof and hence the transaction will be dropped. +- In the public flow, the user calls `transfer_public()`. Here instead, the user calls `unshield()`. Why? The user can't directly transfer their private tokens (their notes) to the uniswap contract, because later the Uniswap contract has to approve the bridge to burn these notes and withdraw to L1. The authwit flow for the private domain requires a signature from the `sender`, which in this case would be the Uniswap contract. For the contract to sign, it would need a private key associated to it. But who would operate this key? +- To work around this, the user can unshield their private tokens into Uniswap L2 contract. Unshielding would convert user's private notes to public balance. It is a private method on the token contract that reduces a user’s private balance and then calls a public method to increase the recipient’s (ie Uniswap) public balance. **Remember that first all private methods are executed and then later all public methods will be - so the Uniswap contract won’t have the funds until public execution begins.** +- Now uniswap has public balance (like with the public flow). Hence, `swap_private()` calls the internal public method which approves the input token bridge to burn Uniswap’s tokens and calls `exit_to_l1_public` to create an L2 → L1 message to exit to L1. +- Constructing the message content for swapping works exactly as the public flow except instead of specifying who would be the Aztec address that receives the swapped funds, we specify a secret hash (`secret_hash_for_redeeming_minted_notes`). Only those who know the preimage to the secret can later redeem the minted notes to themselves. + +### Approve the bridge to burn this contract's funds + +Both public and private swap functions call this function: + +#include_code authwit_uniswap_set noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr rust + +### Assertions + +#include_code assert_token_is_same noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr rust + +This is a simple function that asserts that the token passed in to the function is the one that the bridge is associated with. + +## Utils + +### Compute content hash for public + +#include_code uniswap_public_content_hash noir-projects/noir-contracts/contracts/uniswap_contract/src/util.nr rust + +This method computes the L2 to L1 message content hash for the public. To find out how it is consumed on L1, view the [L1 contracts page](./l1_contract.md) + +### Compute content hash for private + +#include_code compute_swap_private_content_hash noir-projects/noir-contracts/contracts/uniswap_contract/src/util.nr rust + +This method computes the L2 to L1 message content hash for the private. To find out how it is consumed on L1, view the [L1 contracts page](./l1_contract.md). + +## Redeeming assets + +So you emitted a message to withdraw input tokens to L1 and a message to swap. Then you or someone on your behalf can swap on L1 and emit a message to deposit swapped assets to L2. + +You still need to "claim" these swapped funds on L2. + +In the public flow, you can call [`claim_public()`](../../../../tutorials/contract_tutorials/advanced/token_bridge/2_minting_on_aztec.md) on the output token bridge which consumes the deposit message and mints your assets. + +In the private flow, you can choose to leak your secret for L1 → L2 message consumption to let someone mint the notes on L2 (by calling [`claim_private()`](../../../../tutorials/contract_tutorials/advanced/token_bridge/2_minting_on_aztec.md) on the output token bridge) and then you can later redeem these notes to yourself by presenting the preimage to `secret_hash_for_redeeming_minted_notes` and calling the `redeem_shield()` method on the token contract. \ No newline at end of file diff --git a/docs/docs/reference/smart_contract_reference/globals.md b/docs/docs/reference/smart_contract_reference/globals.md index 803fc08c86d..ae034a17f6f 100644 --- a/docs/docs/reference/smart_contract_reference/globals.md +++ b/docs/docs/reference/smart_contract_reference/globals.md @@ -1,7 +1,7 @@ --- title: Global Variables description: Documentation of Aztec's Global Variables in the Public and Private Contexts -sidebar_position: 1 +sidebar_position: 2 --- # Global Variables diff --git a/docs/docs/reference/smart_contract_reference/history_lib_reference.md b/docs/docs/reference/smart_contract_reference/history_lib_reference.md index 9971a6ef775..825d2ddb8cc 100644 --- a/docs/docs/reference/smart_contract_reference/history_lib_reference.md +++ b/docs/docs/reference/smart_contract_reference/history_lib_reference.md @@ -1,6 +1,6 @@ --- title: History Reference -sidebar_position: 2 +sidebar_position: 3 --- diff --git a/docs/docs/reference/smart_contract_reference/portals/_category_.json b/docs/docs/reference/smart_contract_reference/portals/_category_.json index e52acf91653..3a04a4bcda8 100644 --- a/docs/docs/reference/smart_contract_reference/portals/_category_.json +++ b/docs/docs/reference/smart_contract_reference/portals/_category_.json @@ -1,6 +1,6 @@ { "label": "Portals", - "position": 3, + "position": 4, "collapsible": true, "collapsed": true } diff --git a/docs/docs/reference/smart_contract_reference/storage/_category_.json b/docs/docs/reference/smart_contract_reference/storage/_category_.json index 49a4bd8abca..25edf7aa1c2 100644 --- a/docs/docs/reference/smart_contract_reference/storage/_category_.json +++ b/docs/docs/reference/smart_contract_reference/storage/_category_.json @@ -1,5 +1,5 @@ { - "position": 0, + "position": 1, "collapsible": true, "collapsed": true, "label": "Storage" diff --git a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr index e844edd3d87..d00374bb4e4 100644 --- a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr @@ -21,14 +21,14 @@ contract Uniswap { struct Storage { portal_address: SharedImmutable, } - // docs:end:uniswap_setup - + #[aztec(public)] #[aztec(initializer)] fn constructor(portal_address: EthAddress) { storage.portal_address.initialize(portal_address); } - + // docs:end:uniswap_setup + // docs:start:swap_public #[aztec(public)] fn swap_public( From ac75f8cf2019dd00f80c81259c30737a042a4b9b Mon Sep 17 00:00:00 2001 From: Rahul Kothari Date: Tue, 18 Jun 2024 10:24:40 +0100 Subject: [PATCH 06/25] chore: fix migration notes (#7075) --- docs/docs/migration_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index 410a83be8f7..deaae350aa3 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -6,7 +6,7 @@ keywords: [sandbox, aztec, notes, migration, updating, upgrading] Aztec is in full-speed development. Literally every version breaks compatibility with the previous ones. This page attempts to target errors and difficulties you might encounter when upgrading, and how to resolve them. -## TBD +## 0.43.0 ### [Aztec.nr] `options.limit` has to be constant From d4921a032a56eb0ba464b0e505f6ac11cb41502d Mon Sep 17 00:00:00 2001 From: Rahul Kothari Date: Tue, 18 Jun 2024 11:05:36 +0100 Subject: [PATCH 07/25] chore: add transferFrom migration notes (#7079) --- docs/docs/migration_notes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index deaae350aa3..4beb7e9fc14 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -8,6 +8,10 @@ Aztec is in full-speed development. Literally every version breaks compatibility ## 0.43.0 +### [Aztec.nr] break `token.transfer()` into `transfer` and `transferFrom` +Earlier we had just one function - `transfer()` which used authwits to handle the case where a contract/user wants to transfer funds on behalf of another user. +To reduce circuit sizes and proof times, we are breaking up `transfer` and introducing a dedicated `transferFrom()` function like in the ERC20 standard. + ### [Aztec.nr] `options.limit` has to be constant The `limit` parameter in `NoteGetterOptions` and `NoteViewerOptions` is now required to be a compile-time constant. This allows performing loops over this value, which leads to reduced circuit gate counts when setting a `limit` value. From 6b3d04a691586c814d3ace965e0face20b1247b5 Mon Sep 17 00:00:00 2001 From: Aztec Bot <49558828+AztecBot@users.noreply.github.com> Date: Tue, 18 Jun 2024 07:46:34 -0400 Subject: [PATCH 08/25] chore(master): Release 0.43.0 (#6872) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* ---
aztec-package: 0.43.0 ## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-package-v0.42.0...aztec-package-v0.43.0) (2024-06-18) ### Features * Auth registry ([#7035](https://github.com/AztecProtocol/aztec-packages/issues/7035)) ([cea0b3b](https://github.com/AztecProtocol/aztec-packages/commit/cea0b3b29c2f7c37eb07c226a06534f92518cea6)) * Nuking last hardcoded note type ids ([#7069](https://github.com/AztecProtocol/aztec-packages/issues/7069)) ([a23fd0b](https://github.com/AztecProtocol/aztec-packages/commit/a23fd0ba1604a5308fd77ed45a5b1d20da13f405)), closes [#5833](https://github.com/AztecProtocol/aztec-packages/issues/5833) ### Miscellaneous * Move gas bridge initialization into L1 contracts deployment ([#6912](https://github.com/AztecProtocol/aztec-packages/issues/6912)) ([26a1fc4](https://github.com/AztecProtocol/aztec-packages/commit/26a1fc4bcec04434b61651e2f527938a14f3ac3a)) * Rename p2p vars ([#6916](https://github.com/AztecProtocol/aztec-packages/issues/6916)) ([ae7d757](https://github.com/AztecProtocol/aztec-packages/commit/ae7d75764fc704daae67be882e0e9f09a0a9407c)) * Terraform Updates ([#6887](https://github.com/AztecProtocol/aztec-packages/issues/6887)) ([33a3870](https://github.com/AztecProtocol/aztec-packages/commit/33a3870d06ae8bb5d08dbbd9f72a62e0811e5e7d)) * Transfer and transferfrom to save constrains for simpler cases ([#7013](https://github.com/AztecProtocol/aztec-packages/issues/7013)) ([612b972](https://github.com/AztecProtocol/aztec-packages/commit/612b9724a419224c72cd823c889ece4ae8f00ab0)) * Updated devnet terraform ([#6927](https://github.com/AztecProtocol/aztec-packages/issues/6927)) ([4692fb0](https://github.com/AztecProtocol/aztec-packages/commit/4692fb034f22bb62593d257777b7b545993c27ab))
barretenberg.js: 0.43.0 ## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.42.0...barretenberg.js-v0.43.0) (2024-06-18) ### Miscellaneous * **barretenberg.js:** Synchronize aztec-packages versions
aztec-packages: 0.43.0 ## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.42.0...aztec-packages-v0.43.0) (2024-06-18) ### ⚠ BREAKING CHANGES * remove `distinct` keyword (https://github.com/noir-lang/noir/pull/5219) * remove `param_witnesses` and `return_witnesses` from ABI (https://github.com/noir-lang/noir/pull/5154) * add session id to foreign call RPC requests (https://github.com/noir-lang/noir/pull/5205) * make options.limit a compile-time constant ([#7027](https://github.com/AztecProtocol/aztec-packages/issues/7027)) * restrict noir word size to u32 (https://github.com/noir-lang/noir/pull/5180) * separate proving from `noir_js` (https://github.com/noir-lang/noir/pull/5072) ### Features * `pxe.addNullifiedNote(...)` ([#6948](https://github.com/AztecProtocol/aztec-packages/issues/6948)) ([42a4b1c](https://github.com/AztecProtocol/aztec-packages/commit/42a4b1c6f000886b8b63e2fd6b0b218a29cb820c)) * Add data dir to pxe container ([#6874](https://github.com/AztecProtocol/aztec-packages/issues/6874)) ([504fea2](https://github.com/AztecProtocol/aztec-packages/commit/504fea2e330ad66ec269ddff581b7448c008f9ca)) * Add ENFORCE_FEES sequencer config ([#6949](https://github.com/AztecProtocol/aztec-packages/issues/6949)) ([46dcb98](https://github.com/AztecProtocol/aztec-packages/commit/46dcb985e98ca26ee2dd3d2ec98976f1d8f27ba7)) * Add gate profiler for noir circuits ([#7004](https://github.com/AztecProtocol/aztec-packages/issues/7004)) ([a2f6876](https://github.com/AztecProtocol/aztec-packages/commit/a2f687687559d15fde52abce54838f6e144a0aa4)) * Add node to devnet ([#6898](https://github.com/AztecProtocol/aztec-packages/issues/6898)) ([acc534c](https://github.com/AztecProtocol/aztec-packages/commit/acc534c339ad05d548f8f287e4bd6051201cb1f6)) * Add session id to foreign call RPC requests (https://github.com/noir-lang/noir/pull/5205) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Add standard form function to biggroup ([#6899](https://github.com/AztecProtocol/aztec-packages/issues/6899)) ([3e44be5](https://github.com/AztecProtocol/aztec-packages/commit/3e44be538e5c7f0e7269c1e5c0820f7bc6e83734)) * Add utils::collapse ([#7016](https://github.com/AztecProtocol/aztec-packages/issues/7016)) ([2d19ad9](https://github.com/AztecProtocol/aztec-packages/commit/2d19ad9af6130aeaf6621f239c4119c3126dd7c6)) * Affine_element read/write with proper handling of point at infinity ([#6963](https://github.com/AztecProtocol/aztec-packages/issues/6963)) ([c6cbe39](https://github.com/AztecProtocol/aztec-packages/commit/c6cbe39eed23dc845aef898e937e99de43f71675)) * Auth registry ([#7035](https://github.com/AztecProtocol/aztec-packages/issues/7035)) ([cea0b3b](https://github.com/AztecProtocol/aztec-packages/commit/cea0b3b29c2f7c37eb07c226a06534f92518cea6)) * Auto-gen p2p private key ([#6910](https://github.com/AztecProtocol/aztec-packages/issues/6910)) ([0fc9677](https://github.com/AztecProtocol/aztec-packages/commit/0fc9677b2db0b126e6b604b387735a29e295ff05)) * Avm e2e nested call + alu fix + cast fix ([#6974](https://github.com/AztecProtocol/aztec-packages/issues/6974)) ([b150b61](https://github.com/AztecProtocol/aztec-packages/commit/b150b610153e380a93240914c95887f88b56fa94)) * **avm-simulator:** Msm blackbox ([#7048](https://github.com/AztecProtocol/aztec-packages/issues/7048)) ([0ce27e0](https://github.com/AztecProtocol/aztec-packages/commit/0ce27e05c4c099167d0d98300f6d73ced22639ad)) * **avm:** Add get_contract_instance ([#6871](https://github.com/AztecProtocol/aztec-packages/issues/6871)) ([b3a86bf](https://github.com/AztecProtocol/aztec-packages/commit/b3a86bf72343d1060ce58a11f139e05ba2a75754)) * **avm:** Deserialise execution hints in bb main ([#6848](https://github.com/AztecProtocol/aztec-packages/issues/6848)) ([d3be85f](https://github.com/AztecProtocol/aztec-packages/commit/d3be85f57c34aa88e732ea115239f3bed1e7aa16)) * **avm:** E2e proving of storage ([#6967](https://github.com/AztecProtocol/aztec-packages/issues/6967)) ([6a7be0c](https://github.com/AztecProtocol/aztec-packages/commit/6a7be0c434934175bb6da1f3525c025b3f743824)) * **avm:** E2e send l1 msg ([#6880](https://github.com/AztecProtocol/aztec-packages/issues/6880)) ([deb972d](https://github.com/AztecProtocol/aztec-packages/commit/deb972d3f13a92d34a6f91074b072fb66d247f64)) * **avm:** Gas remaining range check and handling of out of gas ([#6944](https://github.com/AztecProtocol/aztec-packages/issues/6944)) ([5647571](https://github.com/AztecProtocol/aztec-packages/commit/56475716e05973e6b493de427f32eee71c0f8f6a)), closes [#6902](https://github.com/AztecProtocol/aztec-packages/issues/6902) * **avm:** Get contract instance now works e2e with avm proving ([#6911](https://github.com/AztecProtocol/aztec-packages/issues/6911)) ([662187d](https://github.com/AztecProtocol/aztec-packages/commit/662187d1d6960b734a71aaf365e7f20d471dc4c9)) * **avm:** Indirect support for kernel output opcodes ([#6962](https://github.com/AztecProtocol/aztec-packages/issues/6962)) ([f330bff](https://github.com/AztecProtocol/aztec-packages/commit/f330bffa80b6da5f037cea3cf469ef1c7b6d9d03)) * **avm:** Indirect support for kernel read opcodes ([#6940](https://github.com/AztecProtocol/aztec-packages/issues/6940)) ([ccc474d](https://github.com/AztecProtocol/aztec-packages/commit/ccc474d9d0cd10faf857bc1ec6571dc25306a531)) * **avm:** L2gasleft and dagasleft opcodes ([#6884](https://github.com/AztecProtocol/aztec-packages/issues/6884)) ([fbab612](https://github.com/AztecProtocol/aztec-packages/commit/fbab612b17dfe0e95ead1a592b7bc9fe6ca5415d)) * **avm:** Nullifier non exist ([#6877](https://github.com/AztecProtocol/aztec-packages/issues/6877)) ([05697f2](https://github.com/AztecProtocol/aztec-packages/commit/05697f289d3b97def74f45cd839a58a8a077c3fa)) * **avm:** Plumb externalcall hints ([#6890](https://github.com/AztecProtocol/aztec-packages/issues/6890)) ([3a97f08](https://github.com/AztecProtocol/aztec-packages/commit/3a97f08c457472bd701200adfa45d61554fd3867)) * **avm:** Plumb start side effect counter in circuit ([#7007](https://github.com/AztecProtocol/aztec-packages/issues/7007)) ([fa8f12f](https://github.com/AztecProtocol/aztec-packages/commit/fa8f12f93a8d94604a4382de444501fac310dbb8)) * **avm:** Revert opcode ([#6909](https://github.com/AztecProtocol/aztec-packages/issues/6909)) ([620d3da](https://github.com/AztecProtocol/aztec-packages/commit/620d3dacc853c71e808ef58001eb4c8584fa59d9)) * **avm:** Support preserving BB working dir for better debugging ([#6990](https://github.com/AztecProtocol/aztec-packages/issues/6990)) ([a9688f0](https://github.com/AztecProtocol/aztec-packages/commit/a9688f058252cb1c4714cfb06bd2cf30c6ac0268)) * **avm:** Use hints in gas accounting (circuit) ([#6895](https://github.com/AztecProtocol/aztec-packages/issues/6895)) ([c3746f5](https://github.com/AztecProtocol/aztec-packages/commit/c3746f5d6ae38bc448d00834d91a7ddd7b901e64)) * **bb:** Stack traces for check_circuit ([#6851](https://github.com/AztecProtocol/aztec-packages/issues/6851)) ([eb35e62](https://github.com/AztecProtocol/aztec-packages/commit/eb35e627445c72ee07fafb3652076349302e7fa1)) * **cli:** Publicly deploy a pre-initialized account ([#6960](https://github.com/AztecProtocol/aztec-packages/issues/6960)) ([e671935](https://github.com/AztecProtocol/aztec-packages/commit/e67193585fe967106a013d266e00e94d20d31b32)) * Constrain note encryption ([#6432](https://github.com/AztecProtocol/aztec-packages/issues/6432)) ([e59f4d3](https://github.com/AztecProtocol/aztec-packages/commit/e59f4d3cee4b27248d26111fc6fda2f0e55a7d54)) * Contract storage reads serialize with side effect counter ([#6961](https://github.com/AztecProtocol/aztec-packages/issues/6961)) ([db49ed5](https://github.com/AztecProtocol/aztec-packages/commit/db49ed57d1d4165ce47e6af01b6fd67239121aa4)) * **docs:** Add uniswap back in as a reference and fix links ([#7074](https://github.com/AztecProtocol/aztec-packages/issues/7074)) ([a4d1df6](https://github.com/AztecProtocol/aztec-packages/commit/a4d1df6d2900185a9c57af44e6f0c3ca80df7c9b)) * **docs:** Nits ([#6187](https://github.com/AztecProtocol/aztec-packages/issues/6187)) ([d025496](https://github.com/AztecProtocol/aztec-packages/commit/d0254960b1712b717e156b428aa05721702ec4a8)) * Ecadd op code ([#6906](https://github.com/AztecProtocol/aztec-packages/issues/6906)) ([03a9064](https://github.com/AztecProtocol/aztec-packages/commit/03a9064b308fbf5541f4f763e1ad1e05f60e1fff)) * Estimate tx size ([#6928](https://github.com/AztecProtocol/aztec-packages/issues/6928)) ([1fa7d84](https://github.com/AztecProtocol/aztec-packages/commit/1fa7d84b6bf176d4585c333747ac4a61b8743e36)) * Flows and tests for the tube component ([#6934](https://github.com/AztecProtocol/aztec-packages/issues/6934)) ([4b45438](https://github.com/AztecProtocol/aztec-packages/commit/4b454386a35f4b0cd4c6a9b8003c55e55e50b592)) * Gas token self deploys ([#6956](https://github.com/AztecProtocol/aztec-packages/issues/6956)) ([ecd7614](https://github.com/AztecProtocol/aztec-packages/commit/ecd7614d0a52d277862aef97e81b68b8f66bc2c0)) * Implement println in the comptime interpreter (https://github.com/noir-lang/noir/pull/5197) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Increase max L2 to L1 msgs ([#6959](https://github.com/AztecProtocol/aztec-packages/issues/6959)) ([875fb2d](https://github.com/AztecProtocol/aztec-packages/commit/875fb2d507368b15c9672526c52b92039ef558d3)) * Make options.limit a compile-time constant ([#7027](https://github.com/AztecProtocol/aztec-packages/issues/7027)) ([78cd640](https://github.com/AztecProtocol/aztec-packages/commit/78cd640dd2d5b281a921140b915a294eaa44f6f0)) * Nuking last hardcoded note type ids ([#7069](https://github.com/AztecProtocol/aztec-packages/issues/7069)) ([a23fd0b](https://github.com/AztecProtocol/aztec-packages/commit/a23fd0ba1604a5308fd77ed45a5b1d20da13f405)), closes [#5833](https://github.com/AztecProtocol/aztec-packages/issues/5833) * Place return value witnesses directly after function arguments (https://github.com/noir-lang/noir/pull/5142) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Poor man's CLI block explorer ([#6946](https://github.com/AztecProtocol/aztec-packages/issues/6946)) ([2b79df6](https://github.com/AztecProtocol/aztec-packages/commit/2b79df673e7a23886052990c85dc6ca530537e9f)) * Poor man's fernet ([#6918](https://github.com/AztecProtocol/aztec-packages/issues/6918)) ([19c2a97](https://github.com/AztecProtocol/aztec-packages/commit/19c2a97784c917da212e76f3307d47e1beb8099f)) * Private kernel output validator ([#6892](https://github.com/AztecProtocol/aztec-packages/issues/6892)) ([0435e9a](https://github.com/AztecProtocol/aztec-packages/commit/0435e9a76f158b72690f34025a2723a29a3c7816)) * Processing outgoing ([#6766](https://github.com/AztecProtocol/aztec-packages/issues/6766)) ([4da66fd](https://github.com/AztecProtocol/aztec-packages/commit/4da66fdfb3d0686b5ed917e947869b9c2cef14a8)) * Pxe can filter on emitted events ([#6947](https://github.com/AztecProtocol/aztec-packages/issues/6947)) ([ee45fda](https://github.com/AztecProtocol/aztec-packages/commit/ee45fdafd837e4070b627aaac630e2f985531c97)) * Restrict noir word size to u32 (https://github.com/noir-lang/noir/pull/5180) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Separate proving from `noir_js` (https://github.com/noir-lang/noir/pull/5072) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Separate runtimes of SSA functions before inlining (https://github.com/noir-lang/noir/pull/5121) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * SMT Standard Circuit separation ([#6904](https://github.com/AztecProtocol/aztec-packages/issues/6904)) ([f970732](https://github.com/AztecProtocol/aztec-packages/commit/f9707321bdd107e3c7116cafd89fd570224e89ef)) * SMT Verification Module Update ([#6849](https://github.com/AztecProtocol/aztec-packages/issues/6849)) ([6c98529](https://github.com/AztecProtocol/aztec-packages/commit/6c985299d796b8c711794395518c3b3a0f41e775)) * SMT Verifier for Ultra Arithmetization ([#7067](https://github.com/AztecProtocol/aztec-packages/issues/7067)) ([6692ac8](https://github.com/AztecProtocol/aztec-packages/commit/6692ac831ab980d9623442236c21b499a7238966)) * Splitting event log functionality ([#6921](https://github.com/AztecProtocol/aztec-packages/issues/6921)) ([8052bc6](https://github.com/AztecProtocol/aztec-packages/commit/8052bc64ee53e27f364438ecee057e2c9c1b3583)) * Standard form for cycle_group ([#6915](https://github.com/AztecProtocol/aztec-packages/issues/6915)) ([e6cba16](https://github.com/AztecProtocol/aztec-packages/commit/e6cba16ef82428b115d527eabe237122e269aa32)) * Standardize pedersen functions to return `EmbeddedCurvePoint` (https://github.com/noir-lang/noir/pull/5190) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Storing outgoing + API for outgoing ([#7022](https://github.com/AztecProtocol/aztec-packages/issues/7022)) ([8281ec6](https://github.com/AztecProtocol/aztec-packages/commit/8281ec6dcd60a08a20da86fb9805dda8e9581764)) * Support casting in globals (https://github.com/noir-lang/noir/pull/5164) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Support disabling aztec vm in non-wasm builds ([#6965](https://github.com/AztecProtocol/aztec-packages/issues/6965)) ([f7a46c0](https://github.com/AztecProtocol/aztec-packages/commit/f7a46c0d8de2e58b7e76576a76eb85f52b266966)) * Sync from aztec-packages (https://github.com/noir-lang/noir/pull/5222) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Track timeout status of proving jobs ([#6868](https://github.com/AztecProtocol/aztec-packages/issues/6868)) ([7306176](https://github.com/AztecProtocol/aztec-packages/commit/7306176c80d1d80c032c3eed38a2008d545fb025)) ### Bug Fixes * ALU pil relation TWO_LINE_OP_NO_OVERLAP ([#6968](https://github.com/AztecProtocol/aztec-packages/issues/6968)) ([4ba553b](https://github.com/AztecProtocol/aztec-packages/commit/4ba553ba3170838de3b6c4cf47b609b0198443d0)) * AVM / aztec-up CircleCI issues ([#7045](https://github.com/AztecProtocol/aztec-packages/issues/7045)) ([3f5d380](https://github.com/AztecProtocol/aztec-packages/commit/3f5d380f72d5ae819b2718ef9fbdfaec6b9a0e4d)) * **avm:** Bugfix related to pc increment in calldatacopy of avm circuit ([#6891](https://github.com/AztecProtocol/aztec-packages/issues/6891)) ([5fe59d2](https://github.com/AztecProtocol/aztec-packages/commit/5fe59d2ed96a5b966efc9e3619c87b4a23c502f4)) * **avm:** Correctly generate public inputs in verifier ([#7018](https://github.com/AztecProtocol/aztec-packages/issues/7018)) ([4c4c17f](https://github.com/AztecProtocol/aztec-packages/commit/4c4c17f804b8735dc017bbae171117ca15df25cc)) * Aztec-builder port issue ([#7068](https://github.com/AztecProtocol/aztec-packages/issues/7068)) ([729e69a](https://github.com/AztecProtocol/aztec-packages/commit/729e69ae2cd773ee176935b7d4644db95dd62668)) * Biggroup batch mul handles collisions ([#6780](https://github.com/AztecProtocol/aztec-packages/issues/6780)) ([e61c40e](https://github.com/AztecProtocol/aztec-packages/commit/e61c40e9c3e71f50c2d6a6c8a1688b6a8ddd4ba8)) * Bugfix for Keccak opcode related to reading bytes from input ([#6989](https://github.com/AztecProtocol/aztec-packages/issues/6989)) ([5713f4e](https://github.com/AztecProtocol/aztec-packages/commit/5713f4e25ef8bf09cb91632bd210cd46bb7a77c3)) * Correct docker-compose vars ([#6945](https://github.com/AztecProtocol/aztec-packages/issues/6945)) ([d492ac8](https://github.com/AztecProtocol/aztec-packages/commit/d492ac80e346572a371df84a6cebc4409b634a8d)) * Declare volume ([#6881](https://github.com/AztecProtocol/aztec-packages/issues/6881)) ([1e38115](https://github.com/AztecProtocol/aztec-packages/commit/1e381159bb1d407dec8a4926242ecd54ec38e787)) * Dirty merge 6880 ([#6905](https://github.com/AztecProtocol/aztec-packages/issues/6905)) ([fc6ec3f](https://github.com/AztecProtocol/aztec-packages/commit/fc6ec3fc7371b2506e7409a7d24ce37f25803fac)) * Do not fail if rollup contract does not support turns ([#6938](https://github.com/AztecProtocol/aztec-packages/issues/6938)) ([5e6fe68](https://github.com/AztecProtocol/aztec-packages/commit/5e6fe68e088483203655522e0242c7e3230297b5)) * Docker compose env vars ([#6926](https://github.com/AztecProtocol/aztec-packages/issues/6926)) ([14e0c1d](https://github.com/AztecProtocol/aztec-packages/commit/14e0c1df512555900cd49fff2d9070b489984e2f)) * **docs:** Fix avm instruction set table ([#7061](https://github.com/AztecProtocol/aztec-packages/issues/7061)) ([fcbd44b](https://github.com/AztecProtocol/aztec-packages/commit/fcbd44b43e8a5dd459b543aaa25158d7f1dcc050)) * **docs:** Remove prefix in link to code snippet source ([#6878](https://github.com/AztecProtocol/aztec-packages/issues/6878)) ([0e8e772](https://github.com/AztecProtocol/aztec-packages/commit/0e8e772c05c81c0b5cf6a2d047a5587c6c2e1a9c)) * **elaborator:** Invert unconstrained check (https://github.com/noir-lang/noir/pull/5176) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * **elaborator:** Lazily elaborate globals (https://github.com/noir-lang/noir/pull/5191) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Ensure changes in aztec up directory are deployed ([#7031](https://github.com/AztecProtocol/aztec-packages/issues/7031)) ([e673fd4](https://github.com/AztecProtocol/aztec-packages/commit/e673fd4784147c365d9191a997049c53a7d6d67f)), closes [#6932](https://github.com/AztecProtocol/aztec-packages/issues/6932) * Error for allocate instructions in acir-gen (https://github.com/noir-lang/noir/pull/5200) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * **experimental elaborator:** Clear generics after elaborating type aliases (https://github.com/noir-lang/noir/pull/5136) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix `impl Trait` when `--use-elaborator` is selected (https://github.com/noir-lang/noir/pull/5138) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix definition kind of globals and tuple patterns with `--use-elaborator` flag (https://github.com/noir-lang/noir/pull/5139) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix frontend tests when `--use-elaborator` flag is specified (https://github.com/noir-lang/noir/pull/5145) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix global values used in the elaborator (https://github.com/noir-lang/noir/pull/5135) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix globals which use function calls (https://github.com/noir-lang/noir/pull/5172) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Expose node port ([#6917](https://github.com/AztecProtocol/aztec-packages/issues/6917)) ([131af88](https://github.com/AztecProtocol/aztec-packages/commit/131af8806a453b851403b0eb7cba855bc2c0cc43)) * Fix avm unit test with proving by passing the public_inputs ([#7062](https://github.com/AztecProtocol/aztec-packages/issues/7062)) ([2d7c097](https://github.com/AztecProtocol/aztec-packages/commit/2d7c097d7a6606101354736d69bd0bbbe6f005bf)) * Fix client ivc incorrect srs size issue and parallelise srs generation for grumpkin ([#6913](https://github.com/AztecProtocol/aztec-packages/issues/6913)) ([f015736](https://github.com/AztecProtocol/aztec-packages/commit/f01573641728d6cc62da36189a22fa813713fd82)) * Fix for the flaky issue (I hope) ([#6923](https://github.com/AztecProtocol/aztec-packages/issues/6923)) ([39747b9](https://github.com/AztecProtocol/aztec-packages/commit/39747b933a13aa08f25c5074207f9d92489d5e3d)) * Fix panic in `get_global_let_statement` (https://github.com/noir-lang/noir/pull/5177) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Fixing 0 naf ([#6950](https://github.com/AztecProtocol/aztec-packages/issues/6950)) ([d35ee2e](https://github.com/AztecProtocol/aztec-packages/commit/d35ee2ed87967a5161ef52d892856900a55de0b9)) * **frontend:** Resolve object types from method calls a single time (https://github.com/noir-lang/noir/pull/5131) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Initialize side_effect_counter based on the initial value passed to builder ([#7017](https://github.com/AztecProtocol/aztec-packages/issues/7017)) ([46d166b](https://github.com/AztecProtocol/aztec-packages/commit/46d166b0f1d16d801e056d3195546970cddda1a8)) * **p2p:** Remove p2p datastore persistence for now ([#6879](https://github.com/AztecProtocol/aztec-packages/issues/6879)) ([ce7f0e2](https://github.com/AztecProtocol/aztec-packages/commit/ce7f0e244621a599796e8d26fd37540b541ca0d3)) * Pxe waits for node to go up ([#6933](https://github.com/AztecProtocol/aztec-packages/issues/6933)) ([06f03fd](https://github.com/AztecProtocol/aztec-packages/commit/06f03fdf73d9374b5d18d33cf1480f7748db016f)) * Register account contract before recipient ([#6855](https://github.com/AztecProtocol/aztec-packages/issues/6855)) ([dfea1c7](https://github.com/AztecProtocol/aztec-packages/commit/dfea1c79f57564af3be83a0b3244374f74834571)) * Revert "chore: add arm64 version of aztec-nargo image" ([#7039](https://github.com/AztecProtocol/aztec-packages/issues/7039)) ([25d12da](https://github.com/AztecProtocol/aztec-packages/commit/25d12da45c1c36e8c5b77a8c81baea3bb365d2c6)) * SimulateTx does not prove ([#6930](https://github.com/AztecProtocol/aztec-packages/issues/6930)) ([d3d6b9e](https://github.com/AztecProtocol/aztec-packages/commit/d3d6b9ebfa81267b28ebf361fdba310071963492)) * Stop squashing storage accesses in avm simulator - all need to be validated in kernel ([#7036](https://github.com/AztecProtocol/aztec-packages/issues/7036)) ([6ffc4b4](https://github.com/AztecProtocol/aztec-packages/commit/6ffc4b4455a0613c933de0ec7528774186f53bee)) * Update docker-compopse env vars ([#6943](https://github.com/AztecProtocol/aztec-packages/issues/6943)) ([80d1121](https://github.com/AztecProtocol/aztec-packages/commit/80d1121f270363a3da1e4200f41283f822357f92)) * Updating max update requests per tx ([#6783](https://github.com/AztecProtocol/aztec-packages/issues/6783)) ([55b1cf7](https://github.com/AztecProtocol/aztec-packages/commit/55b1cf7056ab3d630b2ed98d1d99c43b39feb587)) * Use predicate for curve operations (https://github.com/noir-lang/noir/pull/5076) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Wrapping in signed division (https://github.com/noir-lang/noir/pull/5134) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) ### Miscellaneous * Add arm64 version of aztec-nargo image ([#7034](https://github.com/AztecProtocol/aztec-packages/issues/7034)) ([2a41e84](https://github.com/AztecProtocol/aztec-packages/commit/2a41e8415bac26b122c0da2672bf3077aae4eda2)) * Add more lints related to oracle calls (https://github.com/noir-lang/noir/pull/5193) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Add negative tests for cast and U128 multiplication related to TWO_LINE_OP_NO_OVERLAP ([#7041](https://github.com/AztecProtocol/aztec-packages/issues/7041)) ([7f14ca1](https://github.com/AztecProtocol/aztec-packages/commit/7f14ca122032a56eb322e34ee0290845e75a925a)), closes [#6969](https://github.com/AztecProtocol/aztec-packages/issues/6969) * Add some property tests to ACVM crates (https://github.com/noir-lang/noir/pull/5215) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Add transfer to undeployed account ([#7015](https://github.com/AztecProtocol/aztec-packages/issues/7015)) ([46324b9](https://github.com/AztecProtocol/aztec-packages/commit/46324b96343a9b603413843480211d05abdf4556)) * Add transferFrom migration notes ([#7079](https://github.com/AztecProtocol/aztec-packages/issues/7079)) ([d4921a0](https://github.com/AztecProtocol/aztec-packages/commit/d4921a032a56eb0ba464b0e505f6ac11cb41502d)) * Automate necessary changes to outward sync into noir-lang/noir ([#7049](https://github.com/AztecProtocol/aztec-packages/issues/7049)) ([449e41c](https://github.com/AztecProtocol/aztec-packages/commit/449e41c1ffbded4b64bf9cde7a97fd8670d7647c)) * **avm:** Add a TS prover test suite for each avm context function ([#6957](https://github.com/AztecProtocol/aztec-packages/issues/6957)) ([f745696](https://github.com/AztecProtocol/aztec-packages/commit/f745696270a440ce45a33b1f72996e47dacdaf74)) * **avm:** Add bytecode size metrics ([#7042](https://github.com/AztecProtocol/aztec-packages/issues/7042)) ([555d97a](https://github.com/AztecProtocol/aztec-packages/commit/555d97af65cfb1b8d30b32d5b9b9a23b9b446f9e)) * **avm:** Add debugging info and trace dump ([#6979](https://github.com/AztecProtocol/aztec-packages/issues/6979)) ([e11f880](https://github.com/AztecProtocol/aztec-packages/commit/e11f88004e2c31cb2b2ae376095513e94584a4dc)) * **avm:** Add tag checking and missing indirects ([#6936](https://github.com/AztecProtocol/aztec-packages/issues/6936)) ([48be80c](https://github.com/AztecProtocol/aztec-packages/commit/48be80c4f9cd21885b21cb9c8202e956d537e595)) * **avm:** Add TS bb prover tests for hashing opcodes ([#6970](https://github.com/AztecProtocol/aztec-packages/issues/6970)) ([312718a](https://github.com/AztecProtocol/aztec-packages/commit/312718a6946651470c7c97e42414bfc654355d24)) * **avm:** Enable tag checking and some proving tests ([#6966](https://github.com/AztecProtocol/aztec-packages/issues/6966)) ([b19daa4](https://github.com/AztecProtocol/aztec-packages/commit/b19daa44f034e50109e53363e691493534e7d3f1)) * **avm:** Fix proving for kernel tests ([#7033](https://github.com/AztecProtocol/aztec-packages/issues/7033)) ([f5e1106](https://github.com/AztecProtocol/aztec-packages/commit/f5e1106bcaa9558ac0a953de06d4fafd09fb1fe8)) * **avm:** Fix struct serialization and factory ([#6903](https://github.com/AztecProtocol/aztec-packages/issues/6903)) ([bee2646](https://github.com/AztecProtocol/aztec-packages/commit/bee2646d0274806e8fd1a74bd321620c8c8bd0d9)) * **avm:** Gas alignments with simulator ([#6873](https://github.com/AztecProtocol/aztec-packages/issues/6873)) ([54339d4](https://github.com/AztecProtocol/aztec-packages/commit/54339d48861a91429e996177713f46952ffbd808)), closes [#6860](https://github.com/AztecProtocol/aztec-packages/issues/6860) * **avm:** Modify unit test to have a calldatacopy over 4 elements ([#6893](https://github.com/AztecProtocol/aztec-packages/issues/6893)) ([9f5b113](https://github.com/AztecProtocol/aztec-packages/commit/9f5b11345dc5dd055442eaf7673227fe7cbaf262)) * **avm:** Remove unused public context inputs ([#7028](https://github.com/AztecProtocol/aztec-packages/issues/7028)) ([f7a0921](https://github.com/AztecProtocol/aztec-packages/commit/f7a0921bb4bb26a3abba9c298a7f50e49248d711)) * Avoid `bn254_blackbox_solver` polluting feature flags (https://github.com/noir-lang/noir/pull/5141) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Avoid manual creation of contract artifact in wasm (https://github.com/noir-lang/noir/pull/5117) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Bb repo warning ([#7023](https://github.com/AztecProtocol/aztec-packages/issues/7023)) ([c3d7053](https://github.com/AztecProtocol/aztec-packages/commit/c3d70537c5558ba451a43e403bab067940aa48b6)) * **bb:** Hide `debug()` logs under `--debug` flag ([#7008](https://github.com/AztecProtocol/aztec-packages/issues/7008)) ([a8c3c3f](https://github.com/AztecProtocol/aztec-packages/commit/a8c3c3fcf35b7c464006c481230afcb11b9952dc)) * Break out helper methods for writing foreign call results (https://github.com/noir-lang/noir/pull/5181) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * **ci:** Don't raise MSRV issue if workflow cancelled (https://github.com/noir-lang/noir/pull/5143) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Custom jest Field equality ([#7012](https://github.com/AztecProtocol/aztec-packages/issues/7012)) ([1a198b8](https://github.com/AztecProtocol/aztec-packages/commit/1a198b8d53397f89f9fe6299d9ec5cb42ce245b2)) * Default to using bn254 in `noirc_frontend` (https://github.com/noir-lang/noir/pull/5144) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **docs:** Fix incorrect docs github link in footer (https://github.com/noir-lang/noir/pull/5206) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * **docs:** Fixing the breadcrumb issue ([#6605](https://github.com/AztecProtocol/aztec-packages/issues/6605)) ([2624c26](https://github.com/AztecProtocol/aztec-packages/commit/2624c264fd266e090eec1b79654005b4dcd057de)) * **docs:** Supplement Noir Debugger's dependency versions (https://github.com/noir-lang/noir/pull/5199) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * **docs:** Update docs homepage (https://github.com/noir-lang/noir/pull/5198) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Enable skipped ordering tests since AVM properly updates side-effect counter for nested calls ([#7064](https://github.com/AztecProtocol/aztec-packages/issues/7064)) ([5ff5ffb](https://github.com/AztecProtocol/aztec-packages/commit/5ff5ffb83ae55c6f12af6e5271e399f4aeaa4737)), closes [#6471](https://github.com/AztecProtocol/aztec-packages/issues/6471) * **experimental elaborator:** Handle `comptime` expressions in the elaborator (https://github.com/noir-lang/noir/pull/5169) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Fix issue [#6929](https://github.com/AztecProtocol/aztec-packages/issues/6929) (off-by-one error in `UltraCircuitBuilder::create_range_constraint`) ([#6931](https://github.com/AztecProtocol/aztec-packages/issues/6931)) ([16deef6](https://github.com/AztecProtocol/aztec-packages/commit/16deef6a83a9fe41e1f865e79e17c2f671604bb0)) * Fix migration notes ([#7075](https://github.com/AztecProtocol/aztec-packages/issues/7075)) ([ac75f8c](https://github.com/AztecProtocol/aztec-packages/commit/ac75f8cf2019dd00f80c81259c30737a042a4b9b)) * Granular public simulation benchmarks ([#6924](https://github.com/AztecProtocol/aztec-packages/issues/6924)) ([b70bc98](https://github.com/AztecProtocol/aztec-packages/commit/b70bc98c948c51053560e8948a43b65159a95b58)) * Inline `FieldElement.is_negative` and document (https://github.com/noir-lang/noir/pull/5214) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Lookups cleanup/documentation ([#7002](https://github.com/AztecProtocol/aztec-packages/issues/7002)) ([92b1349](https://github.com/AztecProtocol/aztec-packages/commit/92b1349ba671e87e948bf9248c5133accde9091f)) * Loosen trait bounds on impls depending on `AcirField` (https://github.com/noir-lang/noir/pull/5115) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Make `nargo` crate and debug info generic (https://github.com/noir-lang/noir/pull/5184) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Mark all oracles as unconstrained ([#7032](https://github.com/AztecProtocol/aztec-packages/issues/7032)) ([7a68be4](https://github.com/AztecProtocol/aztec-packages/commit/7a68be4bc31114853d8c25549029c74afd9a8f37)) * Move acir docs to code declaration (https://github.com/noir-lang/noir/pull/5040) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Move gas bridge initialization into L1 contracts deployment ([#6912](https://github.com/AztecProtocol/aztec-packages/issues/6912)) ([26a1fc4](https://github.com/AztecProtocol/aztec-packages/commit/26a1fc4bcec04434b61651e2f527938a14f3ac3a)) * Move implementation of bitwise operations into `blackbox_solver` (https://github.com/noir-lang/noir/pull/5209) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Note emission ([#7003](https://github.com/AztecProtocol/aztec-packages/issues/7003)) ([10048da](https://github.com/AztecProtocol/aztec-packages/commit/10048da5ce7edfe850d03ee97505ed72552c1dca)) * Note processor cleanup ([#6870](https://github.com/AztecProtocol/aztec-packages/issues/6870)) ([315c46e](https://github.com/AztecProtocol/aztec-packages/commit/315c46e3804718bcaf7337da887548755984ca67)) * Opcodes l2gasleft and dagasleft return value with tag ff ([#6896](https://github.com/AztecProtocol/aztec-packages/issues/6896)) ([5890845](https://github.com/AztecProtocol/aztec-packages/commit/5890845e8f9b278b2a5c5c930eb28ec0aba74ebc)) * Parallelise compilation of contracts and protocol circuits ([#7009](https://github.com/AztecProtocol/aztec-packages/issues/7009)) ([86a3314](https://github.com/AztecProtocol/aztec-packages/commit/86a33140f9a65e518003b3f4c60f97d132f85b89)) * Remove `distinct` keyword (https://github.com/noir-lang/noir/pull/5219) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Remove `param_witnesses` and `return_witnesses` from ABI (https://github.com/noir-lang/noir/pull/5154) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Remove deprecated functions ([#7029](https://github.com/AztecProtocol/aztec-packages/issues/7029)) ([bc80e85](https://github.com/AztecProtocol/aztec-packages/commit/bc80e8575b5e60c3a45a7631e445c79774d20a49)) * Remove hir to ast pass (https://github.com/noir-lang/noir/pull/5147) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Remove old public storage access ordering hack ([#7063](https://github.com/AztecProtocol/aztec-packages/issues/7063)) ([bf6b8b8](https://github.com/AztecProtocol/aztec-packages/commit/bf6b8b86d78ce6ee5e863dc0a43e78c36b6b35a8)) * Remove stale comment (https://github.com/noir-lang/noir/pull/5179) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) * Remove unused `new_variables` argument from `resolve_type_inner` (https://github.com/noir-lang/noir/pull/5148) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Rename p2p vars ([#6916](https://github.com/AztecProtocol/aztec-packages/issues/6916)) ([ae7d757](https://github.com/AztecProtocol/aztec-packages/commit/ae7d75764fc704daae67be882e0e9f09a0a9407c)) * Replace relative paths to noir-protocol-circuits ([8f7b865](https://github.com/AztecProtocol/aztec-packages/commit/8f7b8656940354df38bb623bc6d8941ab98f3e5d)) * Replace relative paths to noir-protocol-circuits ([91e1554](https://github.com/AztecProtocol/aztec-packages/commit/91e155472951908e455fff9279118f0b9be0900b)) * Replace relative paths to noir-protocol-circuits ([f4fed13](https://github.com/AztecProtocol/aztec-packages/commit/f4fed131a9c3bb568a995846d09f793620c5a366)) * Replace relative paths to noir-protocol-circuits ([7caa288](https://github.com/AztecProtocol/aztec-packages/commit/7caa28892086b9f97d417d0694e3cad228fd5788)) * Replace relative paths to noir-protocol-circuits ([8a299e9](https://github.com/AztecProtocol/aztec-packages/commit/8a299e99783775d70ba8871f44057a03daaf4917)) * Replace relative paths to noir-protocol-circuits ([acf1188](https://github.com/AztecProtocol/aztec-packages/commit/acf1188fb1fc5ea4d53d57a6c0a362ad55cd707e)) * Replace relative paths to noir-protocol-circuits ([094b511](https://github.com/AztecProtocol/aztec-packages/commit/094b511e6a696e5c2a7687147ca21007801237de)) * Replace relative paths to noir-protocol-circuits ([8e07176](https://github.com/AztecProtocol/aztec-packages/commit/8e0717654ec7f75fe2ea8577457359ec2a102b58)) * Replace relative paths to noir-protocol-circuits ([52b6934](https://github.com/AztecProtocol/aztec-packages/commit/52b69341129a23e300292e3f5e207cb512b05aa6)) * Replace relative paths to noir-protocol-circuits ([873dcea](https://github.com/AztecProtocol/aztec-packages/commit/873dcea15e4e802f99998e2ed113ebaa8bd834e6)) * Replace sibling path read with leaf read ([#6834](https://github.com/AztecProtocol/aztec-packages/issues/6834)) ([a20d845](https://github.com/AztecProtocol/aztec-packages/commit/a20d845d35715816ddc889fb9a75fb9fba4fc356)) * Run all test programs in brillig as well as ACIR (https://github.com/noir-lang/noir/pull/5128) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Schnorr signature verification in noir (https://github.com/noir-lang/noir/pull/5188) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Small fixes for the tube flows ([#7014](https://github.com/AztecProtocol/aztec-packages/issues/7014)) ([838ceed](https://github.com/AztecProtocol/aztec-packages/commit/838ceed3b6ccf1bb7d89552a147db92c3514f0c1)) * Split log emission to encrypt and a log, remove address input ([#6987](https://github.com/AztecProtocol/aztec-packages/issues/6987)) ([ca0e084](https://github.com/AztecProtocol/aztec-packages/commit/ca0e0848563cfae72ebd7d4487a6e2812c2a405c)) * Start moving lints into a separate linting directory (https://github.com/noir-lang/noir/pull/5165) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) * Terraform Updates ([#6887](https://github.com/AztecProtocol/aztec-packages/issues/6887)) ([33a3870](https://github.com/AztecProtocol/aztec-packages/commit/33a3870d06ae8bb5d08dbbd9f72a62e0811e5e7d)) * Transfer and transferfrom to save constrains for simpler cases ([#7013](https://github.com/AztecProtocol/aztec-packages/issues/7013)) ([612b972](https://github.com/AztecProtocol/aztec-packages/commit/612b9724a419224c72cd823c889ece4ae8f00ab0)) * TS avm proving test - add a pattern for assertion failure (timestamp example) ([#7005](https://github.com/AztecProtocol/aztec-packages/issues/7005)) ([cfef246](https://github.com/AztecProtocol/aztec-packages/commit/cfef24654492a1f3eef94db60937bd3a45f8ec3c)) * Update comment on transient nullification ([#7001](https://github.com/AztecProtocol/aztec-packages/issues/7001)) ([6c4e61c](https://github.com/AztecProtocol/aztec-packages/commit/6c4e61c19613560af8aedba03531958f8471bb62)) * Updated devnet terraform ([#6927](https://github.com/AztecProtocol/aztec-packages/issues/6927)) ([4692fb0](https://github.com/AztecProtocol/aztec-packages/commit/4692fb034f22bb62593d257777b7b545993c27ab)) * Updated l1 contracts in compose file ([#6942](https://github.com/AztecProtocol/aztec-packages/issues/6942)) ([15371ce](https://github.com/AztecProtocol/aztec-packages/commit/15371ceafb62627cd0bcb5ba65c854f07e09cb49)) * Updated sha for devnet image in compose file ([#6939](https://github.com/AztecProtocol/aztec-packages/issues/6939)) ([83dd231](https://github.com/AztecProtocol/aztec-packages/commit/83dd231d7c7bc561829296cb3f252fb9ab50528f)) ### Documentation * Add account tags ([#7011](https://github.com/AztecProtocol/aztec-packages/issues/7011)) ([8580467](https://github.com/AztecProtocol/aztec-packages/commit/8580467354fe32cda87c956ea40caa4d0f058a04)) * **avm:** Comments in pil file related to range checks of addresses ([#6837](https://github.com/AztecProtocol/aztec-packages/issues/6837)) ([66f1c87](https://github.com/AztecProtocol/aztec-packages/commit/66f1c876578b05838698377f2ede12b52671e4ca)) * Aztec macros ([#6935](https://github.com/AztecProtocol/aztec-packages/issues/6935)) ([57078d4](https://github.com/AztecProtocol/aztec-packages/commit/57078d4aea54c4beaf66f10db2f0052d4577e46a)) * Clarify comment on collapse ([#7038](https://github.com/AztecProtocol/aztec-packages/issues/7038)) ([6237ddd](https://github.com/AztecProtocol/aztec-packages/commit/6237ddd9052fc98a26de07f11bd494843dcc07ee)) * Update HOW_WE_WRITE_DOCS.md ([#6850](https://github.com/AztecProtocol/aztec-packages/issues/6850)) ([d4dfdaf](https://github.com/AztecProtocol/aztec-packages/commit/d4dfdaf9ab03eeafa3d54be178fc72c59ac51b95))
barretenberg: 0.43.0 ## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.42.0...barretenberg-v0.43.0) (2024-06-18) ### Features * Add gate profiler for noir circuits ([#7004](https://github.com/AztecProtocol/aztec-packages/issues/7004)) ([a2f6876](https://github.com/AztecProtocol/aztec-packages/commit/a2f687687559d15fde52abce54838f6e144a0aa4)) * Add standard form function to biggroup ([#6899](https://github.com/AztecProtocol/aztec-packages/issues/6899)) ([3e44be5](https://github.com/AztecProtocol/aztec-packages/commit/3e44be538e5c7f0e7269c1e5c0820f7bc6e83734)) * Affine_element read/write with proper handling of point at infinity ([#6963](https://github.com/AztecProtocol/aztec-packages/issues/6963)) ([c6cbe39](https://github.com/AztecProtocol/aztec-packages/commit/c6cbe39eed23dc845aef898e937e99de43f71675)) * Avm e2e nested call + alu fix + cast fix ([#6974](https://github.com/AztecProtocol/aztec-packages/issues/6974)) ([b150b61](https://github.com/AztecProtocol/aztec-packages/commit/b150b610153e380a93240914c95887f88b56fa94)) * **avm-simulator:** Msm blackbox ([#7048](https://github.com/AztecProtocol/aztec-packages/issues/7048)) ([0ce27e0](https://github.com/AztecProtocol/aztec-packages/commit/0ce27e05c4c099167d0d98300f6d73ced22639ad)) * **avm:** Add get_contract_instance ([#6871](https://github.com/AztecProtocol/aztec-packages/issues/6871)) ([b3a86bf](https://github.com/AztecProtocol/aztec-packages/commit/b3a86bf72343d1060ce58a11f139e05ba2a75754)) * **avm:** Deserialise execution hints in bb main ([#6848](https://github.com/AztecProtocol/aztec-packages/issues/6848)) ([d3be85f](https://github.com/AztecProtocol/aztec-packages/commit/d3be85f57c34aa88e732ea115239f3bed1e7aa16)) * **avm:** E2e proving of storage ([#6967](https://github.com/AztecProtocol/aztec-packages/issues/6967)) ([6a7be0c](https://github.com/AztecProtocol/aztec-packages/commit/6a7be0c434934175bb6da1f3525c025b3f743824)) * **avm:** E2e send l1 msg ([#6880](https://github.com/AztecProtocol/aztec-packages/issues/6880)) ([deb972d](https://github.com/AztecProtocol/aztec-packages/commit/deb972d3f13a92d34a6f91074b072fb66d247f64)) * **avm:** Gas remaining range check and handling of out of gas ([#6944](https://github.com/AztecProtocol/aztec-packages/issues/6944)) ([5647571](https://github.com/AztecProtocol/aztec-packages/commit/56475716e05973e6b493de427f32eee71c0f8f6a)), closes [#6902](https://github.com/AztecProtocol/aztec-packages/issues/6902) * **avm:** Get contract instance now works e2e with avm proving ([#6911](https://github.com/AztecProtocol/aztec-packages/issues/6911)) ([662187d](https://github.com/AztecProtocol/aztec-packages/commit/662187d1d6960b734a71aaf365e7f20d471dc4c9)) * **avm:** Indirect support for kernel output opcodes ([#6962](https://github.com/AztecProtocol/aztec-packages/issues/6962)) ([f330bff](https://github.com/AztecProtocol/aztec-packages/commit/f330bffa80b6da5f037cea3cf469ef1c7b6d9d03)) * **avm:** Indirect support for kernel read opcodes ([#6940](https://github.com/AztecProtocol/aztec-packages/issues/6940)) ([ccc474d](https://github.com/AztecProtocol/aztec-packages/commit/ccc474d9d0cd10faf857bc1ec6571dc25306a531)) * **avm:** L2gasleft and dagasleft opcodes ([#6884](https://github.com/AztecProtocol/aztec-packages/issues/6884)) ([fbab612](https://github.com/AztecProtocol/aztec-packages/commit/fbab612b17dfe0e95ead1a592b7bc9fe6ca5415d)) * **avm:** Nullifier non exist ([#6877](https://github.com/AztecProtocol/aztec-packages/issues/6877)) ([05697f2](https://github.com/AztecProtocol/aztec-packages/commit/05697f289d3b97def74f45cd839a58a8a077c3fa)) * **avm:** Plumb externalcall hints ([#6890](https://github.com/AztecProtocol/aztec-packages/issues/6890)) ([3a97f08](https://github.com/AztecProtocol/aztec-packages/commit/3a97f08c457472bd701200adfa45d61554fd3867)) * **avm:** Plumb start side effect counter in circuit ([#7007](https://github.com/AztecProtocol/aztec-packages/issues/7007)) ([fa8f12f](https://github.com/AztecProtocol/aztec-packages/commit/fa8f12f93a8d94604a4382de444501fac310dbb8)) * **avm:** Revert opcode ([#6909](https://github.com/AztecProtocol/aztec-packages/issues/6909)) ([620d3da](https://github.com/AztecProtocol/aztec-packages/commit/620d3dacc853c71e808ef58001eb4c8584fa59d9)) * **avm:** Use hints in gas accounting (circuit) ([#6895](https://github.com/AztecProtocol/aztec-packages/issues/6895)) ([c3746f5](https://github.com/AztecProtocol/aztec-packages/commit/c3746f5d6ae38bc448d00834d91a7ddd7b901e64)) * **bb:** Stack traces for check_circuit ([#6851](https://github.com/AztecProtocol/aztec-packages/issues/6851)) ([eb35e62](https://github.com/AztecProtocol/aztec-packages/commit/eb35e627445c72ee07fafb3652076349302e7fa1)) * Contract storage reads serialize with side effect counter ([#6961](https://github.com/AztecProtocol/aztec-packages/issues/6961)) ([db49ed5](https://github.com/AztecProtocol/aztec-packages/commit/db49ed57d1d4165ce47e6af01b6fd67239121aa4)) * Ecadd op code ([#6906](https://github.com/AztecProtocol/aztec-packages/issues/6906)) ([03a9064](https://github.com/AztecProtocol/aztec-packages/commit/03a9064b308fbf5541f4f763e1ad1e05f60e1fff)) * Flows and tests for the tube component ([#6934](https://github.com/AztecProtocol/aztec-packages/issues/6934)) ([4b45438](https://github.com/AztecProtocol/aztec-packages/commit/4b454386a35f4b0cd4c6a9b8003c55e55e50b592)) * Place return value witnesses directly after function arguments (https://github.com/noir-lang/noir/pull/5142) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Separate runtimes of SSA functions before inlining (https://github.com/noir-lang/noir/pull/5121) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * SMT Standard Circuit separation ([#6904](https://github.com/AztecProtocol/aztec-packages/issues/6904)) ([f970732](https://github.com/AztecProtocol/aztec-packages/commit/f9707321bdd107e3c7116cafd89fd570224e89ef)) * SMT Verification Module Update ([#6849](https://github.com/AztecProtocol/aztec-packages/issues/6849)) ([6c98529](https://github.com/AztecProtocol/aztec-packages/commit/6c985299d796b8c711794395518c3b3a0f41e775)) * SMT Verifier for Ultra Arithmetization ([#7067](https://github.com/AztecProtocol/aztec-packages/issues/7067)) ([6692ac8](https://github.com/AztecProtocol/aztec-packages/commit/6692ac831ab980d9623442236c21b499a7238966)) * Standard form for cycle_group ([#6915](https://github.com/AztecProtocol/aztec-packages/issues/6915)) ([e6cba16](https://github.com/AztecProtocol/aztec-packages/commit/e6cba16ef82428b115d527eabe237122e269aa32)) * Support disabling aztec vm in non-wasm builds ([#6965](https://github.com/AztecProtocol/aztec-packages/issues/6965)) ([f7a46c0](https://github.com/AztecProtocol/aztec-packages/commit/f7a46c0d8de2e58b7e76576a76eb85f52b266966)) ### Bug Fixes * ALU pil relation TWO_LINE_OP_NO_OVERLAP ([#6968](https://github.com/AztecProtocol/aztec-packages/issues/6968)) ([4ba553b](https://github.com/AztecProtocol/aztec-packages/commit/4ba553ba3170838de3b6c4cf47b609b0198443d0)) * **avm:** Bugfix related to pc increment in calldatacopy of avm circuit ([#6891](https://github.com/AztecProtocol/aztec-packages/issues/6891)) ([5fe59d2](https://github.com/AztecProtocol/aztec-packages/commit/5fe59d2ed96a5b966efc9e3619c87b4a23c502f4)) * **avm:** Correctly generate public inputs in verifier ([#7018](https://github.com/AztecProtocol/aztec-packages/issues/7018)) ([4c4c17f](https://github.com/AztecProtocol/aztec-packages/commit/4c4c17f804b8735dc017bbae171117ca15df25cc)) * Biggroup batch mul handles collisions ([#6780](https://github.com/AztecProtocol/aztec-packages/issues/6780)) ([e61c40e](https://github.com/AztecProtocol/aztec-packages/commit/e61c40e9c3e71f50c2d6a6c8a1688b6a8ddd4ba8)) * Bugfix for Keccak opcode related to reading bytes from input ([#6989](https://github.com/AztecProtocol/aztec-packages/issues/6989)) ([5713f4e](https://github.com/AztecProtocol/aztec-packages/commit/5713f4e25ef8bf09cb91632bd210cd46bb7a77c3)) * Dirty merge 6880 ([#6905](https://github.com/AztecProtocol/aztec-packages/issues/6905)) ([fc6ec3f](https://github.com/AztecProtocol/aztec-packages/commit/fc6ec3fc7371b2506e7409a7d24ce37f25803fac)) * **experimental elaborator:** Clear generics after elaborating type aliases (https://github.com/noir-lang/noir/pull/5136) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix `impl Trait` when `--use-elaborator` is selected (https://github.com/noir-lang/noir/pull/5138) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix definition kind of globals and tuple patterns with `--use-elaborator` flag (https://github.com/noir-lang/noir/pull/5139) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix frontend tests when `--use-elaborator` flag is specified (https://github.com/noir-lang/noir/pull/5145) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * **experimental elaborator:** Fix global values used in the elaborator (https://github.com/noir-lang/noir/pull/5135) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Fix avm unit test with proving by passing the public_inputs ([#7062](https://github.com/AztecProtocol/aztec-packages/issues/7062)) ([2d7c097](https://github.com/AztecProtocol/aztec-packages/commit/2d7c097d7a6606101354736d69bd0bbbe6f005bf)) * Fix client ivc incorrect srs size issue and parallelise srs generation for grumpkin ([#6913](https://github.com/AztecProtocol/aztec-packages/issues/6913)) ([f015736](https://github.com/AztecProtocol/aztec-packages/commit/f01573641728d6cc62da36189a22fa813713fd82)) * Fix for the flaky issue (I hope) ([#6923](https://github.com/AztecProtocol/aztec-packages/issues/6923)) ([39747b9](https://github.com/AztecProtocol/aztec-packages/commit/39747b933a13aa08f25c5074207f9d92489d5e3d)) * Fixing 0 naf ([#6950](https://github.com/AztecProtocol/aztec-packages/issues/6950)) ([d35ee2e](https://github.com/AztecProtocol/aztec-packages/commit/d35ee2ed87967a5161ef52d892856900a55de0b9)) * **frontend:** Resolve object types from method calls a single time (https://github.com/noir-lang/noir/pull/5131) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Initialize side_effect_counter based on the initial value passed to builder ([#7017](https://github.com/AztecProtocol/aztec-packages/issues/7017)) ([46d166b](https://github.com/AztecProtocol/aztec-packages/commit/46d166b0f1d16d801e056d3195546970cddda1a8)) * Stop squashing storage accesses in avm simulator - all need to be validated in kernel ([#7036](https://github.com/AztecProtocol/aztec-packages/issues/7036)) ([6ffc4b4](https://github.com/AztecProtocol/aztec-packages/commit/6ffc4b4455a0613c933de0ec7528774186f53bee)) * Use predicate for curve operations (https://github.com/noir-lang/noir/pull/5076) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Wrapping in signed division (https://github.com/noir-lang/noir/pull/5134) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) ### Miscellaneous * Add negative tests for cast and U128 multiplication related to TWO_LINE_OP_NO_OVERLAP ([#7041](https://github.com/AztecProtocol/aztec-packages/issues/7041)) ([7f14ca1](https://github.com/AztecProtocol/aztec-packages/commit/7f14ca122032a56eb322e34ee0290845e75a925a)), closes [#6969](https://github.com/AztecProtocol/aztec-packages/issues/6969) * **avm:** Add debugging info and trace dump ([#6979](https://github.com/AztecProtocol/aztec-packages/issues/6979)) ([e11f880](https://github.com/AztecProtocol/aztec-packages/commit/e11f88004e2c31cb2b2ae376095513e94584a4dc)) * **avm:** Fix proving for kernel tests ([#7033](https://github.com/AztecProtocol/aztec-packages/issues/7033)) ([f5e1106](https://github.com/AztecProtocol/aztec-packages/commit/f5e1106bcaa9558ac0a953de06d4fafd09fb1fe8)) * **avm:** Gas alignments with simulator ([#6873](https://github.com/AztecProtocol/aztec-packages/issues/6873)) ([54339d4](https://github.com/AztecProtocol/aztec-packages/commit/54339d48861a91429e996177713f46952ffbd808)), closes [#6860](https://github.com/AztecProtocol/aztec-packages/issues/6860) * **avm:** Modify unit test to have a calldatacopy over 4 elements ([#6893](https://github.com/AztecProtocol/aztec-packages/issues/6893)) ([9f5b113](https://github.com/AztecProtocol/aztec-packages/commit/9f5b11345dc5dd055442eaf7673227fe7cbaf262)) * Bb repo warning ([#7023](https://github.com/AztecProtocol/aztec-packages/issues/7023)) ([c3d7053](https://github.com/AztecProtocol/aztec-packages/commit/c3d70537c5558ba451a43e403bab067940aa48b6)) * **bb:** Hide `debug()` logs under `--debug` flag ([#7008](https://github.com/AztecProtocol/aztec-packages/issues/7008)) ([a8c3c3f](https://github.com/AztecProtocol/aztec-packages/commit/a8c3c3fcf35b7c464006c481230afcb11b9952dc)) * **ci:** Don't raise MSRV issue if workflow cancelled (https://github.com/noir-lang/noir/pull/5143) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Default to using bn254 in `noirc_frontend` (https://github.com/noir-lang/noir/pull/5144) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Fix issue [#6929](https://github.com/AztecProtocol/aztec-packages/issues/6929) (off-by-one error in `UltraCircuitBuilder::create_range_constraint`) ([#6931](https://github.com/AztecProtocol/aztec-packages/issues/6931)) ([16deef6](https://github.com/AztecProtocol/aztec-packages/commit/16deef6a83a9fe41e1f865e79e17c2f671604bb0)) * Lookups cleanup/documentation ([#7002](https://github.com/AztecProtocol/aztec-packages/issues/7002)) ([92b1349](https://github.com/AztecProtocol/aztec-packages/commit/92b1349ba671e87e948bf9248c5133accde9091f)) * Opcodes l2gasleft and dagasleft return value with tag ff ([#6896](https://github.com/AztecProtocol/aztec-packages/issues/6896)) ([5890845](https://github.com/AztecProtocol/aztec-packages/commit/5890845e8f9b278b2a5c5c930eb28ec0aba74ebc)) * Remove hir to ast pass (https://github.com/noir-lang/noir/pull/5147) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Remove unused `new_variables` argument from `resolve_type_inner` (https://github.com/noir-lang/noir/pull/5148) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Run all test programs in brillig as well as ACIR (https://github.com/noir-lang/noir/pull/5128) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) * Small fixes for the tube flows ([#7014](https://github.com/AztecProtocol/aztec-packages/issues/7014)) ([838ceed](https://github.com/AztecProtocol/aztec-packages/commit/838ceed3b6ccf1bb7d89552a147db92c3514f0c1)) ### Documentation * **avm:** Comments in pil file related to range checks of addresses ([#6837](https://github.com/AztecProtocol/aztec-packages/issues/6837)) ([66f1c87](https://github.com/AztecProtocol/aztec-packages/commit/66f1c876578b05838698377f2ede12b52671e4ca))
--- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .release-please-manifest.json | 8 +- CHANGELOG.md | 214 ++++++++++++++++++++++++++++++++ barretenberg/CHANGELOG.md | 85 +++++++++++++ barretenberg/cpp/CMakeLists.txt | 2 +- barretenberg/ts/CHANGELOG.md | 7 ++ barretenberg/ts/package.json | 2 +- yarn-project/aztec/CHANGELOG.md | 17 +++ yarn-project/aztec/package.json | 2 +- 8 files changed, 330 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 068a4b82775..a2daeb9352c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { - ".": "0.42.0", + ".": "0.43.0", "yarn-project/cli": "0.35.1", - "yarn-project/aztec": "0.42.0", - "barretenberg": "0.42.0", - "barretenberg/ts": "0.42.0" + "yarn-project/aztec": "0.43.0", + "barretenberg": "0.43.0", + "barretenberg/ts": "0.43.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 550b06bcb7c..31100bab7b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,219 @@ # Changelog +## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.42.0...aztec-packages-v0.43.0) (2024-06-18) + + +### ⚠ BREAKING CHANGES + +* remove `distinct` keyword (https://github.com/noir-lang/noir/pull/5219) +* remove `param_witnesses` and `return_witnesses` from ABI (https://github.com/noir-lang/noir/pull/5154) +* add session id to foreign call RPC requests (https://github.com/noir-lang/noir/pull/5205) +* make options.limit a compile-time constant ([#7027](https://github.com/AztecProtocol/aztec-packages/issues/7027)) +* restrict noir word size to u32 (https://github.com/noir-lang/noir/pull/5180) +* separate proving from `noir_js` (https://github.com/noir-lang/noir/pull/5072) + +### Features + +* `pxe.addNullifiedNote(...)` ([#6948](https://github.com/AztecProtocol/aztec-packages/issues/6948)) ([42a4b1c](https://github.com/AztecProtocol/aztec-packages/commit/42a4b1c6f000886b8b63e2fd6b0b218a29cb820c)) +* Add data dir to pxe container ([#6874](https://github.com/AztecProtocol/aztec-packages/issues/6874)) ([504fea2](https://github.com/AztecProtocol/aztec-packages/commit/504fea2e330ad66ec269ddff581b7448c008f9ca)) +* Add ENFORCE_FEES sequencer config ([#6949](https://github.com/AztecProtocol/aztec-packages/issues/6949)) ([46dcb98](https://github.com/AztecProtocol/aztec-packages/commit/46dcb985e98ca26ee2dd3d2ec98976f1d8f27ba7)) +* Add gate profiler for noir circuits ([#7004](https://github.com/AztecProtocol/aztec-packages/issues/7004)) ([a2f6876](https://github.com/AztecProtocol/aztec-packages/commit/a2f687687559d15fde52abce54838f6e144a0aa4)) +* Add node to devnet ([#6898](https://github.com/AztecProtocol/aztec-packages/issues/6898)) ([acc534c](https://github.com/AztecProtocol/aztec-packages/commit/acc534c339ad05d548f8f287e4bd6051201cb1f6)) +* Add session id to foreign call RPC requests (https://github.com/noir-lang/noir/pull/5205) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Add standard form function to biggroup ([#6899](https://github.com/AztecProtocol/aztec-packages/issues/6899)) ([3e44be5](https://github.com/AztecProtocol/aztec-packages/commit/3e44be538e5c7f0e7269c1e5c0820f7bc6e83734)) +* Add utils::collapse ([#7016](https://github.com/AztecProtocol/aztec-packages/issues/7016)) ([2d19ad9](https://github.com/AztecProtocol/aztec-packages/commit/2d19ad9af6130aeaf6621f239c4119c3126dd7c6)) +* Affine_element read/write with proper handling of point at infinity ([#6963](https://github.com/AztecProtocol/aztec-packages/issues/6963)) ([c6cbe39](https://github.com/AztecProtocol/aztec-packages/commit/c6cbe39eed23dc845aef898e937e99de43f71675)) +* Auth registry ([#7035](https://github.com/AztecProtocol/aztec-packages/issues/7035)) ([cea0b3b](https://github.com/AztecProtocol/aztec-packages/commit/cea0b3b29c2f7c37eb07c226a06534f92518cea6)) +* Auto-gen p2p private key ([#6910](https://github.com/AztecProtocol/aztec-packages/issues/6910)) ([0fc9677](https://github.com/AztecProtocol/aztec-packages/commit/0fc9677b2db0b126e6b604b387735a29e295ff05)) +* Avm e2e nested call + alu fix + cast fix ([#6974](https://github.com/AztecProtocol/aztec-packages/issues/6974)) ([b150b61](https://github.com/AztecProtocol/aztec-packages/commit/b150b610153e380a93240914c95887f88b56fa94)) +* **avm-simulator:** Msm blackbox ([#7048](https://github.com/AztecProtocol/aztec-packages/issues/7048)) ([0ce27e0](https://github.com/AztecProtocol/aztec-packages/commit/0ce27e05c4c099167d0d98300f6d73ced22639ad)) +* **avm:** Add get_contract_instance ([#6871](https://github.com/AztecProtocol/aztec-packages/issues/6871)) ([b3a86bf](https://github.com/AztecProtocol/aztec-packages/commit/b3a86bf72343d1060ce58a11f139e05ba2a75754)) +* **avm:** Deserialise execution hints in bb main ([#6848](https://github.com/AztecProtocol/aztec-packages/issues/6848)) ([d3be85f](https://github.com/AztecProtocol/aztec-packages/commit/d3be85f57c34aa88e732ea115239f3bed1e7aa16)) +* **avm:** E2e proving of storage ([#6967](https://github.com/AztecProtocol/aztec-packages/issues/6967)) ([6a7be0c](https://github.com/AztecProtocol/aztec-packages/commit/6a7be0c434934175bb6da1f3525c025b3f743824)) +* **avm:** E2e send l1 msg ([#6880](https://github.com/AztecProtocol/aztec-packages/issues/6880)) ([deb972d](https://github.com/AztecProtocol/aztec-packages/commit/deb972d3f13a92d34a6f91074b072fb66d247f64)) +* **avm:** Gas remaining range check and handling of out of gas ([#6944](https://github.com/AztecProtocol/aztec-packages/issues/6944)) ([5647571](https://github.com/AztecProtocol/aztec-packages/commit/56475716e05973e6b493de427f32eee71c0f8f6a)), closes [#6902](https://github.com/AztecProtocol/aztec-packages/issues/6902) +* **avm:** Get contract instance now works e2e with avm proving ([#6911](https://github.com/AztecProtocol/aztec-packages/issues/6911)) ([662187d](https://github.com/AztecProtocol/aztec-packages/commit/662187d1d6960b734a71aaf365e7f20d471dc4c9)) +* **avm:** Indirect support for kernel output opcodes ([#6962](https://github.com/AztecProtocol/aztec-packages/issues/6962)) ([f330bff](https://github.com/AztecProtocol/aztec-packages/commit/f330bffa80b6da5f037cea3cf469ef1c7b6d9d03)) +* **avm:** Indirect support for kernel read opcodes ([#6940](https://github.com/AztecProtocol/aztec-packages/issues/6940)) ([ccc474d](https://github.com/AztecProtocol/aztec-packages/commit/ccc474d9d0cd10faf857bc1ec6571dc25306a531)) +* **avm:** L2gasleft and dagasleft opcodes ([#6884](https://github.com/AztecProtocol/aztec-packages/issues/6884)) ([fbab612](https://github.com/AztecProtocol/aztec-packages/commit/fbab612b17dfe0e95ead1a592b7bc9fe6ca5415d)) +* **avm:** Nullifier non exist ([#6877](https://github.com/AztecProtocol/aztec-packages/issues/6877)) ([05697f2](https://github.com/AztecProtocol/aztec-packages/commit/05697f289d3b97def74f45cd839a58a8a077c3fa)) +* **avm:** Plumb externalcall hints ([#6890](https://github.com/AztecProtocol/aztec-packages/issues/6890)) ([3a97f08](https://github.com/AztecProtocol/aztec-packages/commit/3a97f08c457472bd701200adfa45d61554fd3867)) +* **avm:** Plumb start side effect counter in circuit ([#7007](https://github.com/AztecProtocol/aztec-packages/issues/7007)) ([fa8f12f](https://github.com/AztecProtocol/aztec-packages/commit/fa8f12f93a8d94604a4382de444501fac310dbb8)) +* **avm:** Revert opcode ([#6909](https://github.com/AztecProtocol/aztec-packages/issues/6909)) ([620d3da](https://github.com/AztecProtocol/aztec-packages/commit/620d3dacc853c71e808ef58001eb4c8584fa59d9)) +* **avm:** Support preserving BB working dir for better debugging ([#6990](https://github.com/AztecProtocol/aztec-packages/issues/6990)) ([a9688f0](https://github.com/AztecProtocol/aztec-packages/commit/a9688f058252cb1c4714cfb06bd2cf30c6ac0268)) +* **avm:** Use hints in gas accounting (circuit) ([#6895](https://github.com/AztecProtocol/aztec-packages/issues/6895)) ([c3746f5](https://github.com/AztecProtocol/aztec-packages/commit/c3746f5d6ae38bc448d00834d91a7ddd7b901e64)) +* **bb:** Stack traces for check_circuit ([#6851](https://github.com/AztecProtocol/aztec-packages/issues/6851)) ([eb35e62](https://github.com/AztecProtocol/aztec-packages/commit/eb35e627445c72ee07fafb3652076349302e7fa1)) +* **cli:** Publicly deploy a pre-initialized account ([#6960](https://github.com/AztecProtocol/aztec-packages/issues/6960)) ([e671935](https://github.com/AztecProtocol/aztec-packages/commit/e67193585fe967106a013d266e00e94d20d31b32)) +* Constrain note encryption ([#6432](https://github.com/AztecProtocol/aztec-packages/issues/6432)) ([e59f4d3](https://github.com/AztecProtocol/aztec-packages/commit/e59f4d3cee4b27248d26111fc6fda2f0e55a7d54)) +* Contract storage reads serialize with side effect counter ([#6961](https://github.com/AztecProtocol/aztec-packages/issues/6961)) ([db49ed5](https://github.com/AztecProtocol/aztec-packages/commit/db49ed57d1d4165ce47e6af01b6fd67239121aa4)) +* **docs:** Add uniswap back in as a reference and fix links ([#7074](https://github.com/AztecProtocol/aztec-packages/issues/7074)) ([a4d1df6](https://github.com/AztecProtocol/aztec-packages/commit/a4d1df6d2900185a9c57af44e6f0c3ca80df7c9b)) +* **docs:** Nits ([#6187](https://github.com/AztecProtocol/aztec-packages/issues/6187)) ([d025496](https://github.com/AztecProtocol/aztec-packages/commit/d0254960b1712b717e156b428aa05721702ec4a8)) +* Ecadd op code ([#6906](https://github.com/AztecProtocol/aztec-packages/issues/6906)) ([03a9064](https://github.com/AztecProtocol/aztec-packages/commit/03a9064b308fbf5541f4f763e1ad1e05f60e1fff)) +* Estimate tx size ([#6928](https://github.com/AztecProtocol/aztec-packages/issues/6928)) ([1fa7d84](https://github.com/AztecProtocol/aztec-packages/commit/1fa7d84b6bf176d4585c333747ac4a61b8743e36)) +* Flows and tests for the tube component ([#6934](https://github.com/AztecProtocol/aztec-packages/issues/6934)) ([4b45438](https://github.com/AztecProtocol/aztec-packages/commit/4b454386a35f4b0cd4c6a9b8003c55e55e50b592)) +* Gas token self deploys ([#6956](https://github.com/AztecProtocol/aztec-packages/issues/6956)) ([ecd7614](https://github.com/AztecProtocol/aztec-packages/commit/ecd7614d0a52d277862aef97e81b68b8f66bc2c0)) +* Implement println in the comptime interpreter (https://github.com/noir-lang/noir/pull/5197) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Increase max L2 to L1 msgs ([#6959](https://github.com/AztecProtocol/aztec-packages/issues/6959)) ([875fb2d](https://github.com/AztecProtocol/aztec-packages/commit/875fb2d507368b15c9672526c52b92039ef558d3)) +* Make options.limit a compile-time constant ([#7027](https://github.com/AztecProtocol/aztec-packages/issues/7027)) ([78cd640](https://github.com/AztecProtocol/aztec-packages/commit/78cd640dd2d5b281a921140b915a294eaa44f6f0)) +* Nuking last hardcoded note type ids ([#7069](https://github.com/AztecProtocol/aztec-packages/issues/7069)) ([a23fd0b](https://github.com/AztecProtocol/aztec-packages/commit/a23fd0ba1604a5308fd77ed45a5b1d20da13f405)), closes [#5833](https://github.com/AztecProtocol/aztec-packages/issues/5833) +* Place return value witnesses directly after function arguments (https://github.com/noir-lang/noir/pull/5142) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Poor man's CLI block explorer ([#6946](https://github.com/AztecProtocol/aztec-packages/issues/6946)) ([2b79df6](https://github.com/AztecProtocol/aztec-packages/commit/2b79df673e7a23886052990c85dc6ca530537e9f)) +* Poor man's fernet ([#6918](https://github.com/AztecProtocol/aztec-packages/issues/6918)) ([19c2a97](https://github.com/AztecProtocol/aztec-packages/commit/19c2a97784c917da212e76f3307d47e1beb8099f)) +* Private kernel output validator ([#6892](https://github.com/AztecProtocol/aztec-packages/issues/6892)) ([0435e9a](https://github.com/AztecProtocol/aztec-packages/commit/0435e9a76f158b72690f34025a2723a29a3c7816)) +* Processing outgoing ([#6766](https://github.com/AztecProtocol/aztec-packages/issues/6766)) ([4da66fd](https://github.com/AztecProtocol/aztec-packages/commit/4da66fdfb3d0686b5ed917e947869b9c2cef14a8)) +* Pxe can filter on emitted events ([#6947](https://github.com/AztecProtocol/aztec-packages/issues/6947)) ([ee45fda](https://github.com/AztecProtocol/aztec-packages/commit/ee45fdafd837e4070b627aaac630e2f985531c97)) +* Restrict noir word size to u32 (https://github.com/noir-lang/noir/pull/5180) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Separate proving from `noir_js` (https://github.com/noir-lang/noir/pull/5072) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Separate runtimes of SSA functions before inlining (https://github.com/noir-lang/noir/pull/5121) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* SMT Standard Circuit separation ([#6904](https://github.com/AztecProtocol/aztec-packages/issues/6904)) ([f970732](https://github.com/AztecProtocol/aztec-packages/commit/f9707321bdd107e3c7116cafd89fd570224e89ef)) +* SMT Verification Module Update ([#6849](https://github.com/AztecProtocol/aztec-packages/issues/6849)) ([6c98529](https://github.com/AztecProtocol/aztec-packages/commit/6c985299d796b8c711794395518c3b3a0f41e775)) +* SMT Verifier for Ultra Arithmetization ([#7067](https://github.com/AztecProtocol/aztec-packages/issues/7067)) ([6692ac8](https://github.com/AztecProtocol/aztec-packages/commit/6692ac831ab980d9623442236c21b499a7238966)) +* Splitting event log functionality ([#6921](https://github.com/AztecProtocol/aztec-packages/issues/6921)) ([8052bc6](https://github.com/AztecProtocol/aztec-packages/commit/8052bc64ee53e27f364438ecee057e2c9c1b3583)) +* Standard form for cycle_group ([#6915](https://github.com/AztecProtocol/aztec-packages/issues/6915)) ([e6cba16](https://github.com/AztecProtocol/aztec-packages/commit/e6cba16ef82428b115d527eabe237122e269aa32)) +* Standardize pedersen functions to return `EmbeddedCurvePoint` (https://github.com/noir-lang/noir/pull/5190) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Storing outgoing + API for outgoing ([#7022](https://github.com/AztecProtocol/aztec-packages/issues/7022)) ([8281ec6](https://github.com/AztecProtocol/aztec-packages/commit/8281ec6dcd60a08a20da86fb9805dda8e9581764)) +* Support casting in globals (https://github.com/noir-lang/noir/pull/5164) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Support disabling aztec vm in non-wasm builds ([#6965](https://github.com/AztecProtocol/aztec-packages/issues/6965)) ([f7a46c0](https://github.com/AztecProtocol/aztec-packages/commit/f7a46c0d8de2e58b7e76576a76eb85f52b266966)) +* Sync from aztec-packages (https://github.com/noir-lang/noir/pull/5222) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Track timeout status of proving jobs ([#6868](https://github.com/AztecProtocol/aztec-packages/issues/6868)) ([7306176](https://github.com/AztecProtocol/aztec-packages/commit/7306176c80d1d80c032c3eed38a2008d545fb025)) + + +### Bug Fixes + +* ALU pil relation TWO_LINE_OP_NO_OVERLAP ([#6968](https://github.com/AztecProtocol/aztec-packages/issues/6968)) ([4ba553b](https://github.com/AztecProtocol/aztec-packages/commit/4ba553ba3170838de3b6c4cf47b609b0198443d0)) +* AVM / aztec-up CircleCI issues ([#7045](https://github.com/AztecProtocol/aztec-packages/issues/7045)) ([3f5d380](https://github.com/AztecProtocol/aztec-packages/commit/3f5d380f72d5ae819b2718ef9fbdfaec6b9a0e4d)) +* **avm:** Bugfix related to pc increment in calldatacopy of avm circuit ([#6891](https://github.com/AztecProtocol/aztec-packages/issues/6891)) ([5fe59d2](https://github.com/AztecProtocol/aztec-packages/commit/5fe59d2ed96a5b966efc9e3619c87b4a23c502f4)) +* **avm:** Correctly generate public inputs in verifier ([#7018](https://github.com/AztecProtocol/aztec-packages/issues/7018)) ([4c4c17f](https://github.com/AztecProtocol/aztec-packages/commit/4c4c17f804b8735dc017bbae171117ca15df25cc)) +* Aztec-builder port issue ([#7068](https://github.com/AztecProtocol/aztec-packages/issues/7068)) ([729e69a](https://github.com/AztecProtocol/aztec-packages/commit/729e69ae2cd773ee176935b7d4644db95dd62668)) +* Biggroup batch mul handles collisions ([#6780](https://github.com/AztecProtocol/aztec-packages/issues/6780)) ([e61c40e](https://github.com/AztecProtocol/aztec-packages/commit/e61c40e9c3e71f50c2d6a6c8a1688b6a8ddd4ba8)) +* Bugfix for Keccak opcode related to reading bytes from input ([#6989](https://github.com/AztecProtocol/aztec-packages/issues/6989)) ([5713f4e](https://github.com/AztecProtocol/aztec-packages/commit/5713f4e25ef8bf09cb91632bd210cd46bb7a77c3)) +* Correct docker-compose vars ([#6945](https://github.com/AztecProtocol/aztec-packages/issues/6945)) ([d492ac8](https://github.com/AztecProtocol/aztec-packages/commit/d492ac80e346572a371df84a6cebc4409b634a8d)) +* Declare volume ([#6881](https://github.com/AztecProtocol/aztec-packages/issues/6881)) ([1e38115](https://github.com/AztecProtocol/aztec-packages/commit/1e381159bb1d407dec8a4926242ecd54ec38e787)) +* Dirty merge 6880 ([#6905](https://github.com/AztecProtocol/aztec-packages/issues/6905)) ([fc6ec3f](https://github.com/AztecProtocol/aztec-packages/commit/fc6ec3fc7371b2506e7409a7d24ce37f25803fac)) +* Do not fail if rollup contract does not support turns ([#6938](https://github.com/AztecProtocol/aztec-packages/issues/6938)) ([5e6fe68](https://github.com/AztecProtocol/aztec-packages/commit/5e6fe68e088483203655522e0242c7e3230297b5)) +* Docker compose env vars ([#6926](https://github.com/AztecProtocol/aztec-packages/issues/6926)) ([14e0c1d](https://github.com/AztecProtocol/aztec-packages/commit/14e0c1df512555900cd49fff2d9070b489984e2f)) +* **docs:** Fix avm instruction set table ([#7061](https://github.com/AztecProtocol/aztec-packages/issues/7061)) ([fcbd44b](https://github.com/AztecProtocol/aztec-packages/commit/fcbd44b43e8a5dd459b543aaa25158d7f1dcc050)) +* **docs:** Remove prefix in link to code snippet source ([#6878](https://github.com/AztecProtocol/aztec-packages/issues/6878)) ([0e8e772](https://github.com/AztecProtocol/aztec-packages/commit/0e8e772c05c81c0b5cf6a2d047a5587c6c2e1a9c)) +* **elaborator:** Invert unconstrained check (https://github.com/noir-lang/noir/pull/5176) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* **elaborator:** Lazily elaborate globals (https://github.com/noir-lang/noir/pull/5191) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Ensure changes in aztec up directory are deployed ([#7031](https://github.com/AztecProtocol/aztec-packages/issues/7031)) ([e673fd4](https://github.com/AztecProtocol/aztec-packages/commit/e673fd4784147c365d9191a997049c53a7d6d67f)), closes [#6932](https://github.com/AztecProtocol/aztec-packages/issues/6932) +* Error for allocate instructions in acir-gen (https://github.com/noir-lang/noir/pull/5200) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* **experimental elaborator:** Clear generics after elaborating type aliases (https://github.com/noir-lang/noir/pull/5136) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix `impl Trait` when `--use-elaborator` is selected (https://github.com/noir-lang/noir/pull/5138) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix definition kind of globals and tuple patterns with `--use-elaborator` flag (https://github.com/noir-lang/noir/pull/5139) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix frontend tests when `--use-elaborator` flag is specified (https://github.com/noir-lang/noir/pull/5145) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix global values used in the elaborator (https://github.com/noir-lang/noir/pull/5135) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix globals which use function calls (https://github.com/noir-lang/noir/pull/5172) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Expose node port ([#6917](https://github.com/AztecProtocol/aztec-packages/issues/6917)) ([131af88](https://github.com/AztecProtocol/aztec-packages/commit/131af8806a453b851403b0eb7cba855bc2c0cc43)) +* Fix avm unit test with proving by passing the public_inputs ([#7062](https://github.com/AztecProtocol/aztec-packages/issues/7062)) ([2d7c097](https://github.com/AztecProtocol/aztec-packages/commit/2d7c097d7a6606101354736d69bd0bbbe6f005bf)) +* Fix client ivc incorrect srs size issue and parallelise srs generation for grumpkin ([#6913](https://github.com/AztecProtocol/aztec-packages/issues/6913)) ([f015736](https://github.com/AztecProtocol/aztec-packages/commit/f01573641728d6cc62da36189a22fa813713fd82)) +* Fix for the flaky issue (I hope) ([#6923](https://github.com/AztecProtocol/aztec-packages/issues/6923)) ([39747b9](https://github.com/AztecProtocol/aztec-packages/commit/39747b933a13aa08f25c5074207f9d92489d5e3d)) +* Fix panic in `get_global_let_statement` (https://github.com/noir-lang/noir/pull/5177) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Fixing 0 naf ([#6950](https://github.com/AztecProtocol/aztec-packages/issues/6950)) ([d35ee2e](https://github.com/AztecProtocol/aztec-packages/commit/d35ee2ed87967a5161ef52d892856900a55de0b9)) +* **frontend:** Resolve object types from method calls a single time (https://github.com/noir-lang/noir/pull/5131) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Initialize side_effect_counter based on the initial value passed to builder ([#7017](https://github.com/AztecProtocol/aztec-packages/issues/7017)) ([46d166b](https://github.com/AztecProtocol/aztec-packages/commit/46d166b0f1d16d801e056d3195546970cddda1a8)) +* **p2p:** Remove p2p datastore persistence for now ([#6879](https://github.com/AztecProtocol/aztec-packages/issues/6879)) ([ce7f0e2](https://github.com/AztecProtocol/aztec-packages/commit/ce7f0e244621a599796e8d26fd37540b541ca0d3)) +* Pxe waits for node to go up ([#6933](https://github.com/AztecProtocol/aztec-packages/issues/6933)) ([06f03fd](https://github.com/AztecProtocol/aztec-packages/commit/06f03fdf73d9374b5d18d33cf1480f7748db016f)) +* Register account contract before recipient ([#6855](https://github.com/AztecProtocol/aztec-packages/issues/6855)) ([dfea1c7](https://github.com/AztecProtocol/aztec-packages/commit/dfea1c79f57564af3be83a0b3244374f74834571)) +* Revert "chore: add arm64 version of aztec-nargo image" ([#7039](https://github.com/AztecProtocol/aztec-packages/issues/7039)) ([25d12da](https://github.com/AztecProtocol/aztec-packages/commit/25d12da45c1c36e8c5b77a8c81baea3bb365d2c6)) +* SimulateTx does not prove ([#6930](https://github.com/AztecProtocol/aztec-packages/issues/6930)) ([d3d6b9e](https://github.com/AztecProtocol/aztec-packages/commit/d3d6b9ebfa81267b28ebf361fdba310071963492)) +* Stop squashing storage accesses in avm simulator - all need to be validated in kernel ([#7036](https://github.com/AztecProtocol/aztec-packages/issues/7036)) ([6ffc4b4](https://github.com/AztecProtocol/aztec-packages/commit/6ffc4b4455a0613c933de0ec7528774186f53bee)) +* Update docker-compopse env vars ([#6943](https://github.com/AztecProtocol/aztec-packages/issues/6943)) ([80d1121](https://github.com/AztecProtocol/aztec-packages/commit/80d1121f270363a3da1e4200f41283f822357f92)) +* Updating max update requests per tx ([#6783](https://github.com/AztecProtocol/aztec-packages/issues/6783)) ([55b1cf7](https://github.com/AztecProtocol/aztec-packages/commit/55b1cf7056ab3d630b2ed98d1d99c43b39feb587)) +* Use predicate for curve operations (https://github.com/noir-lang/noir/pull/5076) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Wrapping in signed division (https://github.com/noir-lang/noir/pull/5134) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) + + +### Miscellaneous + +* Add arm64 version of aztec-nargo image ([#7034](https://github.com/AztecProtocol/aztec-packages/issues/7034)) ([2a41e84](https://github.com/AztecProtocol/aztec-packages/commit/2a41e8415bac26b122c0da2672bf3077aae4eda2)) +* Add more lints related to oracle calls (https://github.com/noir-lang/noir/pull/5193) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Add negative tests for cast and U128 multiplication related to TWO_LINE_OP_NO_OVERLAP ([#7041](https://github.com/AztecProtocol/aztec-packages/issues/7041)) ([7f14ca1](https://github.com/AztecProtocol/aztec-packages/commit/7f14ca122032a56eb322e34ee0290845e75a925a)), closes [#6969](https://github.com/AztecProtocol/aztec-packages/issues/6969) +* Add some property tests to ACVM crates (https://github.com/noir-lang/noir/pull/5215) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Add transfer to undeployed account ([#7015](https://github.com/AztecProtocol/aztec-packages/issues/7015)) ([46324b9](https://github.com/AztecProtocol/aztec-packages/commit/46324b96343a9b603413843480211d05abdf4556)) +* Add transferFrom migration notes ([#7079](https://github.com/AztecProtocol/aztec-packages/issues/7079)) ([d4921a0](https://github.com/AztecProtocol/aztec-packages/commit/d4921a032a56eb0ba464b0e505f6ac11cb41502d)) +* Automate necessary changes to outward sync into noir-lang/noir ([#7049](https://github.com/AztecProtocol/aztec-packages/issues/7049)) ([449e41c](https://github.com/AztecProtocol/aztec-packages/commit/449e41c1ffbded4b64bf9cde7a97fd8670d7647c)) +* **avm:** Add a TS prover test suite for each avm context function ([#6957](https://github.com/AztecProtocol/aztec-packages/issues/6957)) ([f745696](https://github.com/AztecProtocol/aztec-packages/commit/f745696270a440ce45a33b1f72996e47dacdaf74)) +* **avm:** Add bytecode size metrics ([#7042](https://github.com/AztecProtocol/aztec-packages/issues/7042)) ([555d97a](https://github.com/AztecProtocol/aztec-packages/commit/555d97af65cfb1b8d30b32d5b9b9a23b9b446f9e)) +* **avm:** Add debugging info and trace dump ([#6979](https://github.com/AztecProtocol/aztec-packages/issues/6979)) ([e11f880](https://github.com/AztecProtocol/aztec-packages/commit/e11f88004e2c31cb2b2ae376095513e94584a4dc)) +* **avm:** Add tag checking and missing indirects ([#6936](https://github.com/AztecProtocol/aztec-packages/issues/6936)) ([48be80c](https://github.com/AztecProtocol/aztec-packages/commit/48be80c4f9cd21885b21cb9c8202e956d537e595)) +* **avm:** Add TS bb prover tests for hashing opcodes ([#6970](https://github.com/AztecProtocol/aztec-packages/issues/6970)) ([312718a](https://github.com/AztecProtocol/aztec-packages/commit/312718a6946651470c7c97e42414bfc654355d24)) +* **avm:** Enable tag checking and some proving tests ([#6966](https://github.com/AztecProtocol/aztec-packages/issues/6966)) ([b19daa4](https://github.com/AztecProtocol/aztec-packages/commit/b19daa44f034e50109e53363e691493534e7d3f1)) +* **avm:** Fix proving for kernel tests ([#7033](https://github.com/AztecProtocol/aztec-packages/issues/7033)) ([f5e1106](https://github.com/AztecProtocol/aztec-packages/commit/f5e1106bcaa9558ac0a953de06d4fafd09fb1fe8)) +* **avm:** Fix struct serialization and factory ([#6903](https://github.com/AztecProtocol/aztec-packages/issues/6903)) ([bee2646](https://github.com/AztecProtocol/aztec-packages/commit/bee2646d0274806e8fd1a74bd321620c8c8bd0d9)) +* **avm:** Gas alignments with simulator ([#6873](https://github.com/AztecProtocol/aztec-packages/issues/6873)) ([54339d4](https://github.com/AztecProtocol/aztec-packages/commit/54339d48861a91429e996177713f46952ffbd808)), closes [#6860](https://github.com/AztecProtocol/aztec-packages/issues/6860) +* **avm:** Modify unit test to have a calldatacopy over 4 elements ([#6893](https://github.com/AztecProtocol/aztec-packages/issues/6893)) ([9f5b113](https://github.com/AztecProtocol/aztec-packages/commit/9f5b11345dc5dd055442eaf7673227fe7cbaf262)) +* **avm:** Remove unused public context inputs ([#7028](https://github.com/AztecProtocol/aztec-packages/issues/7028)) ([f7a0921](https://github.com/AztecProtocol/aztec-packages/commit/f7a0921bb4bb26a3abba9c298a7f50e49248d711)) +* Avoid `bn254_blackbox_solver` polluting feature flags (https://github.com/noir-lang/noir/pull/5141) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Avoid manual creation of contract artifact in wasm (https://github.com/noir-lang/noir/pull/5117) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Bb repo warning ([#7023](https://github.com/AztecProtocol/aztec-packages/issues/7023)) ([c3d7053](https://github.com/AztecProtocol/aztec-packages/commit/c3d70537c5558ba451a43e403bab067940aa48b6)) +* **bb:** Hide `debug()` logs under `--debug` flag ([#7008](https://github.com/AztecProtocol/aztec-packages/issues/7008)) ([a8c3c3f](https://github.com/AztecProtocol/aztec-packages/commit/a8c3c3fcf35b7c464006c481230afcb11b9952dc)) +* Break out helper methods for writing foreign call results (https://github.com/noir-lang/noir/pull/5181) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* **ci:** Don't raise MSRV issue if workflow cancelled (https://github.com/noir-lang/noir/pull/5143) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Custom jest Field equality ([#7012](https://github.com/AztecProtocol/aztec-packages/issues/7012)) ([1a198b8](https://github.com/AztecProtocol/aztec-packages/commit/1a198b8d53397f89f9fe6299d9ec5cb42ce245b2)) +* Default to using bn254 in `noirc_frontend` (https://github.com/noir-lang/noir/pull/5144) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **docs:** Fix incorrect docs github link in footer (https://github.com/noir-lang/noir/pull/5206) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* **docs:** Fixing the breadcrumb issue ([#6605](https://github.com/AztecProtocol/aztec-packages/issues/6605)) ([2624c26](https://github.com/AztecProtocol/aztec-packages/commit/2624c264fd266e090eec1b79654005b4dcd057de)) +* **docs:** Supplement Noir Debugger's dependency versions (https://github.com/noir-lang/noir/pull/5199) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* **docs:** Update docs homepage (https://github.com/noir-lang/noir/pull/5198) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Enable skipped ordering tests since AVM properly updates side-effect counter for nested calls ([#7064](https://github.com/AztecProtocol/aztec-packages/issues/7064)) ([5ff5ffb](https://github.com/AztecProtocol/aztec-packages/commit/5ff5ffb83ae55c6f12af6e5271e399f4aeaa4737)), closes [#6471](https://github.com/AztecProtocol/aztec-packages/issues/6471) +* **experimental elaborator:** Handle `comptime` expressions in the elaborator (https://github.com/noir-lang/noir/pull/5169) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Fix issue [#6929](https://github.com/AztecProtocol/aztec-packages/issues/6929) (off-by-one error in `UltraCircuitBuilder::create_range_constraint`) ([#6931](https://github.com/AztecProtocol/aztec-packages/issues/6931)) ([16deef6](https://github.com/AztecProtocol/aztec-packages/commit/16deef6a83a9fe41e1f865e79e17c2f671604bb0)) +* Fix migration notes ([#7075](https://github.com/AztecProtocol/aztec-packages/issues/7075)) ([ac75f8c](https://github.com/AztecProtocol/aztec-packages/commit/ac75f8cf2019dd00f80c81259c30737a042a4b9b)) +* Granular public simulation benchmarks ([#6924](https://github.com/AztecProtocol/aztec-packages/issues/6924)) ([b70bc98](https://github.com/AztecProtocol/aztec-packages/commit/b70bc98c948c51053560e8948a43b65159a95b58)) +* Inline `FieldElement.is_negative` and document (https://github.com/noir-lang/noir/pull/5214) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Lookups cleanup/documentation ([#7002](https://github.com/AztecProtocol/aztec-packages/issues/7002)) ([92b1349](https://github.com/AztecProtocol/aztec-packages/commit/92b1349ba671e87e948bf9248c5133accde9091f)) +* Loosen trait bounds on impls depending on `AcirField` (https://github.com/noir-lang/noir/pull/5115) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Make `nargo` crate and debug info generic (https://github.com/noir-lang/noir/pull/5184) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Mark all oracles as unconstrained ([#7032](https://github.com/AztecProtocol/aztec-packages/issues/7032)) ([7a68be4](https://github.com/AztecProtocol/aztec-packages/commit/7a68be4bc31114853d8c25549029c74afd9a8f37)) +* Move acir docs to code declaration (https://github.com/noir-lang/noir/pull/5040) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Move gas bridge initialization into L1 contracts deployment ([#6912](https://github.com/AztecProtocol/aztec-packages/issues/6912)) ([26a1fc4](https://github.com/AztecProtocol/aztec-packages/commit/26a1fc4bcec04434b61651e2f527938a14f3ac3a)) +* Move implementation of bitwise operations into `blackbox_solver` (https://github.com/noir-lang/noir/pull/5209) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Note emission ([#7003](https://github.com/AztecProtocol/aztec-packages/issues/7003)) ([10048da](https://github.com/AztecProtocol/aztec-packages/commit/10048da5ce7edfe850d03ee97505ed72552c1dca)) +* Note processor cleanup ([#6870](https://github.com/AztecProtocol/aztec-packages/issues/6870)) ([315c46e](https://github.com/AztecProtocol/aztec-packages/commit/315c46e3804718bcaf7337da887548755984ca67)) +* Opcodes l2gasleft and dagasleft return value with tag ff ([#6896](https://github.com/AztecProtocol/aztec-packages/issues/6896)) ([5890845](https://github.com/AztecProtocol/aztec-packages/commit/5890845e8f9b278b2a5c5c930eb28ec0aba74ebc)) +* Parallelise compilation of contracts and protocol circuits ([#7009](https://github.com/AztecProtocol/aztec-packages/issues/7009)) ([86a3314](https://github.com/AztecProtocol/aztec-packages/commit/86a33140f9a65e518003b3f4c60f97d132f85b89)) +* Remove `distinct` keyword (https://github.com/noir-lang/noir/pull/5219) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Remove `param_witnesses` and `return_witnesses` from ABI (https://github.com/noir-lang/noir/pull/5154) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Remove deprecated functions ([#7029](https://github.com/AztecProtocol/aztec-packages/issues/7029)) ([bc80e85](https://github.com/AztecProtocol/aztec-packages/commit/bc80e8575b5e60c3a45a7631e445c79774d20a49)) +* Remove hir to ast pass (https://github.com/noir-lang/noir/pull/5147) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Remove old public storage access ordering hack ([#7063](https://github.com/AztecProtocol/aztec-packages/issues/7063)) ([bf6b8b8](https://github.com/AztecProtocol/aztec-packages/commit/bf6b8b86d78ce6ee5e863dc0a43e78c36b6b35a8)) +* Remove stale comment (https://github.com/noir-lang/noir/pull/5179) ([12af650](https://github.com/AztecProtocol/aztec-packages/commit/12af650f0d27c37dca06bb329bf76a5574534d78)) +* Remove unused `new_variables` argument from `resolve_type_inner` (https://github.com/noir-lang/noir/pull/5148) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Rename p2p vars ([#6916](https://github.com/AztecProtocol/aztec-packages/issues/6916)) ([ae7d757](https://github.com/AztecProtocol/aztec-packages/commit/ae7d75764fc704daae67be882e0e9f09a0a9407c)) +* Replace relative paths to noir-protocol-circuits ([8f7b865](https://github.com/AztecProtocol/aztec-packages/commit/8f7b8656940354df38bb623bc6d8941ab98f3e5d)) +* Replace relative paths to noir-protocol-circuits ([91e1554](https://github.com/AztecProtocol/aztec-packages/commit/91e155472951908e455fff9279118f0b9be0900b)) +* Replace relative paths to noir-protocol-circuits ([f4fed13](https://github.com/AztecProtocol/aztec-packages/commit/f4fed131a9c3bb568a995846d09f793620c5a366)) +* Replace relative paths to noir-protocol-circuits ([7caa288](https://github.com/AztecProtocol/aztec-packages/commit/7caa28892086b9f97d417d0694e3cad228fd5788)) +* Replace relative paths to noir-protocol-circuits ([8a299e9](https://github.com/AztecProtocol/aztec-packages/commit/8a299e99783775d70ba8871f44057a03daaf4917)) +* Replace relative paths to noir-protocol-circuits ([acf1188](https://github.com/AztecProtocol/aztec-packages/commit/acf1188fb1fc5ea4d53d57a6c0a362ad55cd707e)) +* Replace relative paths to noir-protocol-circuits ([094b511](https://github.com/AztecProtocol/aztec-packages/commit/094b511e6a696e5c2a7687147ca21007801237de)) +* Replace relative paths to noir-protocol-circuits ([8e07176](https://github.com/AztecProtocol/aztec-packages/commit/8e0717654ec7f75fe2ea8577457359ec2a102b58)) +* Replace relative paths to noir-protocol-circuits ([52b6934](https://github.com/AztecProtocol/aztec-packages/commit/52b69341129a23e300292e3f5e207cb512b05aa6)) +* Replace relative paths to noir-protocol-circuits ([873dcea](https://github.com/AztecProtocol/aztec-packages/commit/873dcea15e4e802f99998e2ed113ebaa8bd834e6)) +* Replace sibling path read with leaf read ([#6834](https://github.com/AztecProtocol/aztec-packages/issues/6834)) ([a20d845](https://github.com/AztecProtocol/aztec-packages/commit/a20d845d35715816ddc889fb9a75fb9fba4fc356)) +* Run all test programs in brillig as well as ACIR (https://github.com/noir-lang/noir/pull/5128) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Schnorr signature verification in noir (https://github.com/noir-lang/noir/pull/5188) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Small fixes for the tube flows ([#7014](https://github.com/AztecProtocol/aztec-packages/issues/7014)) ([838ceed](https://github.com/AztecProtocol/aztec-packages/commit/838ceed3b6ccf1bb7d89552a147db92c3514f0c1)) +* Split log emission to encrypt and a log, remove address input ([#6987](https://github.com/AztecProtocol/aztec-packages/issues/6987)) ([ca0e084](https://github.com/AztecProtocol/aztec-packages/commit/ca0e0848563cfae72ebd7d4487a6e2812c2a405c)) +* Start moving lints into a separate linting directory (https://github.com/noir-lang/noir/pull/5165) ([bf38cc2](https://github.com/AztecProtocol/aztec-packages/commit/bf38cc29821d96d801f56e70342426e1b12692e1)) +* Terraform Updates ([#6887](https://github.com/AztecProtocol/aztec-packages/issues/6887)) ([33a3870](https://github.com/AztecProtocol/aztec-packages/commit/33a3870d06ae8bb5d08dbbd9f72a62e0811e5e7d)) +* Transfer and transferfrom to save constrains for simpler cases ([#7013](https://github.com/AztecProtocol/aztec-packages/issues/7013)) ([612b972](https://github.com/AztecProtocol/aztec-packages/commit/612b9724a419224c72cd823c889ece4ae8f00ab0)) +* TS avm proving test - add a pattern for assertion failure (timestamp example) ([#7005](https://github.com/AztecProtocol/aztec-packages/issues/7005)) ([cfef246](https://github.com/AztecProtocol/aztec-packages/commit/cfef24654492a1f3eef94db60937bd3a45f8ec3c)) +* Update comment on transient nullification ([#7001](https://github.com/AztecProtocol/aztec-packages/issues/7001)) ([6c4e61c](https://github.com/AztecProtocol/aztec-packages/commit/6c4e61c19613560af8aedba03531958f8471bb62)) +* Updated devnet terraform ([#6927](https://github.com/AztecProtocol/aztec-packages/issues/6927)) ([4692fb0](https://github.com/AztecProtocol/aztec-packages/commit/4692fb034f22bb62593d257777b7b545993c27ab)) +* Updated l1 contracts in compose file ([#6942](https://github.com/AztecProtocol/aztec-packages/issues/6942)) ([15371ce](https://github.com/AztecProtocol/aztec-packages/commit/15371ceafb62627cd0bcb5ba65c854f07e09cb49)) +* Updated sha for devnet image in compose file ([#6939](https://github.com/AztecProtocol/aztec-packages/issues/6939)) ([83dd231](https://github.com/AztecProtocol/aztec-packages/commit/83dd231d7c7bc561829296cb3f252fb9ab50528f)) + + +### Documentation + +* Add account tags ([#7011](https://github.com/AztecProtocol/aztec-packages/issues/7011)) ([8580467](https://github.com/AztecProtocol/aztec-packages/commit/8580467354fe32cda87c956ea40caa4d0f058a04)) +* **avm:** Comments in pil file related to range checks of addresses ([#6837](https://github.com/AztecProtocol/aztec-packages/issues/6837)) ([66f1c87](https://github.com/AztecProtocol/aztec-packages/commit/66f1c876578b05838698377f2ede12b52671e4ca)) +* Aztec macros ([#6935](https://github.com/AztecProtocol/aztec-packages/issues/6935)) ([57078d4](https://github.com/AztecProtocol/aztec-packages/commit/57078d4aea54c4beaf66f10db2f0052d4577e46a)) +* Clarify comment on collapse ([#7038](https://github.com/AztecProtocol/aztec-packages/issues/7038)) ([6237ddd](https://github.com/AztecProtocol/aztec-packages/commit/6237ddd9052fc98a26de07f11bd494843dcc07ee)) +* Update HOW_WE_WRITE_DOCS.md ([#6850](https://github.com/AztecProtocol/aztec-packages/issues/6850)) ([d4dfdaf](https://github.com/AztecProtocol/aztec-packages/commit/d4dfdaf9ab03eeafa3d54be178fc72c59ac51b95)) + ## [0.42.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.41.0...aztec-packages-v0.42.0) (2024-06-04) diff --git a/barretenberg/CHANGELOG.md b/barretenberg/CHANGELOG.md index 7360a1c32c9..38233698dbc 100644 --- a/barretenberg/CHANGELOG.md +++ b/barretenberg/CHANGELOG.md @@ -1,5 +1,90 @@ # Changelog +## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.42.0...barretenberg-v0.43.0) (2024-06-18) + + +### Features + +* Add gate profiler for noir circuits ([#7004](https://github.com/AztecProtocol/aztec-packages/issues/7004)) ([a2f6876](https://github.com/AztecProtocol/aztec-packages/commit/a2f687687559d15fde52abce54838f6e144a0aa4)) +* Add standard form function to biggroup ([#6899](https://github.com/AztecProtocol/aztec-packages/issues/6899)) ([3e44be5](https://github.com/AztecProtocol/aztec-packages/commit/3e44be538e5c7f0e7269c1e5c0820f7bc6e83734)) +* Affine_element read/write with proper handling of point at infinity ([#6963](https://github.com/AztecProtocol/aztec-packages/issues/6963)) ([c6cbe39](https://github.com/AztecProtocol/aztec-packages/commit/c6cbe39eed23dc845aef898e937e99de43f71675)) +* Avm e2e nested call + alu fix + cast fix ([#6974](https://github.com/AztecProtocol/aztec-packages/issues/6974)) ([b150b61](https://github.com/AztecProtocol/aztec-packages/commit/b150b610153e380a93240914c95887f88b56fa94)) +* **avm-simulator:** Msm blackbox ([#7048](https://github.com/AztecProtocol/aztec-packages/issues/7048)) ([0ce27e0](https://github.com/AztecProtocol/aztec-packages/commit/0ce27e05c4c099167d0d98300f6d73ced22639ad)) +* **avm:** Add get_contract_instance ([#6871](https://github.com/AztecProtocol/aztec-packages/issues/6871)) ([b3a86bf](https://github.com/AztecProtocol/aztec-packages/commit/b3a86bf72343d1060ce58a11f139e05ba2a75754)) +* **avm:** Deserialise execution hints in bb main ([#6848](https://github.com/AztecProtocol/aztec-packages/issues/6848)) ([d3be85f](https://github.com/AztecProtocol/aztec-packages/commit/d3be85f57c34aa88e732ea115239f3bed1e7aa16)) +* **avm:** E2e proving of storage ([#6967](https://github.com/AztecProtocol/aztec-packages/issues/6967)) ([6a7be0c](https://github.com/AztecProtocol/aztec-packages/commit/6a7be0c434934175bb6da1f3525c025b3f743824)) +* **avm:** E2e send l1 msg ([#6880](https://github.com/AztecProtocol/aztec-packages/issues/6880)) ([deb972d](https://github.com/AztecProtocol/aztec-packages/commit/deb972d3f13a92d34a6f91074b072fb66d247f64)) +* **avm:** Gas remaining range check and handling of out of gas ([#6944](https://github.com/AztecProtocol/aztec-packages/issues/6944)) ([5647571](https://github.com/AztecProtocol/aztec-packages/commit/56475716e05973e6b493de427f32eee71c0f8f6a)), closes [#6902](https://github.com/AztecProtocol/aztec-packages/issues/6902) +* **avm:** Get contract instance now works e2e with avm proving ([#6911](https://github.com/AztecProtocol/aztec-packages/issues/6911)) ([662187d](https://github.com/AztecProtocol/aztec-packages/commit/662187d1d6960b734a71aaf365e7f20d471dc4c9)) +* **avm:** Indirect support for kernel output opcodes ([#6962](https://github.com/AztecProtocol/aztec-packages/issues/6962)) ([f330bff](https://github.com/AztecProtocol/aztec-packages/commit/f330bffa80b6da5f037cea3cf469ef1c7b6d9d03)) +* **avm:** Indirect support for kernel read opcodes ([#6940](https://github.com/AztecProtocol/aztec-packages/issues/6940)) ([ccc474d](https://github.com/AztecProtocol/aztec-packages/commit/ccc474d9d0cd10faf857bc1ec6571dc25306a531)) +* **avm:** L2gasleft and dagasleft opcodes ([#6884](https://github.com/AztecProtocol/aztec-packages/issues/6884)) ([fbab612](https://github.com/AztecProtocol/aztec-packages/commit/fbab612b17dfe0e95ead1a592b7bc9fe6ca5415d)) +* **avm:** Nullifier non exist ([#6877](https://github.com/AztecProtocol/aztec-packages/issues/6877)) ([05697f2](https://github.com/AztecProtocol/aztec-packages/commit/05697f289d3b97def74f45cd839a58a8a077c3fa)) +* **avm:** Plumb externalcall hints ([#6890](https://github.com/AztecProtocol/aztec-packages/issues/6890)) ([3a97f08](https://github.com/AztecProtocol/aztec-packages/commit/3a97f08c457472bd701200adfa45d61554fd3867)) +* **avm:** Plumb start side effect counter in circuit ([#7007](https://github.com/AztecProtocol/aztec-packages/issues/7007)) ([fa8f12f](https://github.com/AztecProtocol/aztec-packages/commit/fa8f12f93a8d94604a4382de444501fac310dbb8)) +* **avm:** Revert opcode ([#6909](https://github.com/AztecProtocol/aztec-packages/issues/6909)) ([620d3da](https://github.com/AztecProtocol/aztec-packages/commit/620d3dacc853c71e808ef58001eb4c8584fa59d9)) +* **avm:** Use hints in gas accounting (circuit) ([#6895](https://github.com/AztecProtocol/aztec-packages/issues/6895)) ([c3746f5](https://github.com/AztecProtocol/aztec-packages/commit/c3746f5d6ae38bc448d00834d91a7ddd7b901e64)) +* **bb:** Stack traces for check_circuit ([#6851](https://github.com/AztecProtocol/aztec-packages/issues/6851)) ([eb35e62](https://github.com/AztecProtocol/aztec-packages/commit/eb35e627445c72ee07fafb3652076349302e7fa1)) +* Contract storage reads serialize with side effect counter ([#6961](https://github.com/AztecProtocol/aztec-packages/issues/6961)) ([db49ed5](https://github.com/AztecProtocol/aztec-packages/commit/db49ed57d1d4165ce47e6af01b6fd67239121aa4)) +* Ecadd op code ([#6906](https://github.com/AztecProtocol/aztec-packages/issues/6906)) ([03a9064](https://github.com/AztecProtocol/aztec-packages/commit/03a9064b308fbf5541f4f763e1ad1e05f60e1fff)) +* Flows and tests for the tube component ([#6934](https://github.com/AztecProtocol/aztec-packages/issues/6934)) ([4b45438](https://github.com/AztecProtocol/aztec-packages/commit/4b454386a35f4b0cd4c6a9b8003c55e55e50b592)) +* Place return value witnesses directly after function arguments (https://github.com/noir-lang/noir/pull/5142) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Separate runtimes of SSA functions before inlining (https://github.com/noir-lang/noir/pull/5121) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* SMT Standard Circuit separation ([#6904](https://github.com/AztecProtocol/aztec-packages/issues/6904)) ([f970732](https://github.com/AztecProtocol/aztec-packages/commit/f9707321bdd107e3c7116cafd89fd570224e89ef)) +* SMT Verification Module Update ([#6849](https://github.com/AztecProtocol/aztec-packages/issues/6849)) ([6c98529](https://github.com/AztecProtocol/aztec-packages/commit/6c985299d796b8c711794395518c3b3a0f41e775)) +* SMT Verifier for Ultra Arithmetization ([#7067](https://github.com/AztecProtocol/aztec-packages/issues/7067)) ([6692ac8](https://github.com/AztecProtocol/aztec-packages/commit/6692ac831ab980d9623442236c21b499a7238966)) +* Standard form for cycle_group ([#6915](https://github.com/AztecProtocol/aztec-packages/issues/6915)) ([e6cba16](https://github.com/AztecProtocol/aztec-packages/commit/e6cba16ef82428b115d527eabe237122e269aa32)) +* Support disabling aztec vm in non-wasm builds ([#6965](https://github.com/AztecProtocol/aztec-packages/issues/6965)) ([f7a46c0](https://github.com/AztecProtocol/aztec-packages/commit/f7a46c0d8de2e58b7e76576a76eb85f52b266966)) + + +### Bug Fixes + +* ALU pil relation TWO_LINE_OP_NO_OVERLAP ([#6968](https://github.com/AztecProtocol/aztec-packages/issues/6968)) ([4ba553b](https://github.com/AztecProtocol/aztec-packages/commit/4ba553ba3170838de3b6c4cf47b609b0198443d0)) +* **avm:** Bugfix related to pc increment in calldatacopy of avm circuit ([#6891](https://github.com/AztecProtocol/aztec-packages/issues/6891)) ([5fe59d2](https://github.com/AztecProtocol/aztec-packages/commit/5fe59d2ed96a5b966efc9e3619c87b4a23c502f4)) +* **avm:** Correctly generate public inputs in verifier ([#7018](https://github.com/AztecProtocol/aztec-packages/issues/7018)) ([4c4c17f](https://github.com/AztecProtocol/aztec-packages/commit/4c4c17f804b8735dc017bbae171117ca15df25cc)) +* Biggroup batch mul handles collisions ([#6780](https://github.com/AztecProtocol/aztec-packages/issues/6780)) ([e61c40e](https://github.com/AztecProtocol/aztec-packages/commit/e61c40e9c3e71f50c2d6a6c8a1688b6a8ddd4ba8)) +* Bugfix for Keccak opcode related to reading bytes from input ([#6989](https://github.com/AztecProtocol/aztec-packages/issues/6989)) ([5713f4e](https://github.com/AztecProtocol/aztec-packages/commit/5713f4e25ef8bf09cb91632bd210cd46bb7a77c3)) +* Dirty merge 6880 ([#6905](https://github.com/AztecProtocol/aztec-packages/issues/6905)) ([fc6ec3f](https://github.com/AztecProtocol/aztec-packages/commit/fc6ec3fc7371b2506e7409a7d24ce37f25803fac)) +* **experimental elaborator:** Clear generics after elaborating type aliases (https://github.com/noir-lang/noir/pull/5136) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix `impl Trait` when `--use-elaborator` is selected (https://github.com/noir-lang/noir/pull/5138) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix definition kind of globals and tuple patterns with `--use-elaborator` flag (https://github.com/noir-lang/noir/pull/5139) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix frontend tests when `--use-elaborator` flag is specified (https://github.com/noir-lang/noir/pull/5145) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* **experimental elaborator:** Fix global values used in the elaborator (https://github.com/noir-lang/noir/pull/5135) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Fix avm unit test with proving by passing the public_inputs ([#7062](https://github.com/AztecProtocol/aztec-packages/issues/7062)) ([2d7c097](https://github.com/AztecProtocol/aztec-packages/commit/2d7c097d7a6606101354736d69bd0bbbe6f005bf)) +* Fix client ivc incorrect srs size issue and parallelise srs generation for grumpkin ([#6913](https://github.com/AztecProtocol/aztec-packages/issues/6913)) ([f015736](https://github.com/AztecProtocol/aztec-packages/commit/f01573641728d6cc62da36189a22fa813713fd82)) +* Fix for the flaky issue (I hope) ([#6923](https://github.com/AztecProtocol/aztec-packages/issues/6923)) ([39747b9](https://github.com/AztecProtocol/aztec-packages/commit/39747b933a13aa08f25c5074207f9d92489d5e3d)) +* Fixing 0 naf ([#6950](https://github.com/AztecProtocol/aztec-packages/issues/6950)) ([d35ee2e](https://github.com/AztecProtocol/aztec-packages/commit/d35ee2ed87967a5161ef52d892856900a55de0b9)) +* **frontend:** Resolve object types from method calls a single time (https://github.com/noir-lang/noir/pull/5131) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Initialize side_effect_counter based on the initial value passed to builder ([#7017](https://github.com/AztecProtocol/aztec-packages/issues/7017)) ([46d166b](https://github.com/AztecProtocol/aztec-packages/commit/46d166b0f1d16d801e056d3195546970cddda1a8)) +* Stop squashing storage accesses in avm simulator - all need to be validated in kernel ([#7036](https://github.com/AztecProtocol/aztec-packages/issues/7036)) ([6ffc4b4](https://github.com/AztecProtocol/aztec-packages/commit/6ffc4b4455a0613c933de0ec7528774186f53bee)) +* Use predicate for curve operations (https://github.com/noir-lang/noir/pull/5076) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Wrapping in signed division (https://github.com/noir-lang/noir/pull/5134) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) + + +### Miscellaneous + +* Add negative tests for cast and U128 multiplication related to TWO_LINE_OP_NO_OVERLAP ([#7041](https://github.com/AztecProtocol/aztec-packages/issues/7041)) ([7f14ca1](https://github.com/AztecProtocol/aztec-packages/commit/7f14ca122032a56eb322e34ee0290845e75a925a)), closes [#6969](https://github.com/AztecProtocol/aztec-packages/issues/6969) +* **avm:** Add debugging info and trace dump ([#6979](https://github.com/AztecProtocol/aztec-packages/issues/6979)) ([e11f880](https://github.com/AztecProtocol/aztec-packages/commit/e11f88004e2c31cb2b2ae376095513e94584a4dc)) +* **avm:** Fix proving for kernel tests ([#7033](https://github.com/AztecProtocol/aztec-packages/issues/7033)) ([f5e1106](https://github.com/AztecProtocol/aztec-packages/commit/f5e1106bcaa9558ac0a953de06d4fafd09fb1fe8)) +* **avm:** Gas alignments with simulator ([#6873](https://github.com/AztecProtocol/aztec-packages/issues/6873)) ([54339d4](https://github.com/AztecProtocol/aztec-packages/commit/54339d48861a91429e996177713f46952ffbd808)), closes [#6860](https://github.com/AztecProtocol/aztec-packages/issues/6860) +* **avm:** Modify unit test to have a calldatacopy over 4 elements ([#6893](https://github.com/AztecProtocol/aztec-packages/issues/6893)) ([9f5b113](https://github.com/AztecProtocol/aztec-packages/commit/9f5b11345dc5dd055442eaf7673227fe7cbaf262)) +* Bb repo warning ([#7023](https://github.com/AztecProtocol/aztec-packages/issues/7023)) ([c3d7053](https://github.com/AztecProtocol/aztec-packages/commit/c3d70537c5558ba451a43e403bab067940aa48b6)) +* **bb:** Hide `debug()` logs under `--debug` flag ([#7008](https://github.com/AztecProtocol/aztec-packages/issues/7008)) ([a8c3c3f](https://github.com/AztecProtocol/aztec-packages/commit/a8c3c3fcf35b7c464006c481230afcb11b9952dc)) +* **ci:** Don't raise MSRV issue if workflow cancelled (https://github.com/noir-lang/noir/pull/5143) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Default to using bn254 in `noirc_frontend` (https://github.com/noir-lang/noir/pull/5144) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Fix issue [#6929](https://github.com/AztecProtocol/aztec-packages/issues/6929) (off-by-one error in `UltraCircuitBuilder::create_range_constraint`) ([#6931](https://github.com/AztecProtocol/aztec-packages/issues/6931)) ([16deef6](https://github.com/AztecProtocol/aztec-packages/commit/16deef6a83a9fe41e1f865e79e17c2f671604bb0)) +* Lookups cleanup/documentation ([#7002](https://github.com/AztecProtocol/aztec-packages/issues/7002)) ([92b1349](https://github.com/AztecProtocol/aztec-packages/commit/92b1349ba671e87e948bf9248c5133accde9091f)) +* Opcodes l2gasleft and dagasleft return value with tag ff ([#6896](https://github.com/AztecProtocol/aztec-packages/issues/6896)) ([5890845](https://github.com/AztecProtocol/aztec-packages/commit/5890845e8f9b278b2a5c5c930eb28ec0aba74ebc)) +* Remove hir to ast pass (https://github.com/noir-lang/noir/pull/5147) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Remove unused `new_variables` argument from `resolve_type_inner` (https://github.com/noir-lang/noir/pull/5148) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Run all test programs in brillig as well as ACIR (https://github.com/noir-lang/noir/pull/5128) ([a44b8c8](https://github.com/AztecProtocol/aztec-packages/commit/a44b8c81458eb789e54624e020b6c93d0e9963cc)) +* Small fixes for the tube flows ([#7014](https://github.com/AztecProtocol/aztec-packages/issues/7014)) ([838ceed](https://github.com/AztecProtocol/aztec-packages/commit/838ceed3b6ccf1bb7d89552a147db92c3514f0c1)) + + +### Documentation + +* **avm:** Comments in pil file related to range checks of addresses ([#6837](https://github.com/AztecProtocol/aztec-packages/issues/6837)) ([66f1c87](https://github.com/AztecProtocol/aztec-packages/commit/66f1c876578b05838698377f2ede12b52671e4ca)) + ## [0.42.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.41.0...barretenberg-v0.42.0) (2024-06-04) diff --git a/barretenberg/cpp/CMakeLists.txt b/barretenberg/cpp/CMakeLists.txt index f16b898bf6f..5c76eb77253 100644 --- a/barretenberg/cpp/CMakeLists.txt +++ b/barretenberg/cpp/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24 FATAL_ERROR) project( Barretenberg DESCRIPTION "BN254 elliptic curve library, and PLONK SNARK prover" - VERSION 0.42.0 # x-release-please-version + VERSION 0.43.0 # x-release-please-version LANGUAGES CXX C ) # Insert version into `bb` config file diff --git a/barretenberg/ts/CHANGELOG.md b/barretenberg/ts/CHANGELOG.md index b695c13fdc2..b546c5f69fe 100644 --- a/barretenberg/ts/CHANGELOG.md +++ b/barretenberg/ts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.42.0...barretenberg.js-v0.43.0) (2024-06-18) + + +### Miscellaneous + +* **barretenberg.js:** Synchronize aztec-packages versions + ## [0.42.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.41.0...barretenberg.js-v0.42.0) (2024-06-04) diff --git a/barretenberg/ts/package.json b/barretenberg/ts/package.json index adbb6c9c406..77f78d446a8 100644 --- a/barretenberg/ts/package.json +++ b/barretenberg/ts/package.json @@ -1,6 +1,6 @@ { "name": "@aztec/bb.js", - "version": "0.42.0", + "version": "0.43.0", "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg/ts", "license": "MIT", "type": "module", diff --git a/yarn-project/aztec/CHANGELOG.md b/yarn-project/aztec/CHANGELOG.md index 3c4d709503f..3e6001e44b1 100644 --- a/yarn-project/aztec/CHANGELOG.md +++ b/yarn-project/aztec/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [0.43.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-package-v0.42.0...aztec-package-v0.43.0) (2024-06-18) + + +### Features + +* Auth registry ([#7035](https://github.com/AztecProtocol/aztec-packages/issues/7035)) ([cea0b3b](https://github.com/AztecProtocol/aztec-packages/commit/cea0b3b29c2f7c37eb07c226a06534f92518cea6)) +* Nuking last hardcoded note type ids ([#7069](https://github.com/AztecProtocol/aztec-packages/issues/7069)) ([a23fd0b](https://github.com/AztecProtocol/aztec-packages/commit/a23fd0ba1604a5308fd77ed45a5b1d20da13f405)), closes [#5833](https://github.com/AztecProtocol/aztec-packages/issues/5833) + + +### Miscellaneous + +* Move gas bridge initialization into L1 contracts deployment ([#6912](https://github.com/AztecProtocol/aztec-packages/issues/6912)) ([26a1fc4](https://github.com/AztecProtocol/aztec-packages/commit/26a1fc4bcec04434b61651e2f527938a14f3ac3a)) +* Rename p2p vars ([#6916](https://github.com/AztecProtocol/aztec-packages/issues/6916)) ([ae7d757](https://github.com/AztecProtocol/aztec-packages/commit/ae7d75764fc704daae67be882e0e9f09a0a9407c)) +* Terraform Updates ([#6887](https://github.com/AztecProtocol/aztec-packages/issues/6887)) ([33a3870](https://github.com/AztecProtocol/aztec-packages/commit/33a3870d06ae8bb5d08dbbd9f72a62e0811e5e7d)) +* Transfer and transferfrom to save constrains for simpler cases ([#7013](https://github.com/AztecProtocol/aztec-packages/issues/7013)) ([612b972](https://github.com/AztecProtocol/aztec-packages/commit/612b9724a419224c72cd823c889ece4ae8f00ab0)) +* Updated devnet terraform ([#6927](https://github.com/AztecProtocol/aztec-packages/issues/6927)) ([4692fb0](https://github.com/AztecProtocol/aztec-packages/commit/4692fb034f22bb62593d257777b7b545993c27ab)) + ## [0.42.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-package-v0.41.0...aztec-package-v0.42.0) (2024-06-04) diff --git a/yarn-project/aztec/package.json b/yarn-project/aztec/package.json index 8b04c15e755..6caffb8c0ce 100644 --- a/yarn-project/aztec/package.json +++ b/yarn-project/aztec/package.json @@ -1,6 +1,6 @@ { "name": "@aztec/aztec", - "version": "0.42.0", + "version": "0.43.0", "type": "module", "exports": { ".": "./dest/index.js" From 8630c8f2018c711b84997dc4727d5123ad616107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bene=C5=A1?= Date: Tue, 18 Jun 2024 17:36:37 +0200 Subject: [PATCH 09/25] feat: flamegraph helper script (#7077) I found it quite tedious to actually get a flamegraph so I've created this utility script which builds the profiler (if not available) sets all the params for noir contracts, gets the function artifact and serves the file over http. --- .../noir-contracts/scripts/flamegraph.sh | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 noir-projects/noir-contracts/scripts/flamegraph.sh diff --git a/noir-projects/noir-contracts/scripts/flamegraph.sh b/noir-projects/noir-contracts/scripts/flamegraph.sh new file mode 100755 index 00000000000..6ee8d6cfb29 --- /dev/null +++ b/noir-projects/noir-contracts/scripts/flamegraph.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +set -eu + +# If first arg is -h or --help, print usage +if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then + echo "Usage: $0 " + echo "e.g.: $0 Token transfer" + echo "Generates a flamegraph for the given contract and function" + exit 0 +fi + +# Get the directory of the script +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +PROFILER="$SCRIPT_DIR/../../../noir/noir-repo/target/debug/noir-profiler" + +if [ ! -f $PROFILER ]; then + echo "Profiler not found, building profiler" + cd "$SCRIPT_DIR/../../../noir/noir-repo/tooling/profiler" + cargo build + cd "$SCRIPT_DIR" +fi + +# first console arg is contract name in camel case (e.g. TokenBridge) +CONTRACT=$1 + +# second console arg is the contract function +FUNCTION=$2 + +# convert contract name to following format: token_bridge_contract-TokenBridge.json +ARTIFACT=$(echo "$CONTRACT" | sed -r 's/^([A-Z])/\L\1/; s/([a-z0-9])([A-Z])/\1_\L\2/g') +ARTIFACT_NAME="${ARTIFACT}_contract-${CONTRACT}" + +# Extract artifact for the specific function +node "$SCRIPT_DIR/../extractFunctionAsNoirArtifact.js" "$SCRIPT_DIR/../target/${ARTIFACT_NAME}.json" $FUNCTION + +FUNCTION_ARTIFACT="${ARTIFACT_NAME}-${FUNCTION}.json" + +# We create dest directory and use it as an output for the generated main.svg file +mkdir -p "$SCRIPT_DIR/../dest" + +# At last, generate the flamegraph +$PROFILER gates-flamegraph --artifact-path "$SCRIPT_DIR/../target/$FUNCTION_ARTIFACT" --backend-path "$SCRIPT_DIR/../../../barretenberg/cpp/build/bin/bb" --output "$SCRIPT_DIR/../dest" + +# serve the file over http +echo "Serving flamegraph at http://0.0.0.0:8000/main.svg" +python3 -m http.server --directory "$SCRIPT_DIR/../dest" 8000 From f9c8f20f1bd6af0003960b19f61b737e3bad5f1e Mon Sep 17 00:00:00 2001 From: Ilyas Ridhuan Date: Tue, 18 Jun 2024 16:56:52 +0100 Subject: [PATCH 10/25] feat(avm): cpp msm changes (#7056) Please read [contributing guidelines](CONTRIBUTING.md) and remove this line. --- .../vm/avm_trace/avm_execution.cpp | 7 + .../barretenberg/vm/avm_trace/avm_opcode.cpp | 4 + .../barretenberg/vm/avm_trace/avm_trace.cpp | 251 ++++++++++++++++++ .../barretenberg/vm/avm_trace/avm_trace.hpp | 5 + .../vm/avm_trace/gadgets/avm_ecc.cpp | 17 ++ .../vm/avm_trace/gadgets/avm_ecc.hpp | 9 +- .../vm/tests/avm_execution.test.cpp | 76 ++++++ 7 files changed, 366 insertions(+), 3 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp index a3447e24c6e..f3d2dac5f2d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp @@ -677,6 +677,13 @@ std::vector Execution::gen_trace(std::vector const& instructio std::get(inst.operands.at(6)), std::get(inst.operands.at(7))); break; + case OpCode::MSM: + trace_builder.op_variable_msm(std::get(inst.operands.at(0)), + std::get(inst.operands.at(1)), + std::get(inst.operands.at(2)), + std::get(inst.operands.at(3)), + std::get(inst.operands.at(4))); + break; case OpCode::REVERT: trace_builder.op_revert(std::get(inst.operands.at(0)), std::get(inst.operands.at(1)), diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp index 8ffe817e23a..2439fd4e0a2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp @@ -144,6 +144,10 @@ std::string to_string(OpCode opcode) return "SHA256"; case OpCode::PEDERSEN: return "PEDERSEN"; + case OpCode::ECADD: + return "ECADD"; + case OpCode::MSM: + return "MSM"; case OpCode::TORADIXLE: return "TORADIXLE"; case OpCode::SHA256COMPRESSION: diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp index 5c1ac86c7c3..4ee754de507 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -14,7 +14,9 @@ #include #include "barretenberg/common/throw_or_abort.hpp" +#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include "barretenberg/numeric/uint256/uint256.hpp" +#include "barretenberg/polynomials/univariate.hpp" #include "barretenberg/vm/avm_trace/avm_common.hpp" #include "barretenberg/vm/avm_trace/avm_helper.hpp" #include "barretenberg/vm/avm_trace/avm_opcode.hpp" @@ -3632,6 +3634,255 @@ void AvmTraceBuilder::op_ec_add(uint8_t indirect, FF(internal_return_ptr), { result.is_point_at_infinity() }); } + +// This function is a bit overloaded with logic around reconstructing points and scalars that could probably be moved to +// the gadget at some stage (although this is another temporary gadget..) +void AvmTraceBuilder::op_variable_msm(uint8_t indirect, + uint32_t points_offset, + uint32_t scalars_offset, + uint32_t output_offset, + uint32_t point_length_offset) +{ + auto clk = static_cast(main_trace.size()) + 1; + // This will all get refactored as part of the indirection refactor + bool tag_match = true; + uint32_t direct_points_offset = points_offset; + uint32_t direct_scalars_offset = scalars_offset; + uint32_t direct_output_offset = output_offset; + // Resolve the indirects + bool indirect_points_flag = is_operand_indirect(indirect, 0); + bool indirect_scalars_flag = is_operand_indirect(indirect, 1); + bool indirect_output_flag = is_operand_indirect(indirect, 2); + + // Read in the points first + if (indirect_points_flag) { + auto read_ind_a = + mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_A, points_offset); + direct_points_offset = uint32_t(read_ind_a.val); + tag_match = tag_match && read_ind_a.tag_match; + } + + auto read_points = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IA, direct_points_offset, AvmMemoryTag::FF, AvmMemoryTag::U0); + + // Read in the scalars + if (indirect_scalars_flag) { + auto read_ind_b = mem_trace_builder.indirect_read_and_load_from_memory( + call_ptr, clk, IndirectRegister::IND_B, scalars_offset); + direct_scalars_offset = uint32_t(read_ind_b.val); + tag_match = tag_match && read_ind_b.tag_match; + } + auto read_scalars = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IB, direct_scalars_offset, AvmMemoryTag::FF, AvmMemoryTag::U0); + + // In the refactor we will have the read_slice function handle indirects as well + main_trace.push_back(Row{ + .avm_main_clk = clk, + .avm_main_ia = read_points.val, + .avm_main_ib = read_scalars.val, + .avm_main_ind_a = indirect_points_flag ? FF(points_offset) : FF(0), + .avm_main_ind_b = indirect_scalars_flag ? FF(scalars_offset) : FF(0), + .avm_main_ind_op_a = FF(static_cast(indirect_points_flag)), + .avm_main_ind_op_b = FF(static_cast(indirect_scalars_flag)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(direct_points_offset), + .avm_main_mem_idx_b = FF(direct_scalars_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_pc = FF(pc++), + .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .avm_main_tag_err = FF(static_cast(!tag_match)), + }); + clk++; + + // Read the points length (different row since it has a different memory tag) + auto points_length_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IA, point_length_offset, AvmMemoryTag::U32, AvmMemoryTag::U0); + main_trace.push_back(Row{ + .avm_main_clk = clk, + .avm_main_ia = points_length_read.val, + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(point_length_offset), + .avm_main_mem_op_a = FF(1), + .avm_main_pc = FF(pc), + .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .avm_main_tag_err = FF(static_cast(!points_length_read.tag_match)), + }); + clk++; + + // Points are stored as [x1, y1, inf1, x2, y2, inf2, ...] with the types [FF, FF, U8, FF, FF, U8, ...] + uint32_t num_points = uint32_t(points_length_read.val) / 3; // 3 elements per point + // We need to split up the reads due to the memory tags, + std::vector points_coords_vec; + std::vector points_inf_vec; + std::vector scalars_vec; + // Read the coordinates first, +2 since we read 2 points per row + for (uint32_t i = 0; i < num_points; i += 2) { + // We can read up to 4 coordinates per row (x1,y1,x2,y2) + // Each pair of coordinates are separated by 3 memory addressess + auto point_x1_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IA, direct_points_offset + i * 3, AvmMemoryTag::FF, AvmMemoryTag::U0); + auto point_y1_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IB, direct_points_offset + i * 3 + 1, AvmMemoryTag::FF, AvmMemoryTag::U0); + auto point_x2_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IC, direct_points_offset + (i + 1) * 3, AvmMemoryTag::FF, AvmMemoryTag::U0); + auto point_y2_read = mem_trace_builder.read_and_load_from_memory(call_ptr, + clk, + IntermRegister::ID, + direct_points_offset + (i + 1) * 3 + 1, + AvmMemoryTag::FF, + AvmMemoryTag::U0); + bool tag_match = + point_x1_read.tag_match && point_y1_read.tag_match && point_x2_read.tag_match && point_y2_read.tag_match; + points_coords_vec.insert(points_coords_vec.end(), + { point_x1_read.val, point_y1_read.val, point_x2_read.val, point_y2_read.val }); + main_trace.push_back(Row{ + .avm_main_clk = clk, + .avm_main_ia = point_x1_read.val, + .avm_main_ib = point_y1_read.val, + .avm_main_ic = point_x2_read.val, + .avm_main_id = point_y2_read.val, + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(direct_points_offset + i * 3), + .avm_main_mem_idx_b = FF(direct_points_offset + i * 3 + 1), + .avm_main_mem_idx_c = FF(direct_points_offset + (i + 1) * 3), + .avm_main_mem_idx_d = FF(direct_points_offset + (i + 1) * 3 + 1), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_mem_op_d = FF(1), + .avm_main_pc = FF(pc), + .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .avm_main_tag_err = FF(static_cast(!tag_match)), + }); + clk++; + } + // Read the Infinities flags, +4 since we read 4 points row + for (uint32_t i = 0; i < num_points; i += 4) { + // We can read up to 4 infinities per row + // Each infinity flag is separated by 3 memory addressess + uint32_t offset = direct_points_offset + i * 3 + 2; + auto point_inf1_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IA, offset, AvmMemoryTag::U8, AvmMemoryTag::U0); + offset += 3; + + auto point_inf2_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IB, offset, AvmMemoryTag::U8, AvmMemoryTag::U0); + offset += 3; + + auto point_inf3_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::IC, offset, AvmMemoryTag::U8, AvmMemoryTag::U0); + offset += 3; + + auto point_inf4_read = mem_trace_builder.read_and_load_from_memory( + call_ptr, clk, IntermRegister::ID, offset, AvmMemoryTag::U8, AvmMemoryTag::U0); + + points_inf_vec.insert(points_inf_vec.end(), + { point_inf1_read.val, point_inf2_read.val, point_inf3_read.val, point_inf4_read.val }); + bool tag_match = point_inf1_read.tag_match && point_inf2_read.tag_match && point_inf3_read.tag_match && + point_inf4_read.tag_match; + main_trace.push_back(Row{ + .avm_main_clk = clk, + .avm_main_ia = point_inf1_read.val, + .avm_main_ib = point_inf2_read.val, + .avm_main_ic = point_inf3_read.val, + .avm_main_id = point_inf4_read.val, + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(direct_points_offset + i * 3 + 2), + .avm_main_mem_idx_b = FF(direct_points_offset + (i + 1) * 3 + 2), + .avm_main_mem_idx_c = FF(direct_points_offset + (i + 2) * 3 + 2), + .avm_main_mem_idx_d = FF(direct_points_offset + (i + 3) * 3 + 2), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_mem_op_c = FF(1), + .avm_main_mem_op_d = FF(1), + .avm_main_pc = FF(pc), + .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .avm_main_tag_err = FF(static_cast(!tag_match)), + }); + clk++; + } + // Scalar read length is num_points* 2 since scalars are stored as lo and hi limbs + uint32_t scalar_read_length = num_points * 2; + auto num_scalar_rows = read_slice_to_memory(call_ptr, + clk, + direct_scalars_offset, + AvmMemoryTag::FF, + AvmMemoryTag::U0, + FF(internal_return_ptr), + scalar_read_length, + scalars_vec); + clk += num_scalar_rows; + // Reconstruct Grumpkin points + std::vector points; + for (size_t i = 0; i < num_points; i++) { + grumpkin::g1::Fq x = points_coords_vec[i * 2]; + grumpkin::g1::Fq y = points_coords_vec[i * 2 + 1]; + bool is_inf = points_inf_vec[i] == 1; + if (is_inf) { + points.emplace_back(grumpkin::g1::affine_element::infinity()); + } else { + points.emplace_back(x, y); + } + } + // Reconstruct Grumpkin scalars + // Scalars are stored as [lo1, hi1, lo2, hi2, ...] with the types [FF, FF, FF, FF, ...] + std::vector scalars; + for (size_t i = 0; i < num_points; i++) { + FF lo = scalars_vec[i * 2]; + FF hi = scalars_vec[i * 2 + 1]; + // hi is shifted 128 bits + uint256_t scalar = (uint256_t(hi) << 128) + uint256_t(lo); + scalars.emplace_back(scalar); + } + // Perform the variable MSM - could just put the logic in here since there are no constraints. + auto result = ecc_trace_builder.variable_msm(points, scalars, clk); + // Write the result back to memory [x, y, inf] with tags [FF, FF, U8] + if (indirect_output_flag) { + auto read_ind_a = + mem_trace_builder.indirect_read_and_load_from_memory(call_ptr, clk, IndirectRegister::IND_A, output_offset); + direct_output_offset = uint32_t(read_ind_a.val); + } + mem_trace_builder.write_into_memory( + call_ptr, clk, IntermRegister::IA, direct_output_offset, result.x, AvmMemoryTag::U0, AvmMemoryTag::FF); + mem_trace_builder.write_into_memory( + call_ptr, clk, IntermRegister::IB, direct_output_offset + 1, result.y, AvmMemoryTag::U0, AvmMemoryTag::FF); + main_trace.push_back(Row{ + .avm_main_clk = clk, + .avm_main_ia = result.x, + .avm_main_ib = result.y, + .avm_main_ind_a = indirect_output_flag ? FF(output_offset) : FF(0), + .avm_main_ind_op_a = FF(static_cast(indirect_output_flag)), + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(direct_output_offset), + .avm_main_mem_idx_b = FF(direct_output_offset + 1), + .avm_main_mem_op_a = FF(1), + .avm_main_mem_op_b = FF(1), + .avm_main_pc = FF(pc), + .avm_main_rwa = FF(1), + .avm_main_rwb = FF(1), + .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + }); + clk++; + // Write the infinity + mem_trace_builder.write_into_memory(call_ptr, + clk, + IntermRegister::IA, + direct_output_offset + 2, + result.is_point_at_infinity(), + AvmMemoryTag::U0, + AvmMemoryTag::U8); + main_trace.push_back(Row{ + .avm_main_clk = clk, + .avm_main_ia = static_cast(result.is_point_at_infinity()), + .avm_main_internal_return_ptr = FF(internal_return_ptr), + .avm_main_mem_idx_a = FF(direct_output_offset + 2), + .avm_main_mem_op_a = FF(1), + .avm_main_pc = FF(pc), + .avm_main_rwa = FF(1), + .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + }); +} // Finalise Lookup Counts // // For log derivative lookups, we require a column that contains the number of times each lookup is consumed diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp index aa2ff3c9900..9c9b157b48f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp @@ -204,6 +204,11 @@ class AvmTraceBuilder { uint32_t rhs_y_offset, uint32_t rhs_is_inf_offset, uint32_t output_offset); + void op_variable_msm(uint8_t indirect, + uint32_t points_offset, + uint32_t scalars_offset, + uint32_t output_offset, + uint32_t point_length_offset); private: // Used for the standard indirect address resolution of three operands opcode. diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.cpp index fd3fc8955d1..494da13d192 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.cpp @@ -30,4 +30,21 @@ element AvmEccTraceBuilder::embedded_curve_add(element lhs, element rhs, uint32_ return result; } +element AvmEccTraceBuilder::variable_msm(const std::vector& points, + const std::vector& scalars, + uint32_t clk) +{ + // Replace this with pippenger if/when we have the time + auto result = grumpkin::g1::affine_point_at_infinity; + for (size_t i = 0; i < points.size(); ++i) { + result = result + points[i] * scalars[i]; + } + + std::tuple result_tuple = { result.x, result.y, result.is_point_at_infinity() }; + + ecc_trace.push_back({ .clk = clk, .result = result_tuple }); + + return result; +} + } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.hpp index 6450a33db39..71f070c85a3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/gadgets/avm_ecc.hpp @@ -9,9 +9,9 @@ class AvmEccTraceBuilder { public: struct EccTraceEntry { uint32_t clk = 0; - std::tuple p1; // x, y, is_infinity - std::tuple p2; - std::tuple result; + std::tuple p1 = { FF(0), FF(0), true }; // x, y, is_infinity + std::tuple p2 = { FF(0), FF(0), true }; + std::tuple result = { FF(0), FF(0), true }; }; AvmEccTraceBuilder(); @@ -21,6 +21,9 @@ class AvmEccTraceBuilder { grumpkin::g1::affine_element embedded_curve_add(grumpkin::g1::affine_element lhs, grumpkin::g1::affine_element rhs, uint32_t clk); + grumpkin::g1::affine_element variable_msm(const std::vector& points, + const std::vector& scalars, + uint32_t clk); private: std::vector ecc_trace; diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp index bfa5339d362..9f3d453452b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp @@ -1400,6 +1400,82 @@ TEST_F(AvmExecutionTests, embeddedCurveAddOpCode) validate_trace(std::move(trace), public_inputs); } +// Positive test with MSM +TEST_F(AvmExecutionTests, msmOpCode) +{ + grumpkin::g1::affine_element a = grumpkin::g1::affine_element::random_element(); + FF a_is_inf = a.is_point_at_infinity(); + grumpkin::g1::affine_element b = grumpkin::g1::affine_element::random_element(); + FF b_is_inf = b.is_point_at_infinity(); + + grumpkin::g1::Fr scalar_a = grumpkin::g1::Fr::random_element(); + FF scalar_a_lo = uint256_t::from_uint128(uint128_t(scalar_a)); + FF scalar_a_hi = uint256_t(scalar_a) >> 128; + grumpkin::g1::Fr scalar_b = grumpkin::g1::Fr::random_element(); + FF scalar_b_lo = uint256_t::from_uint128(uint128_t(scalar_b)); + FF scalar_b_hi = uint256_t(scalar_b) >> 128; + auto expected_result = a * scalar_a + b * scalar_b; + std::vector expected_output = { expected_result.x, expected_result.y, expected_result.is_point_at_infinity() }; + // Send all the input as Fields and cast them to U8 later + std::vector calldata = { FF(a.x), FF(a.y), a_is_inf, FF(b.x), FF(b.y), + b_is_inf, scalar_a_lo, scalar_a_hi, scalar_b_lo, scalar_b_hi }; + std::string bytecode_hex = to_hex(OpCode::CALLDATACOPY) + // Calldatacopy...should fix the limit on calldatacopy + "00" // Indirect flag + "00000000" // cd_offset 0 + "0000000a" // copy_size (10 elements) + "00000000" // dst_offset 0 + + to_hex(OpCode::CAST) + // opcode CAST inf to U8 + "00" // Indirect flag + "01" // U8 tag field + "00000002" // a_is_inf + "00000002" // + + to_hex(OpCode::CAST) + // opcode CAST inf to U8 + "00" // Indirect flag + "01" // U8 tag field + "00000005" // b_is_inf + "00000005" // + + to_hex(OpCode::SET) + // opcode SET for length + "00" // Indirect flag + "03" // U32 + "00000006" // Length of point elements (6) + "0000000b" // dst offset (11) + + to_hex(OpCode::SET) + // SET Indirects + "00" // Indirect flag + "03" // U32 + "00000000" // points offset + "0000000d" // dst offset + + + to_hex(OpCode::SET) + // SET Indirects + "00" // Indirect flag + "03" // U32 + "00000006" // scalars offset + "0000000e" + // dst offset + to_hex(OpCode::SET) + // SET Indirects + "00" // Indirect flag + "03" // U32 + "0000000c" // output offset + "0000000f" + // dst offset + to_hex(OpCode::MSM) + // opcode MSM + "07" // Indirect flag (first 3 indirect) + "0000000d" // points offset + "0000000e" // scalars offset + "0000000f" // output offset + "0000000b" // length offset + + to_hex(OpCode::RETURN) + // opcode RETURN + "00" // Indirect flag + "0000000c" // ret offset 12 (this overwrites) + "00000003"; // ret size 3 + + auto bytecode = hex_to_bytes(bytecode_hex); + auto instructions = Deserialization::parse(bytecode); + + // Assign a vector that we will mutate internally in gen_trace to store the return values; + std::vector returndata; + auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + + EXPECT_EQ(returndata, expected_output); + + validate_trace(std::move(trace)); +} // Positive test for Kernel Input opcodes TEST_F(AvmExecutionTests, kernelInputOpcodes) { From 59df72249a8db2b6d1cf0c7908836041c84a54c1 Mon Sep 17 00:00:00 2001 From: Facundo Date: Tue, 18 Jun 2024 17:51:14 +0100 Subject: [PATCH 11/25] chore: track avm proving time (#7084) Almost all that was missing was having an `appCircuitName` when avm-proving. --- .../bb-prover/src/avm_proving.test.ts | 2 + .../src/prover/bb_native_proof_creator.ts | 14 +++---- .../bb-prover/src/prover/bb_prover.ts | 40 ++++++++----------- .../circuit-types/src/tx/processed_tx.ts | 1 + .../circuits.js/src/structs/avm/avm.ts | 17 ++++++-- .../circuits.js/src/tests/factories.ts | 1 + .../src/orchestrator/orchestrator.ts | 1 + .../scripts/src/benchmarks/aggregate.ts | 15 ++++++- .../src/avm/opcodes/external_calls.ts | 6 +++ yarn-project/simulator/src/mocks/fixtures.ts | 1 + .../src/public/abstract_phase_manager.ts | 27 ++++++++----- .../simulator/src/public/execution.ts | 2 + yarn-project/simulator/src/public/executor.ts | 5 ++- .../src/public/transitional_adaptors.ts | 2 + 14 files changed, 87 insertions(+), 47 deletions(-) diff --git a/yarn-project/bb-prover/src/avm_proving.test.ts b/yarn-project/bb-prover/src/avm_proving.test.ts index ba17be603ab..eea9d122527 100644 --- a/yarn-project/bb-prover/src/avm_proving.test.ts +++ b/yarn-project/bb-prover/src/avm_proving.test.ts @@ -248,12 +248,14 @@ const proveAndVerifyAvmTestContract = async ( startGas, context, simulator.getBytecode(), + functionName, ); // TODO(dbanks12): public inputs should not be empty.... Need to construct them from AvmContext? const uncompressedBytecode = simulator.getBytecode()!; const publicInputs = getPublicInputs(pxResult); const avmCircuitInputs = new AvmCircuitInputs( + functionName, uncompressedBytecode, context.environment.calldata, publicInputs, diff --git a/yarn-project/bb-prover/src/prover/bb_native_proof_creator.ts b/yarn-project/bb-prover/src/prover/bb_native_proof_creator.ts index e59a8b87d22..3cc08097278 100644 --- a/yarn-project/bb-prover/src/prover/bb_native_proof_creator.ts +++ b/yarn-project/bb-prover/src/prover/bb_native_proof_creator.ts @@ -42,6 +42,7 @@ import { type NoirCompiledCircuit } from '@aztec/types/noir'; import { serializeWitness } from '@noir-lang/noirc_abi'; import { type WitnessMap } from '@noir-lang/types'; import * as fs from 'fs/promises'; +import { join } from 'path'; import { BB_RESULT, @@ -175,7 +176,7 @@ export class BBNativeProofCreator implements ProofCreator { throw new Error(errorMessage); } - this.log.info(`Successfully verified ${circuitType} proof in ${result.duration} ms`); + this.log.info(`Successfully verified ${circuitType} proof in ${Math.ceil(result.duration)} ms`); } private async verifyProofFromKey( @@ -304,13 +305,14 @@ export class BBNativeProofCreator implements ProofCreator { }> { const compressedBincodedWitness = serializeWitness(partialWitness); - const inputsWitnessFile = `${directory}/witness.gz`; + const inputsWitnessFile = join(directory, 'witness.gz'); await fs.writeFile(inputsWitnessFile, compressedBincodedWitness); this.log.debug(`Written ${inputsWitnessFile}`); - this.log.info(`Proving ${circuitType} circuit...`); + const dbgCircuitName = appCircuitName ? `(${appCircuitName})` : ''; + this.log.info(`Proving ${circuitType}${dbgCircuitName} circuit...`); const timer = new Timer(); @@ -324,13 +326,11 @@ export class BBNativeProofCreator implements ProofCreator { ); if (provingResult.status === BB_RESULT.FAILURE) { - this.log.error(`Failed to generate proof for ${circuitType}: ${provingResult.reason}`); + this.log.error(`Failed to generate proof for ${circuitType}${dbgCircuitName}: ${provingResult.reason}`); throw new Error(provingResult.reason); } - this.log.info( - `Generated ${circuitType === 'App' ? appCircuitName : circuitType} circuit proof in ${timer.ms()} ms`, - ); + this.log.info(`Generated ${circuitType}${dbgCircuitName} circuit proof in ${Math.ceil(timer.ms())} ms`); if (circuitType === 'App') { const vkData = await extractVkData(directory); diff --git a/yarn-project/bb-prover/src/prover/bb_prover.ts b/yarn-project/bb-prover/src/prover/bb_prover.ts index ad39a749448..33210ed6444 100644 --- a/yarn-project/bb-prover/src/prover/bb_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_prover.ts @@ -439,22 +439,17 @@ export class BBNativeRollupProver implements ServerCircuitProver { const rawProof = await fs.readFile(`${provingResult.proofPath!}/${PROOF_FILENAME}`); const proof = new Proof(rawProof, vkData.numPublicInputs); - logger.info( - `Generated proof for ${circuitType} in ${Math.ceil(provingResult.duration)} ms, size: ${ - proof.buffer.length - } bytes`, - { - circuitName: mapProtocolArtifactNameToCircuitName(circuitType), - // does not include reading the proof from disk - duration: provingResult.duration, - proofSize: proof.buffer.length, - eventName: 'circuit-proving', - // circuitOutput is the partial witness that became the input to the proof - inputSize: output.toBuffer().length, - circuitSize: vkData.circuitSize, - numPublicInputs: vkData.numPublicInputs, - } satisfies CircuitProvingStats, - ); + logger.info(`Generated proof for ${circuitType} in ${Math.ceil(provingResult.duration)} ms`, { + circuitName: mapProtocolArtifactNameToCircuitName(circuitType), + // does not include reading the proof from disk + duration: provingResult.duration, + proofSize: proof.buffer.length, + eventName: 'circuit-proving', + // circuitOutput is the partial witness that became the input to the proof + inputSize: output.toBuffer().length, + circuitSize: vkData.circuitSize, + numPublicInputs: vkData.numPublicInputs, + } satisfies CircuitProvingStats); return { circuitOutput: output, proof }; }; @@ -462,12 +457,12 @@ export class BBNativeRollupProver implements ServerCircuitProver { } private async generateAvmProofWithBB(input: AvmCircuitInputs, workingDirectory: string): Promise { - logger.debug(`Proving avm-circuit...`); + logger.info(`Proving avm-circuit for ${input.functionName}...`); const provingResult = await generateAvmProof(this.config.bbBinaryPath, workingDirectory, input, logger.verbose); if (provingResult.status === BB_RESULT.FAILURE) { - logger.error(`Failed to generate proof for avm-circuit: ${provingResult.reason}`); + logger.error(`Failed to generate AVM proof for ${input.functionName}: ${provingResult.reason}`); throw new Error(provingResult.reason); } @@ -490,18 +485,17 @@ export class BBNativeRollupProver implements ServerCircuitProver { const circuitType = 'avm-circuit' as const; logger.info( - `Generated proof for ${circuitType} in ${Math.ceil(provingResult.duration)} ms, size: ${ - proof.buffer.length - } bytes`, + `Generated proof for ${circuitType}(${input.functionName}) in ${Math.ceil(provingResult.duration)} ms`, { circuitName: circuitType, + appCircuitName: input.functionName, // does not include reading the proof from disk duration: provingResult.duration, proofSize: proof.buffer.length, eventName: 'circuit-proving', inputSize: input.toBuffer().length, - circuitSize: verificationKey.circuitSize, - numPublicInputs: verificationKey.numPublicInputs, + circuitSize: verificationKey.circuitSize, // FIX: wrong in VK + numPublicInputs: verificationKey.numPublicInputs, // FIX: wrong in VK } satisfies CircuitProvingStats, ); diff --git a/yarn-project/circuit-types/src/tx/processed_tx.ts b/yarn-project/circuit-types/src/tx/processed_tx.ts index 130cc4a6a6d..cf6bb977423 100644 --- a/yarn-project/circuit-types/src/tx/processed_tx.ts +++ b/yarn-project/circuit-types/src/tx/processed_tx.ts @@ -54,6 +54,7 @@ export const AVM_REQUEST = 'AVM' as const; export type AvmProvingRequest = { type: typeof AVM_REQUEST; + functionName: string; // informational only bytecode: Buffer; calldata: Fr[]; avmHints: AvmExecutionHints; diff --git a/yarn-project/circuits.js/src/structs/avm/avm.ts b/yarn-project/circuits.js/src/structs/avm/avm.ts index 19a55c38667..f33335f800c 100644 --- a/yarn-project/circuits.js/src/structs/avm/avm.ts +++ b/yarn-project/circuits.js/src/structs/avm/avm.ts @@ -367,6 +367,7 @@ export class AvmExecutionHints { export class AvmCircuitInputs { constructor( + public readonly functionName: string, // only informational public readonly bytecode: Buffer, public readonly calldata: Fr[], public readonly publicInputs: PublicCircuitPublicInputs, @@ -378,7 +379,10 @@ export class AvmCircuitInputs { * @returns - The inputs serialized to a buffer. */ toBuffer() { + const functionNameBuffer = Buffer.from(this.functionName); return serializeToBuffer( + functionNameBuffer.length, + functionNameBuffer, this.bytecode.length, this.bytecode, this.calldata.length, @@ -402,7 +406,11 @@ export class AvmCircuitInputs { */ isEmpty(): boolean { return ( - this.bytecode.length == 0 && this.calldata.length == 0 && this.publicInputs.isEmpty() && this.avmHints.isEmpty() + this.functionName.length == 0 && + this.bytecode.length == 0 && + this.calldata.length == 0 && + this.publicInputs.isEmpty() && + this.avmHints.isEmpty() ); } @@ -421,7 +429,7 @@ export class AvmCircuitInputs { * @returns An array of fields. */ static getFields(fields: FieldsOf) { - return [fields.bytecode, fields.calldata, fields.publicInputs, fields.avmHints] as const; + return [fields.functionName, fields.bytecode, fields.calldata, fields.publicInputs, fields.avmHints] as const; } /** @@ -432,8 +440,9 @@ export class AvmCircuitInputs { static fromBuffer(buff: Buffer | BufferReader): AvmCircuitInputs { const reader = BufferReader.asReader(buff); return new AvmCircuitInputs( - reader.readBuffer(), - reader.readVector(Fr), + /*functionName=*/ reader.readBuffer().toString(), + /*bytecode=*/ reader.readBuffer(), + /*calldata=*/ reader.readVector(Fr), PublicCircuitPublicInputs.fromBuffer(reader), AvmExecutionHints.fromBuffer(reader), ); diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index feb968a0dd1..c6fc3c783ec 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -1336,6 +1336,7 @@ export function makeAvmExecutionHints( */ export function makeAvmCircuitInputs(seed = 0, overrides: Partial> = {}): AvmCircuitInputs { return AvmCircuitInputs.from({ + functionName: `function${seed}`, bytecode: makeBytes((seed % 100) + 100, seed), calldata: makeArray((seed % 100) + 10, i => new Fr(i), seed + 0x1000), publicInputs: makePublicCircuitPublicInputs(seed + 0x2000), diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator.ts b/yarn-project/prover-client/src/orchestrator/orchestrator.ts index a270cbb0628..99526b8dfd1 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator.ts @@ -772,6 +772,7 @@ export class ProvingOrchestrator { // Nothing downstream depends on the AVM proof yet. So having this mode lets us incrementally build the AVM circuit. const doAvmProving = async (signal: AbortSignal) => { const inputs: AvmCircuitInputs = new AvmCircuitInputs( + publicFunction.vmRequest!.functionName, publicFunction.vmRequest!.bytecode, publicFunction.vmRequest!.calldata, publicFunction.vmRequest!.kernelRequest.inputs.publicCall.callStackItem.publicInputs, diff --git a/yarn-project/scripts/src/benchmarks/aggregate.ts b/yarn-project/scripts/src/benchmarks/aggregate.ts index 8e7c8d8cba6..5e6f6ab5d89 100644 --- a/yarn-project/scripts/src/benchmarks/aggregate.ts +++ b/yarn-project/scripts/src/benchmarks/aggregate.ts @@ -134,14 +134,25 @@ function processCircuitSimulation(entry: CircuitSimulationStats, results: Benchm */ function processCircuitProving(entry: CircuitProvingStats, results: BenchmarkCollectedResults) { if (entry.circuitName === 'app-circuit') { - const bucket = entry.appCircuitName; - if (!bucket) { + if (!entry.appCircuitName) { return; } + const bucket = entry.appCircuitName; append(results, 'app_circuit_proving_time_in_ms', bucket, entry.duration); append(results, 'app_circuit_proof_size_in_bytes', bucket, entry.proofSize); append(results, 'app_circuit_size_in_gates', bucket, entry.circuitSize); append(results, 'app_circuit_num_public_inputs', bucket, entry.numPublicInputs); + } else if (entry.circuitName === 'avm-circuit') { + if (!entry.appCircuitName) { + return; + } + const bucket = `${entry.appCircuitName} (avm)`; + append(results, 'app_circuit_proving_time_in_ms', bucket, entry.duration); + append(results, 'app_circuit_proof_size_in_bytes', bucket, entry.proofSize); + append(results, 'app_circuit_input_size_in_bytes', bucket, entry.inputSize); + // These are not yet correctly passed in bb_prover.ts. + // append(results, 'app_circuit_size_in_gates', bucket, entry.circuitSize); + // append(results, 'app_circuit_num_public_inputs', bucket, entry.numPublicInputs); } else { const bucket = entry.circuitName; append(results, 'protocol_circuit_proving_time_in_ms', bucket, entry.duration); diff --git a/yarn-project/simulator/src/avm/opcodes/external_calls.ts b/yarn-project/simulator/src/avm/opcodes/external_calls.ts index 9ccc88d362e..20f72557b3c 100644 --- a/yarn-project/simulator/src/avm/opcodes/external_calls.ts +++ b/yarn-project/simulator/src/avm/opcodes/external_calls.ts @@ -94,6 +94,11 @@ abstract class ExternalCall extends Instruction { const oldStyleExecution = createPublicExecution(startSideEffectCounter, nestedContext.environment, calldata); const simulator = new AvmSimulator(nestedContext); const nestedCallResults: AvmContractCallResults = await simulator.execute(); + const functionName = + (await nestedContext.persistableState.hostStorage.contractsDb.getDebugFunctionName( + nestedContext.environment.address, + nestedContext.environment.temporaryFunctionSelector, + )) ?? `${nestedContext.environment.address}:${nestedContext.environment.temporaryFunctionSelector}`; const pxResults = convertAvmResultsToPxResult( nestedCallResults, startSideEffectCounter, @@ -101,6 +106,7 @@ abstract class ExternalCall extends Instruction { Gas.from(allocatedGas), nestedContext, simulator.getBytecode(), + functionName, ); // store the old PublicExecutionResult object to maintain a recursive data structure for the old kernel context.persistableState.transitionalExecutionResult.nestedExecutions.push(pxResults); diff --git a/yarn-project/simulator/src/mocks/fixtures.ts b/yarn-project/simulator/src/mocks/fixtures.ts index 088cdec820a..9c51ebbc184 100644 --- a/yarn-project/simulator/src/mocks/fixtures.ts +++ b/yarn-project/simulator/src/mocks/fixtures.ts @@ -144,6 +144,7 @@ export class PublicExecutionResultBuilder { transactionFee: Fr.ZERO, calldata: [], avmHints: AvmExecutionHints.empty(), + functionName: 'unknown', ...overrides, }; } diff --git a/yarn-project/simulator/src/public/abstract_phase_manager.ts b/yarn-project/simulator/src/public/abstract_phase_manager.ts index 3dd7016612d..1b2833e5875 100644 --- a/yarn-project/simulator/src/public/abstract_phase_manager.ts +++ b/yarn-project/simulator/src/public/abstract_phase_manager.ts @@ -77,6 +77,7 @@ export const PhaseIsRevertible: Record = { }; export type PublicProvingInformation = { + functionName: string; // informational only calldata: Fr[]; bytecode: Buffer; inputs: PublicKernelCircuitPrivateInputs; @@ -89,6 +90,7 @@ export function makeAvmProvingRequest( ): AvmProvingRequest { return { type: AVM_REQUEST, + functionName: info.functionName, bytecode: info.bytecode, calldata: info.calldata, avmHints: info.avmHints, @@ -282,15 +284,17 @@ export abstract class AbstractPhaseManager { const functionSelector = result.execution.functionSelector.toString(); if (result.reverted && !result.revertReason) { throw new Error( - `Simulation of ${result.execution.contractAddress.toString()}:${functionSelector} reverted with no reason.`, + `Simulation of ${result.execution.contractAddress.toString()}:${functionSelector}(${ + result.functionName + }) reverted with no reason.`, ); } if (result.reverted && !PhaseIsRevertible[this.phase]) { this.log.debug( - `Simulation error on ${result.execution.contractAddress.toString()}:${functionSelector} with reason: ${ - result.revertReason - }`, + `Simulation error on ${result.execution.contractAddress.toString()}:${functionSelector}(${ + result.functionName + }) with reason: ${result.revertReason}`, ); throw result.revertReason; } @@ -302,7 +306,9 @@ export abstract class AbstractPhaseManager { // Simulate the public kernel circuit. this.log.debug( - `Running public kernel circuit for ${result.execution.contractAddress.toString()}:${functionSelector}`, + `Running public kernel circuit for ${result.execution.contractAddress.toString()}:${functionSelector}(${ + result.functionName + })`, ); const callData = await this.getPublicCallData(result, isExecutionRequest); const [privateInputs, publicInputs] = await this.runKernelCircuit(kernelPublicOutput, callData); @@ -310,6 +316,7 @@ export abstract class AbstractPhaseManager { // Capture the inputs for later proving in the AVM and kernel. const publicProvingInformation: PublicProvingInformation = { + functionName: result.functionName, calldata: result.calldata, bytecode: result.bytecode!, inputs: privateInputs, @@ -322,7 +329,9 @@ export abstract class AbstractPhaseManager { // but the kernel carries the reverted flag forward. But if the simulator reverts, so should the kernel. if (result.reverted && kernelPublicOutput.revertCode.isOK()) { throw new Error( - `Public kernel circuit did not revert on ${result.execution.contractAddress.toString()}:${functionSelector}, but simulator did.`, + `Public kernel circuit did not revert on ${result.execution.contractAddress.toString()}:${functionSelector}(${ + result.functionName + }), but simulator did.`, ); } @@ -330,9 +339,9 @@ export abstract class AbstractPhaseManager { // So safely return the revert reason and the kernel output (which has had its revertible side effects dropped) if (result.reverted) { this.log.debug( - `Reverting on ${result.execution.contractAddress.toString()}:${functionSelector} with reason: ${ - result.revertReason - }`, + `Reverting on ${result.execution.contractAddress.toString()}:${functionSelector}(${ + result.functionName + }) with reason: ${result.revertReason}`, ); // TODO(@spalladino): Check gasUsed is correct. The AVM should take care of setting gasLeft to zero upon a revert. return { diff --git a/yarn-project/simulator/src/public/execution.ts b/yarn-project/simulator/src/public/execution.ts index bb83e9605b7..2d28731f621 100644 --- a/yarn-project/simulator/src/public/execution.ts +++ b/yarn-project/simulator/src/public/execution.ts @@ -77,6 +77,8 @@ export interface PublicExecutionResult { calldata: Fr[]; /** Hints for proving AVM execution. */ avmHints: AvmExecutionHints; + /** The name of the function that was executed. Only used for logging. */ + functionName: string; } /** diff --git a/yarn-project/simulator/src/public/executor.ts b/yarn-project/simulator/src/public/executor.ts index fde6b655eeb..45885d23de6 100644 --- a/yarn-project/simulator/src/public/executor.ts +++ b/yarn-project/simulator/src/public/executor.ts @@ -43,7 +43,7 @@ export class PublicExecutor { const address = execution.contractAddress; const selector = execution.functionSelector; const startGas = availableGas; - const fnName = await this.contractsDb.getDebugFunctionName(address, selector); + const fnName = (await this.contractsDb.getDebugFunctionName(address, selector)) ?? `${address}:${selector}`; PublicExecutor.log.verbose(`[AVM] Executing public external function ${fnName}.`); const timer = new Timer(); @@ -83,7 +83,7 @@ export class PublicExecutor { }.`, { eventName: 'avm-simulation', - appCircuitName: fnName ?? 'unknown', + appCircuitName: fnName, duration: timer.ms(), bytecodeSize: bytecode!.length, } satisfies AvmSimulationStats, @@ -96,6 +96,7 @@ export class PublicExecutor { startGas, avmContext, bytecode, + fnName, ); // TODO(https://github.com/AztecProtocol/aztec-packages/issues/5818): is this really needed? diff --git a/yarn-project/simulator/src/public/transitional_adaptors.ts b/yarn-project/simulator/src/public/transitional_adaptors.ts index 21d26e0810c..36d0f2ade12 100644 --- a/yarn-project/simulator/src/public/transitional_adaptors.ts +++ b/yarn-project/simulator/src/public/transitional_adaptors.ts @@ -114,12 +114,14 @@ export function convertAvmResultsToPxResult( startGas: Gas, endAvmContext: AvmContext, bytecode: Buffer | undefined, + functionName: string, ): PublicExecutionResult { const endPersistableState = endAvmContext.persistableState; const endMachineState = endAvmContext.machineState; return { ...endPersistableState.transitionalExecutionResult, // includes nestedExecutions + functionName: functionName, execution: fromPx, returnValues: avmResult.output, startSideEffectCounter: new Fr(startSideEffectCounter), From 109624f127dc8da6d9d963b3af9250237be0d4e4 Mon Sep 17 00:00:00 2001 From: Gregorio Juliana Date: Tue, 18 Jun 2024 18:57:38 +0200 Subject: [PATCH 12/25] feat!: TXE (#6985) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds the TXE (Testing eXecution Environment, or Tricky PXE) as a minimalistic oracle resolver that mimics the behavior of the Aztec protocol in order to write smart contract tests, much like Foundry for Solidity contracts. Together with a `TestEnvironment` added to `aztec-nr`, its aim is to make possible writing Aztec tests in pure noir resulting in much faster tests times than running e2e tests. TXE does NOT test the protocol itself and might let you do very illegal stuff ATM, but its intent is to provide a faster way to test contract logic and contract logic only. A 38 second Token Transfer test: ![Screenshot 2024-06-14 at 13 38 08](https://github.com/AztecProtocol/aztec-packages/assets/5404052/93c38be5-b2fd-4507-9894-e3c93e9bb913) WARNING: TXE is under heavy development and we are learning how and what we want to test as we go. It's also in need of a heavy refactor, but we need this base code in order to get it in the hands of more people and understand its scope and required capabilities. --------- Co-authored-by: Nicolás Venturo --- .github/workflows/ci.yml | 2 +- .vscode/settings.json | 1 - noir-projects/Dockerfile | 25 +- noir-projects/Earthfile | 23 +- .../aztec/src/context/call_interfaces.nr | 276 +++++++- .../aztec/src/note/note_getter/test.nr | 46 +- .../src/state_vars/private_mutable/test.nr | 17 +- .../src/state_vars/public_immutable/test.nr | 53 ++ .../src/state_vars/shared_mutable/test.nr | 614 +++++++++--------- .../aztec-nr/aztec/src/state_vars/storage.nr | 5 +- .../aztec-nr/aztec/src/test/helpers.nr | 5 +- .../aztec/src/test/helpers/cheatcodes.nr | 127 ++++ .../aztec/src/test/helpers/context_builder.nr | 52 -- .../aztec-nr/aztec/src/test/helpers/keys.nr | 18 + .../src/test/helpers/test_environment.nr | 207 ++++++ .../aztec-nr/aztec/src/test/helpers/types.nr | 110 ++++ .../aztec-nr/aztec/src/test/mocks.nr | 1 + .../aztec/src/test/mocks/mock_struct.nr | 36 + .../contracts/child_contract/src/main.nr | 2 +- .../contracts/counter_contract/src/main.nr | 25 + .../contracts/parent_contract/Nargo.toml | 2 + .../contracts/parent_contract/src/main.nr | 45 ++ .../contracts/test_contract/src/main.nr | 6 +- .../contracts/token_contract/src/main.nr | 70 ++ .../contracts/uniswap_contract/src/main.nr | 4 +- .../crates/types/src/traits.nr | 8 +- noir/noir-repo/aztec_macros/src/lib.rs | 21 +- .../src/transforms/contract_interface.rs | 214 +++--- .../aztec_macros/src/transforms/storage.rs | 20 +- .../src/monomorphization/mod.rs | 4 +- .../docs/docs/how_to/how-to-oracles.md | 8 +- yarn-project/Earthfile | 13 + yarn-project/archiver/src/archiver/index.ts | 1 + .../src/contract-interface-gen/typescript.ts | 3 +- .../src/contract/contract_instance.ts | 23 +- yarn-project/deploy_npm.sh | 1 + yarn-project/foundation/src/abi/abi.ts | 4 - yarn-project/package.json | 1 + yarn-project/pxe/src/database/index.ts | 1 + yarn-project/pxe/src/index.ts | 2 + .../src/client/execution_note_cache.ts | 1 - yarn-project/simulator/src/client/index.ts | 2 + yarn-project/txe/.eslintrc.cjs | 1 + yarn-project/txe/package.json | 82 +++ yarn-project/txe/src/bin/index.ts | 86 +++ yarn-project/txe/src/oracle/txe_oracle.ts | 596 +++++++++++++++++ .../txe/src/txe_service/txe_service.ts | 522 +++++++++++++++ yarn-project/txe/src/util/encoding.ts | 29 + yarn-project/txe/src/util/txe_database.ts | 24 + yarn-project/txe/tsconfig.json | 47 ++ .../types/src/abi/contract_artifact.ts | 3 - .../world-state/src/world-state-db/index.ts | 2 + yarn-project/yarn.lock | 28 + 53 files changed, 2949 insertions(+), 570 deletions(-) create mode 100644 noir-projects/aztec-nr/aztec/src/state_vars/public_immutable/test.nr create mode 100644 noir-projects/aztec-nr/aztec/src/test/helpers/cheatcodes.nr delete mode 100644 noir-projects/aztec-nr/aztec/src/test/helpers/context_builder.nr create mode 100644 noir-projects/aztec-nr/aztec/src/test/helpers/keys.nr create mode 100644 noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr create mode 100644 noir-projects/aztec-nr/aztec/src/test/helpers/types.nr create mode 100644 noir-projects/aztec-nr/aztec/src/test/mocks/mock_struct.nr create mode 100644 yarn-project/txe/.eslintrc.cjs create mode 100644 yarn-project/txe/package.json create mode 100644 yarn-project/txe/src/bin/index.ts create mode 100644 yarn-project/txe/src/oracle/txe_oracle.ts create mode 100644 yarn-project/txe/src/txe_service/txe_service.ts create mode 100644 yarn-project/txe/src/util/encoding.ts create mode 100644 yarn-project/txe/src/util/txe_database.ts create mode 100644 yarn-project/txe/tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 671ce7a2acb..196a9efb59a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -418,7 +418,7 @@ jobs: run: earthly-ci --no-output ./noir+packages-test noir-projects: - needs: [setup, changes] + needs: [setup, changes, build] runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' || needs.changes.outputs.noir-projects == 'true' }} steps: diff --git a/.vscode/settings.json b/.vscode/settings.json index a8ab844ebe1..86a0427f790 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -169,5 +169,4 @@ "**/noir/noir-repo/docs/versioned_docs/**": true }, "cmake.sourceDirectory": "${workspaceFolder}/barretenberg/cpp", - "noir.nargoPath": "./noir/noir-repo/target/release/nargo" } diff --git a/noir-projects/Dockerfile b/noir-projects/Dockerfile index ab4c6270e97..b8abf566f84 100644 --- a/noir-projects/Dockerfile +++ b/noir-projects/Dockerfile @@ -1,5 +1,6 @@ FROM aztecprotocol/noir as noir FROM aztecprotocol/avm-transpiler as transpiler +FROM aztecprotocol/yarn-project AS yarn-project FROM ubuntu:lunar AS builder RUN apt-get update && apt-get install -y parallel nodejs npm @@ -13,13 +14,25 @@ ENV PATH="/usr/src/avm-transpiler/target/release:${PATH}" # Copy in noir projects WORKDIR /usr/src/noir-projects COPY . . + + # Build -WORKDIR /usr/src/noir-projects/noir-contracts -RUN ./bootstrap.sh && nargo test --silence-warnings -WORKDIR /usr/src/noir-projects/noir-protocol-circuits -RUN ./bootstrap.sh && nargo test --silence-warnings -WORKDIR /usr/src/noir-projects/aztec-nr -RUN nargo test --silence-warnings +WORKDIR /usr/src/noir-projects +RUN cd noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings + +RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd /usr/src/noir-projects/noir-contracts && \ + ./bootstrap.sh && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \ + kill $(cat /tmp/txe.pid) + +RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd /usr/src/noir-projects/aztec-nr && \ + nargo test --silence-warnings --oracle-resolver http://localhost:8080 + FROM scratch COPY --from=builder /usr/src/noir-projects /usr/src/noir-projects \ No newline at end of file diff --git a/noir-projects/Earthfile b/noir-projects/Earthfile index 2a7c32ab568..df8db2aa046 100644 --- a/noir-projects/Earthfile +++ b/noir-projects/Earthfile @@ -41,10 +41,25 @@ build: SAVE ARTIFACT noir-protocol-circuits test: - FROM +build - RUN cd noir-protocol-circuits && nargo test --silence-warnings - RUN cd aztec-nr && nargo test --silence-warnings - RUN cd noir-contracts && nargo test --silence-warnings + FROM ../yarn-project/+txe + + # Install nargo + COPY ../noir/+nargo/nargo /usr/bin/nargo + + COPY +build/. /usr/src/noir-projects + + RUN cd /usr/src/noir-projects/noir-protocol-circuits && nargo test --silence-warnings + RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd /usr/src/noir-projects/aztec-nr && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \ + kill $(cat /tmp/txe.pid) + + RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd /usr/src/noir-projects/noir-contracts && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \ + kill $(cat /tmp/txe.pid) format: FROM +build diff --git a/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr b/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr index 69904595c96..dd1374f9eb0 100644 --- a/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr +++ b/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr @@ -1,20 +1,56 @@ -use dep::protocol_types::{abis::function_selector::FunctionSelector, address::AztecAddress, traits::Deserialize}; +use dep::protocol_types::{ + abis::{function_selector::FunctionSelector, private_circuit_public_inputs::PrivateCircuitPublicInputs}, + address::AztecAddress, traits::Deserialize +}; -use crate::context::private_context::PrivateContext; -use crate::context::public_context::PublicContext; -use crate::context::gas::GasOpts; -use crate::context::public_context::FunctionReturns; +use crate::context::{ + private_context::PrivateContext, public_context::PublicContext, gas::GasOpts, + public_context::FunctionReturns, inputs::{PrivateContextInputs, PublicContextInputs} +}; use crate::oracle::arguments; -struct PrivateCallInterface { +trait CallInterface { + fn get_args(self) -> [Field]; + fn get_original(self) -> fn[Env](T) -> P; + fn get_selector(self) -> FunctionSelector; + fn get_name(self) -> str; + fn get_contract_address(self) -> AztecAddress; +} + +impl CallInterface for PrivateCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PrivateCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args_hash: Field, + args: [Field], + original: fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs } -impl PrivateCallInterface { - pub fn call(self, context: &mut PrivateContext) -> T where T: Deserialize { +impl PrivateCallInterface { + pub fn call(self, context: &mut PrivateContext) -> T where T: Deserialize { let returns = context.call_private_function_with_packed_args( self.target_contract, self.selector, @@ -26,24 +62,49 @@ impl PrivateCallInterface { unpacked } - pub fn view(self, context: &mut PrivateContext) -> T where T: Deserialize { + pub fn view(self, context: &mut PrivateContext) -> T where T: Deserialize { let returns = context.call_private_function_with_packed_args(self.target_contract, self.selector, self.args_hash, true, false); returns.unpack_into() } - pub fn delegate_call(self, context: &mut PrivateContext) -> T where T: Deserialize { + pub fn delegate_call(self, context: &mut PrivateContext) -> T where T: Deserialize { let returns = context.call_private_function_with_packed_args(self.target_contract, self.selector, self.args_hash, false, true); returns.unpack_into() } } -struct PrivateVoidCallInterface { +impl CallInterface for PrivateVoidCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PrivateVoidCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args_hash: Field, + args: [Field], + original: fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs } -impl PrivateVoidCallInterface { +impl PrivateVoidCallInterface { pub fn call(self, context: &mut PrivateContext) { context.call_private_function_with_packed_args( self.target_contract, @@ -63,55 +124,129 @@ impl PrivateVoidCallInterface { } } -struct PrivateStaticCallInterface { +impl CallInterface for PrivateStaticCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PrivateStaticCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args_hash: Field, + args: [Field], + original: fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs } -impl PrivateStaticCallInterface { - pub fn view(self, context: &mut PrivateContext) -> T where T: Deserialize { +impl PrivateStaticCallInterface { + pub fn view(self, context: &mut PrivateContext) -> T where T: Deserialize { let returns = context.call_private_function_with_packed_args(self.target_contract, self.selector, self.args_hash, true, false); returns.unpack_into() } } -struct PrivateStaticVoidCallInterface { +impl CallInterface for PrivateStaticVoidCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PrivateStaticVoidCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args_hash: Field, + args: [Field], + original: fn[Env](PrivateContextInputs) -> PrivateCircuitPublicInputs } -impl PrivateStaticVoidCallInterface { +impl PrivateStaticVoidCallInterface { pub fn view(self, context: &mut PrivateContext) { context.call_private_function_with_packed_args(self.target_contract, self.selector, self.args_hash, true, false).assert_empty(); } } -struct PublicCallInterface { +impl CallInterface for PublicCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PublicContextInputs) -> T { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PublicCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args: [Field], gas_opts: GasOpts, + original: fn[Env](PublicContextInputs) -> T } -impl PublicCallInterface { +impl PublicCallInterface { pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self { self.gas_opts = gas_opts; self } - pub fn call(self, context: &mut PublicContext) -> T where T: Deserialize { + pub fn call(self, context: &mut PublicContext) -> T where T: Deserialize { let returns = context.call_public_function(self.target_contract, self.selector, self.args, self.gas_opts); returns.deserialize_into() } - pub fn view(self, context: &mut PublicContext) -> T where T: Deserialize { + pub fn view(self, context: &mut PublicContext) -> T where T: Deserialize { let returns = context.static_call_public_function(self.target_contract, self.selector, self.args, self.gas_opts); returns.deserialize_into() } - pub fn delegate_call(self, context: &mut PublicContext) -> T where T: Deserialize { + pub fn delegate_call(self, context: &mut PublicContext) -> T where T: Deserialize { let returns = context.delegate_call_public_function(self.target_contract, self.selector, self.args); returns.deserialize_into() } @@ -153,30 +288,54 @@ impl PublicCallInterface { } } -struct PublicVoidCallInterface { +impl CallInterface for PublicVoidCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PublicContextInputs) -> () { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PublicVoidCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args: [Field], gas_opts: GasOpts, + original: fn[Env](PublicContextInputs) -> () } -impl PublicVoidCallInterface { +impl PublicVoidCallInterface { pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self { self.gas_opts = gas_opts; self } - pub fn call(self, context: &mut PublicContext) { + pub fn call(self, context: &mut PublicContext) { let returns = context.call_public_function(self.target_contract, self.selector, self.args, self.gas_opts); returns.assert_empty() } - pub fn view(self, context: &mut PublicContext) { + pub fn view(self, context: &mut PublicContext) { let returns = context.static_call_public_function(self.target_contract, self.selector, self.args, self.gas_opts); returns.assert_empty() } - pub fn delegate_call(self, context: &mut PublicContext) { + pub fn delegate_call(self, context: &mut PublicContext) { let returns = context.delegate_call_public_function(self.target_contract, self.selector, self.args); returns.assert_empty() } @@ -218,22 +377,47 @@ impl PublicVoidCallInterface { } } -struct PublicStaticCallInterface { +impl CallInterface for PublicStaticCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PublicContextInputs) -> T { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PublicStaticCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args: [Field], gas_opts: GasOpts, + original: fn[Env](PublicContextInputs) -> T } -impl PublicStaticCallInterface { +impl PublicStaticCallInterface { pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self { self.gas_opts = gas_opts; self } - pub fn view(self, context: &mut PublicContext) -> T where T: Deserialize { + pub fn view(self, context: &mut PublicContext) -> T where T: Deserialize { let returns = context.static_call_public_function(self.target_contract, self.selector, self.args, self.gas_opts); - returns.deserialize_into() + let unpacked: T = returns.deserialize_into(); + unpacked } pub fn enqueue_view(self, context: &mut PrivateContext) { @@ -249,20 +433,44 @@ impl PublicStaticCallInterface { } } -struct PublicStaticVoidCallInterface { +impl CallInterface for PublicStaticVoidCallInterface { + fn get_args(self) -> [Field] { + self.args + } + + fn get_original(self) -> fn[Env](PublicContextInputs) -> () { + self.original + } + + fn get_selector(self) -> FunctionSelector { + self.selector + } + + fn get_name(self) -> str { + self.name + } + + fn get_contract_address(self) -> AztecAddress { + self.target_contract + } +} + +struct PublicStaticVoidCallInterface { target_contract: AztecAddress, selector: FunctionSelector, + name: str, args: [Field], gas_opts: GasOpts, + original: fn[Env](PublicContextInputs) -> () } -impl PublicStaticVoidCallInterface { +impl PublicStaticVoidCallInterface { pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self { self.gas_opts = gas_opts; self } - pub fn view(self, context: &mut PublicContext) { + pub fn view(self, context: &mut PublicContext) { let returns = context.static_call_public_function(self.target_contract, self.selector, self.args, self.gas_opts); returns.assert_empty() } diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr index 7229268f1e5..9ee0738312e 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr @@ -9,22 +9,22 @@ use crate::{ }; use dep::protocol_types::address::AztecAddress; -use crate::test::{helpers::context_builder::ContextBuilder, mocks::mock_note::MockNote}; +use crate::test::{helpers::{test_environment::TestEnvironment, cheatcodes}, mocks::mock_note::MockNote}; -global contract_address = AztecAddress::from_field(69); global storage_slot: Field = 42; -fn setup() -> PrivateContext { - ContextBuilder::new().contract_address(contract_address).private() +fn setup() -> TestEnvironment { + TestEnvironment::new() } fn build_valid_note(value: Field) -> MockNote { - MockNote::new(value).contract_address(contract_address).storage_slot(storage_slot).build() + MockNote::new(value).contract_address(cheatcodes::get_contract_address()).storage_slot(storage_slot).build() } #[test] fn processes_single_note() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let mut notes_to_constrain = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; notes_to_constrain[0] = Option::some(build_valid_note(13)); @@ -38,7 +38,8 @@ fn processes_single_note() { #[test] fn processes_many_notes() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let mut notes_to_constrain = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; notes_to_constrain[0] = Option::some(build_valid_note(13)); @@ -53,7 +54,8 @@ fn processes_many_notes() { #[test] fn collapses_notes_at_the_beginning_of_the_array() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let mut opt_notes = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; opt_notes[1] = Option::some(build_valid_note(0)); @@ -80,8 +82,9 @@ fn collapses_notes_at_the_beginning_of_the_array() { } #[test(should_fail_with="Cannot return zero notes")] - fn rejects_zero_notes() { - let mut context = setup(); +fn rejects_zero_notes() { + let mut env = setup(); + let mut context = env.private(); let opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; @@ -91,7 +94,8 @@ fn collapses_notes_at_the_beginning_of_the_array() { #[test(should_fail_with="Got more notes than limit.")] fn rejects_mote_notes_than_limit() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let mut opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; opt_notes[1] = Option::some(build_valid_note(0)); @@ -105,7 +109,8 @@ fn rejects_mote_notes_than_limit() { #[test] fn applies_filter_before_constraining() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let mut notes_to_constrain = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; let invalid_note = MockNote::new(13).build(); // This note does not have the correct address or storage slot @@ -138,7 +143,8 @@ fn applies_filter_before_constraining() { #[test(should_fail_with="Mismatch note header contract address.")] fn rejects_mismatched_address() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let note = MockNote::new(1).storage_slot(storage_slot).build(); // We're not setting the right contract address @@ -151,9 +157,10 @@ fn rejects_mismatched_address() { #[test(should_fail_with="Mismatch note header storage slot.")] fn rejects_mismatched_storage_slot() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); - let note = MockNote::new(1).contract_address(contract_address).build(); // We're not setting the right storage slot + let note = MockNote::new(1).contract_address(cheatcodes::get_contract_address()).build(); // We're not setting the right storage slot let mut opt_notes = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; opt_notes[0] = Option::some(note); @@ -164,7 +171,8 @@ fn rejects_mismatched_storage_slot() { #[test(should_fail_with="Mismatch return note field.")] fn rejects_mismatched_selector() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let value = 10; let note = build_valid_note(value); @@ -184,7 +192,8 @@ fn rejects_mismatched_selector() { #[test(should_fail_with="Return notes not sorted in descending order.")] fn rejects_mismatched_desc_sort_order() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let mut opt_notes = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; // Notes in ascending order @@ -201,7 +210,8 @@ fn rejects_mismatched_desc_sort_order() { #[test(should_fail_with="Return notes not sorted in ascending order.")] fn rejects_mismatched_asc_sort_order() { - let mut context = setup(); + let mut env = setup(); + let mut context = env.private(); let mut opt_notes = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; // Notes in descending order diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable/test.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable/test.nr index aca21ab515a..c3949a8e03e 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable/test.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable/test.nr @@ -1,14 +1,16 @@ use dep::protocol_types::{address::AztecAddress, grumpkin_point::GrumpkinPoint}; use crate::{context::PrivateContext, state_vars::private_mutable::PrivateMutable}; -use crate::test::{mocks::mock_note::MockNote, helpers::context_builder::ContextBuilder}; +use crate::test::{mocks::mock_note::MockNote, helpers::{cheatcodes, test_environment::TestEnvironment}}; use dep::std::{unsafe::zeroed, test::OracleMock}; -global contract_address = AztecAddress::from_field(13); global storage_slot = 17; -fn setup() -> PrivateMutable { - let mut context = ContextBuilder::new().contract_address(contract_address).private(); - let state_var = PrivateMutable::new(&mut context, storage_slot); +fn setup() -> TestEnvironment { + TestEnvironment::new() +} + +fn in_private(env: &mut TestEnvironment) -> PrivateMutable { + let state_var = PrivateMutable::new(&mut env.private(), storage_slot); // This oracle is called for its side effects alone - it's always expected to return 0. OracleMock::mock("notifyCreatedNote").returns(0); @@ -18,13 +20,14 @@ fn setup() -> PrivateMutable { #[test] fn test_initialize_or_replace_without_nullifier() { - let state_var = setup(); + let mut env = setup(); + let state_var = in_private(&mut env); let ovpk_m: GrumpkinPoint = zeroed(); let ivpk_m: GrumpkinPoint = zeroed(); let value = 42; - let mut note = MockNote::new(value).contract_address(contract_address).storage_slot(storage_slot).build(); + let mut note = MockNote::new(value).contract_address(cheatcodes::get_contract_address()).storage_slot(storage_slot).build(); OracleMock::mock("checkNullifierExists").returns(0); state_var.initialize_or_replace(&mut note).discard(); diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable/test.nr b/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable/test.nr new file mode 100644 index 00000000000..7614ffff1d1 --- /dev/null +++ b/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable/test.nr @@ -0,0 +1,53 @@ +use crate::{context::PublicContext, state_vars::public_immutable::PublicImmutable}; +use crate::test::{helpers::test_environment::TestEnvironment, mocks::mock_struct::MockStruct}; +use dep::protocol_types::traits::Serialize; + +global storage_slot = 7; + +fn setup() -> TestEnvironment { + TestEnvironment::new() +} + +fn in_public(env: TestEnvironment) -> PublicImmutable { + PublicImmutable::new(&mut env.public(), storage_slot) +} + +#[test] +fn test_uninitialized_by_default() { + let env = setup(); + let state_var = in_public(env); + + assert_eq(state_var.is_initialized(), false); +} + +#[test] +fn test_initialize_uninitialized() { + let env = setup(); + let state_var = in_public(env); + + let value = MockStruct::new(5, 6); + + state_var.initialize(value); + + assert(state_var.is_initialized()); + assert(state_var.read() == value); +} + +#[test(should_fail_with="PublicImmutable already initialized")] +fn test_initialize_already_initialized() { + let env = setup(); + let state_var = in_public(env); + + let value = MockStruct::new(5, 6); + + state_var.initialize(value); + state_var.initialize(value); +} + +#[test(should_fail_with="PublicImmutable not initialized")] +fn test_read_uninitialized() { + let env = setup(); + let state_var = in_public(env); + + let _ = state_var.read(); +} diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr index 6403f166e9e..b193640a54b 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr @@ -1,377 +1,363 @@ -use dep::std::{merkle::compute_merkle_root, test::OracleMock}; - use crate::{ - context::{PublicContext, PrivateContext}, - state_vars::shared_mutable::{ - shared_mutable::SharedMutable, scheduled_value_change::ScheduledValueChange, - scheduled_delay_change::ScheduledDelayChange -}, - test::helpers::context_builder::ContextBuilder, oracle::get_public_data_witness::PublicDataWitness -}; - -use dep::protocol_types::{ - constants::{GENERATOR_INDEX__PUBLIC_LEAF_INDEX, PUBLIC_DATA_TREE_HEIGHT}, hash::pedersen_hash, - address::AztecAddress, public_data_tree_leaf_preimage::PublicDataTreeLeafPreimage + context::{PublicContext, PrivateContext}, state_vars::shared_mutable::shared_mutable::SharedMutable, + test::helpers::test_environment::TestEnvironment }; -global pre_value = 13; -global post_value = 42; +use dep::protocol_types::address::AztecAddress; global new_value = 57; global pre_delay = 20; global post_delay = 15; -global TEST_INITIAL_DELAY = 3; +global storage_slot = 57; -fn setup() -> (SharedMutable, Field) { - let block_number = 40; - let mut context = ContextBuilder::new().block_number(block_number).public(); +global TEST_INITIAL_DELAY: u32 = 30; - let storage_slot = 57; - let state_var = SharedMutable::new(&mut context, storage_slot); - - (state_var, block_number) +fn setup() -> TestEnvironment { + TestEnvironment::new() } -fn mock_value_change_read( - state_var: SharedMutable, - pre: Field, - post: Field, - block_of_change: Field -) { - let value_change_slot = state_var.get_value_change_storage_slot(); - let fields = ScheduledValueChange::new(pre, post, block_of_change as u32).serialize(); - - let _ = OracleMock::mock("storageRead").with_params((value_change_slot, 3)).returns(fields).times(1); +fn in_public(env: TestEnvironment) -> SharedMutable { + SharedMutable::new(&mut env.public(), storage_slot) } -fn mock_delay_change_read( - state_var: SharedMutable, - pre: Field, - post: Field, - block_of_change: Field -) { - let delay_change_slot = state_var.get_delay_change_storage_slot(); - let delay_change: ScheduledDelayChange = ScheduledDelayChange::new( - Option::some(pre as u32), - Option::some(post as u32), - block_of_change as u32 - ); - let fields = delay_change.serialize(); - - let _ = OracleMock::mock("storageRead").with_params((delay_change_slot, 1)).returns(fields).times(1); +fn in_private( + env: &mut TestEnvironment, + historical_block_number: u32 +) -> SharedMutable { + SharedMutable::new(&mut env.private_at(historical_block_number), storage_slot) } -fn mock_delay_change_read_uninitialized(state_var: SharedMutable) { - let delay_change_slot = state_var.get_delay_change_storage_slot(); - let _ = OracleMock::mock("storageRead").with_params((delay_change_slot, 1)).returns([0]).times(1); -} +// #[test] +// fn test_get_current_value_in_public_initial() { +// let env = setup(); +// let state_var = in_public(env); -// Useful since change and delay values are always the global pre/post ones, so we typically only care about their -// block of change. -fn mock_value_and_delay_read( - state_var: SharedMutable, - value_block_of_change: Field, - delay_block_of_change: Field -) { - mock_value_change_read(state_var, pre_value, post_value, value_block_of_change); - mock_delay_change_read(state_var, pre_delay, post_delay, delay_block_of_change); -} +// // 0 is the default empty value for a Field +// assert_eq(state_var.get_current_value_in_public(), 0); +// } -fn mock_value_change_write() -> OracleMock { - OracleMock::mock("storageWrite").returns([0; 3]) -} +// #[test] +// fn test_get_current_value_in_public_before_scheduled_change() { +// let mut env = setup(); +// let state_var = in_public(env); -fn mock_delay_change_write() -> OracleMock { - OracleMock::mock("storageWrite").returns([0; 1]) -} +// state_var.schedule_value_change(new_value); -fn assert_value_change_write( - state_var: SharedMutable, - mock: OracleMock, - pre: Field, - post: Field, - block_of_change: Field -) { - let fields = ScheduledValueChange::new(pre, post, block_of_change as u32).serialize(); - assert_eq(mock.get_last_params(), (state_var.get_value_change_storage_slot(), fields)); -} +// let (_, block_of_change) = state_var.get_scheduled_value_in_public(); -fn assert_delay_change_write( - state_var: SharedMutable, - mock: OracleMock, - pre: Field, - post: Field, - block_of_change: Field -) { - let delay_change: ScheduledDelayChange = ScheduledDelayChange::new( - Option::some(pre as u32), - Option::some(post as u32), - block_of_change as u32 - ); - - let fields = delay_change.serialize(); - assert_eq(mock.get_last_params(), (state_var.get_delay_change_storage_slot(), fields)); -} +// let original_value = 0; -#[test] -fn test_get_current_value_in_public() { - let (state_var, block_number) = setup(); +// // The current value has not changed +// assert_eq(state_var.get_current_value_in_public(), original_value); - // Change in the future, current value is pre - mock_value_change_read(state_var, pre_value, post_value, block_number + 1); - assert_eq(state_var.get_current_value_in_public(), pre_value); +// // The current value still does not change right before the block of change +// env.advance_block_to(block_of_change - 1); +// assert_eq(state_var.get_current_value_in_public(), original_value); +// } - // Change in the current block, current value is post - mock_value_change_read(state_var, pre_value, post_value, block_number); - assert_eq(state_var.get_current_value_in_public(), post_value); +// #[test] +// fn test_get_current_value_in_public_at_scheduled_change() { +// let mut env = setup(); +// let state_var = in_public(env); - // Change in the past, current value is post - mock_value_change_read(state_var, pre_value, post_value, block_number - 1); - assert_eq(state_var.get_current_value_in_public(), post_value); -} +// state_var.schedule_value_change(new_value); -#[test] -fn test_get_scheduled_value_in_public() { - let (state_var, block_number) = setup(); +// let (_, block_of_change) = state_var.get_scheduled_value_in_public(); - // Change in the future, scheduled is post (always is) - mock_value_change_read(state_var, pre_value, post_value, block_number + 1); - assert_eq(state_var.get_scheduled_value_in_public(), (post_value, (block_number + 1) as u32)); +// env.advance_block_to(block_of_change); +// assert_eq(state_var.get_current_value_in_public(), new_value); +// } - // Change in the current block, scheduled is post (always is) - mock_value_change_read(state_var, pre_value, post_value, block_number); - assert_eq(state_var.get_scheduled_value_in_public(), (post_value, block_number as u32)); +// #[test] +// fn test_get_current_value_in_public_after_scheduled_change() { +// let mut env = setup(); +// let state_var = in_public(env); - // Change in the past, scheduled is post (always is) - mock_value_change_read(state_var, pre_value, post_value, block_number - 1); - assert_eq(state_var.get_scheduled_value_in_public(), (post_value, (block_number - 1) as u32)); -} +// state_var.schedule_value_change(new_value); -#[test] -fn test_get_current_delay_in_public() { - let (state_var, block_number) = setup(); +// let (_, block_of_change) = state_var.get_scheduled_value_in_public(); - // Uninitialized - mock_delay_change_read_uninitialized(state_var); - assert_eq(state_var.get_current_delay_in_public(), TEST_INITIAL_DELAY as u32); +// env.advance_block_to(block_of_change + 10); +// assert_eq(state_var.get_current_value_in_public(), new_value); +// } - // Change in the future, current value is pre - mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); - assert_eq(state_var.get_current_delay_in_public(), pre_delay as u32); +// #[test] +// fn test_get_current_value_in_private_before_change() { +// let mut env = setup(); - // Change in the current block, current value is post - mock_delay_change_read(state_var, pre_delay, post_delay, block_number); - assert_eq(state_var.get_current_delay_in_public(), post_delay as u32); +// let public_state_var = in_public(env); +// public_state_var.schedule_value_change(new_value); - // Change in the past, current value is post - mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); - assert_eq(state_var.get_current_delay_in_public(), post_delay as u32); -} +// let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); -#[test] -fn test_get_scheduled_delay_in_public_before_change() { - let (state_var, block_number) = setup(); +// let schedule_block_number = env.block_number(); - // Uninitialized - mock_delay_change_read_uninitialized(state_var); - assert_eq(state_var.get_scheduled_delay_in_public(), (TEST_INITIAL_DELAY as u32, 0)); +// let private_state_var = in_private(&mut env, schedule_block_number); +// assert_eq(private_state_var.get_current_value_in_private(), 0); +// assert_eq(private_state_var.context.max_block_number.unwrap(), block_of_change - 1); +// } - // Change in the future, scheduled is post (always is) - mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); - assert_eq(state_var.get_scheduled_delay_in_public(), (post_delay as u32, (block_number + 1) as u32)); +// #[test] +// fn test_get_current_value_in_private_immediately_before_change() { +// let mut env = setup(); - // Change in the current block, scheduled is post (always is) - mock_delay_change_read(state_var, pre_delay, post_delay, block_number); - assert_eq(state_var.get_scheduled_delay_in_public(), (post_delay as u32, block_number as u32)); +// let public_state_var = in_public(env); +// public_state_var.schedule_value_change(new_value); - // Change in the past, scheduled is post (always is) - mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); - assert_eq(state_var.get_scheduled_delay_in_public(), (post_delay as u32, (block_number - 1) as u32)); -} +// let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); -#[test] -fn test_schedule_value_change_no_delay() { - let (state_var, block_number) = setup(); +// let private_state_var = in_private(&mut env, block_of_change - 1); - // Last value change was in the past - mock_value_change_read(state_var, pre_value, post_value, 0); +// assert_eq(private_state_var.get_current_value_in_private(), 0); +// assert_eq(private_state_var.context.max_block_number.unwrap(), block_of_change - 1); +// } - // Current delay is 0 - mock_delay_change_read(state_var, 0, 0, block_number); +// #[test] +// fn test_get_current_value_in_private_at_change() { +// let mut env = setup(); - let write_mock = mock_value_change_write(); +// let public_state_var = in_public(env); +// public_state_var.schedule_value_change(new_value); - state_var.schedule_value_change(new_value); +// let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); - // The new value has a block of change equal to the current block, i.e. it is the current value - assert_value_change_write(state_var, write_mock, post_value, new_value, block_number); -} +// let historical_block_number = block_of_change; +// let private_state_var = in_private(&mut env, historical_block_number); +// assert_eq(private_state_var.get_current_value_in_private(), new_value); +// assert_eq( +// private_state_var.context.max_block_number.unwrap(), historical_block_number + TEST_INITIAL_DELAY +// ); +// } -#[test] -fn test_schedule_value_change_before_change_no_scheduled_delay() { - let (state_var, block_number) = setup(); +// #[test] +// fn test_get_current_value_in_private_after_change() { +// let mut env = setup(); - // Value change in the future, delay change in the past - mock_value_and_delay_read(state_var, block_number + 1, block_number - 1); - let write_mock = mock_value_change_write(); +// let public_state_var = in_public(env); +// public_state_var.schedule_value_change(new_value); - state_var.schedule_value_change(new_value); +// let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); - // The new scheduled value change replaces the old one, post delay (current) is used - assert_value_change_write( - state_var, - write_mock, - pre_value, - new_value, - block_number + post_delay - ); -} +// let historical_block_number = block_of_change + 10; +// let private_state_var = in_private(&mut env, historical_block_number); +// assert_eq(private_state_var.get_current_value_in_private(), new_value); +// assert_eq( +// private_state_var.context.max_block_number.unwrap(), historical_block_number + TEST_INITIAL_DELAY +// ); +// } -#[test] -fn test_schedule_value_change_before_change_scheduled_delay() { - let (state_var, block_number) = setup(); +// #[test] +// fn test_get_current_delay_in_public() { +// let (state_var, block_number) = setup(); - // Value change in the future, delay change in the future - mock_value_and_delay_read(state_var, block_number + 1, block_number + 1); +// // Uninitialized +// mock_delay_change_read_uninitialized(state_var); +// assert_eq(state_var.get_current_delay_in_public(), TEST_INITIAL_DELAY as u32); - let write_mock = mock_value_change_write(); +// // Change in the future, current value is pre +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); +// assert_eq(state_var.get_current_delay_in_public(), pre_delay as u32); - state_var.schedule_value_change(new_value); +// // Change in the current block, current value is post +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number); +// assert_eq(state_var.get_current_delay_in_public(), post_delay as u32); - // The new scheduled value change replaces the old one, pre delay (current, not scheduled) is used - assert_value_change_write( - state_var, - write_mock, - pre_value, - new_value, - block_number + pre_delay - ); -} +// // Change in the past, current value is post +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); +// assert_eq(state_var.get_current_delay_in_public(), post_delay as u32); +// } -#[test] -fn test_schedule_value_change_after_change_no_scheduled_delay() { - let (state_var, block_number) = setup(); +// #[test] +// fn test_get_scheduled_delay_in_public_before_change() { +// let (state_var, block_number) = setup(); - // Value change in the past, delay change in the past - mock_value_and_delay_read(state_var, block_number - 1, block_number - 1); - let write_mock = mock_value_change_write(); +// // Uninitialized +// mock_delay_change_read_uninitialized(state_var); +// assert_eq(state_var.get_scheduled_delay_in_public(), (TEST_INITIAL_DELAY as u32, 0)); - state_var.schedule_value_change(new_value); +// // Change in the future, scheduled is post (always is) +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); +// assert_eq(state_var.get_scheduled_delay_in_public(), (post_delay as u32, (block_number + 1) as u32)); - // The previous post value becomes the pre value, post delay (current) is used - assert_value_change_write( - state_var, - write_mock, - post_value, - new_value, - block_number + post_delay - ); -} +// // Change in the current block, scheduled is post (always is) +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number); +// assert_eq(state_var.get_scheduled_delay_in_public(), (post_delay as u32, block_number as u32)); -#[test] -fn test_schedule_value_change_after_change_scheduled_delay() { - let (state_var, block_number) = setup(); +// // Change in the past, scheduled is post (always is) +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); +// assert_eq(state_var.get_scheduled_delay_in_public(), (post_delay as u32, (block_number - 1) as u32)); +// } - // Value change in the past, delay change in the future - mock_value_and_delay_read(state_var, block_number - 1, block_number + 1); +// #[test] +// fn test_schedule_value_change_no_delay() { +// let (state_var, block_number) = setup(); - let write_mock = mock_value_change_write(); +// // Last value change was in the past +// mock_value_change_read(state_var, pre_value, post_value, 0); + +// // Current delay is 0 +// mock_delay_change_read(state_var, 0, 0, block_number); + +// let write_mock = mock_value_change_write(); - state_var.schedule_value_change(new_value); - - // The previous post value becomes the pre value, pre delay (current, not scheduled) is used - assert_value_change_write( - state_var, - write_mock, - post_value, - new_value, - block_number + pre_delay - ); -} - -#[test] -fn test_schedule_delay_increase_before_change() { - let (state_var, block_number) = setup(); - - // Delay change in future, current delay is pre - mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); - let write_mock = mock_delay_change_write(); - - let new_delay = pre_delay + 1; - state_var.schedule_delay_change(new_delay as u32); - - // The previous scheduled change is lost, change is immediate (due to increase) - assert_delay_change_write(state_var, write_mock, pre_delay, new_delay, block_number); -} - -#[test] -fn test_schedule_delay_reduction_before_change() { - let (state_var, block_number) = setup(); - - // Delay change in future, current delay is pre - mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); - let write_mock = mock_delay_change_write(); - - let new_delay = pre_delay - 1; - state_var.schedule_delay_change(new_delay as u32); - - // The previous scheduled change is lost, change delay equals difference (due to reduction) - assert_delay_change_write( - state_var, - write_mock, - pre_delay, - new_delay, - block_number + pre_delay - new_delay - ); -} - -#[test] -fn test_schedule_delay_increase_after_change() { - let (state_var, block_number) = setup(); - - // Delay change in the past, current delay is post - mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); - let write_mock = mock_delay_change_write(); - - let new_delay = post_delay + 1; - state_var.schedule_delay_change(new_delay as u32); - - // The current value becomes pre, change is immediate (due to increase) - assert_delay_change_write(state_var, write_mock, post_delay, new_delay, block_number); -} - -#[test] -fn test_schedule_delay_reduction_after_change() { - let (state_var, block_number) = setup(); - - // Delay change in the past, current delay is post - mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); - let write_mock = mock_delay_change_write(); - - let new_delay = post_delay - 1; - state_var.schedule_delay_change(new_delay as u32); - - // The current value becomes pre, change delay equals difference (due to reduction) - assert_delay_change_write( - state_var, - write_mock, - post_delay, - new_delay, - block_number + post_delay - new_delay - ); -} - -#[test] -fn test_get_current_value_in_private_before_change() { - // Here we'd want to test that the private getter returns the correct value and sets max_block_number in the - // context to the expected block horizon, in all the possible scenarios (long before change, before near change, - // after change). - // However, this requires mocking the getPublicDataTreeWitness oracle so that we can convince the circuit that - // it got a valid historical proof. Because we can set the tree root to whatever we want in the context, this is - // trivial for a single historical value (we add a leaf and compute the root with any random path), but is quite - // hard if we're reading more than one value for the same root (as SharedMutable does): we essentially need to - // create an actual indexed tree and compute the correct path for each of the inserted values. - // TODO: implement an actual tree and use it here https://github.com/AztecProtocol/aztec-packages/issues/5494 -} +// state_var.schedule_value_change(new_value); + +// // The new value has a block of change equal to the current block, i.e. it is the current value +// assert_value_change_write(state_var, write_mock, post_value, new_value, block_number); +// } + +// #[test] +// fn test_schedule_value_change_before_change_no_scheduled_delay() { +// let (state_var, block_number) = setup(); + +// // Value change in the future, delay change in the past +// mock_value_and_delay_read(state_var, block_number + 1, block_number - 1); +// let write_mock = mock_value_change_write(); + +// state_var.schedule_value_change(new_value); + +// // The new scheduled value change replaces the old one, post delay (current) is used +// assert_value_change_write( +// state_var, +// write_mock, +// pre_value, +// new_value, +// block_number + post_delay +// ); +// } + +// #[test] +// fn test_schedule_value_change_before_change_scheduled_delay() { +// let (state_var, block_number) = setup(); + +// // Value change in the future, delay change in the future +// mock_value_and_delay_read(state_var, block_number + 1, block_number + 1); + +// let write_mock = mock_value_change_write(); + +// state_var.schedule_value_change(new_value); + +// // The new scheduled value change replaces the old one, pre delay (current, not scheduled) is used +// assert_value_change_write( +// state_var, +// write_mock, +// pre_value, +// new_value, +// block_number + pre_delay +// ); +// } + +// #[test] +// fn test_schedule_value_change_after_change_no_scheduled_delay() { +// let (state_var, block_number) = setup(); + +// // Value change in the past, delay change in the past +// mock_value_and_delay_read(state_var, block_number - 1, block_number - 1); +// let write_mock = mock_value_change_write(); + +// state_var.schedule_value_change(new_value); + +// // The previous post value becomes the pre value, post delay (current) is used +// assert_value_change_write( +// state_var, +// write_mock, +// post_value, +// new_value, +// block_number + post_delay +// ); +// } + +// #[test] +// fn test_schedule_value_change_after_change_scheduled_delay() { +// let (state_var, block_number) = setup(); + +// // Value change in the past, delay change in the future +// mock_value_and_delay_read(state_var, block_number - 1, block_number + 1); + +// let write_mock = mock_value_change_write(); + +// state_var.schedule_value_change(new_value); + +// // The previous post value becomes the pre value, pre delay (current, not scheduled) is used +// assert_value_change_write( +// state_var, +// write_mock, +// post_value, +// new_value, +// block_number + pre_delay +// ); +// } + +// #[test] +// fn test_schedule_delay_increase_before_change() { +// let (state_var, block_number) = setup(); + +// // Delay change in future, current delay is pre +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); +// let write_mock = mock_delay_change_write(); + +// let new_delay = pre_delay + 1; +// state_var.schedule_delay_change(new_delay as u32); + +// // The previous scheduled change is lost, change is immediate (due to increase) +// assert_delay_change_write(state_var, write_mock, pre_delay, new_delay, block_number); +// } + +// #[test] +// fn test_schedule_delay_reduction_before_change() { +// let (state_var, block_number) = setup(); + +// // Delay change in future, current delay is pre +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number + 1); +// let write_mock = mock_delay_change_write(); + +// let new_delay = pre_delay - 1; +// state_var.schedule_delay_change(new_delay as u32); + +// // The previous scheduled change is lost, change delay equals difference (due to reduction) +// assert_delay_change_write( +// state_var, +// write_mock, +// pre_delay, +// new_delay, +// block_number + pre_delay - new_delay +// ); +// } + +// #[test] +// fn test_schedule_delay_increase_after_change() { +// let (state_var, block_number) = setup(); + +// // Delay change in the past, current delay is post +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); +// let write_mock = mock_delay_change_write(); + +// let new_delay = post_delay + 1; +// state_var.schedule_delay_change(new_delay as u32); + +// // The current value becomes pre, change is immediate (due to increase) +// assert_delay_change_write(state_var, write_mock, post_delay, new_delay, block_number); +// } + +// #[test] +// fn test_schedule_delay_reduction_after_change() { +// let (state_var, block_number) = setup(); + +// // Delay change in the past, current delay is post +// mock_delay_change_read(state_var, pre_delay, post_delay, block_number - 1); +// let write_mock = mock_delay_change_write(); + +// let new_delay = post_delay - 1; +// state_var.schedule_delay_change(new_delay as u32); + +// // The current value becomes pre, change delay equals difference (due to reduction) +// assert_delay_change_write( +// state_var, +// write_mock, +// post_delay, +// new_delay, +// block_number + post_delay - new_delay +// ); +// } \ No newline at end of file diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/storage.nr b/noir-projects/aztec-nr/aztec/src/state_vars/storage.nr index 0f8cce2323c..8ae9faf228c 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/storage.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/storage.nr @@ -8,9 +8,8 @@ trait Storage where T: Serialize + Deserialize { // Struct representing an exportable storage variable in the contract // Every entry in the storage struct will be exported in the compilation artifact as a -// Storable entity, containing the storage slot and the type of the variable -struct Storable { +// Storable entity, containing the storage slot +struct Storable { slot: Field, - typ: str } diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers.nr b/noir-projects/aztec-nr/aztec/src/test/helpers.nr index c5c7a4b5f31..b28a85add1c 100644 --- a/noir-projects/aztec-nr/aztec/src/test/helpers.nr +++ b/noir-projects/aztec-nr/aztec/src/test/helpers.nr @@ -1 +1,4 @@ -mod context_builder; +mod test_environment; +mod cheatcodes; +mod types; +mod keys; diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/cheatcodes.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/cheatcodes.nr new file mode 100644 index 00000000000..014757cf9b0 --- /dev/null +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/cheatcodes.nr @@ -0,0 +1,127 @@ +use dep::protocol_types::{abis::function_selector::FunctionSelector, address::{AztecAddress, PartialAddress}}; +use crate::context::inputs::{PublicContextInputs, PrivateContextInputs}; +use crate::test::helpers::types::{Deployer, TestAccount}; +use crate::keys::public_keys::PublicKeys; + +unconstrained pub fn reset() { + oracle_reset(); +} + +unconstrained pub fn get_contract_address() -> AztecAddress { + oracle_get_contract_address() +} + +unconstrained pub fn set_contract_address(address: AztecAddress) { + oracle_set_contract_address(address); +} + +unconstrained pub fn get_block_number() -> u32 { + oracle_get_block_number() +} + +unconstrained pub fn advance_blocks(blocks: u32) { + oracle_time_travel(blocks); +} + +unconstrained pub fn get_private_context_inputs(historical_block_number: u32) -> PrivateContextInputs { + oracle_get_private_context_inputs(historical_block_number) +} + +unconstrained pub fn get_public_context_inputs() -> PublicContextInputs { + oracle_get_public_context_inputs() +} + +unconstrained pub fn deploy( + path: str, + initializer: str, + args: [Field], + public_keys_hash: Field +) -> AztecAddress { + oracle_deploy(path, initializer, args, public_keys_hash) +} + +unconstrained pub fn direct_storage_write( + contract_address: AztecAddress, + storage_slot: Field, + fields: [Field; N] +) { + let _hash = direct_storage_write_oracle(contract_address, storage_slot, fields); +} + +unconstrained pub fn create_account() -> TestAccount { + oracle_create_account() +} + +unconstrained pub fn add_account(secret: Field, partial_address: PartialAddress) -> TestAccount { + oracle_add_account(secret, partial_address) +} + +unconstrained pub fn derive_keys(secret: Field) -> PublicKeys { + oracle_derive_keys(secret) +} + +unconstrained pub fn set_msg_sender(msg_sender: AztecAddress) { + oracle_set_msg_sender(msg_sender) +} + +unconstrained pub fn get_msg_sender() -> AztecAddress { + oracle_get_msg_sender() +} + +unconstrained pub fn get_side_effects_counter() -> u32 { + oracle_get_side_effects_counter() +} + +#[oracle(reset)] +fn oracle_reset() {} + +#[oracle(getContractAddress)] +fn oracle_get_contract_address() -> AztecAddress {} + +#[oracle(setContractAddress)] +fn oracle_set_contract_address(address: AztecAddress) {} + +#[oracle(getBlockNumber)] +fn oracle_get_block_number() -> u32 {} + +#[oracle(timeTravel)] +fn oracle_time_travel(blocks: u32) {} + +#[oracle(getPrivateContextInputs)] +fn oracle_get_private_context_inputs(historical_block_number: u32) -> PrivateContextInputs {} + +#[oracle(getPublicContextInputs)] +fn oracle_get_public_context_inputs() -> PublicContextInputs {} + +#[oracle(deploy)] +fn oracle_deploy( + path: str, + initializer: str, + args: [Field], + public_keys_hash: Field +) -> AztecAddress {} + +#[oracle(directStorageWrite)] +fn direct_storage_write_oracle( + _contract_address: AztecAddress, + _storage_slot: Field, + _values: [Field; N] +) -> [Field; N] {} + +#[oracle(createAccount)] +fn oracle_create_account() -> TestAccount {} + +#[oracle(addAccount)] +fn oracle_add_account(secret: Field, partial_address: PartialAddress) -> TestAccount {} + +#[oracle(deriveKeys)] +fn oracle_derive_keys(secret: Field) -> PublicKeys {} + +#[oracle(getMsgSender)] +fn oracle_get_msg_sender() -> AztecAddress {} + +#[oracle(setMsgSender)] +fn oracle_set_msg_sender(msg_sender: AztecAddress) {} + +#[oracle(getSideEffectsCounter)] +fn oracle_get_side_effects_counter() -> u32 {} diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/context_builder.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/context_builder.nr deleted file mode 100644 index 0b04ac52ccb..00000000000 --- a/noir-projects/aztec-nr/aztec/src/test/helpers/context_builder.nr +++ /dev/null @@ -1,52 +0,0 @@ -use crate::context::{PrivateContext, PublicContext}; -use dep::protocol_types::address::AztecAddress; -use dep::std::test::OracleMock; - -struct ContextBuilder { - block_number: Option, - contract_address: Option, -} - -impl ContextBuilder { - fn new() -> Self { - Self { block_number: Option::none(), contract_address: Option::none() } - } - - fn block_number(&mut self, block_number: Field) -> &mut Self { - self.block_number = Option::some(block_number); - self - } - - fn contract_address(&mut self, contract_address: AztecAddress) -> &mut Self { - self.contract_address = Option::some(contract_address); - self - } - - fn private(&mut self) -> PrivateContext { - let mut context = PrivateContext::empty(); - - if self.block_number.is_some() { - context.inputs.historical_header.global_variables.block_number = self.block_number.unwrap_unchecked(); - } - - if self.contract_address.is_some() { - context.inputs.call_context.storage_contract_address = self.contract_address.unwrap_unchecked(); - } - - context - } - - fn public(&mut self) -> PublicContext { - let mut context = PublicContext::empty(); - - if self.block_number.is_some() { - let _ = OracleMock::mock("avmOpcodeBlockNumber").returns(self.block_number.unwrap()); - } - - if self.contract_address.is_some() { - let _ = OracleMock::mock("avmOpcodeAddress").returns(self.contract_address.unwrap()); - } - - context - } -} diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/keys.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/keys.nr new file mode 100644 index 00000000000..f4c53c95c20 --- /dev/null +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/keys.nr @@ -0,0 +1,18 @@ +use dep::protocol_types::{ + address::AztecAddress, storage::map::derive_storage_slot_in_map, + constants::CANONICAL_KEY_REGISTRY_ADDRESS, grumpkin_point::GrumpkinPoint +}; + +use crate::test::helpers::cheatcodes; + +pub fn store_master_key(key_index: Field, address: AztecAddress, key: GrumpkinPoint) { + let x_coordinate_map_slot = key_index * 2 + 1; + let y_coordinate_map_slot = x_coordinate_map_slot + 1; + let x_coordinate_derived_slot = derive_storage_slot_in_map(x_coordinate_map_slot, address); + let y_coordinate_derived_slot = derive_storage_slot_in_map(y_coordinate_map_slot, address); + + let canonical_registry_address = AztecAddress::from_field(CANONICAL_KEY_REGISTRY_ADDRESS); + + cheatcodes::direct_storage_write(canonical_registry_address, x_coordinate_derived_slot, [key.x]); + cheatcodes::direct_storage_write(canonical_registry_address, y_coordinate_derived_slot, [key.y]); +} diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr new file mode 100644 index 00000000000..142f6fd58f8 --- /dev/null +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr @@ -0,0 +1,207 @@ +use dep::protocol_types::{ + abis::{function_selector::FunctionSelector, private_circuit_public_inputs::PrivateCircuitPublicInputs}, + address::{AztecAddress, PartialAddress}, storage::map::derive_storage_slot_in_map, + constants::CANONICAL_KEY_REGISTRY_ADDRESS, grumpkin_point::GrumpkinPoint, traits::Deserialize +}; + +use crate::context::inputs::{PublicContextInputs, PrivateContextInputs}; +use crate::context::{packed_returns::PackedReturns, call_interfaces::CallInterface}; + +use crate::context::{PrivateContext, PublicContext, PrivateVoidCallInterface}; +use crate::test::helpers::{cheatcodes, types::{Deployer, TestAccount}, keys}; +use crate::keys::constants::{NULLIFIER_INDEX, INCOMING_INDEX, OUTGOING_INDEX, TAGGING_INDEX}; +use crate::hash::hash_args; + +use crate::note::{ + note_header::NoteHeader, note_interface::NoteInterface, + utils::{compute_note_hash_for_insertion, compute_note_hash_for_consumption} +}; +use crate::oracle::notes::notify_created_note; + +struct TestEnvironment { + contract_address: Option, + args_hash: Option, + function_selector: Option +} + +impl TestEnvironment { + fn new() -> Self { + cheatcodes::reset(); + Self { contract_address: Option::none(), args_hash: Option::none(), function_selector: Option::none() } + } + + fn block_number(self) -> u32 { + cheatcodes::get_block_number() + } + + fn advance_block_to(&mut self, block_number: u32) { + let difference = block_number - cheatcodes::get_block_number(); + self.advance_block_by(difference); + } + + fn advance_block_by(&mut self, blocks: u32) { + cheatcodes::advance_blocks(blocks); + } + + fn public(self) -> PublicContext { + PublicContext::empty() + } + + fn private(&mut self) -> PrivateContext { + self.private_at(cheatcodes::get_block_number()) + } + + fn private_at(&mut self, historical_block_number: u32) -> PrivateContext { + if historical_block_number >= cheatcodes::get_block_number() { + self.advance_block_to(historical_block_number + 1); + } + + let mut inputs = cheatcodes::get_private_context_inputs(historical_block_number); + + PrivateContext::new(inputs, 0) + } + + fn create_account(self) -> AztecAddress { + let test_account = cheatcodes::create_account(); + let address = test_account.address; + let keys = test_account.keys; + + keys::store_master_key(NULLIFIER_INDEX, address, keys.npk_m); + keys::store_master_key(INCOMING_INDEX, address, keys.ivpk_m); + keys::store_master_key(OUTGOING_INDEX, address, keys.ovpk_m); + keys::store_master_key(TAGGING_INDEX, address, keys.tpk_m); + + test_account.address + } + + fn create_account_contract(self, secret: Field) -> AztecAddress { + let public_keys = cheatcodes::derive_keys(secret); + let args = &[public_keys.ivpk_m.x, public_keys.ivpk_m.y]; + let address = cheatcodes::deploy( + "@aztec/noir-contracts.js/SchnorrAccount", + "constructor", + args, + public_keys.hash().to_field() + ); + cheatcodes::advance_blocks(1); + let test_account = cheatcodes::add_account(secret, PartialAddress::from_field(address.to_field())); + let address = test_account.address; + let keys = test_account.keys; + + keys::store_master_key(NULLIFIER_INDEX, address, keys.npk_m); + keys::store_master_key(INCOMING_INDEX, address, keys.ivpk_m); + keys::store_master_key(OUTGOING_INDEX, address, keys.ovpk_m); + keys::store_master_key(TAGGING_INDEX, address, keys.tpk_m); + + test_account.address + } + + fn deploy(self, path: str) -> Deployer { + Deployer { path, public_keys_hash: 0 } + } + + fn call_private( + self, + call_interface: C + ) -> T where C: CallInterface, T: Deserialize { + let original_fn = call_interface.get_original(); + let original_msg_sender = cheatcodes::get_msg_sender(); + let original_contract_address = cheatcodes::get_contract_address(); + let target_address = call_interface.get_contract_address(); + + cheatcodes::set_contract_address(target_address); + cheatcodes::set_msg_sender(original_contract_address); + let mut inputs = cheatcodes::get_private_context_inputs(cheatcodes::get_block_number() - 1); + inputs.call_context.function_selector = call_interface.get_selector(); + let public_inputs = original_fn(inputs); + + cheatcodes::set_contract_address(original_contract_address); + cheatcodes::set_msg_sender(original_msg_sender); + PackedReturns::new(public_inputs.returns_hash).unpack_into() + } + + fn call_private_void( + self, + call_interface: C + ) where C: CallInterface { + let original_fn = call_interface.get_original(); + let original_msg_sender = cheatcodes::get_msg_sender(); + let original_contract_address = cheatcodes::get_contract_address(); + let target_address = call_interface.get_contract_address(); + + cheatcodes::set_contract_address(target_address); + cheatcodes::set_msg_sender(original_contract_address); + let mut inputs = cheatcodes::get_private_context_inputs(cheatcodes::get_block_number() - 1); + inputs.call_context.function_selector = call_interface.get_selector(); + let public_inputs = original_fn(inputs); + + cheatcodes::set_contract_address(original_contract_address); + cheatcodes::set_msg_sender(original_msg_sender); + PackedReturns::new(public_inputs.returns_hash).assert_empty(); + } + + fn call_public(self, call_interface: C) -> T where C: CallInterface { + let original_fn = call_interface.get_original(); + let original_msg_sender = cheatcodes::get_msg_sender(); + let original_contract_address = cheatcodes::get_contract_address(); + let target_address = call_interface.get_contract_address(); + + cheatcodes::set_contract_address(target_address); + cheatcodes::set_msg_sender(original_contract_address); + let mut inputs = cheatcodes::get_public_context_inputs(); + inputs.selector = call_interface.get_selector().to_field(); + inputs.args_hash = hash_args(call_interface.get_args()); + let result = original_fn(inputs); + + cheatcodes::set_contract_address(original_contract_address); + cheatcodes::set_msg_sender(original_msg_sender); + result + } + + fn call_public_void(self, call_interface: C) where C: CallInterface { + let original_fn = call_interface.get_original(); + let original_msg_sender = cheatcodes::get_msg_sender(); + let original_contract_address = cheatcodes::get_contract_address(); + let target_address = call_interface.get_contract_address(); + + cheatcodes::set_contract_address(target_address); + cheatcodes::set_msg_sender(original_contract_address); + let mut inputs = cheatcodes::get_public_context_inputs(); + inputs.selector = call_interface.get_selector().to_field(); + inputs.args_hash = hash_args(call_interface.get_args()); + original_fn(inputs); + + cheatcodes::set_contract_address(original_contract_address); + cheatcodes::set_msg_sender(original_msg_sender); + } + + pub fn store_note_in_cache( + self, + note: &mut Note, + storage_slot: Field, + contract_address: AztecAddress + ) where Note: NoteInterface { + let original_contract_address = cheatcodes::get_contract_address(); + cheatcodes::set_contract_address(contract_address); + let note_hash_counter = cheatcodes::get_side_effects_counter(); + + let header = NoteHeader { contract_address, storage_slot, nonce: 0, note_hash_counter }; + // TODO: change this to note.set_header(header) once https://github.com/noir-lang/noir/issues/4095 is fixed + Note::set_header(note, header); + let inner_note_hash = compute_note_hash_for_insertion(*note); + + // TODO: Strong typing required because of https://github.com/noir-lang/noir/issues/4088 + let serialized_note: [Field; N] = Note::serialize_content(*note); + assert( + notify_created_note( + storage_slot, + Note::get_note_type_id(), + serialized_note, + inner_note_hash, + note_hash_counter + ) + == 0 + ); + cheatcodes::set_contract_address(original_contract_address); + } +} diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/types.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/types.nr new file mode 100644 index 00000000000..7baec3523d8 --- /dev/null +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/types.nr @@ -0,0 +1,110 @@ +use dep::protocol_types::{ + traits::{Deserialize, Serialize}, address::AztecAddress, + abis::{function_selector::FunctionSelector, private_circuit_public_inputs::PrivateCircuitPublicInputs} +}; + +use crate::context::inputs::{PublicContextInputs, PrivateContextInputs}; +use crate::context::call_interfaces::CallInterface; +use crate::test::helpers::cheatcodes; +use crate::keys::public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}; +use crate::hash::hash_args; + +struct Deployer { + path: str, + public_keys_hash: Field + } + +impl Deployer { + pub fn with_private_initializer( + self, + call_interface: C + ) -> AztecAddress where C: CallInterface { + let address = cheatcodes::deploy( + self.path, + call_interface.get_name(), + call_interface.get_args(), + self.public_keys_hash + ); + cheatcodes::advance_blocks(1); + let block_number = cheatcodes::get_block_number(); + let original_fn = call_interface.get_original(); + let original_msg_sender = cheatcodes::get_msg_sender(); + let original_contract_address = cheatcodes::get_contract_address(); + + cheatcodes::set_contract_address(address); + cheatcodes::set_msg_sender(original_contract_address); + let mut inputs = cheatcodes::get_private_context_inputs(block_number - 1); + inputs.call_context.function_selector = call_interface.get_selector(); + let _result = original_fn(inputs); + + cheatcodes::set_contract_address(original_contract_address); + cheatcodes::set_msg_sender(original_msg_sender); + address + } + + pub fn with_public_initializer( + self, + call_interface: C + ) -> AztecAddress where C: CallInterface { + let address = cheatcodes::deploy( + self.path, + call_interface.get_name(), + call_interface.get_args(), + self.public_keys_hash + ); + cheatcodes::advance_blocks(1); + let original_fn = call_interface.get_original(); + let original_msg_sender = cheatcodes::get_msg_sender(); + let original_contract_address = cheatcodes::get_contract_address(); + + cheatcodes::set_contract_address(address); + cheatcodes::set_msg_sender(original_contract_address); + let mut inputs = cheatcodes::get_public_context_inputs(); + inputs.selector = call_interface.get_selector().to_field(); + inputs.args_hash = hash_args(call_interface.get_args()); + let _result: T = original_fn(inputs); + + cheatcodes::set_contract_address(original_contract_address); + cheatcodes::set_msg_sender(original_msg_sender); + address + } + + pub fn without_initializer(self) -> AztecAddress { + let address = cheatcodes::deploy(self.path, "", &[], self.public_keys_hash); + address + } +} + +// Keys length + address +global TEST_ACCOUNT_LENGTH = PUBLIC_KEYS_LENGTH + 1; + +struct TestAccount { + address: AztecAddress, + keys: PublicKeys +} + +impl Serialize for TestAccount { + fn serialize(self) -> [Field; TEST_ACCOUNT_LENGTH] { + let mut output = [0; TEST_ACCOUNT_LENGTH]; + + output[0] = self.address.to_field(); + + for i in 0..PUBLIC_KEYS_LENGTH { + output[i+1] = self.keys.serialize()[i]; + } + output + } +} + +impl Deserialize for TestAccount { + fn deserialize(input: [Field; TEST_ACCOUNT_LENGTH]) -> Self { + let address = AztecAddress::from_field(input[0]); + let mut key_buffer = [0; PUBLIC_KEYS_LENGTH]; + for i in 0..PUBLIC_KEYS_LENGTH { + key_buffer[i] = input[i+1]; + } + let keys = PublicKeys::deserialize(key_buffer); + + Self { address, keys } + } +} diff --git a/noir-projects/aztec-nr/aztec/src/test/mocks.nr b/noir-projects/aztec-nr/aztec/src/test/mocks.nr index fb8ef27c7bf..148cc284a9f 100644 --- a/noir-projects/aztec-nr/aztec/src/test/mocks.nr +++ b/noir-projects/aztec-nr/aztec/src/test/mocks.nr @@ -1 +1,2 @@ mod mock_note; +mod mock_struct; diff --git a/noir-projects/aztec-nr/aztec/src/test/mocks/mock_struct.nr b/noir-projects/aztec-nr/aztec/src/test/mocks/mock_struct.nr new file mode 100644 index 00000000000..1a0ed1a304e --- /dev/null +++ b/noir-projects/aztec-nr/aztec/src/test/mocks/mock_struct.nr @@ -0,0 +1,36 @@ +use dep::protocol_types::traits::{Eq, Serialize, Deserialize}; + +struct MockStruct { + a: Field, + b: Field, +} + +impl MockStruct { + fn new(a: Field, b: Field) -> Self { + Self { a, b } + } +} + +impl Eq for MockStruct { + fn eq(self, other: Self) -> bool { + (self.a == other.a) & (self.b == other.b) + } +} + +impl Serialize<2> for MockStruct { + fn serialize(self) -> [Field; 2] { + [self.a, self.b] + } +} + +impl Deserialize<2> for MockStruct { + fn deserialize(fields: [Field; 2]) -> Self { + Self { a: fields[0], b: fields[1] } + } +} + +#[test] +fn test_serde() { + let val = MockStruct::new(5, 6); + assert_eq(val, MockStruct::deserialize(val.serialize())); +} diff --git a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr index 43bfe011063..6a34f458cce 100644 --- a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr @@ -56,7 +56,7 @@ contract Child { let owner_npk_m_hash = header.get_npk_m_hash(&mut context, owner); let mut note = ValueNote::new(new_value, owner_npk_m_hash); - storage.a_map_with_private_values.at(owner).insert(&mut note).emit(encode_and_encrypt(&mut context, context.msg_sender(), owner)); + storage.a_map_with_private_values.at(owner).insert(&mut note).emit(encode_and_encrypt(&mut context, owner, owner)); new_value } diff --git a/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr b/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr index cf2a235e798..e296d211aab 100644 --- a/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr @@ -37,4 +37,29 @@ contract Counter { balance_utils::get_balance(counters.at(owner).set) } // docs:end:get_counter + + use dep::aztec::test::{helpers::{cheatcodes, test_environment::TestEnvironment}}; + use dep::aztec::protocol_types::storage::map::derive_storage_slot_in_map; + use dep::aztec::note::note_getter::{MAX_NOTES_PER_PAGE, view_notes}; + use dep::aztec::note::note_viewer_options::NoteViewerOptions; + + #[test] + fn test_initialize() { + // Setup env, generate keys + let mut env = TestEnvironment::new(); + let owner = env.create_account(); + let outgoing_viewer = env.create_account(); + + // Deploy contract and initialize + let initializer = Counter::interface().initialize(5, owner, outgoing_viewer); + let contract_address = env.deploy("@aztec/noir-contracts.js/Counter").with_private_initializer(initializer); + // Read the stored value in the note + + cheatcodes::set_contract_address(contract_address); + let counter_slot = Counter::storage().counters.slot; + let owner_slot = derive_storage_slot_in_map(counter_slot, owner); + let mut options = NoteViewerOptions::new(); + let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(owner_slot, options); + assert(opt_notes[0].unwrap().value == 5); + } } diff --git a/noir-projects/noir-contracts/contracts/parent_contract/Nargo.toml b/noir-projects/noir-contracts/contracts/parent_contract/Nargo.toml index 53a4d614564..a91d3bd758c 100644 --- a/noir-projects/noir-contracts/contracts/parent_contract/Nargo.toml +++ b/noir-projects/noir-contracts/contracts/parent_contract/Nargo.toml @@ -6,3 +6,5 @@ type = "contract" [dependencies] aztec = { path = "../../../aztec-nr/aztec" } +child_contract = { path = "../child_contract" } +value_note = { path = "../../../aztec-nr/value-note" } diff --git a/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr b/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr index fb066de5ad6..e6901b1a319 100644 --- a/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr @@ -242,4 +242,49 @@ contract Parent { // Call the target private function context.static_call_public_function(target_contract, target_selector, args); } + + use dep::aztec::test::{helpers::{cheatcodes, test_environment::TestEnvironment}}; + use dep::aztec::protocol_types::storage::map::derive_storage_slot_in_map; + use dep::aztec::note::note_getter::{MAX_NOTES_PER_PAGE, view_notes}; + use dep::aztec::note::note_viewer_options::NoteViewerOptions; + use dep::child_contract::Child; + use dep::value_note::value_note::ValueNote; + + #[test] + fn test_private_call() { + // Setup env, generate keys + let mut env = TestEnvironment::new(); + let owner = env.create_account(); + + // Deploy child contract + let child_contract_address = env.deploy("@aztec/noir-contracts.js/Child").without_initializer(); + cheatcodes::advance_blocks(1); + + // Set value in child through parent + let value_to_set = 7; + let parent_private_set_call_interface = Parent::interface().private_call( + child_contract_address, + FunctionSelector::from_signature("private_set_value(Field,(Field))"), + [value_to_set, owner.to_field()] + ); + let result: Field = env.call_private(parent_private_set_call_interface); + assert(result == value_to_set); + // Read the stored value in the note. We have to change the contract address to the child contract in order to read its notes + cheatcodes::set_contract_address(child_contract_address); + let counter_slot = Child::storage().a_map_with_private_values.slot; + let owner_slot = derive_storage_slot_in_map(counter_slot, owner); + let mut options = NoteViewerOptions::new(); + let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(owner_slot, options); + let note_value = opt_notes[0].unwrap().value; + assert(note_value == value_to_set); + assert(note_value == result); + // Get value from child through parent + let parent_private_get_call_interface = Parent::interface().private_call( + child_contract_address, + FunctionSelector::from_signature("private_get_value(Field,(Field))"), + [7, owner.to_field()] + ); + let read_result: Field = env.call_private(parent_private_get_call_interface); + assert(note_value == read_result); + } } diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index c68563ec1b1..79046b74aa0 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -486,12 +486,12 @@ contract Test { // This function is used in the e2e_state_vars to test the SharedMutablePrivateGetter in isolation #[aztec(private)] - fn test_shared_mutable_private_getter( + fn test_shared_mutable_private_getter( contract_address_to_read: AztecAddress, storage_slot_of_shared_mutable: Field - ) -> Field where T: FromField, T: ToField { + ) -> Field { // It's a bit wonky because we need to know the delay for get_current_value_in_private to work correctly - let test: SharedMutablePrivateGetter = SharedMutablePrivateGetter::new( + let test: SharedMutablePrivateGetter = SharedMutablePrivateGetter::new( &mut context, contract_address_to_read, storage_slot_of_shared_mutable diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr index 4c6db0c5d4d..fca6ed10b8f 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr @@ -395,5 +395,75 @@ contract Token { storage.balances.balance_of(owner).to_field() } // docs:end:balance_of_private + + use dep::aztec::test::{helpers::{cheatcodes, test_environment::TestEnvironment}}; + use dep::aztec::protocol_types::storage::map::derive_storage_slot_in_map; + use dep::aztec::note::note_getter::{MAX_NOTES_PER_PAGE, view_notes}; + use dep::aztec::note::note_viewer_options::NoteViewerOptions; + + #[test] + fn test_private_transfer() { + // Setup env, generate keys + let mut env = TestEnvironment::new(); + let owner = env.create_account(); + let recipient = env.create_account(); + let mint_amount = 10000; + + // Start the test in the account contract address + cheatcodes::set_contract_address(owner); + + // Deploy token contract + let initializer_call_interface = Token::interface().constructor( + owner, + "TestToken0000000000000000000000", + "TT00000000000000000000000000000", + 18 + ); + let token_contract_address = env.deploy("@aztec/noir-contracts.js/Token").with_public_initializer(initializer_call_interface); + env.advance_block_by(1); + + // Mint some tokens + let secret = 1; + let secret_hash = compute_secret_hash(secret); + let mint_private_call_interface = Token::at(token_contract_address).mint_private(mint_amount, secret_hash); + env.call_public(mint_private_call_interface); + + // Time travel so we can read keys from the registry + env.advance_block_by(6); + + // Store a note in the cache so we can redeem it + env.store_note_in_cache( + &mut TransparentNote::new(mint_amount, secret_hash), + Token::storage().pending_shields.slot, + token_contract_address + ); + + // Redeem our shielded tokens + let redeem_shield_call_interface = Token::at(token_contract_address).redeem_shield(owner, mint_amount, secret); + env.call_private_void(redeem_shield_call_interface); + + // Not really sure why this is needed? Nullifier inclusion in contract initializer fails otherwise. + // If it were to fail, it should do it at line 443, investigation required + env.advance_block_by(1); + + // Transfer tokens + let transfer_amount = 1000; + let private_token_transfer_call_interface = Token::at(token_contract_address).transfer(recipient, transfer_amount); + env.call_private_void(private_token_transfer_call_interface); + + // Check balances + cheatcodes::set_contract_address(token_contract_address); + + let balances_slot = Token::storage().balances.slot; + let recipient_slot = derive_storage_slot_in_map(balances_slot, recipient); + let mut options = NoteViewerOptions::new(); + let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(recipient_slot, options); + assert(opt_notes[0].unwrap().amount.to_field() == transfer_amount); + + let owner_slot = derive_storage_slot_in_map(balances_slot, owner); + let mut options = NoteViewerOptions::new(); + let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(owner_slot, options); + assert(opt_notes[0].unwrap().amount.to_field() == mint_amount - transfer_amount); + } } // docs:end:token_all \ No newline at end of file diff --git a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr index d00374bb4e4..3bf3f00fb1b 100644 --- a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr @@ -21,14 +21,14 @@ contract Uniswap { struct Storage { portal_address: SharedImmutable, } - + #[aztec(public)] #[aztec(initializer)] fn constructor(portal_address: EthAddress) { storage.portal_address.initialize(portal_address); } // docs:end:uniswap_setup - + // docs:start:swap_public #[aztec(public)] fn swap_public( diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr b/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr index bce2078479a..01af1206fec 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr @@ -110,4 +110,10 @@ impl Serialize for str { trait Deserialize { fn deserialize(fields: [Field; N]) -> Self; } -// docs:end:deserialize \ No newline at end of file +// docs:end:deserialize + +impl Deserialize for [Field; N] { + fn deserialize(fields: [Field; N]) -> Self { + fields + } +} diff --git a/noir/noir-repo/aztec_macros/src/lib.rs b/noir/noir-repo/aztec_macros/src/lib.rs index a36b7b17d09..d79c7b190ed 100644 --- a/noir/noir-repo/aztec_macros/src/lib.rs +++ b/noir/noir-repo/aztec_macros/src/lib.rs @@ -65,14 +65,8 @@ fn transform( // Usage -> mut ast -> aztec_library::transform(&mut ast) // Covers all functions in the ast for submodule in ast.submodules.iter_mut().filter(|submodule| submodule.is_contract) { - if transform_module( - crate_id, - &file_id, - context, - &mut submodule.contents, - submodule.name.0.contents.as_str(), - ) - .map_err(|err| (err.into(), file_id))? + if transform_module(&file_id, &mut submodule.contents, submodule.name.0.contents.as_str()) + .map_err(|err| (err.into(), file_id))? { check_for_aztec_dependency(crate_id, context)?; } @@ -87,9 +81,7 @@ fn transform( /// For annotated functions it calls the `transform` function which will perform the required transformations. /// Returns true if an annotated node is found, false otherwise fn transform_module( - crate_id: &CrateId, file_id: &FileId, - context: &HirContext, module: &mut SortedModule, module_name: &str, ) -> Result { @@ -106,12 +98,7 @@ fn transform_module( if !check_for_storage_implementation(module, storage_struct_name) { generate_storage_implementation(module, storage_struct_name)?; } - // Make sure we're only generating the storage layout for the root crate - // In case we got a contract importing other contracts for their interface, we - // don't want to generate the storage layout for them - if crate_id == context.root_crate_id() { - generate_storage_layout(module, storage_struct_name.clone())?; - } + generate_storage_layout(module, storage_struct_name.clone(), module_name)?; } for structure in module.types.iter_mut() { @@ -219,7 +206,7 @@ fn transform_module( }); } - generate_contract_interface(module, module_name, &stubs)?; + generate_contract_interface(module, module_name, &stubs, storage_defined)?; } Ok(has_transformed_module) diff --git a/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs b/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs index 90f9ce6164a..1875ab0b252 100644 --- a/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs +++ b/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs @@ -61,11 +61,7 @@ pub fn stub_function(aztec_visibility: &str, func: &NoirFunction, is_static_call let parameters = func.parameters(); let is_void = if matches!(fn_return_type.typ, UnresolvedTypeData::Unit) { "Void" } else { "" }; let is_static = if is_static_call { "Static" } else { "" }; - let return_type_hint = if is_void == "Void" { - "".to_string() - } else { - format!("<{}>", fn_return_type.typ.to_string().replace("plain::", "")) - }; + let return_type_hint = fn_return_type.typ.to_string().replace("plain::", ""); let call_args = parameters .iter() .map(|arg| { @@ -73,22 +69,67 @@ pub fn stub_function(aztec_visibility: &str, func: &NoirFunction, is_static_call match &arg.typ.typ { UnresolvedTypeData::Array(_, typ) => { format!( - "let hash_{0} = {0}.map(|x: {1}| x.serialize()); - for i in 0..{0}.len() {{ - args_acc = args_acc.append(hash_{0}[i].as_slice()); - }}\n", + "let serialized_{0} = {0}.map(|x: {1}| x.serialize()); + for i in 0..{0}.len() {{ + args_acc = args_acc.append(serialized_{0}[i].as_slice()); + }}\n", param_name, typ.typ.to_string().replace("plain::", "") ) } - _ => { + UnresolvedTypeData::Named(_, _, _) | UnresolvedTypeData::String(_) => { format!("args_acc = args_acc.append({}.serialize().as_slice());\n", param_name) } + _ => { + format!("args_acc = args_acc.append(&[{}.to_field()]);\n", param_name) + } } }) .collect::>() .join(""); - if aztec_visibility != "Public" { + + let param_types = if !parameters.is_empty() { + parameters + .iter() + .map(|param| param.pattern.name_ident().0.contents.clone()) + .collect::>() + .join(", ") + } else { + "".to_string() + }; + + let original = format!( + "| inputs: dep::aztec::context::inputs::{}ContextInputs | -> {} {{ + {}(inputs{}) + }}", + aztec_visibility, + if aztec_visibility == "Private" { + "dep::aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs".to_string() + } else { + return_type_hint.clone() + }, + fn_name, + if param_types.is_empty() { "".to_string() } else { format!(" ,{} ", param_types) } + ); + let arg_types = format!( + "({}{})", + parameters + .iter() + .map(|param| param.typ.typ.to_string().replace("plain::", "")) + .collect::>() + .join(","), + // In order to distinguish between a single element Tuple (Type,) and a single type with unnecessary parenthesis around it (Type), + // The latter gets simplified to Type, that is NOT a valid env + if parameters.len() == 1 { "," } else { "" } + ); + + let generics = if is_void == "Void" { + format!("{}>", arg_types) + } else { + format!("{}, {}>", return_type_hint, arg_types) + }; + + let fn_body = if aztec_visibility != "Public" { let args_hash = if !parameters.is_empty() { format!( "let mut args_acc: [Field] = &[]; @@ -98,23 +139,25 @@ pub fn stub_function(aztec_visibility: &str, func: &NoirFunction, is_static_call call_args ) } else { - "let args_hash = 0;".to_string() + " + let mut args_acc: [Field] = &[]; + let args_hash = 0; + " + .to_string() }; - let fn_body = format!( - "{} - dep::aztec::context::{}{}{}CallInterface {{ - target_contract: self.target_contract, - selector: {}, - args_hash, - }}", - args_hash, aztec_visibility, is_static, is_void, fn_selector, - ); format!( - "pub fn {}(self, {}) -> dep::aztec::context::{}{}{}CallInterface{} {{ - {} - }}", - fn_name, fn_parameters, aztec_visibility, is_static, is_void, return_type_hint, fn_body + "{} + let selector = {}; + dep::aztec::context::{}{}{}CallInterface {{ + target_contract: self.target_contract, + selector, + name: \"{}\", + args_hash, + args: args_acc, + original: {} + }}", + args_hash, fn_selector, aztec_visibility, is_static, is_void, fn_name, original ) } else { let args = format!( @@ -123,23 +166,34 @@ pub fn stub_function(aztec_visibility: &str, func: &NoirFunction, is_static_call ", call_args ); - let fn_body = format!( + format!( "{} - dep::aztec::context::Public{}{}CallInterface {{ + let selector = {}; + dep::aztec::context::{}{}{}CallInterface {{ target_contract: self.target_contract, - selector: {}, + selector, + name: \"{}\", args: args_acc, gas_opts: dep::aztec::context::gas::GasOpts::default(), + original: {} }}", - args, is_static, is_void, fn_selector, - ); - format!( - "pub fn {}(self, {}) -> dep::aztec::context::Public{}{}CallInterface{} {{ - {} - }}", - fn_name, fn_parameters, is_static, is_void, return_type_hint, fn_body + args, fn_selector, aztec_visibility, is_static, is_void, fn_name, original ) - } + }; + + format!( + "pub fn {}(self, {}) -> dep::aztec::context::{}{}{}CallInterface<{},{} {{ + {} + }}", + fn_name, + fn_parameters, + aztec_visibility, + is_static, + is_void, + fn_name.len(), + generics, + fn_body + ) } // Generates the contract interface as a struct with an `at` function that holds the stubbed functions and provides @@ -149,7 +203,15 @@ pub fn generate_contract_interface( module: &mut SortedModule, module_name: &str, stubs: &[(String, Location)], + has_storage_layout: bool, ) -> Result<(), AztecMacroError> { + let storage_layout_getter = format!( + "#[contract_library_method] + pub fn storage() -> StorageLayout {{ + {}_STORAGE_LAYOUT + }}", + module_name, + ); let contract_interface = format!( " struct {0} {{ @@ -164,6 +226,12 @@ pub fn generate_contract_interface( ) -> Self {{ Self {{ target_contract }} }} + + pub fn interface() -> Self {{ + Self {{ target_contract: dep::aztec::protocol_types::address::AztecAddress::zero() }} + }} + + {2} }} #[contract_library_method] @@ -172,9 +240,18 @@ pub fn generate_contract_interface( ) -> {0} {{ {0} {{ target_contract }} }} + + #[contract_library_method] + pub fn interface() -> {0} {{ + {0} {{ target_contract: dep::aztec::protocol_types::address::AztecAddress::zero() }} + }} + + {3} ", module_name, stubs.iter().map(|(src, _)| src.to_owned()).collect::>().join("\n"), + if has_storage_layout { storage_layout_getter.clone() } else { "".to_string() }, + if has_storage_layout { format!("#[contract_library_method]\n{}", storage_layout_getter) } else { "".to_string() } ); let (contract_interface_ast, errors) = parse_program(&contract_interface); @@ -191,7 +268,7 @@ pub fn generate_contract_interface( .iter() .enumerate() .map(|(i, (method, orig_span))| { - if method.name() == "at" { + if method.name() == "at" || method.name() == "interface" || method.name() == "storage" { (method.clone(), *orig_span) } else { let (_, new_location) = stubs[i]; @@ -205,7 +282,9 @@ pub fn generate_contract_interface( module.types.push(contract_interface_ast.types.pop().unwrap()); module.impls.push(impl_with_locations); - module.functions.push(contract_interface_ast.functions.pop().unwrap()); + for function in contract_interface_ast.functions { + module.functions.push(function); + } Ok(()) } @@ -244,7 +323,7 @@ pub fn update_fn_signatures_in_contract_interface( let name = context.def_interner.function_name(func_id); let fn_parameters = &context.def_interner.function_meta(func_id).parameters.clone(); - if name == "at" { + if name == "at" || name == "interface" || name == "storage" { continue; } @@ -257,42 +336,29 @@ pub fn update_fn_signatures_in_contract_interface( .collect::>(), ); let hir_func = context.def_interner.function(func_id).block(&context.def_interner); - let call_interface_constructor_statement = context.def_interner.statement( - hir_func - .statements() - .last() - .ok_or((AztecMacroError::AztecDepNotFound, file_id))?, + + let function_selector_statement = context.def_interner.statement( + hir_func.statements().get(hir_func.statements().len() - 2).ok_or(( + AztecMacroError::CouldNotGenerateContractInterface { + secondary_message: Some( + "Function signature statement not found, invalid body length" + .to_string(), + ), + }, + file_id, + ))?, ); - let call_interface_constructor_expression = - match call_interface_constructor_statement { - HirStatement::Expression(expression_id) => { - match context.def_interner.expression(&expression_id) { - HirExpression::Constructor(hir_constructor_expression) => { - Ok(hir_constructor_expression) - } - _ => Err(( - AztecMacroError::CouldNotGenerateContractInterface { - secondary_message: Some( - "CallInterface constructor statement must be a constructor expression" - .to_string(), - ), - }, - file_id, - )), - } - } - _ => Err(( - AztecMacroError::CouldNotGenerateContractInterface { - secondary_message: Some( - "CallInterface constructor statement must be an expression" - .to_string(), - ), - }, - file_id, - )), - }?; - let (_, function_selector_expression_id) = - call_interface_constructor_expression.fields[1]; + let function_selector_expression_id = match function_selector_statement { + HirStatement::Let(let_statement) => Ok(let_statement.expression), + _ => Err(( + AztecMacroError::CouldNotGenerateContractInterface { + secondary_message: Some( + "Function selector statement must be an expression".to_string(), + ), + }, + file_id, + )), + }?; let function_selector_expression = context.def_interner.expression(&function_selector_expression_id); diff --git a/noir/noir-repo/aztec_macros/src/transforms/storage.rs b/noir/noir-repo/aztec_macros/src/transforms/storage.rs index a1c21c7efcf..bac87502c7d 100644 --- a/noir/noir-repo/aztec_macros/src/transforms/storage.rs +++ b/noir/noir-repo/aztec_macros/src/transforms/storage.rs @@ -497,6 +497,7 @@ pub fn assign_storage_slots( pub fn generate_storage_layout( module: &mut SortedModule, storage_struct_name: String, + module_name: &str, ) -> Result<(), AztecMacroError> { let definition = module .types @@ -504,33 +505,28 @@ pub fn generate_storage_layout( .find(|r#struct| r#struct.name.0.contents == *storage_struct_name) .unwrap(); - let mut generic_args = vec![]; let mut storable_fields = vec![]; let mut storable_fields_impl = vec![]; - definition.fields.iter().enumerate().for_each(|(index, (field_ident, field_type))| { - storable_fields.push(format!("{}: dep::aztec::prelude::Storable", field_ident, index)); - generic_args.push(format!("N{}", index)); - storable_fields_impl.push(format!( - "{}: dep::aztec::prelude::Storable {{ slot: 0, typ: \"{}\" }}", - field_ident, - field_type.to_string().replace("plain::", "") - )); + definition.fields.iter().for_each(|(field_ident, _)| { + storable_fields.push(format!("{}: dep::aztec::prelude::Storable", field_ident)); + storable_fields_impl + .push(format!("{}: dep::aztec::prelude::Storable {{ slot: 0 }}", field_ident,)); }); let storage_fields_source = format!( " - struct StorageLayout<{}> {{ + struct StorageLayout {{ {} }} #[abi(storage)] - global STORAGE_LAYOUT = StorageLayout {{ + global {}_STORAGE_LAYOUT = StorageLayout {{ {} }}; ", - generic_args.join(", "), storable_fields.join(",\n"), + module_name, storable_fields_impl.join(",\n") ); diff --git a/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs b/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs index 7ecea5c9eac..6dfd575d2b2 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -241,7 +241,9 @@ impl<'interner> Monomorphizer<'interner> { Definition::Oracle(opcode.to_string()) } FunctionKind::Recursive => { - unreachable!("Only main can be specified as recursive, which should already be checked"); + let id = + self.queue_function(id, expr_id, typ, turbofish_generics, trait_method); + Definition::Function(id) } } } diff --git a/noir/noir-repo/docs/docs/how_to/how-to-oracles.md b/noir/noir-repo/docs/docs/how_to/how-to-oracles.md index 62ead1f534f..64d984c8cf9 100644 --- a/noir/noir-repo/docs/docs/how_to/how-to-oracles.md +++ b/noir/noir-repo/docs/docs/how_to/how-to-oracles.md @@ -141,10 +141,10 @@ server.addMethod("resolve_function_call", async (params) => { if params.function !== "getSqrt" { throw Error("Unexpected foreign call") }; - const values = params.inputs[0].Array.map((field) => { + const values = params.inputs[0].map((field) => { return `${Math.sqrt(parseInt(field, 16))}`; }); - return { values: [{ Array: values }] }; + return { values }; }); ``` @@ -232,9 +232,9 @@ const foreignCallHandler = async (name, input) => { // notice that the "inputs" parameter contains *all* the inputs // in this case we to make the RPC request with the first parameter "numbers", which would be input[0] const oracleReturn = await client.request(name, [ - { Array: input[0].map((i) => i.toString("hex")) }, + input[0].map((i) => i.toString("hex")), ]); - return [oracleReturn.values[0].Array]; + return { values: oracleReturn }; }; // the rest of your NoirJS code diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 14b724a28b5..f39379e20a1 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -115,6 +115,19 @@ rollup-verifier-contract: RUN --entrypoint write-contract -c RootRollupArtifact -n UltraVerifier.sol SAVE ARTIFACT /usr/src/bb /usr/src/bb +txe: + FROM +build + RUN yarn workspaces focus @aztec/txe --production && yarn cache clean + # Remove a bunch of stuff that we don't need that takes up space. + RUN rm -rf \ + ../noir-projects \ + ../l1-contracts \ + ../barretenberg/ts/src \ + ../barretenberg/ts/dest/node-cjs \ + ../barretenberg/ts/dest/browser \ + **/artifacts + SAVE ARTIFACT /usr/src /usr/src + aztec-prod: FROM +build RUN yarn workspaces focus @aztec/aztec @aztec/builder --production && yarn cache clean diff --git a/yarn-project/archiver/src/archiver/index.ts b/yarn-project/archiver/src/archiver/index.ts index a7294537624..81aa8727e17 100644 --- a/yarn-project/archiver/src/archiver/index.ts +++ b/yarn-project/archiver/src/archiver/index.ts @@ -3,3 +3,4 @@ export * from './config.js'; export { MemoryArchiverStore } from './memory_archiver_store/memory_archiver_store.js'; export { ArchiverDataStore } from './archiver_store.js'; export { KVArchiverDataStore } from './kv_archiver_store/kv_archiver_store.js'; +export { ContractInstanceStore } from './kv_archiver_store/contract_instance_store.js'; diff --git a/yarn-project/builder/src/contract-interface-gen/typescript.ts b/yarn-project/builder/src/contract-interface-gen/typescript.ts index 614cc21e631..2a51d433bc9 100644 --- a/yarn-project/builder/src/contract-interface-gen/typescript.ts +++ b/yarn-project/builder/src/contract-interface-gen/typescript.ts @@ -194,10 +194,9 @@ function generateStorageLayoutGetter(input: ContractArtifact) { const storageFieldsUnionType = entries.map(([name]) => `'${name}'`).join(' | '); const layout = entries .map( - ([name, { slot, typ }]) => + ([name, { slot }]) => `${name}: { slot: new Fr(${slot.toBigInt()}n), - typ: "${typ}", }`, ) .join(',\n'); diff --git a/yarn-project/circuits.js/src/contract/contract_instance.ts b/yarn-project/circuits.js/src/contract/contract_instance.ts index 1d45791cdab..3168be0ce0c 100644 --- a/yarn-project/circuits.js/src/contract/contract_instance.ts +++ b/yarn-project/circuits.js/src/contract/contract_instance.ts @@ -1,11 +1,20 @@ -import { type ContractArtifact, type FunctionArtifact, getDefaultInitializer } from '@aztec/foundation/abi'; +import { + type ContractArtifact, + type FunctionArtifact, + FunctionSelector, + getDefaultInitializer, +} from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type ContractInstance, type ContractInstanceWithAddress } from '@aztec/types/contracts'; import { getContractClassFromArtifact } from '../contract/contract_class.js'; import { computeContractClassId } from '../contract/contract_class_id.js'; -import { computeContractAddressFromInstance, computeInitializationHash } from './contract_address.js'; +import { + computeContractAddressFromInstance, + computeInitializationHash, + computeInitializationHashFromEncodedArgs, +} from './contract_address.js'; /** * Generates a Contract Instance from the deployment params. @@ -18,6 +27,7 @@ export function getContractInstanceFromDeployParams( opts: { constructorArtifact?: FunctionArtifact | string; constructorArgs?: any[]; + skipArgsDecoding?: boolean; salt?: Fr; publicKeysHash?: Fr; deployer?: AztecAddress; @@ -27,10 +37,15 @@ export function getContractInstanceFromDeployParams( const salt = opts.salt ?? Fr.random(); const constructorArtifact = getConstructorArtifact(artifact, opts.constructorArtifact); const deployer = opts.deployer ?? AztecAddress.ZERO; - const contractClass = getContractClassFromArtifact(artifact); const contractClassId = computeContractClassId(contractClass); - const initializationHash = computeInitializationHash(constructorArtifact, args); + const initializationHash = + constructorArtifact && opts?.skipArgsDecoding + ? computeInitializationHashFromEncodedArgs( + FunctionSelector.fromNameAndParameters(constructorArtifact?.name, constructorArtifact?.parameters), + args, + ) + : computeInitializationHash(constructorArtifact, args); const publicKeysHash = opts.publicKeysHash ?? Fr.ZERO; const instance: ContractInstance = { diff --git a/yarn-project/deploy_npm.sh b/yarn-project/deploy_npm.sh index f8d18abdac7..b7154d1226c 100755 --- a/yarn-project/deploy_npm.sh +++ b/yarn-project/deploy_npm.sh @@ -105,3 +105,4 @@ deploy_package p2p deploy_package prover-client deploy_package sequencer-client deploy_package aztec-node +deploy_package txe diff --git a/yarn-project/foundation/src/abi/abi.ts b/yarn-project/foundation/src/abi/abi.ts index 200e7b0088c..2b608086604 100644 --- a/yarn-project/foundation/src/abi/abi.ts +++ b/yarn-project/foundation/src/abi/abi.ts @@ -290,10 +290,6 @@ export type FieldLayout = { * Slot in which the field is stored. */ slot: Fr; - /** - * Type being stored at the slot (e.g., 'Map>') - */ - typ: string; }; /** diff --git a/yarn-project/package.json b/yarn-project/package.json index fa08f05b063..388c8f4d6df 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -51,6 +51,7 @@ "sequencer-client", "scripts", "types", + "txe", "world-state" ], "prettier": "@aztec/foundation/prettier", diff --git a/yarn-project/pxe/src/database/index.ts b/yarn-project/pxe/src/database/index.ts index 4685cc2f7a8..e01c1803241 100644 --- a/yarn-project/pxe/src/database/index.ts +++ b/yarn-project/pxe/src/database/index.ts @@ -1 +1,2 @@ export * from './pxe_database.js'; +export * from './kv_pxe_database.js'; diff --git a/yarn-project/pxe/src/index.ts b/yarn-project/pxe/src/index.ts index d7cf6d57253..7c62b24d3ff 100644 --- a/yarn-project/pxe/src/index.ts +++ b/yarn-project/pxe/src/index.ts @@ -9,3 +9,5 @@ export * from '@aztec/foundation/fields'; export * from '@aztec/foundation/eth-address'; export * from '@aztec/foundation/aztec-address'; export * from '@aztec/key-store'; +export * from './database/index.js'; +export { ContractDataOracle } from './contract_data_oracle/index.js'; diff --git a/yarn-project/simulator/src/client/execution_note_cache.ts b/yarn-project/simulator/src/client/execution_note_cache.ts index 325e0b8f80b..3615b012c99 100644 --- a/yarn-project/simulator/src/client/execution_note_cache.ts +++ b/yarn-project/simulator/src/client/execution_note_cache.ts @@ -63,7 +63,6 @@ export class ExecutionNoteCache { nullifiedNoteHashCounter = note.counter; this.newNotes.set(contractAddress.toBigInt(), notes); } - return nullifiedNoteHashCounter; } diff --git a/yarn-project/simulator/src/client/index.ts b/yarn-project/simulator/src/client/index.ts index 60fcf15d4a9..bb30eff1312 100644 --- a/yarn-project/simulator/src/client/index.ts +++ b/yarn-project/simulator/src/client/index.ts @@ -1,3 +1,5 @@ export * from './simulator.js'; export * from './db_oracle.js'; export * from './execution_result.js'; +export * from './pick_notes.js'; +export * from './execution_note_cache.js'; diff --git a/yarn-project/txe/.eslintrc.cjs b/yarn-project/txe/.eslintrc.cjs new file mode 100644 index 00000000000..e659927475c --- /dev/null +++ b/yarn-project/txe/.eslintrc.cjs @@ -0,0 +1 @@ +module.exports = require('@aztec/foundation/eslint'); diff --git a/yarn-project/txe/package.json b/yarn-project/txe/package.json new file mode 100644 index 00000000000..5658cd3b454 --- /dev/null +++ b/yarn-project/txe/package.json @@ -0,0 +1,82 @@ +{ + "name": "@aztec/txe", + "version": "0.0.0", + "type": "module", + "exports": "./dest/index.js", + "bin": "./dest/bin/index.js", + "typedocOptions": { + "entryPoints": [ + "./src/index.ts" + ], + "name": "TXE", + "tsconfig": "./tsconfig.json" + }, + "scripts": { + "build": "yarn clean && tsc -b", + "build:dev": "tsc -b --watch", + "clean": "rm -rf ./dest .tsbuildinfo", + "formatting": "run -T prettier --check ./src && run -T eslint ./src", + "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", + "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests", + "start": "DEBUG='aztec:*' && node ./dest/bin/index.js" + }, + "inherits": [ + "../package.common.json" + ], + "jest": { + "moduleNameMapper": { + "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" + }, + "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", + "rootDir": "./src", + "workerThreads": true, + "transform": { + "^.+\\.tsx?$": [ + "@swc/jest" + ] + }, + "extensionsToTreatAsEsm": [ + ".ts" + ], + "reporters": [ + [ + "default", + { + "summaryThreshold": 9999 + } + ] + ] + }, + "dependencies": { + "@aztec/archiver": "workspace:^", + "@aztec/aztec.js": "workspace:^", + "@aztec/circuit-types": "workspace:^", + "@aztec/circuits.js": "workspace:^", + "@aztec/foundation": "workspace:^", + "@aztec/key-store": "workspace:^", + "@aztec/kv-store": "workspace:^", + "@aztec/noir-contracts.js": "workspace:^", + "@aztec/pxe": "workspace:^", + "@aztec/simulator": "workspace:^", + "@aztec/types": "workspace:^", + "@aztec/world-state": "workspace:^" + }, + "devDependencies": { + "@jest/globals": "^29.5.0", + "@types/jest": "^29.5.0", + "@types/node": "^18.7.23", + "jest": "^29.5.0", + "jest-mock-extended": "^3.0.3", + "ts-node": "^10.9.1", + "typescript": "^5.0.4" + }, + "files": [ + "dest", + "src", + "!*.test.*" + ], + "types": "./dest/index.d.ts", + "engines": { + "node": ">=18" + } +} diff --git a/yarn-project/txe/src/bin/index.ts b/yarn-project/txe/src/bin/index.ts new file mode 100644 index 00000000000..14934762159 --- /dev/null +++ b/yarn-project/txe/src/bin/index.ts @@ -0,0 +1,86 @@ +#!/usr/bin/env -S node --no-warnings +import { JsonRpcServer } from '@aztec/foundation/json-rpc/server'; +import { type Logger, createDebugLogger } from '@aztec/foundation/log'; + +import http from 'http'; + +import { TXEService } from '../txe_service/txe_service.js'; +import { type ForeignCallResult, toForeignCallResult } from '../util/encoding.js'; + +const { TXE_PORT = 8080 } = process.env; + +const logger = createDebugLogger('aztec:txe_service'); + +const TXESessions = new Map(); + +type MethodNames = { + [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never; +}[keyof T]; + +type TXEForeignCallInput = { + session_id: number; + function: MethodNames | 'reset'; + inputs: any[]; +}; + +class TXEDispatcher { + constructor(private logger: Logger) {} + + // eslint-disable-next-line camelcase + async resolve_foreign_call({ + session_id: sessionId, + function: functionName, + inputs, + }: TXEForeignCallInput): Promise { + this.logger.debug( + `Calling ${functionName} with inputs: ${JSON.stringify(inputs, null, 2)} on session ${sessionId}`, + ); + + if (!TXESessions.has(sessionId) && functionName != 'reset') { + this.logger.debug(`Creating new session ${sessionId}`); + TXESessions.set(sessionId, await TXEService.init(logger)); + } + + if (functionName === 'reset') { + TXESessions.delete(sessionId) && + this.logger.debug(`Called reset on session ${sessionId}, yeeting it out of existence`); + return toForeignCallResult([]); + } else { + const txeService = TXESessions.get(sessionId); + const response = await (txeService as any)[functionName](...inputs); + this.logger.debug( + `${sessionId}:${functionName}(${JSON.stringify(inputs, null, 2)}) -> ${JSON.stringify(response, null, 2)}`, + ); + return response; + } + } +} + +/** + * Creates an http server that forwards calls to the TXE and starts it on the given port. + * @param txeService - TXE that answers queries to the created HTTP server. + * @param port - Port to listen in. + * @returns A running http server. + */ +export function startTXEHttpServer(dispatcher: TXEDispatcher, port: string | number): http.Server { + const txeServer = new JsonRpcServer(dispatcher, {}, {}, ['init']); + + const app = txeServer.getApp(); + const httpServer = http.createServer(app.callback()); + httpServer.listen(port); + + return httpServer; +} + +/** + * Create and start a new TXE HTTP Server + */ +function main() { + logger.info(`Setting up TXE...`); + + startTXEHttpServer(new TXEDispatcher(logger), TXE_PORT); + + logger.info(`TXE listening on port ${TXE_PORT}`); +} + +main(); diff --git a/yarn-project/txe/src/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts new file mode 100644 index 00000000000..09115f3ebab --- /dev/null +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -0,0 +1,596 @@ +import { + L1NotePayload, + MerkleTreeId, + Note, + type NoteStatus, + NullifierMembershipWitness, + PublicDataWitness, + PublicDataWrite, + TaggedLog, + type UnencryptedL2Log, +} from '@aztec/circuit-types'; +import { type CircuitWitnessGenerationStats } from '@aztec/circuit-types/stats'; +import { + type CompleteAddress, + FunctionData, + type Header, + type KeyValidationRequest, + NULLIFIER_SUBTREE_HEIGHT, + type NULLIFIER_TREE_HEIGHT, + type NullifierLeafPreimage, + PUBLIC_DATA_SUBTREE_HEIGHT, + type PUBLIC_DATA_TREE_HEIGHT, + PrivateCallStackItem, + PrivateCircuitPublicInputs, + PrivateContextInputs, + type PublicCallRequest, + PublicDataTreeLeaf, + type PublicDataTreeLeafPreimage, + computeContractClassId, + deriveKeys, + getContractClassFromArtifact, +} from '@aztec/circuits.js'; +import { Aes128 } from '@aztec/circuits.js/barretenberg'; +import { computePublicDataTreeLeafSlot, siloNoteHash, siloNullifier } from '@aztec/circuits.js/hash'; +import { type ContractArtifact, type FunctionAbi, FunctionSelector, countArgumentsSize } from '@aztec/foundation/abi'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { Fr, GrumpkinScalar, type Point } from '@aztec/foundation/fields'; +import { type Logger, applyStringFormatting } from '@aztec/foundation/log'; +import { Timer } from '@aztec/foundation/timer'; +import { type KeyStore } from '@aztec/key-store'; +import { ContractDataOracle } from '@aztec/pxe'; +import { + ExecutionError, + type ExecutionNoteCache, + type MessageLoadOracleInputs, + type NoteData, + Oracle, + type PackedValuesCache, + type TypedOracle, + acvm, + createSimulationError, + extractCallStack, + pickNotes, + toACVMWitness, + witnessMapToFields, +} from '@aztec/simulator'; +import { type ContractInstance, type ContractInstanceWithAddress } from '@aztec/types/contracts'; +import { MerkleTreeSnapshotOperationsFacade, type MerkleTrees } from '@aztec/world-state'; + +import { type TXEDatabase } from '../util/txe_database.js'; + +export class TXE implements TypedOracle { + private blockNumber = 0; + private sideEffectsCounter = 0; + private contractAddress: AztecAddress; + private msgSender: AztecAddress; + + private contractDataOracle: ContractDataOracle; + + constructor( + private logger: Logger, + private trees: MerkleTrees, + private packedValuesCache: PackedValuesCache, + private noteCache: ExecutionNoteCache, + private keyStore: KeyStore, + private txeDatabase: TXEDatabase, + ) { + this.contractDataOracle = new ContractDataOracle(txeDatabase); + this.contractAddress = AztecAddress.random(); + this.msgSender = AztecAddress.fromField(new Fr(0)); + } + + // Utils + + getMsgSender() { + return this.msgSender; + } + + setMsgSender(msgSender: Fr) { + this.msgSender = msgSender; + } + + getSideEffectsCounter() { + return this.sideEffectsCounter; + } + + setSideEffectsCounter(sideEffectsCounter: number) { + this.sideEffectsCounter = sideEffectsCounter; + } + + setContractAddress(contractAddress: AztecAddress) { + this.contractAddress = contractAddress; + } + + setBlockNumber(blockNumber: number) { + this.blockNumber = blockNumber; + } + + getTrees() { + return this.trees; + } + + getTXEDatabase() { + return this.txeDatabase; + } + + getKeyStore() { + return this.keyStore; + } + + async addContractInstance(contractInstance: ContractInstanceWithAddress) { + await this.txeDatabase.addContractInstance(contractInstance); + } + + async addContractArtifact(artifact: ContractArtifact) { + const contractClass = getContractClassFromArtifact(artifact); + await this.txeDatabase.addContractArtifact(computeContractClassId(contractClass), artifact); + } + + async getPrivateContextInputs(blockNumber: number, sideEffectsCounter = this.sideEffectsCounter) { + const trees = this.getTrees(); + const stateReference = await trees.getStateReference(true); + const inputs = PrivateContextInputs.empty(); + inputs.historicalHeader.globalVariables.blockNumber = new Fr(blockNumber); + inputs.historicalHeader.state = stateReference; + inputs.callContext.msgSender = this.msgSender; + inputs.callContext.storageContractAddress = this.contractAddress; + inputs.callContext.sideEffectCounter = sideEffectsCounter; + inputs.startSideEffectCounter = sideEffectsCounter; + return inputs; + } + + getPublicContextInputs() { + const inputs = { + functionSelector: FunctionSelector.fromField(new Fr(0)), + argsHash: new Fr(0), + isStaticCall: false, + toFields: function () { + return [this.functionSelector.toField(), this.argsHash, new Fr(this.isStaticCall)]; + }, + }; + return inputs; + } + + async avmOpcodeNullifierExists(innerNullifier: Fr, targetAddress: AztecAddress): Promise { + const nullifier = siloNullifier(targetAddress, innerNullifier!); + const db = this.trees.asLatest(); + const index = await db.findLeafIndex(MerkleTreeId.NULLIFIER_TREE, nullifier.toBuffer()); + return index !== undefined; + } + + async avmOpcodeEmitNullifier(nullifier: Fr) { + const db = this.trees.asLatest(); + const siloedNullifier = siloNullifier(this.contractAddress, nullifier); + await db.batchInsert(MerkleTreeId.NULLIFIER_TREE, [siloedNullifier.toBuffer()], NULLIFIER_SUBTREE_HEIGHT); + return Promise.resolve(); + } + + async avmOpcodeEmitNoteHash(innerNoteHash: Fr) { + const db = this.trees.asLatest(); + const noteHash = siloNoteHash(this.contractAddress, innerNoteHash); + await db.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, [noteHash]); + return Promise.resolve(); + } + + deriveKeys(secret: Fr) { + return deriveKeys(secret); + } + + // TypedOracle + + getBlockNumber(): Promise { + return Promise.resolve(this.blockNumber); + } + + getContractAddress(): Promise { + return Promise.resolve(this.contractAddress); + } + + getRandomField() { + return Fr.random(); + } + + packArgumentsArray(args: Fr[]): Promise { + return Promise.resolve(this.packedValuesCache.pack(args)); + } + + packReturns(returns: Fr[]): Promise { + return Promise.resolve(this.packedValuesCache.pack(returns)); + } + + unpackReturns(returnsHash: Fr): Promise { + return Promise.resolve(this.packedValuesCache.unpack(returnsHash)); + } + + getKeyValidationRequest(pkMHash: Fr): Promise { + return this.keyStore.getKeyValidationRequest(pkMHash, this.contractAddress); + } + + async getContractInstance(address: AztecAddress): Promise { + const contractInstance = await this.txeDatabase.getContractInstance(address); + if (!contractInstance) { + throw new Error(`Contract instance not found for address ${address}`); + } + return Promise.resolve(contractInstance); + } + + getMembershipWitness(_blockNumber: number, _treeId: MerkleTreeId, _leafValue: Fr): Promise { + throw new Error('Method not implemented.'); + } + + async getSiblingPath(blockNumber: number, treeId: MerkleTreeId, leafIndex: Fr) { + const committedDb = new MerkleTreeSnapshotOperationsFacade(this.trees, blockNumber); + const result = await committedDb.getSiblingPath(treeId, leafIndex.toBigInt()); + return result.toFields(); + } + + async getNullifierMembershipWitness( + blockNumber: number, + nullifier: Fr, + ): Promise { + const committedDb = new MerkleTreeSnapshotOperationsFacade(this.trees, blockNumber); + const index = await committedDb.findLeafIndex(MerkleTreeId.NULLIFIER_TREE, nullifier.toBuffer()); + if (!index) { + return undefined; + } + + const leafPreimagePromise = committedDb.getLeafPreimage(MerkleTreeId.NULLIFIER_TREE, index); + const siblingPathPromise = committedDb.getSiblingPath( + MerkleTreeId.NULLIFIER_TREE, + BigInt(index), + ); + + const [leafPreimage, siblingPath] = await Promise.all([leafPreimagePromise, siblingPathPromise]); + + if (!leafPreimage) { + return undefined; + } + + return new NullifierMembershipWitness(BigInt(index), leafPreimage as NullifierLeafPreimage, siblingPath); + } + + async getPublicDataTreeWitness(blockNumber: number, leafSlot: Fr): Promise { + const committedDb = new MerkleTreeSnapshotOperationsFacade(this.trees, blockNumber); + const lowLeafResult = await committedDb.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot.toBigInt()); + if (!lowLeafResult) { + return undefined; + } else { + const preimage = (await committedDb.getLeafPreimage( + MerkleTreeId.PUBLIC_DATA_TREE, + lowLeafResult.index, + )) as PublicDataTreeLeafPreimage; + const path = await committedDb.getSiblingPath( + MerkleTreeId.PUBLIC_DATA_TREE, + lowLeafResult.index, + ); + return new PublicDataWitness(lowLeafResult.index, preimage, path); + } + } + + getLowNullifierMembershipWitness( + _blockNumber: number, + _nullifier: Fr, + ): Promise { + throw new Error('Method not implemented.'); + } + + getHeader(_blockNumber: number): Promise
{ + throw new Error('Method not implemented.'); + } + + getCompleteAddress(account: AztecAddress): Promise { + return Promise.resolve(this.txeDatabase.getAccount(account)); + } + + getAuthWitness(_messageHash: Fr): Promise { + throw new Error('Method not implemented.'); + } + + popCapsule(): Promise { + throw new Error('Method not implemented.'); + } + + getNotes( + storageSlot: Fr, + numSelects: number, + selectByIndexes: number[], + selectByOffsets: number[], + selectByLengths: number[], + selectValues: Fr[], + selectComparators: number[], + sortByIndexes: number[], + sortByOffsets: number[], + sortByLengths: number[], + sortOrder: number[], + limit: number, + offset: number, + _status: NoteStatus, + ) { + // Nullified pending notes are already removed from the list. + const pendingNotes = this.noteCache.getNotes(this.contractAddress, storageSlot); + + const notes = pickNotes(pendingNotes, { + selects: selectByIndexes.slice(0, numSelects).map((index, i) => ({ + selector: { index, offset: selectByOffsets[i], length: selectByLengths[i] }, + value: selectValues[i], + comparator: selectComparators[i], + })), + sorts: sortByIndexes.map((index, i) => ({ + selector: { index, offset: sortByOffsets[i], length: sortByLengths[i] }, + order: sortOrder[i], + })), + limit, + offset, + }); + + this.logger.debug( + `Returning ${notes.length} notes for ${this.contractAddress} at ${storageSlot}: ${notes + .map(n => `${n.nonce.toString()}:[${n.note.items.map(i => i.toString()).join(',')}]`) + .join(', ')}`, + ); + + return Promise.resolve(notes); + } + + async notifyCreatedNote(storageSlot: Fr, noteTypeId: Fr, noteItems: Fr[], innerNoteHash: Fr, counter: number) { + const note = new Note(noteItems); + this.noteCache.addNewNote( + { + contractAddress: this.contractAddress, + storageSlot, + nonce: Fr.ZERO, // Nonce cannot be known during private execution. + note, + siloedNullifier: undefined, // Siloed nullifier cannot be known for newly created note. + innerNoteHash, + }, + counter, + ); + const db = this.trees.asLatest(); + const noteHash = siloNoteHash(this.contractAddress, innerNoteHash); + await db.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, [noteHash]); + } + + async notifyNullifiedNote(innerNullifier: Fr, innerNoteHash: Fr, _counter: number) { + this.noteCache.nullifyNote(this.contractAddress, innerNullifier, innerNoteHash); + const db = this.trees.asLatest(); + const siloedNullifier = siloNullifier(this.contractAddress, innerNullifier); + await db.batchInsert(MerkleTreeId.NULLIFIER_TREE, [siloedNullifier.toBuffer()], NULLIFIER_SUBTREE_HEIGHT); + return Promise.resolve(); + } + + async checkNullifierExists(innerNullifier: Fr): Promise { + const nullifier = siloNullifier(this.contractAddress, innerNullifier!); + const db = this.trees.asLatest(); + const index = await db.findLeafIndex(MerkleTreeId.NULLIFIER_TREE, nullifier.toBuffer()); + return index !== undefined; + } + + getL1ToL2MembershipWitness( + _contractAddress: AztecAddress, + _messageHash: Fr, + _secret: Fr, + ): Promise> { + throw new Error('Method not implemented.'); + } + + async storageRead(startStorageSlot: Fr, numberOfElements: number): Promise { + const db = this.trees.asLatest(); + + const values = []; + for (let i = 0n; i < numberOfElements; i++) { + const storageSlot = startStorageSlot.add(new Fr(i)); + const leafSlot = computePublicDataTreeLeafSlot(this.contractAddress, storageSlot).toBigInt(); + + const lowLeafResult = await db.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot); + + let value = Fr.ZERO; + if (lowLeafResult && lowLeafResult.alreadyPresent) { + const preimage = (await db.getLeafPreimage( + MerkleTreeId.PUBLIC_DATA_TREE, + lowLeafResult.index, + )) as PublicDataTreeLeafPreimage; + value = preimage.value; + } + this.logger.debug(`Oracle storage read: slot=${storageSlot.toString()} value=${value}`); + values.push(value); + } + return values; + } + + async storageWrite(startStorageSlot: Fr, values: Fr[]): Promise { + const db = this.trees.asLatest(); + + const publicDataWrites = values.map((value, i) => { + const storageSlot = startStorageSlot.add(new Fr(i)); + this.logger.debug(`Oracle storage write: slot=${storageSlot.toString()} value=${value}`); + return new PublicDataWrite(computePublicDataTreeLeafSlot(this.contractAddress, storageSlot), value); + }); + await db.batchInsert( + MerkleTreeId.PUBLIC_DATA_TREE, + publicDataWrites.map(write => new PublicDataTreeLeaf(write.leafIndex, write.newValue).toBuffer()), + PUBLIC_DATA_SUBTREE_HEIGHT, + ); + return publicDataWrites.map(write => write.newValue); + } + + emitEncryptedLog(_contractAddress: AztecAddress, _randomness: Fr, _encryptedNote: Buffer, _counter: number): void { + return; + } + + emitEncryptedNoteLog(_noteHashCounter: number, _encryptedNote: Buffer, _counter: number): void { + return; + } + + computeEncryptedNoteLog( + contractAddress: AztecAddress, + storageSlot: Fr, + noteTypeId: Fr, + ovKeys: KeyValidationRequest, + ivpkM: Point, + preimage: Fr[], + ): Buffer { + const note = new Note(preimage); + const l1NotePayload = new L1NotePayload(note, contractAddress, storageSlot, noteTypeId); + const taggedNote = new TaggedLog(l1NotePayload); + + const ephSk = GrumpkinScalar.random(); + + const recipient = AztecAddress.random(); + + return taggedNote.encrypt(ephSk, recipient, ivpkM, ovKeys); + } + + emitUnencryptedLog(_log: UnencryptedL2Log, _counter: number): void { + throw new Error('Method not implemented.'); + } + + emitContractClassUnencryptedLog(_log: UnencryptedL2Log, _counter: number): Fr { + throw new Error('Method not implemented.'); + } + + async callPrivateFunction( + targetContractAddress: AztecAddress, + functionSelector: FunctionSelector, + argsHash: Fr, + sideEffectCounter: number, + _isStaticCall: boolean, + _isDelegateCall: boolean, + ): Promise { + this.logger.debug( + `Calling private function ${targetContractAddress}:${functionSelector} from ${this.contractAddress}`, + ); + // Store and modify env + const currentContractAddress = AztecAddress.fromField(this.contractAddress); + const currentMessageSender = AztecAddress.fromField(this.msgSender); + this.setMsgSender(this.contractAddress); + this.setContractAddress(targetContractAddress); + + const artifact = await this.contractDataOracle.getFunctionArtifact(targetContractAddress, functionSelector); + + const acir = artifact.bytecode; + const initialWitness = await this.getInitialWitness(artifact, argsHash, sideEffectCounter); + const acvmCallback = new Oracle(this); + const timer = new Timer(); + const acirExecutionResult = await acvm(acir, initialWitness, acvmCallback).catch((err: Error) => { + const execError = new ExecutionError( + err.message, + { + contractAddress: targetContractAddress, + functionSelector, + }, + extractCallStack(err, artifact.debug), + { cause: err }, + ); + this.logger.debug( + `Error executing private function ${targetContractAddress}:${functionSelector}\n${createSimulationError( + execError, + )}`, + ); + throw execError; + }); + const duration = timer.ms(); + const returnWitness = witnessMapToFields(acirExecutionResult.returnWitness); + const publicInputs = PrivateCircuitPublicInputs.fromFields(returnWitness); + + const initialWitnessSize = witnessMapToFields(initialWitness).length * Fr.SIZE_IN_BYTES; + this.logger.debug(`Ran external function ${targetContractAddress.toString()}:${functionSelector}`, { + circuitName: 'app-circuit', + duration, + eventName: 'circuit-witness-generation', + inputSize: initialWitnessSize, + outputSize: publicInputs.toBuffer().length, + appCircuitName: 'noname', + } satisfies CircuitWitnessGenerationStats); + + const callStackItem = new PrivateCallStackItem( + targetContractAddress, + new FunctionData(functionSelector, true), + publicInputs, + ); + // Apply side effects + this.sideEffectsCounter += publicInputs.endSideEffectCounter.toNumber(); + this.setContractAddress(currentContractAddress); + this.setMsgSender(currentMessageSender); + + return callStackItem; + } + + async getInitialWitness(abi: FunctionAbi, argsHash: Fr, sideEffectCounter: number) { + const argumentsSize = countArgumentsSize(abi); + + const args = this.packedValuesCache.unpack(argsHash); + + if (args.length !== argumentsSize) { + throw new Error('Invalid arguments size'); + } + + const privateContextInputs = await this.getPrivateContextInputs(this.blockNumber - 1, sideEffectCounter); + + const fields = [...privateContextInputs.toFields(), ...args]; + + return toACVMWitness(0, fields); + } + + callPublicFunction( + _targetContractAddress: AztecAddress, + _functionSelector: FunctionSelector, + _argsHash: Fr, + _sideEffectCounter: number, + _isStaticCall: boolean, + _isDelegateCall: boolean, + ): Promise { + throw new Error('Method not implemented.'); + } + + enqueuePublicFunctionCall( + _targetContractAddress: AztecAddress, + _functionSelector: FunctionSelector, + _argsHash: Fr, + _sideEffectCounter: number, + _isStaticCall: boolean, + _isDelegateCall: boolean, + ): Promise { + throw new Error('Method not implemented.'); + } + + setPublicTeardownFunctionCall( + _targetContractAddress: AztecAddress, + _functionSelector: FunctionSelector, + _argsHash: Fr, + _sideEffectCounter: number, + _isStaticCall: boolean, + _isDelegateCall: boolean, + ): Promise { + throw new Error('Method not implemented.'); + } + + aes128Encrypt(input: Buffer, initializationVector: Buffer, key: Buffer): Buffer { + const aes128 = new Aes128(); + return aes128.encryptBufferCBC(input, initializationVector, key); + } + + debugLog(message: string, fields: Fr[]): void { + this.logger.verbose(`debug_log ${applyStringFormatting(message, fields)}`); + } + + emitEncryptedEventLog( + _contractAddress: AztecAddress, + _randomness: Fr, + _encryptedEvent: Buffer, + _counter: number, + ): void { + return; + } + + computeEncryptedEventLog( + _contractAddress: AztecAddress, + _randomness: Fr, + _eventTypeId: Fr, + _ovKeys: KeyValidationRequest, + _ivpkM: Point, + _preimage: Fr[], + ): Buffer { + throw new Error('Method not implemented.'); + } +} diff --git a/yarn-project/txe/src/txe_service/txe_service.ts b/yarn-project/txe/src/txe_service/txe_service.ts new file mode 100644 index 00000000000..6b53c0de1eb --- /dev/null +++ b/yarn-project/txe/src/txe_service/txe_service.ts @@ -0,0 +1,522 @@ +import { L2Block, MerkleTreeId, PublicDataWrite } from '@aztec/circuit-types'; +import { + Fr, + FunctionSelector, + Header, + KeyValidationRequest, + PUBLIC_DATA_SUBTREE_HEIGHT, + Point, + PublicDataTreeLeaf, + getContractInstanceFromDeployParams, +} from '@aztec/circuits.js'; +import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { type Logger } from '@aztec/foundation/log'; +import { KeyStore } from '@aztec/key-store'; +import { type AztecKVStore } from '@aztec/kv-store'; +import { openTmpStore } from '@aztec/kv-store/utils'; +import { ExecutionNoteCache, PackedValuesCache, type TypedOracle } from '@aztec/simulator'; +import { MerkleTrees } from '@aztec/world-state'; + +import { TXE } from '../oracle/txe_oracle.js'; +import { + type ForeignCallArray, + type ForeignCallSingle, + fromArray, + fromSingle, + toArray, + toForeignCallResult, + toSingle, +} from '../util/encoding.js'; +import { TXEDatabase } from '../util/txe_database.js'; + +export class TXEService { + constructor(private logger: Logger, private typedOracle: TypedOracle, private store: AztecKVStore) {} + + static async init(logger: Logger) { + const store = openTmpStore(true); + const trees = await MerkleTrees.new(store, logger); + const packedValuesCache = new PackedValuesCache(); + const noteCache = new ExecutionNoteCache(); + const keyStore = new KeyStore(store); + const txeDatabase = new TXEDatabase(store); + logger.info(`TXE service initialized`); + const txe = new TXE(logger, trees, packedValuesCache, noteCache, keyStore, txeDatabase); + const service = new TXEService(logger, txe, store); + await service.timeTravel(toSingle(new Fr(1n))); + return service; + } + + // Cheatcodes + + async getPrivateContextInputs(blockNumber: ForeignCallSingle) { + const inputs = await (this.typedOracle as TXE).getPrivateContextInputs(fromSingle(blockNumber).toNumber()); + return toForeignCallResult(inputs.toFields().map(toSingle)); + } + + getPublicContextInputs() { + const inputs = (this.typedOracle as TXE).getPublicContextInputs(); + return toForeignCallResult(inputs.toFields().map(toSingle)); + } + + async timeTravel(blocks: ForeignCallSingle) { + const nBlocks = fromSingle(blocks).toNumber(); + this.logger.info(`time traveling ${nBlocks} blocks`); + const trees = (this.typedOracle as TXE).getTrees(); + for (let i = 0; i < nBlocks; i++) { + const header = Header.empty(); + const l2Block = L2Block.empty(); + header.state = await trees.getStateReference(true); + const blockNumber = await this.typedOracle.getBlockNumber(); + + header.globalVariables.blockNumber = new Fr(blockNumber); + header.state.partial.nullifierTree.root = Fr.fromBuffer( + (await trees.getTreeInfo(MerkleTreeId.NULLIFIER_TREE, true)).root, + ); + header.state.partial.noteHashTree.root = Fr.fromBuffer( + (await trees.getTreeInfo(MerkleTreeId.NOTE_HASH_TREE, true)).root, + ); + header.state.partial.publicDataTree.root = Fr.fromBuffer( + (await trees.getTreeInfo(MerkleTreeId.PUBLIC_DATA_TREE, true)).root, + ); + header.state.l1ToL2MessageTree.root = Fr.fromBuffer( + (await trees.getTreeInfo(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, true)).root, + ); + l2Block.archive.root = Fr.fromBuffer((await trees.getTreeInfo(MerkleTreeId.ARCHIVE, true)).root); + l2Block.header = header; + await trees.handleL2BlockAndMessages(l2Block, []); + (this.typedOracle as TXE).setBlockNumber(blockNumber + 1); + } + return toForeignCallResult([]); + } + + setContractAddress(address: ForeignCallSingle) { + const typedAddress = AztecAddress.fromField(fromSingle(address)); + (this.typedOracle as TXE).setContractAddress(typedAddress); + return toForeignCallResult([]); + } + + deriveKeys(secret: ForeignCallSingle) { + const keys = (this.typedOracle as TXE).deriveKeys(fromSingle(secret)); + return toForeignCallResult(keys.publicKeys.toFields().map(toSingle)); + } + + async deploy( + path: ForeignCallArray, + initializer: ForeignCallArray, + _length: ForeignCallSingle, + args: ForeignCallArray, + publicKeysHash: ForeignCallSingle, + ) { + const pathStr = fromArray(path) + .map(char => String.fromCharCode(char.toNumber())) + .join(''); + const initializerStr = fromArray(initializer) + .map(char => String.fromCharCode(char.toNumber())) + .join(''); + const decodedArgs = fromArray(args); + this.logger.debug(`Deploy ${pathStr} with ${initializerStr} and ${decodedArgs}`); + const contractModule = await import(pathStr); + // Hacky way of getting the class, the name of the Artifact is always longer + const contractClass = contractModule[Object.keys(contractModule).sort((a, b) => a.length - b.length)[0]]; + const instance = getContractInstanceFromDeployParams(contractClass.artifact, { + constructorArgs: decodedArgs, + skipArgsDecoding: true, + salt: Fr.ONE, + publicKeysHash: fromSingle(publicKeysHash), + constructorArtifact: initializerStr ? initializerStr : undefined, + deployer: AztecAddress.ZERO, + }); + + this.logger.debug(`Deployed ${contractClass.artifact.name} at ${instance.address}`); + await (this.typedOracle as TXE).addContractInstance(instance); + await (this.typedOracle as TXE).addContractArtifact(contractClass.artifact); + return toForeignCallResult([toSingle(instance.address)]); + } + + async directStorageWrite( + contractAddress: ForeignCallSingle, + startStorageSlot: ForeignCallSingle, + values: ForeignCallArray, + ) { + const trees = (this.typedOracle as TXE).getTrees(); + const startStorageSlotFr = fromSingle(startStorageSlot); + const valuesFr = fromArray(values); + const contractAddressFr = fromSingle(contractAddress); + const db = trees.asLatest(); + + const publicDataWrites = valuesFr.map((value, i) => { + const storageSlot = startStorageSlotFr.add(new Fr(i)); + this.logger.debug(`Oracle storage write: slot=${storageSlot.toString()} value=${value}`); + return new PublicDataWrite(computePublicDataTreeLeafSlot(contractAddressFr, storageSlot), value); + }); + await db.batchInsert( + MerkleTreeId.PUBLIC_DATA_TREE, + publicDataWrites.map(write => new PublicDataTreeLeaf(write.leafIndex, write.newValue).toBuffer()), + PUBLIC_DATA_SUBTREE_HEIGHT, + ); + return toForeignCallResult([toArray(publicDataWrites.map(write => write.newValue))]); + } + + async createAccount() { + const keyStore = (this.typedOracle as TXE).getKeyStore(); + const completeAddress = await keyStore.createAccount(); + const accountStore = (this.typedOracle as TXE).getTXEDatabase(); + await accountStore.setAccount(completeAddress.address, completeAddress); + this.logger.debug(`Created account ${completeAddress.address}`); + return toForeignCallResult([ + toSingle(completeAddress.address), + ...completeAddress.publicKeys.toFields().map(toSingle), + ]); + } + + async addAccount(secret: ForeignCallSingle, partialAddress: ForeignCallSingle) { + const keyStore = (this.typedOracle as TXE).getKeyStore(); + const completeAddress = await keyStore.addAccount(fromSingle(secret), fromSingle(partialAddress)); + const accountStore = (this.typedOracle as TXE).getTXEDatabase(); + await accountStore.setAccount(completeAddress.address, completeAddress); + return toForeignCallResult([ + toSingle(completeAddress.address), + ...completeAddress.publicKeys.toFields().map(toSingle), + ]); + } + + setMsgSender(msgSender: ForeignCallSingle) { + (this.typedOracle as TXE).setMsgSender(fromSingle(msgSender)); + return toForeignCallResult([]); + } + + getMsgSender() { + const msgSender = (this.typedOracle as TXE).getMsgSender(); + return toForeignCallResult([toSingle(msgSender)]); + } + + getSideEffectsCounter() { + const counter = (this.typedOracle as TXE).getSideEffectsCounter(); + return toForeignCallResult([toSingle(new Fr(counter))]); + } + + // PXE oracles + + getRandomField() { + return toForeignCallResult([toSingle(this.typedOracle.getRandomField())]); + } + + async getContractAddress() { + const contractAddress = await this.typedOracle.getContractAddress(); + return toForeignCallResult([toSingle(contractAddress.toField())]); + } + + async getBlockNumber() { + const blockNumber = await this.typedOracle.getBlockNumber(); + return toForeignCallResult([toSingle(new Fr(blockNumber))]); + } + + async avmOpcodeAddress() { + const contractAddress = await this.typedOracle.getContractAddress(); + return toForeignCallResult([toSingle(contractAddress.toField())]); + } + + async avmOpcodeBlockNumber() { + const blockNumber = await this.typedOracle.getBlockNumber(); + return toForeignCallResult([toSingle(new Fr(blockNumber))]); + } + + async packArgumentsArray(args: ForeignCallArray) { + const packed = await this.typedOracle.packArgumentsArray(fromArray(args)); + return toForeignCallResult([toSingle(packed)]); + } + + async packArguments(_length: ForeignCallSingle, values: ForeignCallArray) { + const packed = await this.typedOracle.packArgumentsArray(fromArray(values)); + return toForeignCallResult([toSingle(packed)]); + } + + // Since the argument is a slice, noir automatically adds a length field to oracle call. + async packReturns(_length: ForeignCallSingle, values: ForeignCallArray) { + const packed = await this.typedOracle.packReturns(fromArray(values)); + return toForeignCallResult([toSingle(packed)]); + } + + async unpackReturns(returnsHash: ForeignCallSingle) { + const unpacked = await this.typedOracle.unpackReturns(fromSingle(returnsHash)); + return toForeignCallResult([toArray(unpacked)]); + } + + // Since the argument is a slice, noir automatically adds a length field to oracle call. + debugLog(message: ForeignCallArray, _length: ForeignCallSingle, fields: ForeignCallArray) { + const messageStr = fromArray(message) + .map(field => String.fromCharCode(field.toNumber())) + .join(''); + const fieldsFr = fromArray(fields); + this.typedOracle.debugLog(messageStr, fieldsFr); + return toForeignCallResult([]); + } + + async storageRead(startStorageSlot: ForeignCallSingle, numberOfElements: ForeignCallSingle) { + const values = await this.typedOracle.storageRead( + fromSingle(startStorageSlot), + fromSingle(numberOfElements).toNumber(), + ); + return toForeignCallResult([toArray(values)]); + } + + async storageWrite(startStorageSlot: ForeignCallSingle, values: ForeignCallArray) { + const newValues = await this.typedOracle.storageWrite(fromSingle(startStorageSlot), fromArray(values)); + return toForeignCallResult([toArray(newValues)]); + } + + async getPublicDataTreeWitness(blockNumber: ForeignCallSingle, leafSlot: ForeignCallSingle) { + const parsedBlockNumber = fromSingle(blockNumber).toNumber(); + const parsedLeafSlot = fromSingle(leafSlot); + + const witness = await this.typedOracle.getPublicDataTreeWitness(parsedBlockNumber, parsedLeafSlot); + if (!witness) { + throw new Error(`Public data witness not found for slot ${parsedLeafSlot} at block ${parsedBlockNumber}.`); + } + return toForeignCallResult([toArray(witness.toFields())]); + } + + async getSiblingPath(blockNumber: ForeignCallSingle, treeId: ForeignCallSingle, leafIndex: ForeignCallSingle) { + const result = await this.typedOracle.getSiblingPath( + fromSingle(blockNumber).toNumber(), + fromSingle(treeId).toNumber(), + fromSingle(leafIndex), + ); + return toForeignCallResult([toArray(result)]); + } + + async getNotes( + storageSlot: ForeignCallSingle, + numSelects: ForeignCallSingle, + selectByIndexes: ForeignCallArray, + selectByOffsets: ForeignCallArray, + selectByLengths: ForeignCallArray, + selectValues: ForeignCallArray, + selectComparators: ForeignCallArray, + sortByIndexes: ForeignCallArray, + sortByOffsets: ForeignCallArray, + sortByLengths: ForeignCallArray, + sortOrder: ForeignCallArray, + limit: ForeignCallSingle, + offset: ForeignCallSingle, + status: ForeignCallSingle, + returnSize: ForeignCallSingle, + ) { + const noteDatas = await this.typedOracle.getNotes( + fromSingle(storageSlot), + fromSingle(numSelects).toNumber(), + fromArray(selectByIndexes).map(fr => fr.toNumber()), + fromArray(selectByOffsets).map(fr => fr.toNumber()), + fromArray(selectByLengths).map(fr => fr.toNumber()), + fromArray(selectValues), + fromArray(selectComparators).map(fr => fr.toNumber()), + fromArray(sortByIndexes).map(fr => fr.toNumber()), + fromArray(sortByOffsets).map(fr => fr.toNumber()), + fromArray(sortByLengths).map(fr => fr.toNumber()), + fromArray(sortOrder).map(fr => fr.toNumber()), + fromSingle(limit).toNumber(), + fromSingle(offset).toNumber(), + fromSingle(status).toNumber(), + ); + const noteLength = noteDatas?.[0]?.note.items.length ?? 0; + if (!noteDatas.every(({ note }) => noteLength === note.items.length)) { + throw new Error('Notes should all be the same length.'); + } + + const contractAddress = noteDatas[0]?.contractAddress ?? Fr.ZERO; + + // Values indicates whether the note is settled or transient. + const noteTypes = { + isSettled: new Fr(0), + isTransient: new Fr(1), + }; + const flattenData = noteDatas.flatMap(({ nonce, note, index }) => [ + nonce, + index === undefined ? noteTypes.isTransient : noteTypes.isSettled, + ...note.items, + ]); + + const returnFieldSize = fromSingle(returnSize).toNumber(); + const returnData = [noteDatas.length, contractAddress, ...flattenData].map(v => new Fr(v)); + if (returnData.length > returnFieldSize) { + throw new Error(`Return data size too big. Maximum ${returnFieldSize} fields. Got ${flattenData.length}.`); + } + + const paddedZeros = Array(returnFieldSize - returnData.length).fill(new Fr(0)); + return toForeignCallResult([toArray([...returnData, ...paddedZeros])]); + } + + notifyCreatedNote( + storageSlot: ForeignCallSingle, + noteTypeId: ForeignCallSingle, + note: ForeignCallArray, + innerNoteHash: ForeignCallSingle, + counter: ForeignCallSingle, + ) { + this.typedOracle.notifyCreatedNote( + fromSingle(storageSlot), + fromSingle(noteTypeId), + fromArray(note), + fromSingle(innerNoteHash), + fromSingle(counter).toNumber(), + ); + return toForeignCallResult([toSingle(new Fr(0))]); + } + + async notifyNullifiedNote( + innerNullifier: ForeignCallSingle, + innerNoteHash: ForeignCallSingle, + counter: ForeignCallSingle, + ) { + await this.typedOracle.notifyNullifiedNote( + fromSingle(innerNullifier), + fromSingle(innerNoteHash), + fromSingle(counter).toNumber(), + ); + return toForeignCallResult([toSingle(new Fr(0))]); + } + + async checkNullifierExists(innerNullifier: ForeignCallSingle) { + const exists = await this.typedOracle.checkNullifierExists(fromSingle(innerNullifier)); + return toForeignCallResult([toSingle(new Fr(exists))]); + } + + async getContractInstance(address: ForeignCallSingle) { + const instance = await this.typedOracle.getContractInstance(fromSingle(address)); + return toForeignCallResult([ + toArray([ + instance.salt, + instance.deployer, + instance.contractClassId, + instance.initializationHash, + instance.publicKeysHash, + ]), + ]); + } + + async avmOpcodeGetContractInstance(address: ForeignCallSingle) { + const instance = await this.typedOracle.getContractInstance(fromSingle(address)); + return toForeignCallResult([ + toArray([ + // AVM requires an extra boolean indicating the instance was found + new Fr(1), + instance.salt, + instance.deployer, + instance.contractClassId, + instance.initializationHash, + instance.publicKeysHash, + ]), + ]); + } + + avmOpcodeSender() { + const sender = (this.typedOracle as TXE).getMsgSender(); + return toForeignCallResult([toSingle(sender)]); + } + + async avmOpcodeEmitNullifier(nullifier: ForeignCallSingle) { + await (this.typedOracle as TXE).avmOpcodeEmitNullifier(fromSingle(nullifier)); + return toForeignCallResult([]); + } + + async avmOpcodeEmitNoteHash(innerNoteHash: ForeignCallSingle) { + await (this.typedOracle as TXE).avmOpcodeEmitNoteHash(fromSingle(innerNoteHash)); + return toForeignCallResult([]); + } + + async avmOpcodeNullifierExists(innerNullifier: ForeignCallSingle, targetAddress: ForeignCallSingle) { + const exists = await (this.typedOracle as TXE).avmOpcodeNullifierExists( + fromSingle(innerNullifier), + AztecAddress.fromField(fromSingle(targetAddress)), + ); + return toForeignCallResult([toSingle(new Fr(exists))]); + } + + async getPublicKeysAndPartialAddress(address: ForeignCallSingle) { + const parsedAddress = AztecAddress.fromField(fromSingle(address)); + const { publicKeys, partialAddress } = await this.typedOracle.getCompleteAddress(parsedAddress); + + return toForeignCallResult([toArray([...publicKeys.toFields(), partialAddress])]); + } + + async getKeyValidationRequest(pkMHash: ForeignCallSingle) { + const keyValidationRequest = await this.typedOracle.getKeyValidationRequest(fromSingle(pkMHash)); + return toForeignCallResult([toArray(keyValidationRequest.toFields())]); + } + + computeEncryptedNoteLog( + contractAddress: ForeignCallSingle, + storageSlot: ForeignCallSingle, + noteTypeId: ForeignCallSingle, + ovskApp: ForeignCallSingle, + ovpkMX: ForeignCallSingle, + ovpkMY: ForeignCallSingle, + ivpkMX: ForeignCallSingle, + ivpkMY: ForeignCallSingle, + preimage: ForeignCallArray, + ) { + const ovpkM = new Point(fromSingle(ovpkMX), fromSingle(ovpkMY)); + const ovKeys = new KeyValidationRequest(ovpkM, Fr.fromString(fromSingle(ovskApp).toString())); + const ivpkM = new Point(fromSingle(ivpkMX), fromSingle(ivpkMY)); + const encLog = this.typedOracle.computeEncryptedNoteLog( + AztecAddress.fromString(fromSingle(contractAddress).toString()), + Fr.fromString(fromSingle(storageSlot).toString()), + Fr.fromString(fromSingle(noteTypeId).toString()), + ovKeys, + ivpkM, + fromArray(preimage), + ); + const bytes: Fr[] = []; + + encLog.forEach(v => { + bytes.push(new Fr(v)); + }); + return toForeignCallResult([toArray(bytes)]); + } + + emitEncryptedLog( + _contractAddress: ForeignCallSingle, + _randomandomness: ForeignCallSingle, + _encryptedLog: ForeignCallSingle, + _counter: ForeignCallSingle, + ) { + return toForeignCallResult([]); + } + + emitEncryptedNoteLog( + _noteHashCounter: ForeignCallSingle, + _encryptedNote: ForeignCallArray, + _counter: ForeignCallSingle, + ) { + return toForeignCallResult([]); + } + + async callPrivateFunction( + targetContractAddress: ForeignCallSingle, + functionSelector: ForeignCallSingle, + argsHash: ForeignCallSingle, + sideEffectCounter: ForeignCallSingle, + isStaticCall: ForeignCallSingle, + isDelegateCall: ForeignCallSingle, + ) { + const result = await this.typedOracle.callPrivateFunction( + fromSingle(targetContractAddress), + FunctionSelector.fromField(fromSingle(functionSelector)), + fromSingle(argsHash), + fromSingle(sideEffectCounter).toNumber(), + fromSingle(isStaticCall).toBool(), + fromSingle(isDelegateCall).toBool(), + ); + return toForeignCallResult([toArray(result.toFields())]); + } + + async getNullifierMembershipWitness(blockNumber: ForeignCallSingle, nullifier: ForeignCallSingle) { + const parsedBlockNumber = fromSingle(blockNumber).toNumber(); + const witness = await this.typedOracle.getNullifierMembershipWitness(parsedBlockNumber, fromSingle(nullifier)); + if (!witness) { + throw new Error(`Nullifier membership witness not found at block ${parsedBlockNumber}.`); + } + return toForeignCallResult([toArray(witness.toFields())]); + } +} diff --git a/yarn-project/txe/src/util/encoding.ts b/yarn-project/txe/src/util/encoding.ts new file mode 100644 index 00000000000..0d4a78ba61a --- /dev/null +++ b/yarn-project/txe/src/util/encoding.ts @@ -0,0 +1,29 @@ +import { Fr } from '@aztec/foundation/fields'; + +export type ForeignCallSingle = string; + +export type ForeignCallArray = string[]; + +export type ForeignCallResult = { + values: (ForeignCallSingle | ForeignCallArray)[]; +}; + +export function fromSingle(obj: ForeignCallSingle) { + return Fr.fromBuffer(Buffer.from(obj, 'hex')); +} + +export function fromArray(obj: ForeignCallArray) { + return obj.map(str => Fr.fromBuffer(Buffer.from(str, 'hex'))); +} + +export function toSingle(obj: Fr) { + return obj.toString().slice(2); +} + +export function toArray(objs: Fr[]) { + return objs.map(obj => obj.toString()); +} + +export function toForeignCallResult(obj: (ForeignCallSingle | ForeignCallArray)[]) { + return { values: obj }; +} diff --git a/yarn-project/txe/src/util/txe_database.ts b/yarn-project/txe/src/util/txe_database.ts new file mode 100644 index 00000000000..b154fd8702a --- /dev/null +++ b/yarn-project/txe/src/util/txe_database.ts @@ -0,0 +1,24 @@ +import { type AztecAddress, CompleteAddress } from '@aztec/circuits.js'; +import { type AztecKVStore, type AztecMap } from '@aztec/kv-store'; +import { KVPxeDatabase } from '@aztec/pxe'; + +export class TXEDatabase extends KVPxeDatabase { + #accounts: AztecMap; + + constructor(db: AztecKVStore) { + super(db); + this.#accounts = db.openMap('accounts'); + } + + getAccount(key: AztecAddress) { + const completeAddress = this.#accounts.get(key.toString()); + if (!completeAddress) { + throw new Error(`Account not found: ${key.toString()}`); + } + return CompleteAddress.fromBuffer(completeAddress); + } + + async setAccount(key: AztecAddress, value: CompleteAddress) { + await this.#accounts.set(key.toString(), value.toBuffer()); + } +} diff --git a/yarn-project/txe/tsconfig.json b/yarn-project/txe/tsconfig.json new file mode 100644 index 00000000000..7db2bf79778 --- /dev/null +++ b/yarn-project/txe/tsconfig.json @@ -0,0 +1,47 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "references": [ + { + "path": "../archiver" + }, + { + "path": "../aztec.js" + }, + { + "path": "../circuit-types" + }, + { + "path": "../circuits.js" + }, + { + "path": "../foundation" + }, + { + "path": "../key-store" + }, + { + "path": "../kv-store" + }, + { + "path": "../noir-contracts.js" + }, + { + "path": "../pxe" + }, + { + "path": "../simulator" + }, + { + "path": "../types" + }, + { + "path": "../world-state" + } + ], + "include": ["src"] +} diff --git a/yarn-project/types/src/abi/contract_artifact.ts b/yarn-project/types/src/abi/contract_artifact.ts index 8ca72aa68a7..9fff2b21b6a 100644 --- a/yarn-project/types/src/abi/contract_artifact.ts +++ b/yarn-project/types/src/abi/contract_artifact.ts @@ -2,7 +2,6 @@ import { type ABIParameter, type ABIParameterVisibility, type AbiType, - type BasicValue, type ContractArtifact, type ContractNote, type FieldLayout, @@ -227,10 +226,8 @@ function getStorageLayout(input: NoirCompiledContract) { return storageFields.reduce((acc: Record, field) => { const name = field.name; const slot = field.value.fields[0].value as IntegerValue; - const typ = field.value.fields[1].value as BasicValue<'string', string>; acc[name] = { slot: new Fr(BigInt(slot.value)), - typ: typ.value, }; return acc; }, {}); diff --git a/yarn-project/world-state/src/world-state-db/index.ts b/yarn-project/world-state/src/world-state-db/index.ts index 9d72e0991e8..f4c20a567f9 100644 --- a/yarn-project/world-state/src/world-state-db/index.ts +++ b/yarn-project/world-state/src/world-state-db/index.ts @@ -1,3 +1,5 @@ export * from './merkle_trees.js'; export * from './merkle_tree_db.js'; export * from './merkle_tree_operations.js'; +export * from './merkle_tree_operations_facade.js'; +export * from './merkle_tree_snapshot_operations_facade.js'; diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index d1fe44fd9df..cc328c7abd1 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -933,6 +933,34 @@ __metadata: languageName: unknown linkType: soft +"@aztec/txe@workspace:txe": + version: 0.0.0-use.local + resolution: "@aztec/txe@workspace:txe" + dependencies: + "@aztec/archiver": "workspace:^" + "@aztec/aztec.js": "workspace:^" + "@aztec/circuit-types": "workspace:^" + "@aztec/circuits.js": "workspace:^" + "@aztec/foundation": "workspace:^" + "@aztec/key-store": "workspace:^" + "@aztec/kv-store": "workspace:^" + "@aztec/noir-contracts.js": "workspace:^" + "@aztec/pxe": "workspace:^" + "@aztec/simulator": "workspace:^" + "@aztec/types": "workspace:^" + "@aztec/world-state": "workspace:^" + "@jest/globals": ^29.5.0 + "@types/jest": ^29.5.0 + "@types/node": ^18.7.23 + jest: ^29.5.0 + jest-mock-extended: ^3.0.3 + ts-node: ^10.9.1 + typescript: ^5.0.4 + bin: + txe: ./dest/bin/index.js + languageName: unknown + linkType: soft + "@aztec/types@workspace:^, @aztec/types@workspace:types": version: 0.0.0-use.local resolution: "@aztec/types@workspace:types" From 7f62a901c848020058a58f6e772d495566416e0b Mon Sep 17 00:00:00 2001 From: Ilyas Ridhuan Date: Tue, 18 Jun 2024 18:22:26 +0100 Subject: [PATCH 13/25] feat(avm): add ECC ops to avm_proving_test (#7058) Please read [contributing guidelines](CONTRIBUTING.md) and remove this line. --- yarn-project/bb-prover/src/avm_proving.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/yarn-project/bb-prover/src/avm_proving.test.ts b/yarn-project/bb-prover/src/avm_proving.test.ts index eea9d122527..917850189ff 100644 --- a/yarn-project/bb-prover/src/avm_proving.test.ts +++ b/yarn-project/bb-prover/src/avm_proving.test.ts @@ -146,6 +146,20 @@ describe('AVM WitGen, proof generation and verification', () => { TIMEOUT, ); + /************************************************************************ + * Avm Embedded Curve functions + ************************************************************************/ + describe('AVM Embedded Curve functions', () => { + const avmEmbeddedCurveFunctions: string[] = ['elliptic_curve_add_and_double', 'variable_base_msm']; + it.each(avmEmbeddedCurveFunctions)( + 'Should prove %s', + async name => { + await proveAndVerifyAvmTestContract(name); + }, + TIMEOUT, + ); + }); + /************************************************************************ * AvmContext functions ************************************************************************/ From 9f12cd6d8760010dc4ddc1bc96732c9b3d2760b1 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Wed, 19 Jun 2024 02:15:04 +0000 Subject: [PATCH 14/25] git subrepo push --branch=master barretenberg subrepo: subdir: "barretenberg" merged: "cb8df49c66" upstream: origin: "https://github.com/AztecProtocol/barretenberg" branch: "master" commit: "cb8df49c66" git-subrepo: version: "0.4.6" origin: "???" commit: "???" [skip ci] --- barretenberg/.gitrepo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/barretenberg/.gitrepo b/barretenberg/.gitrepo index 1a16c028c7e..60a3eb53837 100644 --- a/barretenberg/.gitrepo +++ b/barretenberg/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/barretenberg branch = master - commit = 08121ebf109b32b35057048e7679d343b3e6beaf - parent = 6692ac831ab980d9623442236c21b499a7238966 + commit = cb8df49c666a8e9c739583e0422e99818845a40d + parent = 7f62a901c848020058a58f6e772d495566416e0b method = merge cmdver = 0.4.6 From 67bcd8279f0d8921437a6f37e6ec3f25a69471a5 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Wed, 19 Jun 2024 02:15:39 +0000 Subject: [PATCH 15/25] chore: replace relative paths to noir-protocol-circuits --- noir-projects/aztec-nr/aztec/Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir-projects/aztec-nr/aztec/Nargo.toml b/noir-projects/aztec-nr/aztec/Nargo.toml index 7a1f1af5863..2ac33eb0e22 100644 --- a/noir-projects/aztec-nr/aztec/Nargo.toml +++ b/noir-projects/aztec-nr/aztec/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = ">=0.18.0" type = "lib" [dependencies] -protocol_types = { path = "../../noir-protocol-circuits/crates/types" } +protocol_types = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.43.0", directory="noir-projects/noir-protocol-circuits/crates/types" } From 80df6d02efb771aaaa0768669da47c23887ac0a6 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Wed, 19 Jun 2024 02:15:39 +0000 Subject: [PATCH 16/25] git_subrepo.sh: Fix parent in .gitrepo file. [skip ci] --- noir-projects/aztec-nr/.gitrepo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir-projects/aztec-nr/.gitrepo b/noir-projects/aztec-nr/.gitrepo index f9c964748f8..b1221b9e50b 100644 --- a/noir-projects/aztec-nr/.gitrepo +++ b/noir-projects/aztec-nr/.gitrepo @@ -9,4 +9,4 @@ commit = afee776d80f622d89234a9acc8ed07a1d96cd25e method = merge cmdver = 0.4.6 - parent = 01d95ce259f37e7eacfade3f15b122ca33cda38f + parent = 847f4fc10c17d030f6868e2304ae9a59ee0b08b0 From 210fc9215dfb2d6baeba7da3180be0af5130d528 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Wed, 19 Jun 2024 02:15:42 +0000 Subject: [PATCH 17/25] git subrepo push --branch=master noir-projects/aztec-nr subrepo: subdir: "noir-projects/aztec-nr" merged: "dccc947480" upstream: origin: "https://github.com/AztecProtocol/aztec-nr" branch: "master" commit: "dccc947480" git-subrepo: version: "0.4.6" origin: "???" commit: "???" [skip ci] --- noir-projects/aztec-nr/.gitrepo | 4 ++-- noir-projects/aztec-nr/aztec/Nargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/noir-projects/aztec-nr/.gitrepo b/noir-projects/aztec-nr/.gitrepo index b1221b9e50b..750fcda62d8 100644 --- a/noir-projects/aztec-nr/.gitrepo +++ b/noir-projects/aztec-nr/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/aztec-nr branch = master - commit = afee776d80f622d89234a9acc8ed07a1d96cd25e + commit = dccc9474800862e9658324ec6855703c9b009d8e method = merge cmdver = 0.4.6 - parent = 847f4fc10c17d030f6868e2304ae9a59ee0b08b0 + parent = 42337f17077b7f7d43c696a8ef14ccbb329f34d2 diff --git a/noir-projects/aztec-nr/aztec/Nargo.toml b/noir-projects/aztec-nr/aztec/Nargo.toml index 2ac33eb0e22..7a1f1af5863 100644 --- a/noir-projects/aztec-nr/aztec/Nargo.toml +++ b/noir-projects/aztec-nr/aztec/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = ">=0.18.0" type = "lib" [dependencies] -protocol_types = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.43.0", directory="noir-projects/noir-protocol-circuits/crates/types" } +protocol_types = { path = "../../noir-protocol-circuits/crates/types" } From b502fcd500dcb10945b29d00f86e290bec63cce3 Mon Sep 17 00:00:00 2001 From: Maddiaa <47148561+Maddiaa0@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:26:21 +0100 Subject: [PATCH 18/25] chore(avm): remove avm prefix from pil and executor (#7099) ## Overview Removes the avm_ prefix from the pil files and from all generated code, its noisy --- .../cpp/pil/avm/{avm_alu.pil => alu.pil} | 6 +- .../pil/avm/{avm_binary.pil => binary.pil} | 12 +- .../{avm_byte_lookup.pil => byte_lookup.pil} | 2 +- .../{avm_conversion.pil => conversion.pil} | 4 +- .../{avm_keccakf1600.pil => keccakf1600.pil} | 4 +- .../{avm_pedersen.pil => pedersen.pil} | 4 +- .../{avm_poseidon2.pil => poseidon2.pil} | 4 +- .../gadgets/{avm_sha256.pil => sha256.pil} | 4 +- .../cpp/pil/avm/{avm_gas.pil => gas.pil} | 2 +- .../pil/avm/{avm_kernel.pil => kernel.pil} | 28 +- .../cpp/pil/avm/{avm_main.pil => main.pil} | 204 +- .../cpp/pil/avm/{avm_mem.pil => mem.pil} | 26 +- .../relations/generated/avm/alu.hpp | 1187 ++++ .../relations/generated/avm/avm_alu.hpp | 1222 ---- .../generated/avm/avm_keccakf1600.hpp | 49 - .../relations/generated/avm/avm_kernel.hpp | 200 - .../avm/{avm_binary.hpp => binary.hpp} | 66 +- .../avm/{avm_pedersen.hpp => conversion.hpp} | 12 +- .../relations/generated/avm/declare_views.hpp | 744 +-- .../generated/avm/incl_main_tag_err.hpp | 22 +- .../generated/avm/incl_mem_tag_err.hpp | 22 +- .../avm/{avm_sha256.hpp => keccakf1600.hpp} | 12 +- .../relations/generated/avm/kernel.hpp | 197 + .../generated/avm/kernel_output_lookup.hpp | 46 +- .../generated/avm/lookup_byte_lengths.hpp | 30 +- .../generated/avm/lookup_byte_operations.hpp | 46 +- .../generated/avm/lookup_div_u16_0.hpp | 22 +- .../generated/avm/lookup_div_u16_1.hpp | 22 +- .../generated/avm/lookup_div_u16_2.hpp | 22 +- .../generated/avm/lookup_div_u16_3.hpp | 22 +- .../generated/avm/lookup_div_u16_4.hpp | 22 +- .../generated/avm/lookup_div_u16_5.hpp | 22 +- .../generated/avm/lookup_div_u16_6.hpp | 22 +- .../generated/avm/lookup_div_u16_7.hpp | 22 +- .../generated/avm/lookup_into_kernel.hpp | 30 +- .../generated/avm/lookup_mem_rng_chk_hi.hpp | 22 +- .../generated/avm/lookup_mem_rng_chk_lo.hpp | 22 +- .../generated/avm/lookup_mem_rng_chk_mid.hpp | 22 +- .../generated/avm/lookup_opcode_gas.hpp | 38 +- .../generated/avm/lookup_pow_2_0.hpp | 30 +- .../generated/avm/lookup_pow_2_1.hpp | 30 +- .../relations/generated/avm/lookup_u16_0.hpp | 22 +- .../relations/generated/avm/lookup_u16_1.hpp | 22 +- .../relations/generated/avm/lookup_u16_10.hpp | 22 +- .../relations/generated/avm/lookup_u16_11.hpp | 22 +- .../relations/generated/avm/lookup_u16_12.hpp | 22 +- .../relations/generated/avm/lookup_u16_13.hpp | 22 +- .../relations/generated/avm/lookup_u16_14.hpp | 22 +- .../relations/generated/avm/lookup_u16_2.hpp | 22 +- .../relations/generated/avm/lookup_u16_3.hpp | 22 +- .../relations/generated/avm/lookup_u16_4.hpp | 22 +- .../relations/generated/avm/lookup_u16_5.hpp | 22 +- .../relations/generated/avm/lookup_u16_6.hpp | 22 +- .../relations/generated/avm/lookup_u16_7.hpp | 22 +- .../relations/generated/avm/lookup_u16_8.hpp | 22 +- .../relations/generated/avm/lookup_u16_9.hpp | 22 +- .../relations/generated/avm/lookup_u8_0.hpp | 22 +- .../relations/generated/avm/lookup_u8_1.hpp | 22 +- .../generated/avm/{avm_main.hpp => main.hpp} | 849 ++- .../generated/avm/{avm_mem.hpp => mem.hpp} | 200 +- .../avm/{avm_poseidon2.hpp => pedersen.hpp} | 12 +- .../relations/generated/avm/perm_main_alu.hpp | 142 +- .../relations/generated/avm/perm_main_bin.hpp | 62 +- .../generated/avm/perm_main_conv.hpp | 46 +- .../generated/avm/perm_main_mem_a.hpp | 86 +- .../generated/avm/perm_main_mem_b.hpp | 86 +- .../generated/avm/perm_main_mem_c.hpp | 70 +- .../generated/avm/perm_main_mem_d.hpp | 78 +- .../generated/avm/perm_main_mem_ind_a.hpp | 46 +- .../generated/avm/perm_main_mem_ind_b.hpp | 46 +- .../generated/avm/perm_main_mem_ind_c.hpp | 46 +- .../generated/avm/perm_main_mem_ind_d.hpp | 46 +- .../generated/avm/perm_main_pedersen.hpp | 30 +- .../generated/avm/perm_main_pos2_perm.hpp | 38 +- .../avm/{avm_conversion.hpp => poseidon2.hpp} | 12 +- .../generated/avm/range_check_da_gas_hi.hpp | 22 +- .../generated/avm/range_check_da_gas_lo.hpp | 22 +- .../generated/avm/range_check_l2_gas_hi.hpp | 22 +- .../generated/avm/range_check_l2_gas_lo.hpp | 22 +- .../relations/generated/avm/sha256.hpp | 49 + .../barretenberg/vm/avm_trace/avm_helper.cpp | 122 +- .../barretenberg/vm/avm_trace/avm_trace.cpp | 2838 ++++---- .../vm/generated/avm_circuit_builder.cpp | 952 ++- .../vm/generated/avm_circuit_builder.hpp | 1556 +++-- .../barretenberg/vm/generated/avm_flavor.hpp | 5908 ++++++++--------- .../barretenberg/vm/generated/avm_prover.cpp | 1308 ++-- .../vm/generated/avm_verifier.cpp | 941 ++- .../vm/tests/avm_arithmetic.test.cpp | 772 +-- .../vm/tests/avm_bitwise.test.cpp | 237 +- .../barretenberg/vm/tests/avm_cast.test.cpp | 178 +- .../vm/tests/avm_comparison.test.cpp | 121 +- .../vm/tests/avm_control_flow.test.cpp | 102 +- .../vm/tests/avm_execution.test.cpp | 486 +- .../barretenberg/vm/tests/avm_gas.test.cpp | 2 +- .../vm/tests/avm_indirect_mem.test.cpp | 96 +- .../vm/tests/avm_inter_table.test.cpp | 257 +- .../barretenberg/vm/tests/avm_kernel.test.cpp | 145 +- .../vm/tests/avm_mem_opcodes.test.cpp | 392 +- .../barretenberg/vm/tests/avm_memory.test.cpp | 104 +- .../barretenberg/vm/tests/helpers.test.cpp | 50 +- 100 files changed, 11616 insertions(+), 11882 deletions(-) rename barretenberg/cpp/pil/avm/{avm_alu.pil => alu.pil} (99%) rename barretenberg/cpp/pil/avm/{avm_binary.pil => binary.pil} (87%) rename barretenberg/cpp/pil/avm/{avm_byte_lookup.pil => byte_lookup.pil} (96%) rename barretenberg/cpp/pil/avm/gadgets/{avm_conversion.pil => conversion.pil} (92%) rename barretenberg/cpp/pil/avm/gadgets/{avm_keccakf1600.pil => keccakf1600.pil} (84%) rename barretenberg/cpp/pil/avm/gadgets/{avm_pedersen.pil => pedersen.pil} (84%) rename barretenberg/cpp/pil/avm/gadgets/{avm_poseidon2.pil => poseidon2.pil} (84%) rename barretenberg/cpp/pil/avm/gadgets/{avm_sha256.pil => sha256.pil} (86%) rename barretenberg/cpp/pil/avm/{avm_gas.pil => gas.pil} (94%) rename barretenberg/cpp/pil/avm/{avm_kernel.pil => kernel.pil} (80%) rename barretenberg/cpp/pil/avm/{avm_main.pil => main.pil} (76%) rename barretenberg/cpp/pil/avm/{avm_mem.pil => mem.pil} (94%) create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/alu.hpp delete mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp delete mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_keccakf1600.hpp delete mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_kernel.hpp rename barretenberg/cpp/src/barretenberg/relations/generated/avm/{avm_binary.hpp => binary.hpp} (57%) rename barretenberg/cpp/src/barretenberg/relations/generated/avm/{avm_pedersen.hpp => conversion.hpp} (71%) rename barretenberg/cpp/src/barretenberg/relations/generated/avm/{avm_sha256.hpp => keccakf1600.hpp} (71%) create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel.hpp rename barretenberg/cpp/src/barretenberg/relations/generated/avm/{avm_main.hpp => main.hpp} (50%) rename barretenberg/cpp/src/barretenberg/relations/generated/avm/{avm_mem.hpp => mem.hpp} (59%) rename barretenberg/cpp/src/barretenberg/relations/generated/avm/{avm_poseidon2.hpp => pedersen.hpp} (70%) rename barretenberg/cpp/src/barretenberg/relations/generated/avm/{avm_conversion.hpp => poseidon2.hpp} (70%) create mode 100644 barretenberg/cpp/src/barretenberg/relations/generated/avm/sha256.hpp diff --git a/barretenberg/cpp/pil/avm/avm_alu.pil b/barretenberg/cpp/pil/avm/alu.pil similarity index 99% rename from barretenberg/cpp/pil/avm/avm_alu.pil rename to barretenberg/cpp/pil/avm/alu.pil index 4adb3e1b931..5ebf510d2c5 100644 --- a/barretenberg/cpp/pil/avm/avm_alu.pil +++ b/barretenberg/cpp/pil/avm/alu.pil @@ -1,6 +1,6 @@ -include "avm_main.pil"; +include "main.pil"; -namespace avm_alu(256); +namespace alu(256); // ========= Table ALU-TR ================================================= @@ -246,7 +246,7 @@ namespace avm_alu(256); // ========= EQUALITY Operation Constraints =============================== // TODO: Note this method differs from the approach taken for "equality to zero" checks - // in handling the error tags found in avm_main and avm_mem files. The predicted relation difference + // in handling the error tags found in main and mem files. The predicted relation difference // is minor and when we optimise we will harmonise the methods based on actual performance. // Equality of two elements is found by performing an "equality to zero" check. diff --git a/barretenberg/cpp/pil/avm/avm_binary.pil b/barretenberg/cpp/pil/avm/binary.pil similarity index 87% rename from barretenberg/cpp/pil/avm/avm_binary.pil rename to barretenberg/cpp/pil/avm/binary.pil index 5385efc982d..35f27914d58 100644 --- a/barretenberg/cpp/pil/avm/avm_binary.pil +++ b/barretenberg/cpp/pil/avm/binary.pil @@ -1,8 +1,8 @@ -include "avm_byte_lookup.pil"; -include "avm_main.pil"; +include "byte_lookup.pil"; +include "main.pil"; -namespace avm_binary(256); +namespace binary(256); pol commit clk; @@ -30,7 +30,7 @@ namespace avm_binary(256); (op_id' - op_id) * mem_tag_ctr = 0; // Little Endian bitwise decomposition of accumulators (which are processed top-down), - // constrained to be U8 given by the lookup to the avm_byte_lookup + // constrained to be U8 given by the lookup to the byte_lookup pol commit ia_bytes; pol commit ib_bytes; pol commit ic_bytes; @@ -65,12 +65,12 @@ namespace avm_binary(256); #[LOOKUP_BYTE_LENGTHS] start {in_tag, mem_tag_ctr} in - avm_byte_lookup.bin_sel {avm_byte_lookup.table_in_tags, avm_byte_lookup.table_byte_lengths}; + byte_lookup.bin_sel {byte_lookup.table_in_tags, byte_lookup.table_byte_lengths}; #[LOOKUP_BYTE_OPERATIONS] bin_sel {op_id, ia_bytes, ib_bytes, ic_bytes} in - avm_byte_lookup.bin_sel {avm_byte_lookup.table_op_id, avm_byte_lookup.table_input_a, avm_byte_lookup.table_input_b, avm_byte_lookup.table_output}; + byte_lookup.bin_sel {byte_lookup.table_op_id, byte_lookup.table_input_a, byte_lookup.table_input_b, byte_lookup.table_output}; #[ACC_REL_A] (acc_ia - ia_bytes - 256 * acc_ia') * mem_tag_ctr = 0; diff --git a/barretenberg/cpp/pil/avm/avm_byte_lookup.pil b/barretenberg/cpp/pil/avm/byte_lookup.pil similarity index 96% rename from barretenberg/cpp/pil/avm/avm_byte_lookup.pil rename to barretenberg/cpp/pil/avm/byte_lookup.pil index d06135389fd..58bb7d4ea00 100644 --- a/barretenberg/cpp/pil/avm/avm_byte_lookup.pil +++ b/barretenberg/cpp/pil/avm/byte_lookup.pil @@ -1,5 +1,5 @@ -namespace avm_byte_lookup(256); +namespace byte_lookup(256); // These columns are commited for now, but will be migrated to constant/fixed when // we support more *exotic* code generation options pol commit table_op_id; // identifies if operation is AND/OR/XOR diff --git a/barretenberg/cpp/pil/avm/gadgets/avm_conversion.pil b/barretenberg/cpp/pil/avm/gadgets/conversion.pil similarity index 92% rename from barretenberg/cpp/pil/avm/gadgets/avm_conversion.pil rename to barretenberg/cpp/pil/avm/gadgets/conversion.pil index abd2e5c6121..4f34f0f7d3f 100644 --- a/barretenberg/cpp/pil/avm/gadgets/avm_conversion.pil +++ b/barretenberg/cpp/pil/avm/gadgets/conversion.pil @@ -1,6 +1,6 @@ -include "../avm_main.pil"; +include "../main.pil"; -namespace avm_conversion(256); +namespace conversion(256); pol commit clk; diff --git a/barretenberg/cpp/pil/avm/gadgets/avm_keccakf1600.pil b/barretenberg/cpp/pil/avm/gadgets/keccakf1600.pil similarity index 84% rename from barretenberg/cpp/pil/avm/gadgets/avm_keccakf1600.pil rename to barretenberg/cpp/pil/avm/gadgets/keccakf1600.pil index acc9a54f277..c6e814e1be0 100644 --- a/barretenberg/cpp/pil/avm/gadgets/avm_keccakf1600.pil +++ b/barretenberg/cpp/pil/avm/gadgets/keccakf1600.pil @@ -1,6 +1,6 @@ -include "../avm_main.pil"; +include "../main.pil"; -namespace avm_keccakf1600(256); +namespace keccakf1600(256); pol commit clk; diff --git a/barretenberg/cpp/pil/avm/gadgets/avm_pedersen.pil b/barretenberg/cpp/pil/avm/gadgets/pedersen.pil similarity index 84% rename from barretenberg/cpp/pil/avm/gadgets/avm_pedersen.pil rename to barretenberg/cpp/pil/avm/gadgets/pedersen.pil index 335b6ea3f2c..e38704dbe73 100644 --- a/barretenberg/cpp/pil/avm/gadgets/avm_pedersen.pil +++ b/barretenberg/cpp/pil/avm/gadgets/pedersen.pil @@ -1,7 +1,7 @@ -include "../avm_main.pil"; +include "../main.pil"; -namespace avm_pedersen(256); +namespace pedersen(256); pol commit clk; diff --git a/barretenberg/cpp/pil/avm/gadgets/avm_poseidon2.pil b/barretenberg/cpp/pil/avm/gadgets/poseidon2.pil similarity index 84% rename from barretenberg/cpp/pil/avm/gadgets/avm_poseidon2.pil rename to barretenberg/cpp/pil/avm/gadgets/poseidon2.pil index fd5a1d7c67c..95b1990cc27 100644 --- a/barretenberg/cpp/pil/avm/gadgets/avm_poseidon2.pil +++ b/barretenberg/cpp/pil/avm/gadgets/poseidon2.pil @@ -1,6 +1,6 @@ -include "../avm_main.pil"; +include "../main.pil"; -namespace avm_poseidon2(256); +namespace poseidon2(256); pol commit clk; diff --git a/barretenberg/cpp/pil/avm/gadgets/avm_sha256.pil b/barretenberg/cpp/pil/avm/gadgets/sha256.pil similarity index 86% rename from barretenberg/cpp/pil/avm/gadgets/avm_sha256.pil rename to barretenberg/cpp/pil/avm/gadgets/sha256.pil index f7ca8b8337a..dc88d50ab3d 100644 --- a/barretenberg/cpp/pil/avm/gadgets/avm_sha256.pil +++ b/barretenberg/cpp/pil/avm/gadgets/sha256.pil @@ -1,6 +1,6 @@ -include "../avm_main.pil"; +include "../main.pil"; -namespace avm_sha256(256); +namespace sha256(256); pol commit clk; diff --git a/barretenberg/cpp/pil/avm/avm_gas.pil b/barretenberg/cpp/pil/avm/gas.pil similarity index 94% rename from barretenberg/cpp/pil/avm/avm_gas.pil rename to barretenberg/cpp/pil/avm/gas.pil index 0ee48d43ece..ab016d1cd12 100644 --- a/barretenberg/cpp/pil/avm/avm_gas.pil +++ b/barretenberg/cpp/pil/avm/gas.pil @@ -1,5 +1,5 @@ -namespace avm_gas(256); +namespace gas(256); // TODO: WILL BE FIXED - we should be able to have this be a fixed column / the lookup tables are fixed so require no selectors // TODO: All the columns here will have to be constant (when supported by our powdr fork and proving system) pol commit gas_cost_sel; diff --git a/barretenberg/cpp/pil/avm/avm_kernel.pil b/barretenberg/cpp/pil/avm/kernel.pil similarity index 80% rename from barretenberg/cpp/pil/avm/avm_kernel.pil rename to barretenberg/cpp/pil/avm/kernel.pil index 5e9d9db8667..e713c877e13 100644 --- a/barretenberg/cpp/pil/avm/avm_kernel.pil +++ b/barretenberg/cpp/pil/avm/kernel.pil @@ -1,7 +1,7 @@ -include "avm_main.pil"; +include "main.pil"; include "constants.pil"; -namespace avm_kernel(256); +namespace kernel(256); pol public(/*idx=*/0) kernel_inputs; pol public(/*idx=*/1) kernel_value_out; @@ -58,29 +58,29 @@ namespace avm_kernel(256); pol commit emit_l2_to_l1_msg_write_offset; - pol NOT_LAST = (1 - avm_main.last); + pol NOT_LAST = (1 - main.last); // Constraints to increase the offsets when the opcodes are found #[NOTE_HASH_EXISTS_INC_CONSISTENCY_CHECK] - NOT_LAST * (note_hash_exist_write_offset' - (note_hash_exist_write_offset + avm_main.sel_op_note_hash_exists)) = 0; + NOT_LAST * (note_hash_exist_write_offset' - (note_hash_exist_write_offset + main.sel_op_note_hash_exists)) = 0; #[EMIT_NOTE_HASH_INC_CONSISTENCY_CHECK] - NOT_LAST * (emit_note_hash_write_offset' - (emit_note_hash_write_offset + avm_main.sel_op_emit_note_hash)) = 0; - // if avm_main.ib is set on op_nullifier_exists, then the nullifier_exists_write_offset will be incremented by 1, otherwise non_exists will be incremented + NOT_LAST * (emit_note_hash_write_offset' - (emit_note_hash_write_offset + main.sel_op_emit_note_hash)) = 0; + // if main.ib is set on op_nullifier_exists, then the nullifier_exists_write_offset will be incremented by 1, otherwise non_exists will be incremented #[NULLIFIER_EXISTS_INC_CONSISTENCY_CHECK] - NOT_LAST * (nullifier_exists_write_offset' - (nullifier_exists_write_offset + (avm_main.sel_op_nullifier_exists * avm_main.ib))) = 0; + NOT_LAST * (nullifier_exists_write_offset' - (nullifier_exists_write_offset + (main.sel_op_nullifier_exists * main.ib))) = 0; #[NULLIFIER_NON_EXISTS_INC_CONSISTENCY_CHECK] - NOT_LAST * (nullifier_non_exists_write_offset' - (nullifier_non_exists_write_offset + (avm_main.sel_op_nullifier_exists * (1 - avm_main.ib)))) = 0; + NOT_LAST * (nullifier_non_exists_write_offset' - (nullifier_non_exists_write_offset + (main.sel_op_nullifier_exists * (1 - main.ib)))) = 0; #[EMIT_NULLIFIER_INC_CONSISTENCY_CHECK] - NOT_LAST * (emit_nullifier_write_offset' - (emit_nullifier_write_offset + avm_main.sel_op_emit_nullifier)) = 0; + NOT_LAST * (emit_nullifier_write_offset' - (emit_nullifier_write_offset + main.sel_op_emit_nullifier)) = 0; #[L1_TO_L2_MSG_EXISTS_INC_CONSISTENCY_CHECK] - NOT_LAST * (l1_to_l2_msg_exists_write_offset' - (l1_to_l2_msg_exists_write_offset + avm_main.sel_op_l1_to_l2_msg_exists)) = 0; + NOT_LAST * (l1_to_l2_msg_exists_write_offset' - (l1_to_l2_msg_exists_write_offset + main.sel_op_l1_to_l2_msg_exists)) = 0; #[EMIT_UNENCRYPTED_LOG_INC_CONSISTENCY_CHECK] - NOT_LAST * (emit_unencrypted_log_write_offset' - (emit_unencrypted_log_write_offset + avm_main.sel_op_emit_unencrypted_log)) = 0; + NOT_LAST * (emit_unencrypted_log_write_offset' - (emit_unencrypted_log_write_offset + main.sel_op_emit_unencrypted_log)) = 0; #[EMIT_L2_TO_L1_MSG_INC_CONSISTENCY_CHECK] - NOT_LAST * (emit_l2_to_l1_msg_write_offset' - (emit_l2_to_l1_msg_write_offset + avm_main.sel_op_emit_l2_to_l1_msg)) = 0; + NOT_LAST * (emit_l2_to_l1_msg_write_offset' - (emit_l2_to_l1_msg_write_offset + main.sel_op_emit_l2_to_l1_msg)) = 0; #[SLOAD_INC_CONSISTENCY_CHECK] - NOT_LAST * (sload_write_offset' - (sload_write_offset + avm_main.sel_op_sload)) = 0; + NOT_LAST * (sload_write_offset' - (sload_write_offset + main.sel_op_sload)) = 0; #[SSTORE_INC_CONSISTENCY_CHECK] - NOT_LAST * (sstore_write_offset' - (sstore_write_offset + avm_main.sel_op_sstore)) = 0; + NOT_LAST * (sstore_write_offset' - (sstore_write_offset + main.sel_op_sstore)) = 0; diff --git a/barretenberg/cpp/pil/avm/avm_main.pil b/barretenberg/cpp/pil/avm/main.pil similarity index 76% rename from barretenberg/cpp/pil/avm/avm_main.pil rename to barretenberg/cpp/pil/avm/main.pil index 1952c1627e4..0389fe25a46 100644 --- a/barretenberg/cpp/pil/avm/avm_main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -1,17 +1,17 @@ -include "avm_mem.pil"; -include "avm_alu.pil"; -include "avm_binary.pil"; +include "mem.pil"; +include "alu.pil"; +include "binary.pil"; include "constants.pil"; -include "avm_kernel.pil"; -include "avm_gas.pil"; -include "gadgets/avm_conversion.pil"; -include "gadgets/avm_sha256.pil"; -include "gadgets/avm_poseidon2.pil"; -include "gadgets/avm_keccakf1600.pil"; -include "gadgets/avm_pedersen.pil"; - -namespace avm_main(256); +include "kernel.pil"; +include "gas.pil"; +include "gadgets/conversion.pil"; +include "gadgets/sha256.pil"; +include "gadgets/poseidon2.pil"; +include "gadgets/keccakf1600.pil"; +include "gadgets/pedersen.pil"; + +namespace main(256); //===== CONSTANT POLYNOMIALS ================================================== pol constant clk(i) { i }; pol constant first = [1] + [0]*; // Used mostly to toggle off the first row consisting @@ -58,7 +58,7 @@ namespace avm_main(256); pol commit sel_op_sstore; //===== GAS ACCOUNTING ======================================================== - // 1. The gas lookup table (in avm_gas.pil) is constant and maps the opcode value to L2/DA gas (fixed) cost. + // 1. The gas lookup table (in gas.pil) is constant and maps the opcode value to L2/DA gas (fixed) cost. // 2. Read gas_op from gas table based on the opcode value // 3. TODO(#6588): constrain gas start and gas end @@ -113,7 +113,7 @@ namespace avm_main(256); #[LOOKUP_OPCODE_GAS] gas_cost_active {opcode_val, l2_gas_op, da_gas_op} in - avm_gas.gas_cost_sel {clk, avm_gas.l2_gas_fixed_table, avm_gas.da_gas_fixed_table}; + gas.gas_cost_sel {clk, gas.l2_gas_fixed_table, gas.da_gas_fixed_table}; #[RANGE_CHECK_L2_GAS_HI] gas_cost_active {abs_l2_rem_gas_hi} in sel_rng_16 {clk}; @@ -214,7 +214,7 @@ namespace avm_main(256); // Errors pol commit op_err; // Boolean flag pertaining to an operation error - pol commit tag_err; // Boolean flag (foreign key to avm_mem.tag_err) + pol commit tag_err; // Boolean flag (foreign key to mem.tag_err) // A helper witness being the inverse of some value // to show a non-zero equality @@ -328,7 +328,7 @@ namespace avm_main(256); sel_cmov * ( 1 - sel_cmov) = 0; op_err * (1 - op_err) = 0; - tag_err * (1 - tag_err) = 0; // Potential optimization (boolean constraint derivation from equivalence check to avm_mem)? + tag_err * (1 - tag_err) = 0; // Potential optimization (boolean constraint derivation from equivalence check to mem)? id_zero * (1 - id_zero) = 0; // Might be removed if derived from opcode based on a lookup of constants @@ -569,107 +569,107 @@ namespace avm_main(256); // CALL CONTEXT #[SENDER_KERNEL] - sel_op_sender * (avm_kernel.kernel_in_offset - constants.SENDER_SELECTOR) = 0; + sel_op_sender * (kernel.kernel_in_offset - constants.SENDER_SELECTOR) = 0; #[ADDRESS_KERNEL] - sel_op_address * (avm_kernel.kernel_in_offset - constants.ADDRESS_SELECTOR) = 0; + sel_op_address * (kernel.kernel_in_offset - constants.ADDRESS_SELECTOR) = 0; #[STORAGE_ADDRESS_KERNEL] - sel_op_storage_address * (avm_kernel.kernel_in_offset - constants.STORAGE_ADDRESS_SELECTOR) = 0; + sel_op_storage_address * (kernel.kernel_in_offset - constants.STORAGE_ADDRESS_SELECTOR) = 0; // FEES #[FEE_DA_GAS_KERNEL] - sel_op_fee_per_da_gas * (avm_kernel.kernel_in_offset - constants.FEE_PER_DA_GAS_SELECTOR) = 0; + sel_op_fee_per_da_gas * (kernel.kernel_in_offset - constants.FEE_PER_DA_GAS_SELECTOR) = 0; #[FEE_L2_GAS_KERNEL] - sel_op_fee_per_l2_gas * (avm_kernel.kernel_in_offset - constants.FEE_PER_L2_GAS_SELECTOR) = 0; + sel_op_fee_per_l2_gas * (kernel.kernel_in_offset - constants.FEE_PER_L2_GAS_SELECTOR) = 0; #[FEE_TRANSACTION_FEE_KERNEL] - sel_op_transaction_fee * (avm_kernel.kernel_in_offset - constants.TRANSACTION_FEE_SELECTOR) = 0; + sel_op_transaction_fee * (kernel.kernel_in_offset - constants.TRANSACTION_FEE_SELECTOR) = 0; // GLOBALS #[CHAIN_ID_KERNEL] - sel_op_chain_id * (avm_kernel.kernel_in_offset - constants.CHAIN_ID_SELECTOR) = 0; + sel_op_chain_id * (kernel.kernel_in_offset - constants.CHAIN_ID_SELECTOR) = 0; #[VERSION_KERNEL] - sel_op_version * (avm_kernel.kernel_in_offset - constants.VERSION_SELECTOR) = 0; + sel_op_version * (kernel.kernel_in_offset - constants.VERSION_SELECTOR) = 0; #[BLOCK_NUMBER_KERNEL] - sel_op_block_number * (avm_kernel.kernel_in_offset - constants.BLOCK_NUMBER_SELECTOR) = 0; + sel_op_block_number * (kernel.kernel_in_offset - constants.BLOCK_NUMBER_SELECTOR) = 0; #[COINBASE_KERNEL] - sel_op_coinbase * (avm_kernel.kernel_in_offset - constants.COINBASE_SELECTOR) = 0; + sel_op_coinbase * (kernel.kernel_in_offset - constants.COINBASE_SELECTOR) = 0; #[TIMESTAMP_KERNEL] - sel_op_timestamp * (avm_kernel.kernel_in_offset - constants.TIMESTAMP_SELECTOR) = 0; + sel_op_timestamp * (kernel.kernel_in_offset - constants.TIMESTAMP_SELECTOR) = 0; // OUTPUTS LOOKUPS // Constrain the value of kernel_out_offset to be the correct offset for the operation being performed #[NOTE_HASH_KERNEL_OUTPUT] - sel_op_note_hash_exists * (avm_kernel.kernel_out_offset - (avm_kernel.START_NOTE_HASH_EXISTS_WRITE_OFFSET + avm_kernel.note_hash_exist_write_offset)) = 0; - first * avm_kernel.note_hash_exist_write_offset = 0; + sel_op_note_hash_exists * (kernel.kernel_out_offset - (kernel.START_NOTE_HASH_EXISTS_WRITE_OFFSET + kernel.note_hash_exist_write_offset)) = 0; + first * kernel.note_hash_exist_write_offset = 0; #[EMIT_NOTE_HASH_KERNEL_OUTPUT] - sel_op_emit_note_hash * (avm_kernel.kernel_out_offset - (avm_kernel.START_EMIT_NOTE_HASH_WRITE_OFFSET + avm_kernel.emit_note_hash_write_offset)) = 0; - first * avm_kernel.emit_note_hash_write_offset = 0; + sel_op_emit_note_hash * (kernel.kernel_out_offset - (kernel.START_EMIT_NOTE_HASH_WRITE_OFFSET + kernel.emit_note_hash_write_offset)) = 0; + first * kernel.emit_note_hash_write_offset = 0; #[NULLIFIER_EXISTS_KERNEL_OUTPUT] - sel_op_nullifier_exists * (avm_kernel.kernel_out_offset - ((ib * (avm_kernel.START_NULLIFIER_EXISTS_OFFSET + avm_kernel.nullifier_exists_write_offset)) + ((1 - ib) * (avm_kernel.START_NULLIFIER_NON_EXISTS_OFFSET + avm_kernel.nullifier_non_exists_write_offset)))) = 0; - first * avm_kernel.nullifier_exists_write_offset = 0; - first * avm_kernel.nullifier_non_exists_write_offset = 0; + sel_op_nullifier_exists * (kernel.kernel_out_offset - ((ib * (kernel.START_NULLIFIER_EXISTS_OFFSET + kernel.nullifier_exists_write_offset)) + ((1 - ib) * (kernel.START_NULLIFIER_NON_EXISTS_OFFSET + kernel.nullifier_non_exists_write_offset)))) = 0; + first * kernel.nullifier_exists_write_offset = 0; + first * kernel.nullifier_non_exists_write_offset = 0; #[EMIT_NULLIFIER_KERNEL_OUTPUT] - sel_op_emit_nullifier * (avm_kernel.kernel_out_offset - (avm_kernel.START_EMIT_NULLIFIER_WRITE_OFFSET + avm_kernel.emit_nullifier_write_offset)) = 0; - first * avm_kernel.emit_nullifier_write_offset = 0; + sel_op_emit_nullifier * (kernel.kernel_out_offset - (kernel.START_EMIT_NULLIFIER_WRITE_OFFSET + kernel.emit_nullifier_write_offset)) = 0; + first * kernel.emit_nullifier_write_offset = 0; #[L1_TO_L2_MSG_EXISTS_KERNEL_OUTPUT] - sel_op_l1_to_l2_msg_exists * (avm_kernel.kernel_out_offset - (avm_kernel.START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + avm_kernel.l1_to_l2_msg_exists_write_offset)) = 0; - first * avm_kernel.l1_to_l2_msg_exists_write_offset = 0; + sel_op_l1_to_l2_msg_exists * (kernel.kernel_out_offset - (kernel.START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + kernel.l1_to_l2_msg_exists_write_offset)) = 0; + first * kernel.l1_to_l2_msg_exists_write_offset = 0; #[EMIT_UNENCRYPTED_LOG_KERNEL_OUTPUT] - sel_op_emit_unencrypted_log * (avm_kernel.kernel_out_offset - (avm_kernel.START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET + avm_kernel.emit_unencrypted_log_write_offset)) = 0; - first * avm_kernel.emit_unencrypted_log_write_offset = 0; + sel_op_emit_unencrypted_log * (kernel.kernel_out_offset - (kernel.START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET + kernel.emit_unencrypted_log_write_offset)) = 0; + first * kernel.emit_unencrypted_log_write_offset = 0; // TODO: Add the equivalent for GETCONTRACTINSTANCE? #[EMIT_L2_TO_L1_MSGS_KERNEL_OUTPUT] - sel_op_emit_l2_to_l1_msg * (avm_kernel.kernel_out_offset - (avm_kernel.START_EMIT_L2_TO_l1_MSG + avm_kernel.emit_l2_to_l1_msg_write_offset)) = 0; - first * avm_kernel.emit_l2_to_l1_msg_write_offset = 0; + sel_op_emit_l2_to_l1_msg * (kernel.kernel_out_offset - (kernel.START_EMIT_L2_TO_l1_MSG + kernel.emit_l2_to_l1_msg_write_offset)) = 0; + first * kernel.emit_l2_to_l1_msg_write_offset = 0; #[SLOAD_KERNEL_OUTPUT] - sel_op_sload * (avm_kernel.kernel_out_offset - (avm_kernel.START_SLOAD_WRITE_OFFSET + avm_kernel.sload_write_offset)) = 0; - first * avm_kernel.sload_write_offset = 0; + sel_op_sload * (kernel.kernel_out_offset - (kernel.START_SLOAD_WRITE_OFFSET + kernel.sload_write_offset)) = 0; + first * kernel.sload_write_offset = 0; #[SSTORE_KERNEL_OUTPUT] - sel_op_sstore * (avm_kernel.kernel_out_offset - (avm_kernel.START_SSTORE_WRITE_OFFSET + avm_kernel.sstore_write_offset)) = 0; - first * avm_kernel.sstore_write_offset = 0; + sel_op_sstore * (kernel.kernel_out_offset - (kernel.START_SSTORE_WRITE_OFFSET + kernel.sstore_write_offset)) = 0; + first * kernel.sstore_write_offset = 0; // When we encounter a state writing opcode // We increment the side effect counter by 1 - KERNEL_OUTPUT_SELECTORS * (avm_kernel.side_effect_counter' - (avm_kernel.side_effect_counter + 1)) = 0; + KERNEL_OUTPUT_SELECTORS * (kernel.side_effect_counter' - (kernel.side_effect_counter + 1)) = 0; #[KERNEL_OUTPUT_LOOKUP] - q_kernel_output_lookup {avm_kernel.kernel_out_offset, ia, avm_kernel.side_effect_counter, ib} in avm_kernel.q_public_input_kernel_out_add_to_table {clk, avm_kernel.kernel_value_out, avm_kernel.kernel_side_effect_out, avm_kernel.kernel_metadata_out}; + q_kernel_output_lookup {kernel.kernel_out_offset, ia, kernel.side_effect_counter, ib} in kernel.q_public_input_kernel_out_add_to_table {clk, kernel.kernel_value_out, kernel.kernel_side_effect_out, kernel.kernel_metadata_out}; #[LOOKUP_INTO_KERNEL] - q_kernel_lookup { avm_main.ia, avm_kernel.kernel_in_offset } in avm_kernel.q_public_input_kernel_add_to_table { avm_kernel.kernel_inputs, clk }; + q_kernel_lookup { main.ia, kernel.kernel_in_offset } in kernel.q_public_input_kernel_add_to_table { kernel.kernel_inputs, clk }; //====== Inter-table Constraints ============================================ #[INCL_MAIN_TAG_ERR] - avm_mem.tag_err {avm_mem.clk} in tag_err {clk}; + mem.tag_err {mem.clk} in tag_err {clk}; #[INCL_MEM_TAG_ERR] - tag_err {clk} in avm_mem.tag_err {avm_mem.clk}; + tag_err {clk} in mem.tag_err {mem.clk}; #[PERM_MAIN_ALU] alu_sel {clk, ia, ib, ic, sel_op_add, sel_op_sub, sel_op_mul, sel_op_div, sel_op_eq, sel_op_not, sel_op_cast, sel_op_lt, sel_op_lte, sel_op_shr, sel_op_shl, alu_in_tag} is - avm_alu.alu_sel {avm_alu.clk, avm_alu.ia, avm_alu.ib, avm_alu.ic, avm_alu.op_add, avm_alu.op_sub, - avm_alu.op_mul, avm_alu.op_div, avm_alu.op_eq, avm_alu.op_not, avm_alu.op_cast, - avm_alu.op_lt, avm_alu.op_lte, avm_alu.op_shr, avm_alu.op_shl, avm_alu.in_tag}; + alu.alu_sel {alu.clk, alu.ia, alu.ib, alu.ic, alu.op_add, alu.op_sub, + alu.op_mul, alu.op_div, alu.op_eq, alu.op_not, alu.op_cast, + alu.op_lt, alu.op_lte, alu.op_shr, alu.op_shl, alu.in_tag}; // Based on the boolean selectors, we derive the binary op id to lookup in the table; // TODO: Check if having 4 columns (op_id + 3 boolean selectors) is more optimal that just using the op_id @@ -687,179 +687,179 @@ namespace avm_main(256); #[PERM_MAIN_BIN] bin_sel {clk, ia, ib, ic, bin_op_id, r_in_tag} is - avm_binary.start {avm_binary.clk, avm_binary.acc_ia, avm_binary.acc_ib, avm_binary.acc_ic, avm_binary.op_id, avm_binary.in_tag}; + binary.start {binary.clk, binary.acc_ia, binary.acc_ib, binary.acc_ic, binary.op_id, binary.in_tag}; #[PERM_MAIN_CONV] sel_op_radix_le {clk, ia, ic, id} is - avm_conversion.to_radix_le_sel {avm_conversion.clk, avm_conversion.input, avm_conversion.radix, avm_conversion.num_limbs}; + conversion.to_radix_le_sel {conversion.clk, conversion.input, conversion.radix, conversion.num_limbs}; // This will be enabled when we migrate just to sha256Compression, as getting sha256 to work with it is tricky. // #[PERM_MAIN_SHA256] // sel_op_sha256 {clk, ia, ib, ic} // is - // avm_sha256.sha256_compression_sel {avm_sha256.clk, avm_sha256.state, avm_sha256.input, avm_sha256.output}; + // sha256.sha256_compression_sel {sha256.clk, sha256.state, sha256.input, sha256.output}; #[PERM_MAIN_POS2_PERM] sel_op_poseidon2 {clk, ia, ib} is - avm_poseidon2.poseidon_perm_sel {avm_poseidon2.clk, avm_poseidon2.input, avm_poseidon2.output}; + poseidon2.poseidon_perm_sel {poseidon2.clk, poseidon2.input, poseidon2.output}; // This will be enabled when we migrate just to keccakf1600, as getting keccak to work with it is tricky. // #[PERM_MAIN_KECCAK] // sel_op_keccak {clk, ia, ic} // is - // avm_keccakf1600.keccakf1600_sel {avm_keccakf1600.clk, avm_keccakf1600.input, avm_keccakf1600.output}; + // keccakf1600.keccakf1600_sel {keccakf1600.clk, keccakf1600.input, keccakf1600.output}; #[PERM_MAIN_PEDERSEN] sel_op_pedersen {clk, ia} is - avm_pedersen.pedersen_sel {avm_pedersen.clk, avm_pedersen.input}; + pedersen.pedersen_sel {pedersen.clk, pedersen.input}; #[PERM_MAIN_MEM_A] mem_op_a {clk, space_id, mem_idx_a, ia, rwa , r_in_tag, w_in_tag, sel_mov_a, sel_cmov} is - avm_mem.op_a {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val, avm_mem.rw - , avm_mem.r_in_tag, avm_mem.w_in_tag, avm_mem.sel_mov_a, avm_mem.sel_cmov}; + mem.op_a {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw + , mem.r_in_tag, mem.w_in_tag, mem.sel_mov_a, mem.sel_cmov}; #[PERM_MAIN_MEM_B] mem_op_b {clk, space_id, mem_idx_b, ib, rwb , r_in_tag, w_in_tag, sel_mov_b, sel_cmov} is - avm_mem.op_b {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val, avm_mem.rw - , avm_mem.r_in_tag, avm_mem.w_in_tag, avm_mem.sel_mov_b, avm_mem.sel_cmov}; + mem.op_b {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw + , mem.r_in_tag, mem.w_in_tag, mem.sel_mov_b, mem.sel_cmov}; #[PERM_MAIN_MEM_C] mem_op_c {clk, space_id, mem_idx_c, ic, rwc , r_in_tag, w_in_tag} is - avm_mem.op_c {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val, avm_mem.rw - , avm_mem.r_in_tag, avm_mem.w_in_tag}; + mem.op_c {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw + , mem.r_in_tag, mem.w_in_tag}; #[PERM_MAIN_MEM_D] mem_op_d {clk, space_id, mem_idx_d, id, rwd , r_in_tag, w_in_tag, sel_cmov} is - avm_mem.op_d {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val, avm_mem.rw - , avm_mem.r_in_tag, avm_mem.w_in_tag, avm_mem.sel_cmov}; + mem.op_d {mem.clk, mem.space_id, mem.addr, mem.val, mem.rw + , mem.r_in_tag, mem.w_in_tag, mem.sel_cmov}; #[PERM_MAIN_MEM_IND_A] ind_op_a {clk, space_id, ind_a, mem_idx_a} is - avm_mem.ind_op_a {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val}; + mem.ind_op_a {mem.clk, mem.space_id, mem.addr, mem.val}; #[PERM_MAIN_MEM_IND_B] ind_op_b {clk, space_id, ind_b, mem_idx_b} is - avm_mem.ind_op_b {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val}; + mem.ind_op_b {mem.clk, mem.space_id, mem.addr, mem.val}; #[PERM_MAIN_MEM_IND_C] ind_op_c {clk, space_id, ind_c, mem_idx_c} is - avm_mem.ind_op_c {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val}; + mem.ind_op_c {mem.clk, mem.space_id, mem.addr, mem.val}; #[PERM_MAIN_MEM_IND_D] ind_op_d {clk, space_id, ind_d, mem_idx_d} is - avm_mem.ind_op_d {avm_mem.clk, avm_mem.space_id, avm_mem.addr, avm_mem.val}; + mem.ind_op_d {mem.clk, mem.space_id, mem.addr, mem.val}; #[LOOKUP_MEM_RNG_CHK_LO] - avm_mem.rng_chk_sel {avm_mem.diff_lo} in sel_rng_16 {clk}; + mem.rng_chk_sel {mem.diff_lo} in sel_rng_16 {clk}; #[LOOKUP_MEM_RNG_CHK_MID] - avm_mem.rng_chk_sel {avm_mem.diff_mid} in sel_rng_16 {clk}; + mem.rng_chk_sel {mem.diff_mid} in sel_rng_16 {clk}; #[LOOKUP_MEM_RNG_CHK_HI] - avm_mem.rng_chk_sel {avm_mem.diff_hi} in sel_rng_8 {clk}; + mem.rng_chk_sel {mem.diff_hi} in sel_rng_8 {clk}; //====== Inter-table Shift Constraints (Lookups) ============================================ // Currently only used for shift operations but can be generalised for other uses. // Lookup for 2**(ib) #[LOOKUP_POW_2_0] - avm_alu.shift_sel {avm_alu.ib, avm_alu.two_pow_s} in sel_rng_8 {clk, table_pow_2}; + alu.shift_sel {alu.ib, alu.two_pow_s} in sel_rng_8 {clk, table_pow_2}; // Lookup for 2**(t-ib) #[LOOKUP_POW_2_1] - avm_alu.shift_sel {avm_alu.t_sub_s_bits , avm_alu.two_pow_t_sub_s} in sel_rng_8 {clk, table_pow_2}; + alu.shift_sel {alu.t_sub_s_bits , alu.two_pow_t_sub_s} in sel_rng_8 {clk, table_pow_2}; //====== Inter-table Constraints (Range Checks) ============================================ // TODO: Investigate optimising these range checks. Handling non-FF elements should require less range checks. // One can increase the granularity based on the operation and tag. In the most extreme case, // a specific selector per register might be introduced. #[LOOKUP_U8_0] - avm_alu.rng_chk_lookup_selector { avm_alu.u8_r0 } in sel_rng_8 { clk }; + alu.rng_chk_lookup_selector { alu.u8_r0 } in sel_rng_8 { clk }; #[LOOKUP_U8_1] - avm_alu.rng_chk_lookup_selector { avm_alu.u8_r1 } in sel_rng_8 { clk }; + alu.rng_chk_lookup_selector { alu.u8_r1 } in sel_rng_8 { clk }; #[LOOKUP_U16_0] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r0 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r0 } in sel_rng_16 { clk }; #[LOOKUP_U16_1] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r1 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r1 } in sel_rng_16 { clk }; #[LOOKUP_U16_2] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r2 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r2 } in sel_rng_16 { clk }; #[LOOKUP_U16_3] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r3 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r3 } in sel_rng_16 { clk }; #[LOOKUP_U16_4] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r4 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r4 } in sel_rng_16 { clk }; #[LOOKUP_U16_5] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r5 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r5 } in sel_rng_16 { clk }; #[LOOKUP_U16_6] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r6 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r6 } in sel_rng_16 { clk }; #[LOOKUP_U16_7] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r7 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r7 } in sel_rng_16 { clk }; #[LOOKUP_U16_8] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r8 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r8 } in sel_rng_16 { clk }; #[LOOKUP_U16_9] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r9 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r9 } in sel_rng_16 { clk }; #[LOOKUP_U16_10] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r10 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r10 } in sel_rng_16 { clk }; #[LOOKUP_U16_11] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r11 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r11 } in sel_rng_16 { clk }; #[LOOKUP_U16_12] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r12 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r12 } in sel_rng_16 { clk }; #[LOOKUP_U16_13] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r13 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r13 } in sel_rng_16 { clk }; #[LOOKUP_U16_14] - avm_alu.rng_chk_lookup_selector {avm_alu.u16_r14 } in sel_rng_16 { clk }; + alu.rng_chk_lookup_selector {alu.u16_r14 } in sel_rng_16 { clk }; // ==== Additional row range checks for division #[LOOKUP_DIV_U16_0] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r0} in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r0} in sel_rng_16 { clk }; #[LOOKUP_DIV_U16_1] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r1 } in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r1 } in sel_rng_16 { clk }; #[LOOKUP_DIV_U16_2] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r2 } in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r2 } in sel_rng_16 { clk }; #[LOOKUP_DIV_U16_3] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r3 } in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r3 } in sel_rng_16 { clk }; #[LOOKUP_DIV_U16_4] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r4 } in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r4 } in sel_rng_16 { clk }; #[LOOKUP_DIV_U16_5] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r5 } in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r5 } in sel_rng_16 { clk }; #[LOOKUP_DIV_U16_6] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r6 } in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r6 } in sel_rng_16 { clk }; #[LOOKUP_DIV_U16_7] - avm_alu.div_rng_chk_selector {avm_alu.div_u16_r7 } in sel_rng_16 { clk }; + alu.div_rng_chk_selector {alu.div_u16_r7 } in sel_rng_16 { clk }; diff --git a/barretenberg/cpp/pil/avm/avm_mem.pil b/barretenberg/cpp/pil/avm/mem.pil similarity index 94% rename from barretenberg/cpp/pil/avm/avm_mem.pil rename to barretenberg/cpp/pil/avm/mem.pil index 1b2b3164866..c999e7196f1 100644 --- a/barretenberg/cpp/pil/avm/avm_mem.pil +++ b/barretenberg/cpp/pil/avm/mem.pil @@ -1,6 +1,6 @@ -include "avm_main.pil"; +include "main.pil"; -namespace avm_mem(256); +namespace mem(256); // ========= Table MEM-TR ================= pol commit clk; pol commit tsp; // Timestamp derived form clk and sub-operation types (SUB_CLK) @@ -15,18 +15,18 @@ namespace avm_mem(256); pol commit mem_sel; // Selector for every row pertaining to the memory trace pol commit rng_chk_sel; // Selector for row on which range-checks apply. - pol commit r_in_tag; // Instruction memory tag ("foreign key" pointing to avm_main.r_in_tag) - pol commit w_in_tag; // Instruction memory tag ("foreign key" pointing to avm_main.w_in_tag) + pol commit r_in_tag; // Instruction memory tag ("foreign key" pointing to main.r_in_tag) + pol commit w_in_tag; // Instruction memory tag ("foreign key" pointing to main.w_in_tag) pol commit skip_check_tag; // A boolean value which relaxes the consistency check in memory // trace between tag and r_in_tag. Required for CMOV opcode. - // Indicator of the intermediate register pertaining to the memory operation (foreign key to avm_main.mem_op_XXX) + // Indicator of the intermediate register pertaining to the memory operation (foreign key to main.mem_op_XXX) pol commit op_a; pol commit op_b; pol commit op_c; pol commit op_d; - // Indicator of the indirect register pertaining to the memory operation (foreign key to avm_main.ind_op_XXX) + // Indicator of the indirect register pertaining to the memory operation (foreign key to main.ind_op_XXX) pol commit ind_op_a; pol commit ind_op_b; pol commit ind_op_c; @@ -73,11 +73,11 @@ namespace avm_mem(256); // Enforce the memory entries to be contiguous, i.e., as soon as // mem_sel is disabled all subsequent rows have mem_sel disabled. #[MEM_CONTIGUOUS] - (1 - avm_main.first) * mem_sel' * (1 - mem_sel) = 0; + (1 - main.first) * mem_sel' * (1 - mem_sel) = 0; // Memory trace rows cannot start at first row #[MEM_FIRST_EMPTY] - avm_main.first * mem_sel = 0; + main.first * mem_sel = 0; // Definition of last, i.e., last row with mem_sel activated #[MEM_LAST] @@ -105,13 +105,13 @@ namespace avm_mem(256); glob_addr = space_id * 2**32 + addr; #[LAST_ACCESS_FIRST_ROW] - avm_main.first * (1 - lastAccess) = 0; + main.first * (1 - lastAccess) = 0; // Remark: lastAccess == 1 on first row and therefore any relation with the - // multiplicative term (1 - lastAccess) implicitly includes (1 - avm_main.first) + // multiplicative term (1 - lastAccess) implicitly includes (1 - main.first) // Similarly, this includes (1 - last) as well. // lastAccess == 0 ==> glob_addr' == glob_addr - // Optimization: We removed the term (1 - avm_main.first) + // Optimization: We removed the term (1 - main.first) #[MEM_LAST_ACCESS_DELIMITER] (1 - lastAccess) * (glob_addr' - glob_addr) = 0; @@ -138,12 +138,12 @@ namespace avm_mem(256); // Note: in barretenberg, a shifted polynomial will be 0 on the last row (shift is not cyclic) // Note2: in barretenberg, if a poynomial is shifted, its non-shifted equivalent must be 0 on the first row - // Optimization: We removed the term (1 - avm_main.first) and (1 - last) + // Optimization: We removed the term (1 - main.first) and (1 - last) #[MEM_READ_WRITE_VAL_CONSISTENCY] (1 - lastAccess) * (1 - rw') * (val' - val) = 0; // lastAccess == 0 && rw' == 0 ==> tag == tag' - // Optimization: We removed the term (1 - avm_main.first) and (1 - last) + // Optimization: We removed the term (1 - main.first) and (1 - last) #[MEM_READ_WRITE_TAG_CONSISTENCY] (1 - lastAccess) * (1 - rw') * (tag' - tag) = 0; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/alu.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/alu.hpp new file mode 100644 index 00000000000..f1d0c3163cc --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/alu.hpp @@ -0,0 +1,1187 @@ + +#pragma once +#include "../../relation_parameters.hpp" +#include "../../relation_types.hpp" +#include "./declare_views.hpp" + +namespace bb::Avm_vm { + +template struct AluRow { + FF alu_a_hi{}; + FF alu_a_hi_shift{}; + FF alu_a_lo{}; + FF alu_a_lo_shift{}; + FF alu_alu_sel{}; + FF alu_alu_sel_shift{}; + FF alu_b_hi{}; + FF alu_b_hi_shift{}; + FF alu_b_lo{}; + FF alu_b_lo_shift{}; + FF alu_borrow{}; + FF alu_cf{}; + FF alu_cmp_rng_ctr{}; + FF alu_cmp_rng_ctr_shift{}; + FF alu_cmp_sel{}; + FF alu_cmp_sel_shift{}; + FF alu_div_rng_chk_selector{}; + FF alu_div_rng_chk_selector_shift{}; + FF alu_div_u16_r0{}; + FF alu_div_u16_r0_shift{}; + FF alu_div_u16_r1{}; + FF alu_div_u16_r1_shift{}; + FF alu_div_u16_r2{}; + FF alu_div_u16_r2_shift{}; + FF alu_div_u16_r3{}; + FF alu_div_u16_r3_shift{}; + FF alu_div_u16_r4{}; + FF alu_div_u16_r4_shift{}; + FF alu_div_u16_r5{}; + FF alu_div_u16_r5_shift{}; + FF alu_div_u16_r6{}; + FF alu_div_u16_r6_shift{}; + FF alu_div_u16_r7{}; + FF alu_div_u16_r7_shift{}; + FF alu_divisor_hi{}; + FF alu_divisor_lo{}; + FF alu_ff_tag{}; + FF alu_ia{}; + FF alu_ib{}; + FF alu_ic{}; + FF alu_in_tag{}; + FF alu_op_add{}; + FF alu_op_add_shift{}; + FF alu_op_cast{}; + FF alu_op_cast_prev{}; + FF alu_op_cast_prev_shift{}; + FF alu_op_cast_shift{}; + FF alu_op_div{}; + FF alu_op_div_a_lt_b{}; + FF alu_op_div_shift{}; + FF alu_op_div_std{}; + FF alu_op_eq{}; + FF alu_op_eq_diff_inv{}; + FF alu_op_lt{}; + FF alu_op_lte{}; + FF alu_op_mul{}; + FF alu_op_mul_shift{}; + FF alu_op_not{}; + FF alu_op_shl{}; + FF alu_op_shl_shift{}; + FF alu_op_shr{}; + FF alu_op_shr_shift{}; + FF alu_op_sub{}; + FF alu_op_sub_shift{}; + FF alu_p_a_borrow{}; + FF alu_p_b_borrow{}; + FF alu_p_sub_a_hi{}; + FF alu_p_sub_a_hi_shift{}; + FF alu_p_sub_a_lo{}; + FF alu_p_sub_a_lo_shift{}; + FF alu_p_sub_b_hi{}; + FF alu_p_sub_b_hi_shift{}; + FF alu_p_sub_b_lo{}; + FF alu_p_sub_b_lo_shift{}; + FF alu_partial_prod_hi{}; + FF alu_partial_prod_lo{}; + FF alu_quotient_hi{}; + FF alu_quotient_lo{}; + FF alu_remainder{}; + FF alu_res_hi{}; + FF alu_res_lo{}; + FF alu_rng_chk_lookup_selector_shift{}; + FF alu_rng_chk_sel{}; + FF alu_rng_chk_sel_shift{}; + FF alu_shift_lt_bit_len{}; + FF alu_shift_sel{}; + FF alu_t_sub_s_bits{}; + FF alu_two_pow_s{}; + FF alu_two_pow_t_sub_s{}; + FF alu_u128_tag{}; + FF alu_u16_r0{}; + FF alu_u16_r0_shift{}; + FF alu_u16_r1{}; + FF alu_u16_r10{}; + FF alu_u16_r11{}; + FF alu_u16_r12{}; + FF alu_u16_r13{}; + FF alu_u16_r14{}; + FF alu_u16_r1_shift{}; + FF alu_u16_r2{}; + FF alu_u16_r2_shift{}; + FF alu_u16_r3{}; + FF alu_u16_r3_shift{}; + FF alu_u16_r4{}; + FF alu_u16_r4_shift{}; + FF alu_u16_r5{}; + FF alu_u16_r5_shift{}; + FF alu_u16_r6{}; + FF alu_u16_r6_shift{}; + FF alu_u16_r7{}; + FF alu_u16_r8{}; + FF alu_u16_r9{}; + FF alu_u16_tag{}; + FF alu_u32_tag{}; + FF alu_u64_tag{}; + FF alu_u8_r0{}; + FF alu_u8_r0_shift{}; + FF alu_u8_r1{}; + FF alu_u8_r1_shift{}; + FF alu_u8_tag{}; + + [[maybe_unused]] static std::vector names(); +}; + +inline std::string get_relation_label_alu(int index) +{ + switch (index) { + case 12: + return "ALU_ADD_SUB_1"; + + case 13: + return "ALU_ADD_SUB_2"; + + case 14: + return "ALU_MULTIPLICATION_FF"; + + case 15: + return "ALU_MUL_COMMON_1"; + + case 16: + return "ALU_MUL_COMMON_2"; + + case 19: + return "ALU_MULTIPLICATION_OUT_U128"; + + case 20: + return "ALU_FF_NOT_XOR"; + + case 21: + return "ALU_OP_NOT"; + + case 22: + return "ALU_RES_IS_BOOL"; + + case 23: + return "ALU_OP_EQ"; + + case 24: + return "INPUT_DECOMP_1"; + + case 25: + return "INPUT_DECOMP_2"; + + case 27: + return "SUB_LO_1"; + + case 28: + return "SUB_HI_1"; + + case 30: + return "SUB_LO_2"; + + case 31: + return "SUB_HI_2"; + + case 32: + return "RES_LO"; + + case 33: + return "RES_HI"; + + case 34: + return "CMP_CTR_REL_1"; + + case 35: + return "CMP_CTR_REL_2"; + + case 38: + return "CTR_NON_ZERO_REL"; + + case 39: + return "RNG_CHK_LOOKUP_SELECTOR"; + + case 40: + return "LOWER_CMP_RNG_CHK"; + + case 41: + return "UPPER_CMP_RNG_CHK"; + + case 42: + return "SHIFT_RELS_0"; + + case 44: + return "SHIFT_RELS_1"; + + case 46: + return "SHIFT_RELS_2"; + + case 48: + return "SHIFT_RELS_3"; + + case 50: + return "OP_CAST_PREV_LINE"; + + case 51: + return "ALU_OP_CAST"; + + case 52: + return "OP_CAST_RNG_CHECK_P_SUB_A_LOW"; + + case 53: + return "OP_CAST_RNG_CHECK_P_SUB_A_HIGH"; + + case 54: + return "TWO_LINE_OP_NO_OVERLAP"; + + case 55: + return "SHR_RANGE_0"; + + case 56: + return "SHR_RANGE_1"; + + case 57: + return "SHL_RANGE_0"; + + case 58: + return "SHL_RANGE_1"; + + case 60: + return "SHIFT_LT_BIT_LEN"; + + case 61: + return "SHR_INPUT_DECOMPOSITION"; + + case 62: + return "SHR_OUTPUT"; + + case 63: + return "SHL_INPUT_DECOMPOSITION"; + + case 64: + return "SHL_OUTPUT"; + + case 74: + return "ALU_PROD_DIV"; + + case 75: + return "REMAINDER_RANGE_CHK"; + + case 76: + return "CMP_CTR_REL_3"; + + case 78: + return "DIVISION_RELATION"; + } + return std::to_string(index); +} + +template class aluImpl { + public: + using FF = FF_; + + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 6, 6, 8, 3, 4, 4, 5, 4, 4, 3, 4, 3, + 3, 4, 3, 6, 5, 3, 3, 3, 3, 4, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 4, 4, 4, 4, + 4, 3, 5, 5, 4, 5, 5, 2, 3, 3, 3, 3, 3, 4, 4, 3, 5, 3, 3, 3, 5, 3, 3, 4, 4, 4, 4, 4, 4, + }; + + template + void static accumulate(ContainerOverSubrelations& evals, + const AllEntities& new_term, + [[maybe_unused]] const RelationParameters&, + [[maybe_unused]] const FF& scaling_factor) + { + + // Contribution 0 + { + Avm_DECLARE_VIEWS(0); + + auto tmp = (alu_alu_sel - + ((((((((((alu_op_add + alu_op_sub) + alu_op_mul) + alu_op_not) + alu_op_eq) + alu_op_cast) + + alu_op_lt) + + alu_op_lte) + + alu_op_shr) + + alu_op_shl) + + alu_op_div)); + tmp *= scaling_factor; + std::get<0>(evals) += tmp; + } + // Contribution 1 + { + Avm_DECLARE_VIEWS(1); + + auto tmp = (alu_cmp_sel - (alu_op_lt + alu_op_lte)); + tmp *= scaling_factor; + std::get<1>(evals) += tmp; + } + // Contribution 2 + { + Avm_DECLARE_VIEWS(2); + + auto tmp = (alu_shift_sel - (alu_op_shl + alu_op_shr)); + tmp *= scaling_factor; + std::get<2>(evals) += tmp; + } + // Contribution 3 + { + Avm_DECLARE_VIEWS(3); + + auto tmp = (alu_cf * (-alu_cf + FF(1))); + tmp *= scaling_factor; + std::get<3>(evals) += tmp; + } + // Contribution 4 + { + Avm_DECLARE_VIEWS(4); + + auto tmp = (alu_ff_tag * (-alu_ff_tag + FF(1))); + tmp *= scaling_factor; + std::get<4>(evals) += tmp; + } + // Contribution 5 + { + Avm_DECLARE_VIEWS(5); + + auto tmp = (alu_u8_tag * (-alu_u8_tag + FF(1))); + tmp *= scaling_factor; + std::get<5>(evals) += tmp; + } + // Contribution 6 + { + Avm_DECLARE_VIEWS(6); + + auto tmp = (alu_u16_tag * (-alu_u16_tag + FF(1))); + tmp *= scaling_factor; + std::get<6>(evals) += tmp; + } + // Contribution 7 + { + Avm_DECLARE_VIEWS(7); + + auto tmp = (alu_u32_tag * (-alu_u32_tag + FF(1))); + tmp *= scaling_factor; + std::get<7>(evals) += tmp; + } + // Contribution 8 + { + Avm_DECLARE_VIEWS(8); + + auto tmp = (alu_u64_tag * (-alu_u64_tag + FF(1))); + tmp *= scaling_factor; + std::get<8>(evals) += tmp; + } + // Contribution 9 + { + Avm_DECLARE_VIEWS(9); + + auto tmp = (alu_u128_tag * (-alu_u128_tag + FF(1))); + tmp *= scaling_factor; + std::get<9>(evals) += tmp; + } + // Contribution 10 + { + Avm_DECLARE_VIEWS(10); + + auto tmp = + (alu_alu_sel * + ((((((alu_ff_tag + alu_u8_tag) + alu_u16_tag) + alu_u32_tag) + alu_u64_tag) + alu_u128_tag) - FF(1))); + tmp *= scaling_factor; + std::get<10>(evals) += tmp; + } + // Contribution 11 + { + Avm_DECLARE_VIEWS(11); + + auto tmp = (alu_in_tag - + (((((alu_u8_tag + (alu_u16_tag * FF(2))) + (alu_u32_tag * FF(3))) + (alu_u64_tag * FF(4))) + + (alu_u128_tag * FF(5))) + + (alu_ff_tag * FF(6)))); + tmp *= scaling_factor; + std::get<11>(evals) += tmp; + } + // Contribution 12 + { + Avm_DECLARE_VIEWS(12); + + auto tmp = + (((alu_op_add + alu_op_sub) * ((((((((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))) + + (alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + (alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + + (alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + + (alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) - + alu_ia) + + (alu_ff_tag * alu_ic))) + + ((alu_op_add - alu_op_sub) * ((alu_cf * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL })) - alu_ib))); + tmp *= scaling_factor; + std::get<12>(evals) += tmp; + } + // Contribution 13 + { + Avm_DECLARE_VIEWS(13); + + auto tmp = (((alu_op_add + alu_op_sub) * + (((((((alu_u8_tag * alu_u8_r0) + (alu_u16_tag * (alu_u8_r0 + (alu_u8_r1 * FF(256))))) + + (alu_u32_tag * ((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))))) + + (alu_u64_tag * ((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))))) + + (alu_u128_tag * ((((((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))) + + (alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + (alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + + (alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + + (alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))))) + + (alu_ff_tag * alu_ia)) - + alu_ic)) + + ((alu_ff_tag * (alu_op_add - alu_op_sub)) * alu_ib)); + tmp *= scaling_factor; + std::get<13>(evals) += tmp; + } + // Contribution 14 + { + Avm_DECLARE_VIEWS(14); + + auto tmp = ((alu_ff_tag * alu_op_mul) * ((alu_ia * alu_ib) - alu_ic)); + tmp *= scaling_factor; + std::get<14>(evals) += tmp; + } + // Contribution 15 + { + Avm_DECLARE_VIEWS(15); + + auto tmp = ((((-alu_ff_tag + FF(1)) - alu_u128_tag) * alu_op_mul) * + (((((((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))) + + (alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + (alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + + (alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + + (alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) - + (alu_ia * alu_ib))); + tmp *= scaling_factor; + std::get<15>(evals) += tmp; + } + // Contribution 16 + { + Avm_DECLARE_VIEWS(16); + + auto tmp = + (alu_op_mul * (((((alu_u8_tag * alu_u8_r0) + (alu_u16_tag * (alu_u8_r0 + (alu_u8_r1 * FF(256))))) + + (alu_u32_tag * ((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))))) + + (alu_u64_tag * ((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))))) - + (((-alu_ff_tag + FF(1)) - alu_u128_tag) * alu_ic))); + tmp *= scaling_factor; + std::get<16>(evals) += tmp; + } + // Contribution 17 + { + Avm_DECLARE_VIEWS(17); + + auto tmp = ((alu_u128_tag * alu_op_mul) * + ((((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))) + + ((((alu_u16_r3 + (alu_u16_r4 * FF(65536))) + (alu_u16_r5 * FF(4294967296UL))) + + (alu_u16_r6 * FF(281474976710656UL))) * + FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) - + alu_ia)); + tmp *= scaling_factor; + std::get<17>(evals) += tmp; + } + // Contribution 18 + { + Avm_DECLARE_VIEWS(18); + + auto tmp = + ((alu_u128_tag * alu_op_mul) * + ((((((alu_u8_r0_shift + (alu_u8_r1_shift * FF(256))) + (alu_u16_r0_shift * FF(65536))) + + (alu_u16_r1_shift * FF(4294967296UL))) + + (alu_u16_r2_shift * FF(281474976710656UL))) + + ((((alu_u16_r3_shift + (alu_u16_r4_shift * FF(65536))) + (alu_u16_r5_shift * FF(4294967296UL))) + + (alu_u16_r6_shift * FF(281474976710656UL))) * + FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) - + alu_ib)); + tmp *= scaling_factor; + std::get<18>(evals) += tmp; + } + // Contribution 19 + { + Avm_DECLARE_VIEWS(19); + + auto tmp = + ((alu_u128_tag * alu_op_mul) * + ((((alu_ia * ((((alu_u8_r0_shift + (alu_u8_r1_shift * FF(256))) + (alu_u16_r0_shift * FF(65536))) + + (alu_u16_r1_shift * FF(4294967296UL))) + + (alu_u16_r2_shift * FF(281474976710656UL)))) + + ((((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))) * + (((alu_u16_r3_shift + (alu_u16_r4_shift * FF(65536))) + (alu_u16_r5_shift * FF(4294967296UL))) + + (alu_u16_r6_shift * FF(281474976710656UL)))) * + FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) - + (((alu_cf * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })) + + (((alu_u16_r7 + (alu_u16_r8 * FF(65536))) + (alu_u16_r9 * FF(4294967296UL))) + + (alu_u16_r10 * FF(281474976710656UL)))) * + FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - + alu_ic)); + tmp *= scaling_factor; + std::get<19>(evals) += tmp; + } + // Contribution 20 + { + Avm_DECLARE_VIEWS(20); + + auto tmp = (alu_op_not * alu_ff_tag); + tmp *= scaling_factor; + std::get<20>(evals) += tmp; + } + // Contribution 21 + { + Avm_DECLARE_VIEWS(21); + + auto tmp = (alu_op_not * + ((alu_ia + alu_ic) - + ((((((alu_u8_tag * FF(256)) + (alu_u16_tag * FF(65536))) + (alu_u32_tag * FF(4294967296UL))) + + (alu_u64_tag * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + (alu_u128_tag * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - + FF(1)))); + tmp *= scaling_factor; + std::get<21>(evals) += tmp; + } + // Contribution 22 + { + Avm_DECLARE_VIEWS(22); + + auto tmp = ((alu_cmp_sel + alu_op_eq) * (alu_ic * (-alu_ic + FF(1)))); + tmp *= scaling_factor; + std::get<22>(evals) += tmp; + } + // Contribution 23 + { + Avm_DECLARE_VIEWS(23); + + auto tmp = + (alu_op_eq * + ((((alu_ia - alu_ib) * ((alu_ic * (-alu_op_eq_diff_inv + FF(1))) + alu_op_eq_diff_inv)) - FF(1)) + + alu_ic)); + tmp *= scaling_factor; + std::get<23>(evals) += tmp; + } + // Contribution 24 + { + Avm_DECLARE_VIEWS(24); + + auto tmp = (((alu_op_lt * alu_ib) + ((alu_op_lte + alu_op_cast) * alu_ia)) - + ((alu_a_lo + (alu_a_hi * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * (alu_cmp_sel + alu_op_cast))); + tmp *= scaling_factor; + std::get<24>(evals) += tmp; + } + // Contribution 25 + { + Avm_DECLARE_VIEWS(25); + + auto tmp = (((alu_op_lt * alu_ia) + (alu_op_lte * alu_ib)) - + ((alu_b_lo + (alu_b_hi * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * alu_cmp_sel)); + tmp *= scaling_factor; + std::get<25>(evals) += tmp; + } + // Contribution 26 + { + Avm_DECLARE_VIEWS(26); + + auto tmp = (alu_p_a_borrow * (-alu_p_a_borrow + FF(1))); + tmp *= scaling_factor; + std::get<26>(evals) += tmp; + } + // Contribution 27 + { + Avm_DECLARE_VIEWS(27); + + auto tmp = ((alu_p_sub_a_lo - + ((-alu_a_lo + FF(uint256_t{ 4891460686036598784UL, 2896914383306846353UL, 0UL, 0UL })) + + (alu_p_a_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL })))) * + ((alu_cmp_sel + alu_op_cast) + alu_op_div_std)); + tmp *= scaling_factor; + std::get<27>(evals) += tmp; + } + // Contribution 28 + { + Avm_DECLARE_VIEWS(28); + + auto tmp = ((alu_p_sub_a_hi - + ((-alu_a_hi + FF(uint256_t{ 13281191951274694749UL, 3486998266802970665UL, 0UL, 0UL })) - + alu_p_a_borrow)) * + ((alu_cmp_sel + alu_op_cast) + alu_op_div_std)); + tmp *= scaling_factor; + std::get<28>(evals) += tmp; + } + // Contribution 29 + { + Avm_DECLARE_VIEWS(29); + + auto tmp = (alu_p_b_borrow * (-alu_p_b_borrow + FF(1))); + tmp *= scaling_factor; + std::get<29>(evals) += tmp; + } + // Contribution 30 + { + Avm_DECLARE_VIEWS(30); + + auto tmp = ((alu_p_sub_b_lo - + ((-alu_b_lo + FF(uint256_t{ 4891460686036598784UL, 2896914383306846353UL, 0UL, 0UL })) + + (alu_p_b_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL })))) * + alu_cmp_sel); + tmp *= scaling_factor; + std::get<30>(evals) += tmp; + } + // Contribution 31 + { + Avm_DECLARE_VIEWS(31); + + auto tmp = ((alu_p_sub_b_hi - + ((-alu_b_hi + FF(uint256_t{ 13281191951274694749UL, 3486998266802970665UL, 0UL, 0UL })) - + alu_p_b_borrow)) * + alu_cmp_sel); + tmp *= scaling_factor; + std::get<31>(evals) += tmp; + } + // Contribution 32 + { + Avm_DECLARE_VIEWS(32); + + auto tmp = ((alu_res_lo - + (((((alu_a_lo - alu_b_lo) - FF(1)) + (alu_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * + ((alu_op_lt * alu_ic) + ((-alu_ic + FF(1)) * alu_op_lte))) + + (((alu_b_lo - alu_a_lo) + (alu_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * + (-((alu_op_lt * alu_ic) + ((-alu_ic + FF(1)) * alu_op_lte)) + FF(1))))) * + alu_cmp_sel); + tmp *= scaling_factor; + std::get<32>(evals) += tmp; + } + // Contribution 33 + { + Avm_DECLARE_VIEWS(33); + + auto tmp = + ((alu_res_hi - + ((((alu_a_hi - alu_b_hi) - alu_borrow) * ((alu_op_lt * alu_ic) + ((-alu_ic + FF(1)) * alu_op_lte))) + + (((alu_b_hi - alu_a_hi) - alu_borrow) * + (-((alu_op_lt * alu_ic) + ((-alu_ic + FF(1)) * alu_op_lte)) + FF(1))))) * + alu_cmp_sel); + tmp *= scaling_factor; + std::get<33>(evals) += tmp; + } + // Contribution 34 + { + Avm_DECLARE_VIEWS(34); + + auto tmp = (((alu_cmp_rng_ctr_shift - alu_cmp_rng_ctr) + FF(1)) * alu_cmp_rng_ctr); + tmp *= scaling_factor; + std::get<34>(evals) += tmp; + } + // Contribution 35 + { + Avm_DECLARE_VIEWS(35); + + auto tmp = ((alu_cmp_rng_ctr_shift - FF(4)) * alu_cmp_sel); + tmp *= scaling_factor; + std::get<35>(evals) += tmp; + } + // Contribution 36 + { + Avm_DECLARE_VIEWS(36); + + auto tmp = (alu_rng_chk_sel * (-alu_rng_chk_sel + FF(1))); + tmp *= scaling_factor; + std::get<36>(evals) += tmp; + } + // Contribution 37 + { + Avm_DECLARE_VIEWS(37); + + auto tmp = (alu_rng_chk_sel * alu_cmp_sel); + tmp *= scaling_factor; + std::get<37>(evals) += tmp; + } + // Contribution 38 + { + Avm_DECLARE_VIEWS(38); + + auto tmp = ((alu_cmp_rng_ctr * + (((-alu_rng_chk_sel + FF(1)) * (-alu_op_eq_diff_inv + FF(1))) + alu_op_eq_diff_inv)) - + alu_rng_chk_sel); + tmp *= scaling_factor; + std::get<38>(evals) += tmp; + } + // Contribution 39 + { + Avm_DECLARE_VIEWS(39); + + auto tmp = (alu_rng_chk_lookup_selector_shift - + ((((((((((alu_cmp_sel_shift + alu_rng_chk_sel_shift) + alu_op_add_shift) + alu_op_sub_shift) + + alu_op_mul_shift) + + (alu_op_mul * alu_u128_tag)) + + alu_op_cast_shift) + + alu_op_cast_prev_shift) + + alu_op_shl_shift) + + alu_op_shr_shift) + + alu_op_div_shift)); + tmp *= scaling_factor; + std::get<39>(evals) += tmp; + } + // Contribution 40 + { + Avm_DECLARE_VIEWS(40); + + auto tmp = + (alu_a_lo - + (((((((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))) + + (alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + (alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + + (alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + + (alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) * + (((((alu_rng_chk_sel + alu_cmp_sel) + alu_op_cast) + alu_op_cast_prev) + alu_shift_lt_bit_len) + + alu_op_div))); + tmp *= scaling_factor; + std::get<40>(evals) += tmp; + } + // Contribution 41 + { + Avm_DECLARE_VIEWS(41); + + auto tmp = + (alu_a_hi - + ((((((((alu_u16_r7 + (alu_u16_r8 * FF(65536))) + (alu_u16_r9 * FF(4294967296UL))) + + (alu_u16_r10 * FF(281474976710656UL))) + + (alu_u16_r11 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + (alu_u16_r12 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + + (alu_u16_r13 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + + (alu_u16_r14 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) * + (((((alu_rng_chk_sel + alu_cmp_sel) + alu_op_cast) + alu_op_cast_prev) + alu_shift_lt_bit_len) + + alu_op_div))); + tmp *= scaling_factor; + std::get<41>(evals) += tmp; + } + // Contribution 42 + { + Avm_DECLARE_VIEWS(42); + + auto tmp = ((alu_a_lo_shift - alu_b_lo) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<42>(evals) += tmp; + } + // Contribution 43 + { + Avm_DECLARE_VIEWS(43); + + auto tmp = ((alu_a_hi_shift - alu_b_hi) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<43>(evals) += tmp; + } + // Contribution 44 + { + Avm_DECLARE_VIEWS(44); + + auto tmp = ((alu_b_lo_shift - alu_p_sub_a_lo) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<44>(evals) += tmp; + } + // Contribution 45 + { + Avm_DECLARE_VIEWS(45); + + auto tmp = ((alu_b_hi_shift - alu_p_sub_a_hi) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<45>(evals) += tmp; + } + // Contribution 46 + { + Avm_DECLARE_VIEWS(46); + + auto tmp = ((alu_p_sub_a_lo_shift - alu_p_sub_b_lo) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<46>(evals) += tmp; + } + // Contribution 47 + { + Avm_DECLARE_VIEWS(47); + + auto tmp = ((alu_p_sub_a_hi_shift - alu_p_sub_b_hi) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<47>(evals) += tmp; + } + // Contribution 48 + { + Avm_DECLARE_VIEWS(48); + + auto tmp = ((alu_p_sub_b_lo_shift - alu_res_lo) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<48>(evals) += tmp; + } + // Contribution 49 + { + Avm_DECLARE_VIEWS(49); + + auto tmp = ((alu_p_sub_b_hi_shift - alu_res_hi) * alu_rng_chk_sel_shift); + tmp *= scaling_factor; + std::get<49>(evals) += tmp; + } + // Contribution 50 + { + Avm_DECLARE_VIEWS(50); + + auto tmp = (alu_op_cast_prev_shift - alu_op_cast); + tmp *= scaling_factor; + std::get<50>(evals) += tmp; + } + // Contribution 51 + { + Avm_DECLARE_VIEWS(51); + + auto tmp = (alu_op_cast * + (((((((alu_u8_tag * alu_u8_r0) + (alu_u16_tag * (alu_u8_r0 + (alu_u8_r1 * FF(256))))) + + (alu_u32_tag * ((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))))) + + (alu_u64_tag * ((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))))) + + (alu_u128_tag * ((((((((alu_u8_r0 + (alu_u8_r1 * FF(256))) + (alu_u16_r0 * FF(65536))) + + (alu_u16_r1 * FF(4294967296UL))) + + (alu_u16_r2 * FF(281474976710656UL))) + + (alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + (alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + + (alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + + (alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))))) + + (alu_ff_tag * alu_ia)) - + alu_ic)); + tmp *= scaling_factor; + std::get<51>(evals) += tmp; + } + // Contribution 52 + { + Avm_DECLARE_VIEWS(52); + + auto tmp = (alu_op_cast * (alu_a_lo_shift - alu_p_sub_a_lo)); + tmp *= scaling_factor; + std::get<52>(evals) += tmp; + } + // Contribution 53 + { + Avm_DECLARE_VIEWS(53); + + auto tmp = (alu_op_cast * (alu_a_hi_shift - alu_p_sub_a_hi)); + tmp *= scaling_factor; + std::get<53>(evals) += tmp; + } + // Contribution 54 + { + Avm_DECLARE_VIEWS(54); + + auto tmp = (((alu_op_mul * alu_u128_tag) + alu_op_cast) * alu_alu_sel_shift); + tmp *= scaling_factor; + std::get<54>(evals) += tmp; + } + // Contribution 55 + { + Avm_DECLARE_VIEWS(55); + + auto tmp = ((alu_shift_lt_bit_len * alu_op_shr) * (alu_a_lo - ((alu_two_pow_s - alu_b_lo) - FF(1)))); + tmp *= scaling_factor; + std::get<55>(evals) += tmp; + } + // Contribution 56 + { + Avm_DECLARE_VIEWS(56); + + auto tmp = ((alu_shift_lt_bit_len * alu_op_shr) * (alu_a_hi - ((alu_two_pow_t_sub_s - alu_b_hi) - FF(1)))); + tmp *= scaling_factor; + std::get<56>(evals) += tmp; + } + // Contribution 57 + { + Avm_DECLARE_VIEWS(57); + + auto tmp = ((alu_shift_lt_bit_len * alu_op_shl) * (alu_a_lo - ((alu_two_pow_t_sub_s - alu_b_lo) - FF(1)))); + tmp *= scaling_factor; + std::get<57>(evals) += tmp; + } + // Contribution 58 + { + Avm_DECLARE_VIEWS(58); + + auto tmp = ((alu_shift_lt_bit_len * alu_op_shl) * (alu_a_hi - ((alu_two_pow_s - alu_b_hi) - FF(1)))); + tmp *= scaling_factor; + std::get<58>(evals) += tmp; + } + // Contribution 59 + { + Avm_DECLARE_VIEWS(59); + + auto tmp = (alu_shift_lt_bit_len * (-alu_shift_lt_bit_len + FF(1))); + tmp *= scaling_factor; + std::get<59>(evals) += tmp; + } + // Contribution 60 + { + Avm_DECLARE_VIEWS(60); + + auto tmp = (alu_t_sub_s_bits - + (alu_shift_sel * + ((alu_shift_lt_bit_len * + ((((((alu_u8_tag * FF(8)) + (alu_u16_tag * FF(16))) + (alu_u32_tag * FF(32))) + + (alu_u64_tag * FF(64))) + + (alu_u128_tag * FF(128))) - + alu_ib)) + + ((-alu_shift_lt_bit_len + FF(1)) * + (alu_ib - (((((alu_u8_tag * FF(8)) + (alu_u16_tag * FF(16))) + (alu_u32_tag * FF(32))) + + (alu_u64_tag * FF(64))) + + (alu_u128_tag * FF(128)))))))); + tmp *= scaling_factor; + std::get<60>(evals) += tmp; + } + // Contribution 61 + { + Avm_DECLARE_VIEWS(61); + + auto tmp = ((alu_shift_lt_bit_len * alu_op_shr) * (((alu_b_hi * alu_two_pow_s) + alu_b_lo) - alu_ia)); + tmp *= scaling_factor; + std::get<61>(evals) += tmp; + } + // Contribution 62 + { + Avm_DECLARE_VIEWS(62); + + auto tmp = (alu_op_shr * (alu_ic - (alu_b_hi * alu_shift_lt_bit_len))); + tmp *= scaling_factor; + std::get<62>(evals) += tmp; + } + // Contribution 63 + { + Avm_DECLARE_VIEWS(63); + + auto tmp = ((alu_shift_lt_bit_len * alu_op_shl) * (((alu_b_hi * alu_two_pow_t_sub_s) + alu_b_lo) - alu_ia)); + tmp *= scaling_factor; + std::get<63>(evals) += tmp; + } + // Contribution 64 + { + Avm_DECLARE_VIEWS(64); + + auto tmp = (alu_op_shl * (alu_ic - ((alu_b_lo * alu_two_pow_s) * alu_shift_lt_bit_len))); + tmp *= scaling_factor; + std::get<64>(evals) += tmp; + } + // Contribution 65 + { + Avm_DECLARE_VIEWS(65); + + auto tmp = (alu_op_div - (alu_op_div_std + alu_op_div_a_lt_b)); + tmp *= scaling_factor; + std::get<65>(evals) += tmp; + } + // Contribution 66 + { + Avm_DECLARE_VIEWS(66); + + auto tmp = (alu_op_div_a_lt_b * (-alu_op_div_a_lt_b + FF(1))); + tmp *= scaling_factor; + std::get<66>(evals) += tmp; + } + // Contribution 67 + { + Avm_DECLARE_VIEWS(67); + + auto tmp = (alu_op_div_a_lt_b * (alu_a_lo - ((alu_ib - alu_ia) - FF(1)))); + tmp *= scaling_factor; + std::get<67>(evals) += tmp; + } + // Contribution 68 + { + Avm_DECLARE_VIEWS(68); + + auto tmp = (alu_op_div_a_lt_b * alu_ic); + tmp *= scaling_factor; + std::get<68>(evals) += tmp; + } + // Contribution 69 + { + Avm_DECLARE_VIEWS(69); + + auto tmp = (alu_op_div_a_lt_b * (alu_ia - alu_remainder)); + tmp *= scaling_factor; + std::get<69>(evals) += tmp; + } + // Contribution 70 + { + Avm_DECLARE_VIEWS(70); + + auto tmp = (alu_op_div_std * (-alu_op_div_std + FF(1))); + tmp *= scaling_factor; + std::get<70>(evals) += tmp; + } + // Contribution 71 + { + Avm_DECLARE_VIEWS(71); + + auto tmp = + (alu_op_div_std * ((alu_ib - alu_divisor_lo) - (alu_divisor_hi * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })))); + tmp *= scaling_factor; + std::get<71>(evals) += tmp; + } + // Contribution 72 + { + Avm_DECLARE_VIEWS(72); + + auto tmp = (alu_op_div_std * + ((alu_ic - alu_quotient_lo) - (alu_quotient_hi * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })))); + tmp *= scaling_factor; + std::get<72>(evals) += tmp; + } + // Contribution 73 + { + Avm_DECLARE_VIEWS(73); + + auto tmp = (((alu_divisor_hi * alu_quotient_lo) + (alu_divisor_lo * alu_quotient_hi)) - + (alu_partial_prod_lo + (alu_partial_prod_hi * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })))); + tmp *= scaling_factor; + std::get<73>(evals) += tmp; + } + // Contribution 74 + { + Avm_DECLARE_VIEWS(74); + + auto tmp = + (alu_op_div_std * + ((((alu_divisor_lo * alu_quotient_lo) + (alu_partial_prod_lo * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + ((alu_partial_prod_hi + (alu_divisor_hi * alu_quotient_hi)) * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - + (alu_a_lo + (alu_a_hi * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))))); + tmp *= scaling_factor; + std::get<74>(evals) += tmp; + } + // Contribution 75 + { + Avm_DECLARE_VIEWS(75); + + auto tmp = (alu_op_div_std * (alu_b_hi - ((alu_ib - alu_remainder) - FF(1)))); + tmp *= scaling_factor; + std::get<75>(evals) += tmp; + } + // Contribution 76 + { + Avm_DECLARE_VIEWS(76); + + auto tmp = ((alu_cmp_rng_ctr_shift - FF(2)) * alu_op_div_std); + tmp *= scaling_factor; + std::get<76>(evals) += tmp; + } + // Contribution 77 + { + Avm_DECLARE_VIEWS(77); + + auto tmp = (alu_rng_chk_sel * alu_op_div_std); + tmp *= scaling_factor; + std::get<77>(evals) += tmp; + } + // Contribution 78 + { + Avm_DECLARE_VIEWS(78); + + auto tmp = + (alu_op_div_std * + ((((alu_divisor_lo * alu_quotient_lo) + (alu_partial_prod_lo * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + + ((alu_partial_prod_hi + (alu_divisor_hi * alu_quotient_hi)) * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - + (alu_ia - alu_remainder))); + tmp *= scaling_factor; + std::get<78>(evals) += tmp; + } + // Contribution 79 + { + Avm_DECLARE_VIEWS(79); + + auto tmp = (alu_div_rng_chk_selector * (-alu_div_rng_chk_selector + FF(1))); + tmp *= scaling_factor; + std::get<79>(evals) += tmp; + } + // Contribution 80 + { + Avm_DECLARE_VIEWS(80); + + auto tmp = ((alu_div_rng_chk_selector * alu_div_rng_chk_selector_shift) - alu_op_div_std); + tmp *= scaling_factor; + std::get<80>(evals) += tmp; + } + // Contribution 81 + { + Avm_DECLARE_VIEWS(81); + + auto tmp = (alu_divisor_lo - (alu_op_div_std * (((alu_div_u16_r0 + (alu_div_u16_r1 * FF(65536))) + + (alu_div_u16_r2 * FF(4294967296UL))) + + (alu_div_u16_r3 * FF(281474976710656UL))))); + tmp *= scaling_factor; + std::get<81>(evals) += tmp; + } + // Contribution 82 + { + Avm_DECLARE_VIEWS(82); + + auto tmp = (alu_divisor_hi - (alu_op_div_std * (((alu_div_u16_r4 + (alu_div_u16_r5 * FF(65536))) + + (alu_div_u16_r6 * FF(4294967296UL))) + + (alu_div_u16_r7 * FF(281474976710656UL))))); + tmp *= scaling_factor; + std::get<82>(evals) += tmp; + } + // Contribution 83 + { + Avm_DECLARE_VIEWS(83); + + auto tmp = + (alu_quotient_lo - (alu_op_div_std * (((alu_div_u16_r0_shift + (alu_div_u16_r1_shift * FF(65536))) + + (alu_div_u16_r2_shift * FF(4294967296UL))) + + (alu_div_u16_r3_shift * FF(281474976710656UL))))); + tmp *= scaling_factor; + std::get<83>(evals) += tmp; + } + // Contribution 84 + { + Avm_DECLARE_VIEWS(84); + + auto tmp = + (alu_quotient_hi - (alu_op_div_std * (((alu_div_u16_r4_shift + (alu_div_u16_r5_shift * FF(65536))) + + (alu_div_u16_r6_shift * FF(4294967296UL))) + + (alu_div_u16_r7_shift * FF(281474976710656UL))))); + tmp *= scaling_factor; + std::get<84>(evals) += tmp; + } + // Contribution 85 + { + Avm_DECLARE_VIEWS(85); + + auto tmp = (alu_partial_prod_lo - (alu_op_div_std * ((((alu_u8_r0_shift + (alu_u8_r1_shift * FF(256))) + + (alu_u16_r0_shift * FF(65536))) + + (alu_u16_r1_shift * FF(4294967296UL))) + + (alu_u16_r2_shift * FF(281474976710656UL))))); + tmp *= scaling_factor; + std::get<85>(evals) += tmp; + } + // Contribution 86 + { + Avm_DECLARE_VIEWS(86); + + auto tmp = (alu_partial_prod_hi - (alu_op_div_std * (((alu_u16_r3_shift + (alu_u16_r4_shift * FF(65536))) + + (alu_u16_r5_shift * FF(4294967296UL))) + + (alu_u16_r6_shift * FF(281474976710656UL))))); + tmp *= scaling_factor; + std::get<86>(evals) += tmp; + } + } +}; + +template using alu = Relation>; + +} // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp deleted file mode 100644 index 013013909c3..00000000000 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_alu.hpp +++ /dev/null @@ -1,1222 +0,0 @@ - -#pragma once -#include "../../relation_parameters.hpp" -#include "../../relation_types.hpp" -#include "./declare_views.hpp" - -namespace bb::Avm_vm { - -template struct Avm_aluRow { - FF avm_alu_a_hi{}; - FF avm_alu_a_hi_shift{}; - FF avm_alu_a_lo{}; - FF avm_alu_a_lo_shift{}; - FF avm_alu_alu_sel{}; - FF avm_alu_alu_sel_shift{}; - FF avm_alu_b_hi{}; - FF avm_alu_b_hi_shift{}; - FF avm_alu_b_lo{}; - FF avm_alu_b_lo_shift{}; - FF avm_alu_borrow{}; - FF avm_alu_cf{}; - FF avm_alu_cmp_rng_ctr{}; - FF avm_alu_cmp_rng_ctr_shift{}; - FF avm_alu_cmp_sel{}; - FF avm_alu_cmp_sel_shift{}; - FF avm_alu_div_rng_chk_selector{}; - FF avm_alu_div_rng_chk_selector_shift{}; - FF avm_alu_div_u16_r0{}; - FF avm_alu_div_u16_r0_shift{}; - FF avm_alu_div_u16_r1{}; - FF avm_alu_div_u16_r1_shift{}; - FF avm_alu_div_u16_r2{}; - FF avm_alu_div_u16_r2_shift{}; - FF avm_alu_div_u16_r3{}; - FF avm_alu_div_u16_r3_shift{}; - FF avm_alu_div_u16_r4{}; - FF avm_alu_div_u16_r4_shift{}; - FF avm_alu_div_u16_r5{}; - FF avm_alu_div_u16_r5_shift{}; - FF avm_alu_div_u16_r6{}; - FF avm_alu_div_u16_r6_shift{}; - FF avm_alu_div_u16_r7{}; - FF avm_alu_div_u16_r7_shift{}; - FF avm_alu_divisor_hi{}; - FF avm_alu_divisor_lo{}; - FF avm_alu_ff_tag{}; - FF avm_alu_ia{}; - FF avm_alu_ib{}; - FF avm_alu_ic{}; - FF avm_alu_in_tag{}; - FF avm_alu_op_add{}; - FF avm_alu_op_add_shift{}; - FF avm_alu_op_cast{}; - FF avm_alu_op_cast_prev{}; - FF avm_alu_op_cast_prev_shift{}; - FF avm_alu_op_cast_shift{}; - FF avm_alu_op_div{}; - FF avm_alu_op_div_a_lt_b{}; - FF avm_alu_op_div_shift{}; - FF avm_alu_op_div_std{}; - FF avm_alu_op_eq{}; - FF avm_alu_op_eq_diff_inv{}; - FF avm_alu_op_lt{}; - FF avm_alu_op_lte{}; - FF avm_alu_op_mul{}; - FF avm_alu_op_mul_shift{}; - FF avm_alu_op_not{}; - FF avm_alu_op_shl{}; - FF avm_alu_op_shl_shift{}; - FF avm_alu_op_shr{}; - FF avm_alu_op_shr_shift{}; - FF avm_alu_op_sub{}; - FF avm_alu_op_sub_shift{}; - FF avm_alu_p_a_borrow{}; - FF avm_alu_p_b_borrow{}; - FF avm_alu_p_sub_a_hi{}; - FF avm_alu_p_sub_a_hi_shift{}; - FF avm_alu_p_sub_a_lo{}; - FF avm_alu_p_sub_a_lo_shift{}; - FF avm_alu_p_sub_b_hi{}; - FF avm_alu_p_sub_b_hi_shift{}; - FF avm_alu_p_sub_b_lo{}; - FF avm_alu_p_sub_b_lo_shift{}; - FF avm_alu_partial_prod_hi{}; - FF avm_alu_partial_prod_lo{}; - FF avm_alu_quotient_hi{}; - FF avm_alu_quotient_lo{}; - FF avm_alu_remainder{}; - FF avm_alu_res_hi{}; - FF avm_alu_res_lo{}; - FF avm_alu_rng_chk_lookup_selector_shift{}; - FF avm_alu_rng_chk_sel{}; - FF avm_alu_rng_chk_sel_shift{}; - FF avm_alu_shift_lt_bit_len{}; - FF avm_alu_shift_sel{}; - FF avm_alu_t_sub_s_bits{}; - FF avm_alu_two_pow_s{}; - FF avm_alu_two_pow_t_sub_s{}; - FF avm_alu_u128_tag{}; - FF avm_alu_u16_r0{}; - FF avm_alu_u16_r0_shift{}; - FF avm_alu_u16_r1{}; - FF avm_alu_u16_r10{}; - FF avm_alu_u16_r11{}; - FF avm_alu_u16_r12{}; - FF avm_alu_u16_r13{}; - FF avm_alu_u16_r14{}; - FF avm_alu_u16_r1_shift{}; - FF avm_alu_u16_r2{}; - FF avm_alu_u16_r2_shift{}; - FF avm_alu_u16_r3{}; - FF avm_alu_u16_r3_shift{}; - FF avm_alu_u16_r4{}; - FF avm_alu_u16_r4_shift{}; - FF avm_alu_u16_r5{}; - FF avm_alu_u16_r5_shift{}; - FF avm_alu_u16_r6{}; - FF avm_alu_u16_r6_shift{}; - FF avm_alu_u16_r7{}; - FF avm_alu_u16_r8{}; - FF avm_alu_u16_r9{}; - FF avm_alu_u16_tag{}; - FF avm_alu_u32_tag{}; - FF avm_alu_u64_tag{}; - FF avm_alu_u8_r0{}; - FF avm_alu_u8_r0_shift{}; - FF avm_alu_u8_r1{}; - FF avm_alu_u8_r1_shift{}; - FF avm_alu_u8_tag{}; - - [[maybe_unused]] static std::vector names(); -}; - -inline std::string get_relation_label_avm_alu(int index) -{ - switch (index) { - case 12: - return "ALU_ADD_SUB_1"; - - case 13: - return "ALU_ADD_SUB_2"; - - case 14: - return "ALU_MULTIPLICATION_FF"; - - case 15: - return "ALU_MUL_COMMON_1"; - - case 16: - return "ALU_MUL_COMMON_2"; - - case 19: - return "ALU_MULTIPLICATION_OUT_U128"; - - case 20: - return "ALU_FF_NOT_XOR"; - - case 21: - return "ALU_OP_NOT"; - - case 22: - return "ALU_RES_IS_BOOL"; - - case 23: - return "ALU_OP_EQ"; - - case 24: - return "INPUT_DECOMP_1"; - - case 25: - return "INPUT_DECOMP_2"; - - case 27: - return "SUB_LO_1"; - - case 28: - return "SUB_HI_1"; - - case 30: - return "SUB_LO_2"; - - case 31: - return "SUB_HI_2"; - - case 32: - return "RES_LO"; - - case 33: - return "RES_HI"; - - case 34: - return "CMP_CTR_REL_1"; - - case 35: - return "CMP_CTR_REL_2"; - - case 38: - return "CTR_NON_ZERO_REL"; - - case 39: - return "RNG_CHK_LOOKUP_SELECTOR"; - - case 40: - return "LOWER_CMP_RNG_CHK"; - - case 41: - return "UPPER_CMP_RNG_CHK"; - - case 42: - return "SHIFT_RELS_0"; - - case 44: - return "SHIFT_RELS_1"; - - case 46: - return "SHIFT_RELS_2"; - - case 48: - return "SHIFT_RELS_3"; - - case 50: - return "OP_CAST_PREV_LINE"; - - case 51: - return "ALU_OP_CAST"; - - case 52: - return "OP_CAST_RNG_CHECK_P_SUB_A_LOW"; - - case 53: - return "OP_CAST_RNG_CHECK_P_SUB_A_HIGH"; - - case 54: - return "TWO_LINE_OP_NO_OVERLAP"; - - case 55: - return "SHR_RANGE_0"; - - case 56: - return "SHR_RANGE_1"; - - case 57: - return "SHL_RANGE_0"; - - case 58: - return "SHL_RANGE_1"; - - case 60: - return "SHIFT_LT_BIT_LEN"; - - case 61: - return "SHR_INPUT_DECOMPOSITION"; - - case 62: - return "SHR_OUTPUT"; - - case 63: - return "SHL_INPUT_DECOMPOSITION"; - - case 64: - return "SHL_OUTPUT"; - - case 74: - return "ALU_PROD_DIV"; - - case 75: - return "REMAINDER_RANGE_CHK"; - - case 76: - return "CMP_CTR_REL_3"; - - case 78: - return "DIVISION_RELATION"; - } - return std::to_string(index); -} - -template class avm_aluImpl { - public: - using FF = FF_; - - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 6, 6, 8, 3, 4, 4, 5, 4, 4, 3, 4, 3, - 3, 4, 3, 6, 5, 3, 3, 3, 3, 4, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 4, 4, 4, 4, - 4, 3, 5, 5, 4, 5, 5, 2, 3, 3, 3, 3, 3, 4, 4, 3, 5, 3, 3, 3, 5, 3, 3, 4, 4, 4, 4, 4, 4, - }; - - template - void static accumulate(ContainerOverSubrelations& evals, - const AllEntities& new_term, - [[maybe_unused]] const RelationParameters&, - [[maybe_unused]] const FF& scaling_factor) - { - - // Contribution 0 - { - Avm_DECLARE_VIEWS(0); - - auto tmp = - (avm_alu_alu_sel - - ((((((((((avm_alu_op_add + avm_alu_op_sub) + avm_alu_op_mul) + avm_alu_op_not) + avm_alu_op_eq) + - avm_alu_op_cast) + - avm_alu_op_lt) + - avm_alu_op_lte) + - avm_alu_op_shr) + - avm_alu_op_shl) + - avm_alu_op_div)); - tmp *= scaling_factor; - std::get<0>(evals) += tmp; - } - // Contribution 1 - { - Avm_DECLARE_VIEWS(1); - - auto tmp = (avm_alu_cmp_sel - (avm_alu_op_lt + avm_alu_op_lte)); - tmp *= scaling_factor; - std::get<1>(evals) += tmp; - } - // Contribution 2 - { - Avm_DECLARE_VIEWS(2); - - auto tmp = (avm_alu_shift_sel - (avm_alu_op_shl + avm_alu_op_shr)); - tmp *= scaling_factor; - std::get<2>(evals) += tmp; - } - // Contribution 3 - { - Avm_DECLARE_VIEWS(3); - - auto tmp = (avm_alu_cf * (-avm_alu_cf + FF(1))); - tmp *= scaling_factor; - std::get<3>(evals) += tmp; - } - // Contribution 4 - { - Avm_DECLARE_VIEWS(4); - - auto tmp = (avm_alu_ff_tag * (-avm_alu_ff_tag + FF(1))); - tmp *= scaling_factor; - std::get<4>(evals) += tmp; - } - // Contribution 5 - { - Avm_DECLARE_VIEWS(5); - - auto tmp = (avm_alu_u8_tag * (-avm_alu_u8_tag + FF(1))); - tmp *= scaling_factor; - std::get<5>(evals) += tmp; - } - // Contribution 6 - { - Avm_DECLARE_VIEWS(6); - - auto tmp = (avm_alu_u16_tag * (-avm_alu_u16_tag + FF(1))); - tmp *= scaling_factor; - std::get<6>(evals) += tmp; - } - // Contribution 7 - { - Avm_DECLARE_VIEWS(7); - - auto tmp = (avm_alu_u32_tag * (-avm_alu_u32_tag + FF(1))); - tmp *= scaling_factor; - std::get<7>(evals) += tmp; - } - // Contribution 8 - { - Avm_DECLARE_VIEWS(8); - - auto tmp = (avm_alu_u64_tag * (-avm_alu_u64_tag + FF(1))); - tmp *= scaling_factor; - std::get<8>(evals) += tmp; - } - // Contribution 9 - { - Avm_DECLARE_VIEWS(9); - - auto tmp = (avm_alu_u128_tag * (-avm_alu_u128_tag + FF(1))); - tmp *= scaling_factor; - std::get<9>(evals) += tmp; - } - // Contribution 10 - { - Avm_DECLARE_VIEWS(10); - - auto tmp = - (avm_alu_alu_sel * - ((((((avm_alu_ff_tag + avm_alu_u8_tag) + avm_alu_u16_tag) + avm_alu_u32_tag) + avm_alu_u64_tag) + - avm_alu_u128_tag) - - FF(1))); - tmp *= scaling_factor; - std::get<10>(evals) += tmp; - } - // Contribution 11 - { - Avm_DECLARE_VIEWS(11); - - auto tmp = (avm_alu_in_tag - (((((avm_alu_u8_tag + (avm_alu_u16_tag * FF(2))) + (avm_alu_u32_tag * FF(3))) + - (avm_alu_u64_tag * FF(4))) + - (avm_alu_u128_tag * FF(5))) + - (avm_alu_ff_tag * FF(6)))); - tmp *= scaling_factor; - std::get<11>(evals) += tmp; - } - // Contribution 12 - { - Avm_DECLARE_VIEWS(12); - - auto tmp = (((avm_alu_op_add + avm_alu_op_sub) * - ((((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - (avm_alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + - (avm_alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + - (avm_alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) - - avm_alu_ia) + - (avm_alu_ff_tag * avm_alu_ic))) + - ((avm_alu_op_add - avm_alu_op_sub) * - ((avm_alu_cf * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL })) - avm_alu_ib))); - tmp *= scaling_factor; - std::get<12>(evals) += tmp; - } - // Contribution 13 - { - Avm_DECLARE_VIEWS(13); - - auto tmp = (((avm_alu_op_add + avm_alu_op_sub) * - (((((((avm_alu_u8_tag * avm_alu_u8_r0) + - (avm_alu_u16_tag * (avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))))) + - (avm_alu_u32_tag * - ((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))))) + - (avm_alu_u64_tag * - ((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))))) + - (avm_alu_u128_tag * - ((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - (avm_alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + - (avm_alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + - (avm_alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))))) + - (avm_alu_ff_tag * avm_alu_ia)) - - avm_alu_ic)) + - ((avm_alu_ff_tag * (avm_alu_op_add - avm_alu_op_sub)) * avm_alu_ib)); - tmp *= scaling_factor; - std::get<13>(evals) += tmp; - } - // Contribution 14 - { - Avm_DECLARE_VIEWS(14); - - auto tmp = ((avm_alu_ff_tag * avm_alu_op_mul) * ((avm_alu_ia * avm_alu_ib) - avm_alu_ic)); - tmp *= scaling_factor; - std::get<14>(evals) += tmp; - } - // Contribution 15 - { - Avm_DECLARE_VIEWS(15); - - auto tmp = ((((-avm_alu_ff_tag + FF(1)) - avm_alu_u128_tag) * avm_alu_op_mul) * - (((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - (avm_alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + - (avm_alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + - (avm_alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) - - (avm_alu_ia * avm_alu_ib))); - tmp *= scaling_factor; - std::get<15>(evals) += tmp; - } - // Contribution 16 - { - Avm_DECLARE_VIEWS(16); - - auto tmp = - (avm_alu_op_mul * - (((((avm_alu_u8_tag * avm_alu_u8_r0) + - (avm_alu_u16_tag * (avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))))) + - (avm_alu_u32_tag * ((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))))) + - (avm_alu_u64_tag * ((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))))) - - (((-avm_alu_ff_tag + FF(1)) - avm_alu_u128_tag) * avm_alu_ic))); - tmp *= scaling_factor; - std::get<16>(evals) += tmp; - } - // Contribution 17 - { - Avm_DECLARE_VIEWS(17); - - auto tmp = ((avm_alu_u128_tag * avm_alu_op_mul) * - ((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))) + - ((((avm_alu_u16_r3 + (avm_alu_u16_r4 * FF(65536))) + (avm_alu_u16_r5 * FF(4294967296UL))) + - (avm_alu_u16_r6 * FF(281474976710656UL))) * - FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) - - avm_alu_ia)); - tmp *= scaling_factor; - std::get<17>(evals) += tmp; - } - // Contribution 18 - { - Avm_DECLARE_VIEWS(18); - - auto tmp = - ((avm_alu_u128_tag * avm_alu_op_mul) * - ((((((avm_alu_u8_r0_shift + (avm_alu_u8_r1_shift * FF(256))) + (avm_alu_u16_r0_shift * FF(65536))) + - (avm_alu_u16_r1_shift * FF(4294967296UL))) + - (avm_alu_u16_r2_shift * FF(281474976710656UL))) + - ((((avm_alu_u16_r3_shift + (avm_alu_u16_r4_shift * FF(65536))) + - (avm_alu_u16_r5_shift * FF(4294967296UL))) + - (avm_alu_u16_r6_shift * FF(281474976710656UL))) * - FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) - - avm_alu_ib)); - tmp *= scaling_factor; - std::get<18>(evals) += tmp; - } - // Contribution 19 - { - Avm_DECLARE_VIEWS(19); - - auto tmp = - ((avm_alu_u128_tag * avm_alu_op_mul) * - ((((avm_alu_ia * - ((((avm_alu_u8_r0_shift + (avm_alu_u8_r1_shift * FF(256))) + (avm_alu_u16_r0_shift * FF(65536))) + - (avm_alu_u16_r1_shift * FF(4294967296UL))) + - (avm_alu_u16_r2_shift * FF(281474976710656UL)))) + - ((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))) * - (((avm_alu_u16_r3_shift + (avm_alu_u16_r4_shift * FF(65536))) + - (avm_alu_u16_r5_shift * FF(4294967296UL))) + - (avm_alu_u16_r6_shift * FF(281474976710656UL)))) * - FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) - - (((avm_alu_cf * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })) + - (((avm_alu_u16_r7 + (avm_alu_u16_r8 * FF(65536))) + (avm_alu_u16_r9 * FF(4294967296UL))) + - (avm_alu_u16_r10 * FF(281474976710656UL)))) * - FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - - avm_alu_ic)); - tmp *= scaling_factor; - std::get<19>(evals) += tmp; - } - // Contribution 20 - { - Avm_DECLARE_VIEWS(20); - - auto tmp = (avm_alu_op_not * avm_alu_ff_tag); - tmp *= scaling_factor; - std::get<20>(evals) += tmp; - } - // Contribution 21 - { - Avm_DECLARE_VIEWS(21); - - auto tmp = (avm_alu_op_not * - ((avm_alu_ia + avm_alu_ic) - ((((((avm_alu_u8_tag * FF(256)) + (avm_alu_u16_tag * FF(65536))) + - (avm_alu_u32_tag * FF(4294967296UL))) + - (avm_alu_u64_tag * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - (avm_alu_u128_tag * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - - FF(1)))); - tmp *= scaling_factor; - std::get<21>(evals) += tmp; - } - // Contribution 22 - { - Avm_DECLARE_VIEWS(22); - - auto tmp = ((avm_alu_cmp_sel + avm_alu_op_eq) * (avm_alu_ic * (-avm_alu_ic + FF(1)))); - tmp *= scaling_factor; - std::get<22>(evals) += tmp; - } - // Contribution 23 - { - Avm_DECLARE_VIEWS(23); - - auto tmp = - (avm_alu_op_eq * ((((avm_alu_ia - avm_alu_ib) * - ((avm_alu_ic * (-avm_alu_op_eq_diff_inv + FF(1))) + avm_alu_op_eq_diff_inv)) - - FF(1)) + - avm_alu_ic)); - tmp *= scaling_factor; - std::get<23>(evals) += tmp; - } - // Contribution 24 - { - Avm_DECLARE_VIEWS(24); - - auto tmp = (((avm_alu_op_lt * avm_alu_ib) + ((avm_alu_op_lte + avm_alu_op_cast) * avm_alu_ia)) - - ((avm_alu_a_lo + (avm_alu_a_hi * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * - (avm_alu_cmp_sel + avm_alu_op_cast))); - tmp *= scaling_factor; - std::get<24>(evals) += tmp; - } - // Contribution 25 - { - Avm_DECLARE_VIEWS(25); - - auto tmp = (((avm_alu_op_lt * avm_alu_ia) + (avm_alu_op_lte * avm_alu_ib)) - - ((avm_alu_b_lo + (avm_alu_b_hi * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * avm_alu_cmp_sel)); - tmp *= scaling_factor; - std::get<25>(evals) += tmp; - } - // Contribution 26 - { - Avm_DECLARE_VIEWS(26); - - auto tmp = (avm_alu_p_a_borrow * (-avm_alu_p_a_borrow + FF(1))); - tmp *= scaling_factor; - std::get<26>(evals) += tmp; - } - // Contribution 27 - { - Avm_DECLARE_VIEWS(27); - - auto tmp = ((avm_alu_p_sub_a_lo - - ((-avm_alu_a_lo + FF(uint256_t{ 4891460686036598784UL, 2896914383306846353UL, 0UL, 0UL })) + - (avm_alu_p_a_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL })))) * - ((avm_alu_cmp_sel + avm_alu_op_cast) + avm_alu_op_div_std)); - tmp *= scaling_factor; - std::get<27>(evals) += tmp; - } - // Contribution 28 - { - Avm_DECLARE_VIEWS(28); - - auto tmp = ((avm_alu_p_sub_a_hi - - ((-avm_alu_a_hi + FF(uint256_t{ 13281191951274694749UL, 3486998266802970665UL, 0UL, 0UL })) - - avm_alu_p_a_borrow)) * - ((avm_alu_cmp_sel + avm_alu_op_cast) + avm_alu_op_div_std)); - tmp *= scaling_factor; - std::get<28>(evals) += tmp; - } - // Contribution 29 - { - Avm_DECLARE_VIEWS(29); - - auto tmp = (avm_alu_p_b_borrow * (-avm_alu_p_b_borrow + FF(1))); - tmp *= scaling_factor; - std::get<29>(evals) += tmp; - } - // Contribution 30 - { - Avm_DECLARE_VIEWS(30); - - auto tmp = ((avm_alu_p_sub_b_lo - - ((-avm_alu_b_lo + FF(uint256_t{ 4891460686036598784UL, 2896914383306846353UL, 0UL, 0UL })) + - (avm_alu_p_b_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL })))) * - avm_alu_cmp_sel); - tmp *= scaling_factor; - std::get<30>(evals) += tmp; - } - // Contribution 31 - { - Avm_DECLARE_VIEWS(31); - - auto tmp = ((avm_alu_p_sub_b_hi - - ((-avm_alu_b_hi + FF(uint256_t{ 13281191951274694749UL, 3486998266802970665UL, 0UL, 0UL })) - - avm_alu_p_b_borrow)) * - avm_alu_cmp_sel); - tmp *= scaling_factor; - std::get<31>(evals) += tmp; - } - // Contribution 32 - { - Avm_DECLARE_VIEWS(32); - - auto tmp = - ((avm_alu_res_lo - - (((((avm_alu_a_lo - avm_alu_b_lo) - FF(1)) + (avm_alu_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * - ((avm_alu_op_lt * avm_alu_ic) + ((-avm_alu_ic + FF(1)) * avm_alu_op_lte))) + - (((avm_alu_b_lo - avm_alu_a_lo) + (avm_alu_borrow * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) * - (-((avm_alu_op_lt * avm_alu_ic) + ((-avm_alu_ic + FF(1)) * avm_alu_op_lte)) + FF(1))))) * - avm_alu_cmp_sel); - tmp *= scaling_factor; - std::get<32>(evals) += tmp; - } - // Contribution 33 - { - Avm_DECLARE_VIEWS(33); - - auto tmp = ((avm_alu_res_hi - - ((((avm_alu_a_hi - avm_alu_b_hi) - avm_alu_borrow) * - ((avm_alu_op_lt * avm_alu_ic) + ((-avm_alu_ic + FF(1)) * avm_alu_op_lte))) + - (((avm_alu_b_hi - avm_alu_a_hi) - avm_alu_borrow) * - (-((avm_alu_op_lt * avm_alu_ic) + ((-avm_alu_ic + FF(1)) * avm_alu_op_lte)) + FF(1))))) * - avm_alu_cmp_sel); - tmp *= scaling_factor; - std::get<33>(evals) += tmp; - } - // Contribution 34 - { - Avm_DECLARE_VIEWS(34); - - auto tmp = (((avm_alu_cmp_rng_ctr_shift - avm_alu_cmp_rng_ctr) + FF(1)) * avm_alu_cmp_rng_ctr); - tmp *= scaling_factor; - std::get<34>(evals) += tmp; - } - // Contribution 35 - { - Avm_DECLARE_VIEWS(35); - - auto tmp = ((avm_alu_cmp_rng_ctr_shift - FF(4)) * avm_alu_cmp_sel); - tmp *= scaling_factor; - std::get<35>(evals) += tmp; - } - // Contribution 36 - { - Avm_DECLARE_VIEWS(36); - - auto tmp = (avm_alu_rng_chk_sel * (-avm_alu_rng_chk_sel + FF(1))); - tmp *= scaling_factor; - std::get<36>(evals) += tmp; - } - // Contribution 37 - { - Avm_DECLARE_VIEWS(37); - - auto tmp = (avm_alu_rng_chk_sel * avm_alu_cmp_sel); - tmp *= scaling_factor; - std::get<37>(evals) += tmp; - } - // Contribution 38 - { - Avm_DECLARE_VIEWS(38); - - auto tmp = ((avm_alu_cmp_rng_ctr * (((-avm_alu_rng_chk_sel + FF(1)) * (-avm_alu_op_eq_diff_inv + FF(1))) + - avm_alu_op_eq_diff_inv)) - - avm_alu_rng_chk_sel); - tmp *= scaling_factor; - std::get<38>(evals) += tmp; - } - // Contribution 39 - { - Avm_DECLARE_VIEWS(39); - - auto tmp = (avm_alu_rng_chk_lookup_selector_shift - - ((((((((((avm_alu_cmp_sel_shift + avm_alu_rng_chk_sel_shift) + avm_alu_op_add_shift) + - avm_alu_op_sub_shift) + - avm_alu_op_mul_shift) + - (avm_alu_op_mul * avm_alu_u128_tag)) + - avm_alu_op_cast_shift) + - avm_alu_op_cast_prev_shift) + - avm_alu_op_shl_shift) + - avm_alu_op_shr_shift) + - avm_alu_op_div_shift)); - tmp *= scaling_factor; - std::get<39>(evals) += tmp; - } - // Contribution 40 - { - Avm_DECLARE_VIEWS(40); - - auto tmp = (avm_alu_a_lo - - (((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - (avm_alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + - (avm_alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + - (avm_alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) * - (((((avm_alu_rng_chk_sel + avm_alu_cmp_sel) + avm_alu_op_cast) + avm_alu_op_cast_prev) + - avm_alu_shift_lt_bit_len) + - avm_alu_op_div))); - tmp *= scaling_factor; - std::get<40>(evals) += tmp; - } - // Contribution 41 - { - Avm_DECLARE_VIEWS(41); - - auto tmp = (avm_alu_a_hi - - ((((((((avm_alu_u16_r7 + (avm_alu_u16_r8 * FF(65536))) + (avm_alu_u16_r9 * FF(4294967296UL))) + - (avm_alu_u16_r10 * FF(281474976710656UL))) + - (avm_alu_u16_r11 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - (avm_alu_u16_r12 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + - (avm_alu_u16_r13 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + - (avm_alu_u16_r14 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))) * - (((((avm_alu_rng_chk_sel + avm_alu_cmp_sel) + avm_alu_op_cast) + avm_alu_op_cast_prev) + - avm_alu_shift_lt_bit_len) + - avm_alu_op_div))); - tmp *= scaling_factor; - std::get<41>(evals) += tmp; - } - // Contribution 42 - { - Avm_DECLARE_VIEWS(42); - - auto tmp = ((avm_alu_a_lo_shift - avm_alu_b_lo) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<42>(evals) += tmp; - } - // Contribution 43 - { - Avm_DECLARE_VIEWS(43); - - auto tmp = ((avm_alu_a_hi_shift - avm_alu_b_hi) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<43>(evals) += tmp; - } - // Contribution 44 - { - Avm_DECLARE_VIEWS(44); - - auto tmp = ((avm_alu_b_lo_shift - avm_alu_p_sub_a_lo) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<44>(evals) += tmp; - } - // Contribution 45 - { - Avm_DECLARE_VIEWS(45); - - auto tmp = ((avm_alu_b_hi_shift - avm_alu_p_sub_a_hi) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<45>(evals) += tmp; - } - // Contribution 46 - { - Avm_DECLARE_VIEWS(46); - - auto tmp = ((avm_alu_p_sub_a_lo_shift - avm_alu_p_sub_b_lo) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<46>(evals) += tmp; - } - // Contribution 47 - { - Avm_DECLARE_VIEWS(47); - - auto tmp = ((avm_alu_p_sub_a_hi_shift - avm_alu_p_sub_b_hi) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<47>(evals) += tmp; - } - // Contribution 48 - { - Avm_DECLARE_VIEWS(48); - - auto tmp = ((avm_alu_p_sub_b_lo_shift - avm_alu_res_lo) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<48>(evals) += tmp; - } - // Contribution 49 - { - Avm_DECLARE_VIEWS(49); - - auto tmp = ((avm_alu_p_sub_b_hi_shift - avm_alu_res_hi) * avm_alu_rng_chk_sel_shift); - tmp *= scaling_factor; - std::get<49>(evals) += tmp; - } - // Contribution 50 - { - Avm_DECLARE_VIEWS(50); - - auto tmp = (avm_alu_op_cast_prev_shift - avm_alu_op_cast); - tmp *= scaling_factor; - std::get<50>(evals) += tmp; - } - // Contribution 51 - { - Avm_DECLARE_VIEWS(51); - - auto tmp = - (avm_alu_op_cast * - (((((((avm_alu_u8_tag * avm_alu_u8_r0) + - (avm_alu_u16_tag * (avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))))) + - (avm_alu_u32_tag * - ((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))))) + - (avm_alu_u64_tag * ((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))))) + - (avm_alu_u128_tag * - ((((((((avm_alu_u8_r0 + (avm_alu_u8_r1 * FF(256))) + (avm_alu_u16_r0 * FF(65536))) + - (avm_alu_u16_r1 * FF(4294967296UL))) + - (avm_alu_u16_r2 * FF(281474976710656UL))) + - (avm_alu_u16_r3 * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - (avm_alu_u16_r4 * FF(uint256_t{ 0UL, 65536UL, 0UL, 0UL }))) + - (avm_alu_u16_r5 * FF(uint256_t{ 0UL, 4294967296UL, 0UL, 0UL }))) + - (avm_alu_u16_r6 * FF(uint256_t{ 0UL, 281474976710656UL, 0UL, 0UL }))))) + - (avm_alu_ff_tag * avm_alu_ia)) - - avm_alu_ic)); - tmp *= scaling_factor; - std::get<51>(evals) += tmp; - } - // Contribution 52 - { - Avm_DECLARE_VIEWS(52); - - auto tmp = (avm_alu_op_cast * (avm_alu_a_lo_shift - avm_alu_p_sub_a_lo)); - tmp *= scaling_factor; - std::get<52>(evals) += tmp; - } - // Contribution 53 - { - Avm_DECLARE_VIEWS(53); - - auto tmp = (avm_alu_op_cast * (avm_alu_a_hi_shift - avm_alu_p_sub_a_hi)); - tmp *= scaling_factor; - std::get<53>(evals) += tmp; - } - // Contribution 54 - { - Avm_DECLARE_VIEWS(54); - - auto tmp = (((avm_alu_op_mul * avm_alu_u128_tag) + avm_alu_op_cast) * avm_alu_alu_sel_shift); - tmp *= scaling_factor; - std::get<54>(evals) += tmp; - } - // Contribution 55 - { - Avm_DECLARE_VIEWS(55); - - auto tmp = ((avm_alu_shift_lt_bit_len * avm_alu_op_shr) * - (avm_alu_a_lo - ((avm_alu_two_pow_s - avm_alu_b_lo) - FF(1)))); - tmp *= scaling_factor; - std::get<55>(evals) += tmp; - } - // Contribution 56 - { - Avm_DECLARE_VIEWS(56); - - auto tmp = ((avm_alu_shift_lt_bit_len * avm_alu_op_shr) * - (avm_alu_a_hi - ((avm_alu_two_pow_t_sub_s - avm_alu_b_hi) - FF(1)))); - tmp *= scaling_factor; - std::get<56>(evals) += tmp; - } - // Contribution 57 - { - Avm_DECLARE_VIEWS(57); - - auto tmp = ((avm_alu_shift_lt_bit_len * avm_alu_op_shl) * - (avm_alu_a_lo - ((avm_alu_two_pow_t_sub_s - avm_alu_b_lo) - FF(1)))); - tmp *= scaling_factor; - std::get<57>(evals) += tmp; - } - // Contribution 58 - { - Avm_DECLARE_VIEWS(58); - - auto tmp = ((avm_alu_shift_lt_bit_len * avm_alu_op_shl) * - (avm_alu_a_hi - ((avm_alu_two_pow_s - avm_alu_b_hi) - FF(1)))); - tmp *= scaling_factor; - std::get<58>(evals) += tmp; - } - // Contribution 59 - { - Avm_DECLARE_VIEWS(59); - - auto tmp = (avm_alu_shift_lt_bit_len * (-avm_alu_shift_lt_bit_len + FF(1))); - tmp *= scaling_factor; - std::get<59>(evals) += tmp; - } - // Contribution 60 - { - Avm_DECLARE_VIEWS(60); - - auto tmp = (avm_alu_t_sub_s_bits - - (avm_alu_shift_sel * - ((avm_alu_shift_lt_bit_len * - ((((((avm_alu_u8_tag * FF(8)) + (avm_alu_u16_tag * FF(16))) + (avm_alu_u32_tag * FF(32))) + - (avm_alu_u64_tag * FF(64))) + - (avm_alu_u128_tag * FF(128))) - - avm_alu_ib)) + - ((-avm_alu_shift_lt_bit_len + FF(1)) * - (avm_alu_ib - - (((((avm_alu_u8_tag * FF(8)) + (avm_alu_u16_tag * FF(16))) + (avm_alu_u32_tag * FF(32))) + - (avm_alu_u64_tag * FF(64))) + - (avm_alu_u128_tag * FF(128)))))))); - tmp *= scaling_factor; - std::get<60>(evals) += tmp; - } - // Contribution 61 - { - Avm_DECLARE_VIEWS(61); - - auto tmp = ((avm_alu_shift_lt_bit_len * avm_alu_op_shr) * - (((avm_alu_b_hi * avm_alu_two_pow_s) + avm_alu_b_lo) - avm_alu_ia)); - tmp *= scaling_factor; - std::get<61>(evals) += tmp; - } - // Contribution 62 - { - Avm_DECLARE_VIEWS(62); - - auto tmp = (avm_alu_op_shr * (avm_alu_ic - (avm_alu_b_hi * avm_alu_shift_lt_bit_len))); - tmp *= scaling_factor; - std::get<62>(evals) += tmp; - } - // Contribution 63 - { - Avm_DECLARE_VIEWS(63); - - auto tmp = ((avm_alu_shift_lt_bit_len * avm_alu_op_shl) * - (((avm_alu_b_hi * avm_alu_two_pow_t_sub_s) + avm_alu_b_lo) - avm_alu_ia)); - tmp *= scaling_factor; - std::get<63>(evals) += tmp; - } - // Contribution 64 - { - Avm_DECLARE_VIEWS(64); - - auto tmp = - (avm_alu_op_shl * (avm_alu_ic - ((avm_alu_b_lo * avm_alu_two_pow_s) * avm_alu_shift_lt_bit_len))); - tmp *= scaling_factor; - std::get<64>(evals) += tmp; - } - // Contribution 65 - { - Avm_DECLARE_VIEWS(65); - - auto tmp = (avm_alu_op_div - (avm_alu_op_div_std + avm_alu_op_div_a_lt_b)); - tmp *= scaling_factor; - std::get<65>(evals) += tmp; - } - // Contribution 66 - { - Avm_DECLARE_VIEWS(66); - - auto tmp = (avm_alu_op_div_a_lt_b * (-avm_alu_op_div_a_lt_b + FF(1))); - tmp *= scaling_factor; - std::get<66>(evals) += tmp; - } - // Contribution 67 - { - Avm_DECLARE_VIEWS(67); - - auto tmp = (avm_alu_op_div_a_lt_b * (avm_alu_a_lo - ((avm_alu_ib - avm_alu_ia) - FF(1)))); - tmp *= scaling_factor; - std::get<67>(evals) += tmp; - } - // Contribution 68 - { - Avm_DECLARE_VIEWS(68); - - auto tmp = (avm_alu_op_div_a_lt_b * avm_alu_ic); - tmp *= scaling_factor; - std::get<68>(evals) += tmp; - } - // Contribution 69 - { - Avm_DECLARE_VIEWS(69); - - auto tmp = (avm_alu_op_div_a_lt_b * (avm_alu_ia - avm_alu_remainder)); - tmp *= scaling_factor; - std::get<69>(evals) += tmp; - } - // Contribution 70 - { - Avm_DECLARE_VIEWS(70); - - auto tmp = (avm_alu_op_div_std * (-avm_alu_op_div_std + FF(1))); - tmp *= scaling_factor; - std::get<70>(evals) += tmp; - } - // Contribution 71 - { - Avm_DECLARE_VIEWS(71); - - auto tmp = (avm_alu_op_div_std * ((avm_alu_ib - avm_alu_divisor_lo) - - (avm_alu_divisor_hi * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })))); - tmp *= scaling_factor; - std::get<71>(evals) += tmp; - } - // Contribution 72 - { - Avm_DECLARE_VIEWS(72); - - auto tmp = (avm_alu_op_div_std * ((avm_alu_ic - avm_alu_quotient_lo) - - (avm_alu_quotient_hi * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })))); - tmp *= scaling_factor; - std::get<72>(evals) += tmp; - } - // Contribution 73 - { - Avm_DECLARE_VIEWS(73); - - auto tmp = (((avm_alu_divisor_hi * avm_alu_quotient_lo) + (avm_alu_divisor_lo * avm_alu_quotient_hi)) - - (avm_alu_partial_prod_lo + (avm_alu_partial_prod_hi * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL })))); - tmp *= scaling_factor; - std::get<73>(evals) += tmp; - } - // Contribution 74 - { - Avm_DECLARE_VIEWS(74); - - auto tmp = (avm_alu_op_div_std * ((((avm_alu_divisor_lo * avm_alu_quotient_lo) + - (avm_alu_partial_prod_lo * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - ((avm_alu_partial_prod_hi + (avm_alu_divisor_hi * avm_alu_quotient_hi)) * - FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - - (avm_alu_a_lo + (avm_alu_a_hi * FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))))); - tmp *= scaling_factor; - std::get<74>(evals) += tmp; - } - // Contribution 75 - { - Avm_DECLARE_VIEWS(75); - - auto tmp = (avm_alu_op_div_std * (avm_alu_b_hi - ((avm_alu_ib - avm_alu_remainder) - FF(1)))); - tmp *= scaling_factor; - std::get<75>(evals) += tmp; - } - // Contribution 76 - { - Avm_DECLARE_VIEWS(76); - - auto tmp = ((avm_alu_cmp_rng_ctr_shift - FF(2)) * avm_alu_op_div_std); - tmp *= scaling_factor; - std::get<76>(evals) += tmp; - } - // Contribution 77 - { - Avm_DECLARE_VIEWS(77); - - auto tmp = (avm_alu_rng_chk_sel * avm_alu_op_div_std); - tmp *= scaling_factor; - std::get<77>(evals) += tmp; - } - // Contribution 78 - { - Avm_DECLARE_VIEWS(78); - - auto tmp = (avm_alu_op_div_std * ((((avm_alu_divisor_lo * avm_alu_quotient_lo) + - (avm_alu_partial_prod_lo * FF(uint256_t{ 0UL, 1UL, 0UL, 0UL }))) + - ((avm_alu_partial_prod_hi + (avm_alu_divisor_hi * avm_alu_quotient_hi)) * - FF(uint256_t{ 0UL, 0UL, 1UL, 0UL }))) - - (avm_alu_ia - avm_alu_remainder))); - tmp *= scaling_factor; - std::get<78>(evals) += tmp; - } - // Contribution 79 - { - Avm_DECLARE_VIEWS(79); - - auto tmp = (avm_alu_div_rng_chk_selector * (-avm_alu_div_rng_chk_selector + FF(1))); - tmp *= scaling_factor; - std::get<79>(evals) += tmp; - } - // Contribution 80 - { - Avm_DECLARE_VIEWS(80); - - auto tmp = ((avm_alu_div_rng_chk_selector * avm_alu_div_rng_chk_selector_shift) - avm_alu_op_div_std); - tmp *= scaling_factor; - std::get<80>(evals) += tmp; - } - // Contribution 81 - { - Avm_DECLARE_VIEWS(81); - - auto tmp = - (avm_alu_divisor_lo - (avm_alu_op_div_std * (((avm_alu_div_u16_r0 + (avm_alu_div_u16_r1 * FF(65536))) + - (avm_alu_div_u16_r2 * FF(4294967296UL))) + - (avm_alu_div_u16_r3 * FF(281474976710656UL))))); - tmp *= scaling_factor; - std::get<81>(evals) += tmp; - } - // Contribution 82 - { - Avm_DECLARE_VIEWS(82); - - auto tmp = - (avm_alu_divisor_hi - (avm_alu_op_div_std * (((avm_alu_div_u16_r4 + (avm_alu_div_u16_r5 * FF(65536))) + - (avm_alu_div_u16_r6 * FF(4294967296UL))) + - (avm_alu_div_u16_r7 * FF(281474976710656UL))))); - tmp *= scaling_factor; - std::get<82>(evals) += tmp; - } - // Contribution 83 - { - Avm_DECLARE_VIEWS(83); - - auto tmp = (avm_alu_quotient_lo - - (avm_alu_op_div_std * (((avm_alu_div_u16_r0_shift + (avm_alu_div_u16_r1_shift * FF(65536))) + - (avm_alu_div_u16_r2_shift * FF(4294967296UL))) + - (avm_alu_div_u16_r3_shift * FF(281474976710656UL))))); - tmp *= scaling_factor; - std::get<83>(evals) += tmp; - } - // Contribution 84 - { - Avm_DECLARE_VIEWS(84); - - auto tmp = (avm_alu_quotient_hi - - (avm_alu_op_div_std * (((avm_alu_div_u16_r4_shift + (avm_alu_div_u16_r5_shift * FF(65536))) + - (avm_alu_div_u16_r6_shift * FF(4294967296UL))) + - (avm_alu_div_u16_r7_shift * FF(281474976710656UL))))); - tmp *= scaling_factor; - std::get<84>(evals) += tmp; - } - // Contribution 85 - { - Avm_DECLARE_VIEWS(85); - - auto tmp = - (avm_alu_partial_prod_lo - - (avm_alu_op_div_std * - ((((avm_alu_u8_r0_shift + (avm_alu_u8_r1_shift * FF(256))) + (avm_alu_u16_r0_shift * FF(65536))) + - (avm_alu_u16_r1_shift * FF(4294967296UL))) + - (avm_alu_u16_r2_shift * FF(281474976710656UL))))); - tmp *= scaling_factor; - std::get<85>(evals) += tmp; - } - // Contribution 86 - { - Avm_DECLARE_VIEWS(86); - - auto tmp = (avm_alu_partial_prod_hi - - (avm_alu_op_div_std * (((avm_alu_u16_r3_shift + (avm_alu_u16_r4_shift * FF(65536))) + - (avm_alu_u16_r5_shift * FF(4294967296UL))) + - (avm_alu_u16_r6_shift * FF(281474976710656UL))))); - tmp *= scaling_factor; - std::get<86>(evals) += tmp; - } - } -}; - -template using avm_alu = Relation>; - -} // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_keccakf1600.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_keccakf1600.hpp deleted file mode 100644 index bdff14a827b..00000000000 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_keccakf1600.hpp +++ /dev/null @@ -1,49 +0,0 @@ - -#pragma once -#include "../../relation_parameters.hpp" -#include "../../relation_types.hpp" -#include "./declare_views.hpp" - -namespace bb::Avm_vm { - -template struct Avm_keccakf1600Row { - FF avm_keccakf1600_keccakf1600_sel{}; - - [[maybe_unused]] static std::vector names(); -}; - -inline std::string get_relation_label_avm_keccakf1600(int index) -{ - switch (index) {} - return std::to_string(index); -} - -template class avm_keccakf1600Impl { - public: - using FF = FF_; - - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ - 3, - }; - - template - void static accumulate(ContainerOverSubrelations& evals, - const AllEntities& new_term, - [[maybe_unused]] const RelationParameters&, - [[maybe_unused]] const FF& scaling_factor) - { - - // Contribution 0 - { - Avm_DECLARE_VIEWS(0); - - auto tmp = (avm_keccakf1600_keccakf1600_sel * (-avm_keccakf1600_keccakf1600_sel + FF(1))); - tmp *= scaling_factor; - std::get<0>(evals) += tmp; - } - } -}; - -template using avm_keccakf1600 = Relation>; - -} // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_kernel.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_kernel.hpp deleted file mode 100644 index 60e1051b1f9..00000000000 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_kernel.hpp +++ /dev/null @@ -1,200 +0,0 @@ - -#pragma once -#include "../../relation_parameters.hpp" -#include "../../relation_types.hpp" -#include "./declare_views.hpp" - -namespace bb::Avm_vm { - -template struct Avm_kernelRow { - FF avm_kernel_emit_l2_to_l1_msg_write_offset{}; - FF avm_kernel_emit_l2_to_l1_msg_write_offset_shift{}; - FF avm_kernel_emit_note_hash_write_offset{}; - FF avm_kernel_emit_note_hash_write_offset_shift{}; - FF avm_kernel_emit_nullifier_write_offset{}; - FF avm_kernel_emit_nullifier_write_offset_shift{}; - FF avm_kernel_emit_unencrypted_log_write_offset{}; - FF avm_kernel_emit_unencrypted_log_write_offset_shift{}; - FF avm_kernel_l1_to_l2_msg_exists_write_offset{}; - FF avm_kernel_l1_to_l2_msg_exists_write_offset_shift{}; - FF avm_kernel_note_hash_exist_write_offset{}; - FF avm_kernel_note_hash_exist_write_offset_shift{}; - FF avm_kernel_nullifier_exists_write_offset{}; - FF avm_kernel_nullifier_exists_write_offset_shift{}; - FF avm_kernel_nullifier_non_exists_write_offset{}; - FF avm_kernel_nullifier_non_exists_write_offset_shift{}; - FF avm_kernel_sload_write_offset{}; - FF avm_kernel_sload_write_offset_shift{}; - FF avm_kernel_sstore_write_offset{}; - FF avm_kernel_sstore_write_offset_shift{}; - FF avm_main_ib{}; - FF avm_main_last{}; - FF avm_main_sel_op_emit_l2_to_l1_msg{}; - FF avm_main_sel_op_emit_note_hash{}; - FF avm_main_sel_op_emit_nullifier{}; - FF avm_main_sel_op_emit_unencrypted_log{}; - FF avm_main_sel_op_l1_to_l2_msg_exists{}; - FF avm_main_sel_op_note_hash_exists{}; - FF avm_main_sel_op_nullifier_exists{}; - FF avm_main_sel_op_sload{}; - FF avm_main_sel_op_sstore{}; - - [[maybe_unused]] static std::vector names(); -}; - -inline std::string get_relation_label_avm_kernel(int index) -{ - switch (index) { - case 0: - return "NOTE_HASH_EXISTS_INC_CONSISTENCY_CHECK"; - - case 1: - return "EMIT_NOTE_HASH_INC_CONSISTENCY_CHECK"; - - case 2: - return "NULLIFIER_EXISTS_INC_CONSISTENCY_CHECK"; - - case 3: - return "NULLIFIER_NON_EXISTS_INC_CONSISTENCY_CHECK"; - - case 4: - return "EMIT_NULLIFIER_INC_CONSISTENCY_CHECK"; - - case 5: - return "L1_TO_L2_MSG_EXISTS_INC_CONSISTENCY_CHECK"; - - case 6: - return "EMIT_UNENCRYPTED_LOG_INC_CONSISTENCY_CHECK"; - - case 7: - return "EMIT_L2_TO_L1_MSG_INC_CONSISTENCY_CHECK"; - - case 8: - return "SLOAD_INC_CONSISTENCY_CHECK"; - - case 9: - return "SSTORE_INC_CONSISTENCY_CHECK"; - } - return std::to_string(index); -} - -template class avm_kernelImpl { - public: - using FF = FF_; - - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ - 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, - }; - - template - void static accumulate(ContainerOverSubrelations& evals, - const AllEntities& new_term, - [[maybe_unused]] const RelationParameters&, - [[maybe_unused]] const FF& scaling_factor) - { - - // Contribution 0 - { - Avm_DECLARE_VIEWS(0); - - auto tmp = ((-avm_main_last + FF(1)) * - (avm_kernel_note_hash_exist_write_offset_shift - - (avm_kernel_note_hash_exist_write_offset + avm_main_sel_op_note_hash_exists))); - tmp *= scaling_factor; - std::get<0>(evals) += tmp; - } - // Contribution 1 - { - Avm_DECLARE_VIEWS(1); - - auto tmp = ((-avm_main_last + FF(1)) * - (avm_kernel_emit_note_hash_write_offset_shift - - (avm_kernel_emit_note_hash_write_offset + avm_main_sel_op_emit_note_hash))); - tmp *= scaling_factor; - std::get<1>(evals) += tmp; - } - // Contribution 2 - { - Avm_DECLARE_VIEWS(2); - - auto tmp = - ((-avm_main_last + FF(1)) * - (avm_kernel_nullifier_exists_write_offset_shift - - (avm_kernel_nullifier_exists_write_offset + (avm_main_sel_op_nullifier_exists * avm_main_ib)))); - tmp *= scaling_factor; - std::get<2>(evals) += tmp; - } - // Contribution 3 - { - Avm_DECLARE_VIEWS(3); - - auto tmp = ((-avm_main_last + FF(1)) * (avm_kernel_nullifier_non_exists_write_offset_shift - - (avm_kernel_nullifier_non_exists_write_offset + - (avm_main_sel_op_nullifier_exists * (-avm_main_ib + FF(1)))))); - tmp *= scaling_factor; - std::get<3>(evals) += tmp; - } - // Contribution 4 - { - Avm_DECLARE_VIEWS(4); - - auto tmp = ((-avm_main_last + FF(1)) * - (avm_kernel_emit_nullifier_write_offset_shift - - (avm_kernel_emit_nullifier_write_offset + avm_main_sel_op_emit_nullifier))); - tmp *= scaling_factor; - std::get<4>(evals) += tmp; - } - // Contribution 5 - { - Avm_DECLARE_VIEWS(5); - - auto tmp = ((-avm_main_last + FF(1)) * - (avm_kernel_l1_to_l2_msg_exists_write_offset_shift - - (avm_kernel_l1_to_l2_msg_exists_write_offset + avm_main_sel_op_l1_to_l2_msg_exists))); - tmp *= scaling_factor; - std::get<5>(evals) += tmp; - } - // Contribution 6 - { - Avm_DECLARE_VIEWS(6); - - auto tmp = ((-avm_main_last + FF(1)) * - (avm_kernel_emit_unencrypted_log_write_offset_shift - - (avm_kernel_emit_unencrypted_log_write_offset + avm_main_sel_op_emit_unencrypted_log))); - tmp *= scaling_factor; - std::get<6>(evals) += tmp; - } - // Contribution 7 - { - Avm_DECLARE_VIEWS(7); - - auto tmp = ((-avm_main_last + FF(1)) * - (avm_kernel_emit_l2_to_l1_msg_write_offset_shift - - (avm_kernel_emit_l2_to_l1_msg_write_offset + avm_main_sel_op_emit_l2_to_l1_msg))); - tmp *= scaling_factor; - std::get<7>(evals) += tmp; - } - // Contribution 8 - { - Avm_DECLARE_VIEWS(8); - - auto tmp = ((-avm_main_last + FF(1)) * (avm_kernel_sload_write_offset_shift - - (avm_kernel_sload_write_offset + avm_main_sel_op_sload))); - tmp *= scaling_factor; - std::get<8>(evals) += tmp; - } - // Contribution 9 - { - Avm_DECLARE_VIEWS(9); - - auto tmp = ((-avm_main_last + FF(1)) * (avm_kernel_sstore_write_offset_shift - - (avm_kernel_sstore_write_offset + avm_main_sel_op_sstore))); - tmp *= scaling_factor; - std::get<9>(evals) += tmp; - } - } -}; - -template using avm_kernel = Relation>; - -} // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/binary.hpp similarity index 57% rename from barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp rename to barretenberg/cpp/src/barretenberg/relations/generated/avm/binary.hpp index c36833b090f..b9a7b218306 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_binary.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/binary.hpp @@ -6,27 +6,27 @@ namespace bb::Avm_vm { -template struct Avm_binaryRow { - FF avm_binary_acc_ia{}; - FF avm_binary_acc_ia_shift{}; - FF avm_binary_acc_ib{}; - FF avm_binary_acc_ib_shift{}; - FF avm_binary_acc_ic{}; - FF avm_binary_acc_ic_shift{}; - FF avm_binary_bin_sel{}; - FF avm_binary_ia_bytes{}; - FF avm_binary_ib_bytes{}; - FF avm_binary_ic_bytes{}; - FF avm_binary_mem_tag_ctr{}; - FF avm_binary_mem_tag_ctr_inv{}; - FF avm_binary_mem_tag_ctr_shift{}; - FF avm_binary_op_id{}; - FF avm_binary_op_id_shift{}; +template struct BinaryRow { + FF binary_acc_ia{}; + FF binary_acc_ia_shift{}; + FF binary_acc_ib{}; + FF binary_acc_ib_shift{}; + FF binary_acc_ic{}; + FF binary_acc_ic_shift{}; + FF binary_bin_sel{}; + FF binary_ia_bytes{}; + FF binary_ib_bytes{}; + FF binary_ic_bytes{}; + FF binary_mem_tag_ctr{}; + FF binary_mem_tag_ctr_inv{}; + FF binary_mem_tag_ctr_shift{}; + FF binary_op_id{}; + FF binary_op_id_shift{}; [[maybe_unused]] static std::vector names(); }; -inline std::string get_relation_label_avm_binary(int index) +inline std::string get_relation_label_binary(int index) { switch (index) { case 1: @@ -50,7 +50,7 @@ inline std::string get_relation_label_avm_binary(int index) return std::to_string(index); } -template class avm_binaryImpl { +template class binaryImpl { public: using FF = FF_; @@ -69,7 +69,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_binary_bin_sel * (-avm_binary_bin_sel + FF(1))); + auto tmp = (binary_bin_sel * (-binary_bin_sel + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } @@ -77,7 +77,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(1); - auto tmp = ((avm_binary_op_id_shift - avm_binary_op_id) * avm_binary_mem_tag_ctr); + auto tmp = ((binary_op_id_shift - binary_op_id) * binary_mem_tag_ctr); tmp *= scaling_factor; std::get<1>(evals) += tmp; } @@ -85,7 +85,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(2); - auto tmp = (((avm_binary_mem_tag_ctr_shift - avm_binary_mem_tag_ctr) + FF(1)) * avm_binary_mem_tag_ctr); + auto tmp = (((binary_mem_tag_ctr_shift - binary_mem_tag_ctr) + FF(1)) * binary_mem_tag_ctr); tmp *= scaling_factor; std::get<2>(evals) += tmp; } @@ -93,10 +93,9 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(3); - auto tmp = - ((avm_binary_mem_tag_ctr * (((-avm_binary_bin_sel + FF(1)) * (-avm_binary_mem_tag_ctr_inv + FF(1))) + - avm_binary_mem_tag_ctr_inv)) - - avm_binary_bin_sel); + auto tmp = ((binary_mem_tag_ctr * + (((-binary_bin_sel + FF(1)) * (-binary_mem_tag_ctr_inv + FF(1))) + binary_mem_tag_ctr_inv)) - + binary_bin_sel); tmp *= scaling_factor; std::get<3>(evals) += tmp; } @@ -104,7 +103,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(4); - auto tmp = ((-avm_binary_bin_sel + FF(1)) * avm_binary_acc_ia); + auto tmp = ((-binary_bin_sel + FF(1)) * binary_acc_ia); tmp *= scaling_factor; std::get<4>(evals) += tmp; } @@ -112,7 +111,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(5); - auto tmp = ((-avm_binary_bin_sel + FF(1)) * avm_binary_acc_ib); + auto tmp = ((-binary_bin_sel + FF(1)) * binary_acc_ib); tmp *= scaling_factor; std::get<5>(evals) += tmp; } @@ -120,7 +119,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(6); - auto tmp = ((-avm_binary_bin_sel + FF(1)) * avm_binary_acc_ic); + auto tmp = ((-binary_bin_sel + FF(1)) * binary_acc_ic); tmp *= scaling_factor; std::get<6>(evals) += tmp; } @@ -128,8 +127,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(7); - auto tmp = (((avm_binary_acc_ia - avm_binary_ia_bytes) - (avm_binary_acc_ia_shift * FF(256))) * - avm_binary_mem_tag_ctr); + auto tmp = (((binary_acc_ia - binary_ia_bytes) - (binary_acc_ia_shift * FF(256))) * binary_mem_tag_ctr); tmp *= scaling_factor; std::get<7>(evals) += tmp; } @@ -137,8 +135,7 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(8); - auto tmp = (((avm_binary_acc_ib - avm_binary_ib_bytes) - (avm_binary_acc_ib_shift * FF(256))) * - avm_binary_mem_tag_ctr); + auto tmp = (((binary_acc_ib - binary_ib_bytes) - (binary_acc_ib_shift * FF(256))) * binary_mem_tag_ctr); tmp *= scaling_factor; std::get<8>(evals) += tmp; } @@ -146,14 +143,13 @@ template class avm_binaryImpl { { Avm_DECLARE_VIEWS(9); - auto tmp = (((avm_binary_acc_ic - avm_binary_ic_bytes) - (avm_binary_acc_ic_shift * FF(256))) * - avm_binary_mem_tag_ctr); + auto tmp = (((binary_acc_ic - binary_ic_bytes) - (binary_acc_ic_shift * FF(256))) * binary_mem_tag_ctr); tmp *= scaling_factor; std::get<9>(evals) += tmp; } } }; -template using avm_binary = Relation>; +template using binary = Relation>; } // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_pedersen.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/conversion.hpp similarity index 71% rename from barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_pedersen.hpp rename to barretenberg/cpp/src/barretenberg/relations/generated/avm/conversion.hpp index 76f784d5634..d0f8491e721 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/conversion.hpp @@ -6,19 +6,19 @@ namespace bb::Avm_vm { -template struct Avm_pedersenRow { - FF avm_pedersen_pedersen_sel{}; +template struct ConversionRow { + FF conversion_to_radix_le_sel{}; [[maybe_unused]] static std::vector names(); }; -inline std::string get_relation_label_avm_pedersen(int index) +inline std::string get_relation_label_conversion(int index) { switch (index) {} return std::to_string(index); } -template class avm_pedersenImpl { +template class conversionImpl { public: using FF = FF_; @@ -37,13 +37,13 @@ template class avm_pedersenImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_pedersen_pedersen_sel * (-avm_pedersen_pedersen_sel + FF(1))); + auto tmp = (conversion_to_radix_le_sel * (-conversion_to_radix_le_sel + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } } }; -template using avm_pedersen = Relation>; +template using conversion = Relation>; } // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp index b40847cdff2..46ddc52e6d9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/declare_views.hpp @@ -2,307 +2,302 @@ #define Avm_DECLARE_VIEWS(index) \ using Accumulator = typename std::tuple_element::type; \ using View = typename Accumulator::View; \ - [[maybe_unused]] auto avm_main_clk = View(new_term.avm_main_clk); \ - [[maybe_unused]] auto avm_main_first = View(new_term.avm_main_first); \ - [[maybe_unused]] auto avm_alu_a_hi = View(new_term.avm_alu_a_hi); \ - [[maybe_unused]] auto avm_alu_a_lo = View(new_term.avm_alu_a_lo); \ - [[maybe_unused]] auto avm_alu_alu_sel = View(new_term.avm_alu_alu_sel); \ - [[maybe_unused]] auto avm_alu_b_hi = View(new_term.avm_alu_b_hi); \ - [[maybe_unused]] auto avm_alu_b_lo = View(new_term.avm_alu_b_lo); \ - [[maybe_unused]] auto avm_alu_borrow = View(new_term.avm_alu_borrow); \ - [[maybe_unused]] auto avm_alu_cf = View(new_term.avm_alu_cf); \ - [[maybe_unused]] auto avm_alu_clk = View(new_term.avm_alu_clk); \ - [[maybe_unused]] auto avm_alu_cmp_rng_ctr = View(new_term.avm_alu_cmp_rng_ctr); \ - [[maybe_unused]] auto avm_alu_cmp_sel = View(new_term.avm_alu_cmp_sel); \ - [[maybe_unused]] auto avm_alu_div_rng_chk_selector = View(new_term.avm_alu_div_rng_chk_selector); \ - [[maybe_unused]] auto avm_alu_div_u16_r0 = View(new_term.avm_alu_div_u16_r0); \ - [[maybe_unused]] auto avm_alu_div_u16_r1 = View(new_term.avm_alu_div_u16_r1); \ - [[maybe_unused]] auto avm_alu_div_u16_r2 = View(new_term.avm_alu_div_u16_r2); \ - [[maybe_unused]] auto avm_alu_div_u16_r3 = View(new_term.avm_alu_div_u16_r3); \ - [[maybe_unused]] auto avm_alu_div_u16_r4 = View(new_term.avm_alu_div_u16_r4); \ - [[maybe_unused]] auto avm_alu_div_u16_r5 = View(new_term.avm_alu_div_u16_r5); \ - [[maybe_unused]] auto avm_alu_div_u16_r6 = View(new_term.avm_alu_div_u16_r6); \ - [[maybe_unused]] auto avm_alu_div_u16_r7 = View(new_term.avm_alu_div_u16_r7); \ - [[maybe_unused]] auto avm_alu_divisor_hi = View(new_term.avm_alu_divisor_hi); \ - [[maybe_unused]] auto avm_alu_divisor_lo = View(new_term.avm_alu_divisor_lo); \ - [[maybe_unused]] auto avm_alu_ff_tag = View(new_term.avm_alu_ff_tag); \ - [[maybe_unused]] auto avm_alu_ia = View(new_term.avm_alu_ia); \ - [[maybe_unused]] auto avm_alu_ib = View(new_term.avm_alu_ib); \ - [[maybe_unused]] auto avm_alu_ic = View(new_term.avm_alu_ic); \ - [[maybe_unused]] auto avm_alu_in_tag = View(new_term.avm_alu_in_tag); \ - [[maybe_unused]] auto avm_alu_op_add = View(new_term.avm_alu_op_add); \ - [[maybe_unused]] auto avm_alu_op_cast = View(new_term.avm_alu_op_cast); \ - [[maybe_unused]] auto avm_alu_op_cast_prev = View(new_term.avm_alu_op_cast_prev); \ - [[maybe_unused]] auto avm_alu_op_div = View(new_term.avm_alu_op_div); \ - [[maybe_unused]] auto avm_alu_op_div_a_lt_b = View(new_term.avm_alu_op_div_a_lt_b); \ - [[maybe_unused]] auto avm_alu_op_div_std = View(new_term.avm_alu_op_div_std); \ - [[maybe_unused]] auto avm_alu_op_eq = View(new_term.avm_alu_op_eq); \ - [[maybe_unused]] auto avm_alu_op_eq_diff_inv = View(new_term.avm_alu_op_eq_diff_inv); \ - [[maybe_unused]] auto avm_alu_op_lt = View(new_term.avm_alu_op_lt); \ - [[maybe_unused]] auto avm_alu_op_lte = View(new_term.avm_alu_op_lte); \ - [[maybe_unused]] auto avm_alu_op_mul = View(new_term.avm_alu_op_mul); \ - [[maybe_unused]] auto avm_alu_op_not = View(new_term.avm_alu_op_not); \ - [[maybe_unused]] auto avm_alu_op_shl = View(new_term.avm_alu_op_shl); \ - [[maybe_unused]] auto avm_alu_op_shr = View(new_term.avm_alu_op_shr); \ - [[maybe_unused]] auto avm_alu_op_sub = View(new_term.avm_alu_op_sub); \ - [[maybe_unused]] auto avm_alu_p_a_borrow = View(new_term.avm_alu_p_a_borrow); \ - [[maybe_unused]] auto avm_alu_p_b_borrow = View(new_term.avm_alu_p_b_borrow); \ - [[maybe_unused]] auto avm_alu_p_sub_a_hi = View(new_term.avm_alu_p_sub_a_hi); \ - [[maybe_unused]] auto avm_alu_p_sub_a_lo = View(new_term.avm_alu_p_sub_a_lo); \ - [[maybe_unused]] auto avm_alu_p_sub_b_hi = View(new_term.avm_alu_p_sub_b_hi); \ - [[maybe_unused]] auto avm_alu_p_sub_b_lo = View(new_term.avm_alu_p_sub_b_lo); \ - [[maybe_unused]] auto avm_alu_partial_prod_hi = View(new_term.avm_alu_partial_prod_hi); \ - [[maybe_unused]] auto avm_alu_partial_prod_lo = View(new_term.avm_alu_partial_prod_lo); \ - [[maybe_unused]] auto avm_alu_quotient_hi = View(new_term.avm_alu_quotient_hi); \ - [[maybe_unused]] auto avm_alu_quotient_lo = View(new_term.avm_alu_quotient_lo); \ - [[maybe_unused]] auto avm_alu_remainder = View(new_term.avm_alu_remainder); \ - [[maybe_unused]] auto avm_alu_res_hi = View(new_term.avm_alu_res_hi); \ - [[maybe_unused]] auto avm_alu_res_lo = View(new_term.avm_alu_res_lo); \ - [[maybe_unused]] auto avm_alu_rng_chk_lookup_selector = View(new_term.avm_alu_rng_chk_lookup_selector); \ - [[maybe_unused]] auto avm_alu_rng_chk_sel = View(new_term.avm_alu_rng_chk_sel); \ - [[maybe_unused]] auto avm_alu_shift_lt_bit_len = View(new_term.avm_alu_shift_lt_bit_len); \ - [[maybe_unused]] auto avm_alu_shift_sel = View(new_term.avm_alu_shift_sel); \ - [[maybe_unused]] auto avm_alu_t_sub_s_bits = View(new_term.avm_alu_t_sub_s_bits); \ - [[maybe_unused]] auto avm_alu_two_pow_s = View(new_term.avm_alu_two_pow_s); \ - [[maybe_unused]] auto avm_alu_two_pow_t_sub_s = View(new_term.avm_alu_two_pow_t_sub_s); \ - [[maybe_unused]] auto avm_alu_u128_tag = View(new_term.avm_alu_u128_tag); \ - [[maybe_unused]] auto avm_alu_u16_r0 = View(new_term.avm_alu_u16_r0); \ - [[maybe_unused]] auto avm_alu_u16_r1 = View(new_term.avm_alu_u16_r1); \ - [[maybe_unused]] auto avm_alu_u16_r10 = View(new_term.avm_alu_u16_r10); \ - [[maybe_unused]] auto avm_alu_u16_r11 = View(new_term.avm_alu_u16_r11); \ - [[maybe_unused]] auto avm_alu_u16_r12 = View(new_term.avm_alu_u16_r12); \ - [[maybe_unused]] auto avm_alu_u16_r13 = View(new_term.avm_alu_u16_r13); \ - [[maybe_unused]] auto avm_alu_u16_r14 = View(new_term.avm_alu_u16_r14); \ - [[maybe_unused]] auto avm_alu_u16_r2 = View(new_term.avm_alu_u16_r2); \ - [[maybe_unused]] auto avm_alu_u16_r3 = View(new_term.avm_alu_u16_r3); \ - [[maybe_unused]] auto avm_alu_u16_r4 = View(new_term.avm_alu_u16_r4); \ - [[maybe_unused]] auto avm_alu_u16_r5 = View(new_term.avm_alu_u16_r5); \ - [[maybe_unused]] auto avm_alu_u16_r6 = View(new_term.avm_alu_u16_r6); \ - [[maybe_unused]] auto avm_alu_u16_r7 = View(new_term.avm_alu_u16_r7); \ - [[maybe_unused]] auto avm_alu_u16_r8 = View(new_term.avm_alu_u16_r8); \ - [[maybe_unused]] auto avm_alu_u16_r9 = View(new_term.avm_alu_u16_r9); \ - [[maybe_unused]] auto avm_alu_u16_tag = View(new_term.avm_alu_u16_tag); \ - [[maybe_unused]] auto avm_alu_u32_tag = View(new_term.avm_alu_u32_tag); \ - [[maybe_unused]] auto avm_alu_u64_tag = View(new_term.avm_alu_u64_tag); \ - [[maybe_unused]] auto avm_alu_u8_r0 = View(new_term.avm_alu_u8_r0); \ - [[maybe_unused]] auto avm_alu_u8_r1 = View(new_term.avm_alu_u8_r1); \ - [[maybe_unused]] auto avm_alu_u8_tag = View(new_term.avm_alu_u8_tag); \ - [[maybe_unused]] auto avm_binary_acc_ia = View(new_term.avm_binary_acc_ia); \ - [[maybe_unused]] auto avm_binary_acc_ib = View(new_term.avm_binary_acc_ib); \ - [[maybe_unused]] auto avm_binary_acc_ic = View(new_term.avm_binary_acc_ic); \ - [[maybe_unused]] auto avm_binary_bin_sel = View(new_term.avm_binary_bin_sel); \ - [[maybe_unused]] auto avm_binary_clk = View(new_term.avm_binary_clk); \ - [[maybe_unused]] auto avm_binary_ia_bytes = View(new_term.avm_binary_ia_bytes); \ - [[maybe_unused]] auto avm_binary_ib_bytes = View(new_term.avm_binary_ib_bytes); \ - [[maybe_unused]] auto avm_binary_ic_bytes = View(new_term.avm_binary_ic_bytes); \ - [[maybe_unused]] auto avm_binary_in_tag = View(new_term.avm_binary_in_tag); \ - [[maybe_unused]] auto avm_binary_mem_tag_ctr = View(new_term.avm_binary_mem_tag_ctr); \ - [[maybe_unused]] auto avm_binary_mem_tag_ctr_inv = View(new_term.avm_binary_mem_tag_ctr_inv); \ - [[maybe_unused]] auto avm_binary_op_id = View(new_term.avm_binary_op_id); \ - [[maybe_unused]] auto avm_binary_start = View(new_term.avm_binary_start); \ - [[maybe_unused]] auto avm_byte_lookup_bin_sel = View(new_term.avm_byte_lookup_bin_sel); \ - [[maybe_unused]] auto avm_byte_lookup_table_byte_lengths = View(new_term.avm_byte_lookup_table_byte_lengths); \ - [[maybe_unused]] auto avm_byte_lookup_table_in_tags = View(new_term.avm_byte_lookup_table_in_tags); \ - [[maybe_unused]] auto avm_byte_lookup_table_input_a = View(new_term.avm_byte_lookup_table_input_a); \ - [[maybe_unused]] auto avm_byte_lookup_table_input_b = View(new_term.avm_byte_lookup_table_input_b); \ - [[maybe_unused]] auto avm_byte_lookup_table_op_id = View(new_term.avm_byte_lookup_table_op_id); \ - [[maybe_unused]] auto avm_byte_lookup_table_output = View(new_term.avm_byte_lookup_table_output); \ - [[maybe_unused]] auto avm_conversion_clk = View(new_term.avm_conversion_clk); \ - [[maybe_unused]] auto avm_conversion_input = View(new_term.avm_conversion_input); \ - [[maybe_unused]] auto avm_conversion_num_limbs = View(new_term.avm_conversion_num_limbs); \ - [[maybe_unused]] auto avm_conversion_radix = View(new_term.avm_conversion_radix); \ - [[maybe_unused]] auto avm_conversion_to_radix_le_sel = View(new_term.avm_conversion_to_radix_le_sel); \ - [[maybe_unused]] auto avm_gas_da_gas_fixed_table = View(new_term.avm_gas_da_gas_fixed_table); \ - [[maybe_unused]] auto avm_gas_gas_cost_sel = View(new_term.avm_gas_gas_cost_sel); \ - [[maybe_unused]] auto avm_gas_l2_gas_fixed_table = View(new_term.avm_gas_l2_gas_fixed_table); \ - [[maybe_unused]] auto avm_keccakf1600_clk = View(new_term.avm_keccakf1600_clk); \ - [[maybe_unused]] auto avm_keccakf1600_input = View(new_term.avm_keccakf1600_input); \ - [[maybe_unused]] auto avm_keccakf1600_keccakf1600_sel = View(new_term.avm_keccakf1600_keccakf1600_sel); \ - [[maybe_unused]] auto avm_keccakf1600_output = View(new_term.avm_keccakf1600_output); \ - [[maybe_unused]] auto avm_kernel_emit_l2_to_l1_msg_write_offset = \ - View(new_term.avm_kernel_emit_l2_to_l1_msg_write_offset); \ - [[maybe_unused]] auto avm_kernel_emit_note_hash_write_offset = \ - View(new_term.avm_kernel_emit_note_hash_write_offset); \ - [[maybe_unused]] auto avm_kernel_emit_nullifier_write_offset = \ - View(new_term.avm_kernel_emit_nullifier_write_offset); \ - [[maybe_unused]] auto avm_kernel_emit_unencrypted_log_write_offset = \ - View(new_term.avm_kernel_emit_unencrypted_log_write_offset); \ - [[maybe_unused]] auto avm_kernel_kernel_in_offset = View(new_term.avm_kernel_kernel_in_offset); \ - [[maybe_unused]] auto avm_kernel_kernel_inputs = View(new_term.avm_kernel_kernel_inputs); \ - [[maybe_unused]] auto avm_kernel_kernel_metadata_out = View(new_term.avm_kernel_kernel_metadata_out); \ - [[maybe_unused]] auto avm_kernel_kernel_out_offset = View(new_term.avm_kernel_kernel_out_offset); \ - [[maybe_unused]] auto avm_kernel_kernel_side_effect_out = View(new_term.avm_kernel_kernel_side_effect_out); \ - [[maybe_unused]] auto avm_kernel_kernel_value_out = View(new_term.avm_kernel_kernel_value_out); \ - [[maybe_unused]] auto avm_kernel_l1_to_l2_msg_exists_write_offset = \ - View(new_term.avm_kernel_l1_to_l2_msg_exists_write_offset); \ - [[maybe_unused]] auto avm_kernel_note_hash_exist_write_offset = \ - View(new_term.avm_kernel_note_hash_exist_write_offset); \ - [[maybe_unused]] auto avm_kernel_nullifier_exists_write_offset = \ - View(new_term.avm_kernel_nullifier_exists_write_offset); \ - [[maybe_unused]] auto avm_kernel_nullifier_non_exists_write_offset = \ - View(new_term.avm_kernel_nullifier_non_exists_write_offset); \ - [[maybe_unused]] auto avm_kernel_q_public_input_kernel_add_to_table = \ - View(new_term.avm_kernel_q_public_input_kernel_add_to_table); \ - [[maybe_unused]] auto avm_kernel_q_public_input_kernel_out_add_to_table = \ - View(new_term.avm_kernel_q_public_input_kernel_out_add_to_table); \ - [[maybe_unused]] auto avm_kernel_side_effect_counter = View(new_term.avm_kernel_side_effect_counter); \ - [[maybe_unused]] auto avm_kernel_sload_write_offset = View(new_term.avm_kernel_sload_write_offset); \ - [[maybe_unused]] auto avm_kernel_sstore_write_offset = View(new_term.avm_kernel_sstore_write_offset); \ - [[maybe_unused]] auto avm_main_abs_da_rem_gas_hi = View(new_term.avm_main_abs_da_rem_gas_hi); \ - [[maybe_unused]] auto avm_main_abs_da_rem_gas_lo = View(new_term.avm_main_abs_da_rem_gas_lo); \ - [[maybe_unused]] auto avm_main_abs_l2_rem_gas_hi = View(new_term.avm_main_abs_l2_rem_gas_hi); \ - [[maybe_unused]] auto avm_main_abs_l2_rem_gas_lo = View(new_term.avm_main_abs_l2_rem_gas_lo); \ - [[maybe_unused]] auto avm_main_alu_in_tag = View(new_term.avm_main_alu_in_tag); \ - [[maybe_unused]] auto avm_main_alu_sel = View(new_term.avm_main_alu_sel); \ - [[maybe_unused]] auto avm_main_bin_op_id = View(new_term.avm_main_bin_op_id); \ - [[maybe_unused]] auto avm_main_bin_sel = View(new_term.avm_main_bin_sel); \ - [[maybe_unused]] auto avm_main_call_ptr = View(new_term.avm_main_call_ptr); \ - [[maybe_unused]] auto avm_main_da_gas_op = View(new_term.avm_main_da_gas_op); \ - [[maybe_unused]] auto avm_main_da_gas_remaining = View(new_term.avm_main_da_gas_remaining); \ - [[maybe_unused]] auto avm_main_da_out_of_gas = View(new_term.avm_main_da_out_of_gas); \ - [[maybe_unused]] auto avm_main_gas_cost_active = View(new_term.avm_main_gas_cost_active); \ - [[maybe_unused]] auto avm_main_ia = View(new_term.avm_main_ia); \ - [[maybe_unused]] auto avm_main_ib = View(new_term.avm_main_ib); \ - [[maybe_unused]] auto avm_main_ic = View(new_term.avm_main_ic); \ - [[maybe_unused]] auto avm_main_id = View(new_term.avm_main_id); \ - [[maybe_unused]] auto avm_main_id_zero = View(new_term.avm_main_id_zero); \ - [[maybe_unused]] auto avm_main_ind_a = View(new_term.avm_main_ind_a); \ - [[maybe_unused]] auto avm_main_ind_b = View(new_term.avm_main_ind_b); \ - [[maybe_unused]] auto avm_main_ind_c = View(new_term.avm_main_ind_c); \ - [[maybe_unused]] auto avm_main_ind_d = View(new_term.avm_main_ind_d); \ - [[maybe_unused]] auto avm_main_ind_op_a = View(new_term.avm_main_ind_op_a); \ - [[maybe_unused]] auto avm_main_ind_op_b = View(new_term.avm_main_ind_op_b); \ - [[maybe_unused]] auto avm_main_ind_op_c = View(new_term.avm_main_ind_op_c); \ - [[maybe_unused]] auto avm_main_ind_op_d = View(new_term.avm_main_ind_op_d); \ - [[maybe_unused]] auto avm_main_internal_return_ptr = View(new_term.avm_main_internal_return_ptr); \ - [[maybe_unused]] auto avm_main_inv = View(new_term.avm_main_inv); \ - [[maybe_unused]] auto avm_main_l2_gas_op = View(new_term.avm_main_l2_gas_op); \ - [[maybe_unused]] auto avm_main_l2_gas_remaining = View(new_term.avm_main_l2_gas_remaining); \ - [[maybe_unused]] auto avm_main_l2_out_of_gas = View(new_term.avm_main_l2_out_of_gas); \ - [[maybe_unused]] auto avm_main_last = View(new_term.avm_main_last); \ - [[maybe_unused]] auto avm_main_mem_idx_a = View(new_term.avm_main_mem_idx_a); \ - [[maybe_unused]] auto avm_main_mem_idx_b = View(new_term.avm_main_mem_idx_b); \ - [[maybe_unused]] auto avm_main_mem_idx_c = View(new_term.avm_main_mem_idx_c); \ - [[maybe_unused]] auto avm_main_mem_idx_d = View(new_term.avm_main_mem_idx_d); \ - [[maybe_unused]] auto avm_main_mem_op_a = View(new_term.avm_main_mem_op_a); \ - [[maybe_unused]] auto avm_main_mem_op_activate_gas = View(new_term.avm_main_mem_op_activate_gas); \ - [[maybe_unused]] auto avm_main_mem_op_b = View(new_term.avm_main_mem_op_b); \ - [[maybe_unused]] auto avm_main_mem_op_c = View(new_term.avm_main_mem_op_c); \ - [[maybe_unused]] auto avm_main_mem_op_d = View(new_term.avm_main_mem_op_d); \ - [[maybe_unused]] auto avm_main_op_err = View(new_term.avm_main_op_err); \ - [[maybe_unused]] auto avm_main_opcode_val = View(new_term.avm_main_opcode_val); \ - [[maybe_unused]] auto avm_main_pc = View(new_term.avm_main_pc); \ - [[maybe_unused]] auto avm_main_q_kernel_lookup = View(new_term.avm_main_q_kernel_lookup); \ - [[maybe_unused]] auto avm_main_q_kernel_output_lookup = View(new_term.avm_main_q_kernel_output_lookup); \ - [[maybe_unused]] auto avm_main_r_in_tag = View(new_term.avm_main_r_in_tag); \ - [[maybe_unused]] auto avm_main_rwa = View(new_term.avm_main_rwa); \ - [[maybe_unused]] auto avm_main_rwb = View(new_term.avm_main_rwb); \ - [[maybe_unused]] auto avm_main_rwc = View(new_term.avm_main_rwc); \ - [[maybe_unused]] auto avm_main_rwd = View(new_term.avm_main_rwd); \ - [[maybe_unused]] auto avm_main_sel_cmov = View(new_term.avm_main_sel_cmov); \ - [[maybe_unused]] auto avm_main_sel_external_call = View(new_term.avm_main_sel_external_call); \ - [[maybe_unused]] auto avm_main_sel_halt = View(new_term.avm_main_sel_halt); \ - [[maybe_unused]] auto avm_main_sel_internal_call = View(new_term.avm_main_sel_internal_call); \ - [[maybe_unused]] auto avm_main_sel_internal_return = View(new_term.avm_main_sel_internal_return); \ - [[maybe_unused]] auto avm_main_sel_jump = View(new_term.avm_main_sel_jump); \ - [[maybe_unused]] auto avm_main_sel_jumpi = View(new_term.avm_main_sel_jumpi); \ - [[maybe_unused]] auto avm_main_sel_mov = View(new_term.avm_main_sel_mov); \ - [[maybe_unused]] auto avm_main_sel_mov_a = View(new_term.avm_main_sel_mov_a); \ - [[maybe_unused]] auto avm_main_sel_mov_b = View(new_term.avm_main_sel_mov_b); \ - [[maybe_unused]] auto avm_main_sel_op_add = View(new_term.avm_main_sel_op_add); \ - [[maybe_unused]] auto avm_main_sel_op_address = View(new_term.avm_main_sel_op_address); \ - [[maybe_unused]] auto avm_main_sel_op_and = View(new_term.avm_main_sel_op_and); \ - [[maybe_unused]] auto avm_main_sel_op_block_number = View(new_term.avm_main_sel_op_block_number); \ - [[maybe_unused]] auto avm_main_sel_op_cast = View(new_term.avm_main_sel_op_cast); \ - [[maybe_unused]] auto avm_main_sel_op_chain_id = View(new_term.avm_main_sel_op_chain_id); \ - [[maybe_unused]] auto avm_main_sel_op_coinbase = View(new_term.avm_main_sel_op_coinbase); \ - [[maybe_unused]] auto avm_main_sel_op_dagasleft = View(new_term.avm_main_sel_op_dagasleft); \ - [[maybe_unused]] auto avm_main_sel_op_div = View(new_term.avm_main_sel_op_div); \ - [[maybe_unused]] auto avm_main_sel_op_emit_l2_to_l1_msg = View(new_term.avm_main_sel_op_emit_l2_to_l1_msg); \ - [[maybe_unused]] auto avm_main_sel_op_emit_note_hash = View(new_term.avm_main_sel_op_emit_note_hash); \ - [[maybe_unused]] auto avm_main_sel_op_emit_nullifier = View(new_term.avm_main_sel_op_emit_nullifier); \ - [[maybe_unused]] auto avm_main_sel_op_emit_unencrypted_log = View(new_term.avm_main_sel_op_emit_unencrypted_log); \ - [[maybe_unused]] auto avm_main_sel_op_eq = View(new_term.avm_main_sel_op_eq); \ - [[maybe_unused]] auto avm_main_sel_op_fdiv = View(new_term.avm_main_sel_op_fdiv); \ - [[maybe_unused]] auto avm_main_sel_op_fee_per_da_gas = View(new_term.avm_main_sel_op_fee_per_da_gas); \ - [[maybe_unused]] auto avm_main_sel_op_fee_per_l2_gas = View(new_term.avm_main_sel_op_fee_per_l2_gas); \ - [[maybe_unused]] auto avm_main_sel_op_get_contract_instance = \ - View(new_term.avm_main_sel_op_get_contract_instance); \ - [[maybe_unused]] auto avm_main_sel_op_keccak = View(new_term.avm_main_sel_op_keccak); \ - [[maybe_unused]] auto avm_main_sel_op_l1_to_l2_msg_exists = View(new_term.avm_main_sel_op_l1_to_l2_msg_exists); \ - [[maybe_unused]] auto avm_main_sel_op_l2gasleft = View(new_term.avm_main_sel_op_l2gasleft); \ - [[maybe_unused]] auto avm_main_sel_op_lt = View(new_term.avm_main_sel_op_lt); \ - [[maybe_unused]] auto avm_main_sel_op_lte = View(new_term.avm_main_sel_op_lte); \ - [[maybe_unused]] auto avm_main_sel_op_mul = View(new_term.avm_main_sel_op_mul); \ - [[maybe_unused]] auto avm_main_sel_op_not = View(new_term.avm_main_sel_op_not); \ - [[maybe_unused]] auto avm_main_sel_op_note_hash_exists = View(new_term.avm_main_sel_op_note_hash_exists); \ - [[maybe_unused]] auto avm_main_sel_op_nullifier_exists = View(new_term.avm_main_sel_op_nullifier_exists); \ - [[maybe_unused]] auto avm_main_sel_op_or = View(new_term.avm_main_sel_op_or); \ - [[maybe_unused]] auto avm_main_sel_op_pedersen = View(new_term.avm_main_sel_op_pedersen); \ - [[maybe_unused]] auto avm_main_sel_op_poseidon2 = View(new_term.avm_main_sel_op_poseidon2); \ - [[maybe_unused]] auto avm_main_sel_op_radix_le = View(new_term.avm_main_sel_op_radix_le); \ - [[maybe_unused]] auto avm_main_sel_op_sender = View(new_term.avm_main_sel_op_sender); \ - [[maybe_unused]] auto avm_main_sel_op_sha256 = View(new_term.avm_main_sel_op_sha256); \ - [[maybe_unused]] auto avm_main_sel_op_shl = View(new_term.avm_main_sel_op_shl); \ - [[maybe_unused]] auto avm_main_sel_op_shr = View(new_term.avm_main_sel_op_shr); \ - [[maybe_unused]] auto avm_main_sel_op_sload = View(new_term.avm_main_sel_op_sload); \ - [[maybe_unused]] auto avm_main_sel_op_sstore = View(new_term.avm_main_sel_op_sstore); \ - [[maybe_unused]] auto avm_main_sel_op_storage_address = View(new_term.avm_main_sel_op_storage_address); \ - [[maybe_unused]] auto avm_main_sel_op_sub = View(new_term.avm_main_sel_op_sub); \ - [[maybe_unused]] auto avm_main_sel_op_timestamp = View(new_term.avm_main_sel_op_timestamp); \ - [[maybe_unused]] auto avm_main_sel_op_transaction_fee = View(new_term.avm_main_sel_op_transaction_fee); \ - [[maybe_unused]] auto avm_main_sel_op_version = View(new_term.avm_main_sel_op_version); \ - [[maybe_unused]] auto avm_main_sel_op_xor = View(new_term.avm_main_sel_op_xor); \ - [[maybe_unused]] auto avm_main_sel_rng_16 = View(new_term.avm_main_sel_rng_16); \ - [[maybe_unused]] auto avm_main_sel_rng_8 = View(new_term.avm_main_sel_rng_8); \ - [[maybe_unused]] auto avm_main_space_id = View(new_term.avm_main_space_id); \ - [[maybe_unused]] auto avm_main_table_pow_2 = View(new_term.avm_main_table_pow_2); \ - [[maybe_unused]] auto avm_main_tag_err = View(new_term.avm_main_tag_err); \ - [[maybe_unused]] auto avm_main_w_in_tag = View(new_term.avm_main_w_in_tag); \ - [[maybe_unused]] auto avm_mem_addr = View(new_term.avm_mem_addr); \ - [[maybe_unused]] auto avm_mem_clk = View(new_term.avm_mem_clk); \ - [[maybe_unused]] auto avm_mem_diff_hi = View(new_term.avm_mem_diff_hi); \ - [[maybe_unused]] auto avm_mem_diff_lo = View(new_term.avm_mem_diff_lo); \ - [[maybe_unused]] auto avm_mem_diff_mid = View(new_term.avm_mem_diff_mid); \ - [[maybe_unused]] auto avm_mem_glob_addr = View(new_term.avm_mem_glob_addr); \ - [[maybe_unused]] auto avm_mem_ind_op_a = View(new_term.avm_mem_ind_op_a); \ - [[maybe_unused]] auto avm_mem_ind_op_b = View(new_term.avm_mem_ind_op_b); \ - [[maybe_unused]] auto avm_mem_ind_op_c = View(new_term.avm_mem_ind_op_c); \ - [[maybe_unused]] auto avm_mem_ind_op_d = View(new_term.avm_mem_ind_op_d); \ - [[maybe_unused]] auto avm_mem_last = View(new_term.avm_mem_last); \ - [[maybe_unused]] auto avm_mem_lastAccess = View(new_term.avm_mem_lastAccess); \ - [[maybe_unused]] auto avm_mem_mem_sel = View(new_term.avm_mem_mem_sel); \ - [[maybe_unused]] auto avm_mem_one_min_inv = View(new_term.avm_mem_one_min_inv); \ - [[maybe_unused]] auto avm_mem_op_a = View(new_term.avm_mem_op_a); \ - [[maybe_unused]] auto avm_mem_op_b = View(new_term.avm_mem_op_b); \ - [[maybe_unused]] auto avm_mem_op_c = View(new_term.avm_mem_op_c); \ - [[maybe_unused]] auto avm_mem_op_d = View(new_term.avm_mem_op_d); \ - [[maybe_unused]] auto avm_mem_r_in_tag = View(new_term.avm_mem_r_in_tag); \ - [[maybe_unused]] auto avm_mem_rng_chk_sel = View(new_term.avm_mem_rng_chk_sel); \ - [[maybe_unused]] auto avm_mem_rw = View(new_term.avm_mem_rw); \ - [[maybe_unused]] auto avm_mem_sel_cmov = View(new_term.avm_mem_sel_cmov); \ - [[maybe_unused]] auto avm_mem_sel_mov_a = View(new_term.avm_mem_sel_mov_a); \ - [[maybe_unused]] auto avm_mem_sel_mov_b = View(new_term.avm_mem_sel_mov_b); \ - [[maybe_unused]] auto avm_mem_skip_check_tag = View(new_term.avm_mem_skip_check_tag); \ - [[maybe_unused]] auto avm_mem_space_id = View(new_term.avm_mem_space_id); \ - [[maybe_unused]] auto avm_mem_tag = View(new_term.avm_mem_tag); \ - [[maybe_unused]] auto avm_mem_tag_err = View(new_term.avm_mem_tag_err); \ - [[maybe_unused]] auto avm_mem_tsp = View(new_term.avm_mem_tsp); \ - [[maybe_unused]] auto avm_mem_val = View(new_term.avm_mem_val); \ - [[maybe_unused]] auto avm_mem_w_in_tag = View(new_term.avm_mem_w_in_tag); \ - [[maybe_unused]] auto avm_pedersen_clk = View(new_term.avm_pedersen_clk); \ - [[maybe_unused]] auto avm_pedersen_input = View(new_term.avm_pedersen_input); \ - [[maybe_unused]] auto avm_pedersen_output = View(new_term.avm_pedersen_output); \ - [[maybe_unused]] auto avm_pedersen_pedersen_sel = View(new_term.avm_pedersen_pedersen_sel); \ - [[maybe_unused]] auto avm_poseidon2_clk = View(new_term.avm_poseidon2_clk); \ - [[maybe_unused]] auto avm_poseidon2_input = View(new_term.avm_poseidon2_input); \ - [[maybe_unused]] auto avm_poseidon2_output = View(new_term.avm_poseidon2_output); \ - [[maybe_unused]] auto avm_poseidon2_poseidon_perm_sel = View(new_term.avm_poseidon2_poseidon_perm_sel); \ - [[maybe_unused]] auto avm_sha256_clk = View(new_term.avm_sha256_clk); \ - [[maybe_unused]] auto avm_sha256_input = View(new_term.avm_sha256_input); \ - [[maybe_unused]] auto avm_sha256_output = View(new_term.avm_sha256_output); \ - [[maybe_unused]] auto avm_sha256_sha256_compression_sel = View(new_term.avm_sha256_sha256_compression_sel); \ - [[maybe_unused]] auto avm_sha256_state = View(new_term.avm_sha256_state); \ + [[maybe_unused]] auto main_clk = View(new_term.main_clk); \ + [[maybe_unused]] auto main_first = View(new_term.main_first); \ + [[maybe_unused]] auto alu_a_hi = View(new_term.alu_a_hi); \ + [[maybe_unused]] auto alu_a_lo = View(new_term.alu_a_lo); \ + [[maybe_unused]] auto alu_alu_sel = View(new_term.alu_alu_sel); \ + [[maybe_unused]] auto alu_b_hi = View(new_term.alu_b_hi); \ + [[maybe_unused]] auto alu_b_lo = View(new_term.alu_b_lo); \ + [[maybe_unused]] auto alu_borrow = View(new_term.alu_borrow); \ + [[maybe_unused]] auto alu_cf = View(new_term.alu_cf); \ + [[maybe_unused]] auto alu_clk = View(new_term.alu_clk); \ + [[maybe_unused]] auto alu_cmp_rng_ctr = View(new_term.alu_cmp_rng_ctr); \ + [[maybe_unused]] auto alu_cmp_sel = View(new_term.alu_cmp_sel); \ + [[maybe_unused]] auto alu_div_rng_chk_selector = View(new_term.alu_div_rng_chk_selector); \ + [[maybe_unused]] auto alu_div_u16_r0 = View(new_term.alu_div_u16_r0); \ + [[maybe_unused]] auto alu_div_u16_r1 = View(new_term.alu_div_u16_r1); \ + [[maybe_unused]] auto alu_div_u16_r2 = View(new_term.alu_div_u16_r2); \ + [[maybe_unused]] auto alu_div_u16_r3 = View(new_term.alu_div_u16_r3); \ + [[maybe_unused]] auto alu_div_u16_r4 = View(new_term.alu_div_u16_r4); \ + [[maybe_unused]] auto alu_div_u16_r5 = View(new_term.alu_div_u16_r5); \ + [[maybe_unused]] auto alu_div_u16_r6 = View(new_term.alu_div_u16_r6); \ + [[maybe_unused]] auto alu_div_u16_r7 = View(new_term.alu_div_u16_r7); \ + [[maybe_unused]] auto alu_divisor_hi = View(new_term.alu_divisor_hi); \ + [[maybe_unused]] auto alu_divisor_lo = View(new_term.alu_divisor_lo); \ + [[maybe_unused]] auto alu_ff_tag = View(new_term.alu_ff_tag); \ + [[maybe_unused]] auto alu_ia = View(new_term.alu_ia); \ + [[maybe_unused]] auto alu_ib = View(new_term.alu_ib); \ + [[maybe_unused]] auto alu_ic = View(new_term.alu_ic); \ + [[maybe_unused]] auto alu_in_tag = View(new_term.alu_in_tag); \ + [[maybe_unused]] auto alu_op_add = View(new_term.alu_op_add); \ + [[maybe_unused]] auto alu_op_cast = View(new_term.alu_op_cast); \ + [[maybe_unused]] auto alu_op_cast_prev = View(new_term.alu_op_cast_prev); \ + [[maybe_unused]] auto alu_op_div = View(new_term.alu_op_div); \ + [[maybe_unused]] auto alu_op_div_a_lt_b = View(new_term.alu_op_div_a_lt_b); \ + [[maybe_unused]] auto alu_op_div_std = View(new_term.alu_op_div_std); \ + [[maybe_unused]] auto alu_op_eq = View(new_term.alu_op_eq); \ + [[maybe_unused]] auto alu_op_eq_diff_inv = View(new_term.alu_op_eq_diff_inv); \ + [[maybe_unused]] auto alu_op_lt = View(new_term.alu_op_lt); \ + [[maybe_unused]] auto alu_op_lte = View(new_term.alu_op_lte); \ + [[maybe_unused]] auto alu_op_mul = View(new_term.alu_op_mul); \ + [[maybe_unused]] auto alu_op_not = View(new_term.alu_op_not); \ + [[maybe_unused]] auto alu_op_shl = View(new_term.alu_op_shl); \ + [[maybe_unused]] auto alu_op_shr = View(new_term.alu_op_shr); \ + [[maybe_unused]] auto alu_op_sub = View(new_term.alu_op_sub); \ + [[maybe_unused]] auto alu_p_a_borrow = View(new_term.alu_p_a_borrow); \ + [[maybe_unused]] auto alu_p_b_borrow = View(new_term.alu_p_b_borrow); \ + [[maybe_unused]] auto alu_p_sub_a_hi = View(new_term.alu_p_sub_a_hi); \ + [[maybe_unused]] auto alu_p_sub_a_lo = View(new_term.alu_p_sub_a_lo); \ + [[maybe_unused]] auto alu_p_sub_b_hi = View(new_term.alu_p_sub_b_hi); \ + [[maybe_unused]] auto alu_p_sub_b_lo = View(new_term.alu_p_sub_b_lo); \ + [[maybe_unused]] auto alu_partial_prod_hi = View(new_term.alu_partial_prod_hi); \ + [[maybe_unused]] auto alu_partial_prod_lo = View(new_term.alu_partial_prod_lo); \ + [[maybe_unused]] auto alu_quotient_hi = View(new_term.alu_quotient_hi); \ + [[maybe_unused]] auto alu_quotient_lo = View(new_term.alu_quotient_lo); \ + [[maybe_unused]] auto alu_remainder = View(new_term.alu_remainder); \ + [[maybe_unused]] auto alu_res_hi = View(new_term.alu_res_hi); \ + [[maybe_unused]] auto alu_res_lo = View(new_term.alu_res_lo); \ + [[maybe_unused]] auto alu_rng_chk_lookup_selector = View(new_term.alu_rng_chk_lookup_selector); \ + [[maybe_unused]] auto alu_rng_chk_sel = View(new_term.alu_rng_chk_sel); \ + [[maybe_unused]] auto alu_shift_lt_bit_len = View(new_term.alu_shift_lt_bit_len); \ + [[maybe_unused]] auto alu_shift_sel = View(new_term.alu_shift_sel); \ + [[maybe_unused]] auto alu_t_sub_s_bits = View(new_term.alu_t_sub_s_bits); \ + [[maybe_unused]] auto alu_two_pow_s = View(new_term.alu_two_pow_s); \ + [[maybe_unused]] auto alu_two_pow_t_sub_s = View(new_term.alu_two_pow_t_sub_s); \ + [[maybe_unused]] auto alu_u128_tag = View(new_term.alu_u128_tag); \ + [[maybe_unused]] auto alu_u16_r0 = View(new_term.alu_u16_r0); \ + [[maybe_unused]] auto alu_u16_r1 = View(new_term.alu_u16_r1); \ + [[maybe_unused]] auto alu_u16_r10 = View(new_term.alu_u16_r10); \ + [[maybe_unused]] auto alu_u16_r11 = View(new_term.alu_u16_r11); \ + [[maybe_unused]] auto alu_u16_r12 = View(new_term.alu_u16_r12); \ + [[maybe_unused]] auto alu_u16_r13 = View(new_term.alu_u16_r13); \ + [[maybe_unused]] auto alu_u16_r14 = View(new_term.alu_u16_r14); \ + [[maybe_unused]] auto alu_u16_r2 = View(new_term.alu_u16_r2); \ + [[maybe_unused]] auto alu_u16_r3 = View(new_term.alu_u16_r3); \ + [[maybe_unused]] auto alu_u16_r4 = View(new_term.alu_u16_r4); \ + [[maybe_unused]] auto alu_u16_r5 = View(new_term.alu_u16_r5); \ + [[maybe_unused]] auto alu_u16_r6 = View(new_term.alu_u16_r6); \ + [[maybe_unused]] auto alu_u16_r7 = View(new_term.alu_u16_r7); \ + [[maybe_unused]] auto alu_u16_r8 = View(new_term.alu_u16_r8); \ + [[maybe_unused]] auto alu_u16_r9 = View(new_term.alu_u16_r9); \ + [[maybe_unused]] auto alu_u16_tag = View(new_term.alu_u16_tag); \ + [[maybe_unused]] auto alu_u32_tag = View(new_term.alu_u32_tag); \ + [[maybe_unused]] auto alu_u64_tag = View(new_term.alu_u64_tag); \ + [[maybe_unused]] auto alu_u8_r0 = View(new_term.alu_u8_r0); \ + [[maybe_unused]] auto alu_u8_r1 = View(new_term.alu_u8_r1); \ + [[maybe_unused]] auto alu_u8_tag = View(new_term.alu_u8_tag); \ + [[maybe_unused]] auto binary_acc_ia = View(new_term.binary_acc_ia); \ + [[maybe_unused]] auto binary_acc_ib = View(new_term.binary_acc_ib); \ + [[maybe_unused]] auto binary_acc_ic = View(new_term.binary_acc_ic); \ + [[maybe_unused]] auto binary_bin_sel = View(new_term.binary_bin_sel); \ + [[maybe_unused]] auto binary_clk = View(new_term.binary_clk); \ + [[maybe_unused]] auto binary_ia_bytes = View(new_term.binary_ia_bytes); \ + [[maybe_unused]] auto binary_ib_bytes = View(new_term.binary_ib_bytes); \ + [[maybe_unused]] auto binary_ic_bytes = View(new_term.binary_ic_bytes); \ + [[maybe_unused]] auto binary_in_tag = View(new_term.binary_in_tag); \ + [[maybe_unused]] auto binary_mem_tag_ctr = View(new_term.binary_mem_tag_ctr); \ + [[maybe_unused]] auto binary_mem_tag_ctr_inv = View(new_term.binary_mem_tag_ctr_inv); \ + [[maybe_unused]] auto binary_op_id = View(new_term.binary_op_id); \ + [[maybe_unused]] auto binary_start = View(new_term.binary_start); \ + [[maybe_unused]] auto byte_lookup_bin_sel = View(new_term.byte_lookup_bin_sel); \ + [[maybe_unused]] auto byte_lookup_table_byte_lengths = View(new_term.byte_lookup_table_byte_lengths); \ + [[maybe_unused]] auto byte_lookup_table_in_tags = View(new_term.byte_lookup_table_in_tags); \ + [[maybe_unused]] auto byte_lookup_table_input_a = View(new_term.byte_lookup_table_input_a); \ + [[maybe_unused]] auto byte_lookup_table_input_b = View(new_term.byte_lookup_table_input_b); \ + [[maybe_unused]] auto byte_lookup_table_op_id = View(new_term.byte_lookup_table_op_id); \ + [[maybe_unused]] auto byte_lookup_table_output = View(new_term.byte_lookup_table_output); \ + [[maybe_unused]] auto conversion_clk = View(new_term.conversion_clk); \ + [[maybe_unused]] auto conversion_input = View(new_term.conversion_input); \ + [[maybe_unused]] auto conversion_num_limbs = View(new_term.conversion_num_limbs); \ + [[maybe_unused]] auto conversion_radix = View(new_term.conversion_radix); \ + [[maybe_unused]] auto conversion_to_radix_le_sel = View(new_term.conversion_to_radix_le_sel); \ + [[maybe_unused]] auto gas_da_gas_fixed_table = View(new_term.gas_da_gas_fixed_table); \ + [[maybe_unused]] auto gas_gas_cost_sel = View(new_term.gas_gas_cost_sel); \ + [[maybe_unused]] auto gas_l2_gas_fixed_table = View(new_term.gas_l2_gas_fixed_table); \ + [[maybe_unused]] auto keccakf1600_clk = View(new_term.keccakf1600_clk); \ + [[maybe_unused]] auto keccakf1600_input = View(new_term.keccakf1600_input); \ + [[maybe_unused]] auto keccakf1600_keccakf1600_sel = View(new_term.keccakf1600_keccakf1600_sel); \ + [[maybe_unused]] auto keccakf1600_output = View(new_term.keccakf1600_output); \ + [[maybe_unused]] auto kernel_emit_l2_to_l1_msg_write_offset = \ + View(new_term.kernel_emit_l2_to_l1_msg_write_offset); \ + [[maybe_unused]] auto kernel_emit_note_hash_write_offset = View(new_term.kernel_emit_note_hash_write_offset); \ + [[maybe_unused]] auto kernel_emit_nullifier_write_offset = View(new_term.kernel_emit_nullifier_write_offset); \ + [[maybe_unused]] auto kernel_emit_unencrypted_log_write_offset = \ + View(new_term.kernel_emit_unencrypted_log_write_offset); \ + [[maybe_unused]] auto kernel_kernel_in_offset = View(new_term.kernel_kernel_in_offset); \ + [[maybe_unused]] auto kernel_kernel_inputs = View(new_term.kernel_kernel_inputs); \ + [[maybe_unused]] auto kernel_kernel_metadata_out = View(new_term.kernel_kernel_metadata_out); \ + [[maybe_unused]] auto kernel_kernel_out_offset = View(new_term.kernel_kernel_out_offset); \ + [[maybe_unused]] auto kernel_kernel_side_effect_out = View(new_term.kernel_kernel_side_effect_out); \ + [[maybe_unused]] auto kernel_kernel_value_out = View(new_term.kernel_kernel_value_out); \ + [[maybe_unused]] auto kernel_l1_to_l2_msg_exists_write_offset = \ + View(new_term.kernel_l1_to_l2_msg_exists_write_offset); \ + [[maybe_unused]] auto kernel_note_hash_exist_write_offset = View(new_term.kernel_note_hash_exist_write_offset); \ + [[maybe_unused]] auto kernel_nullifier_exists_write_offset = View(new_term.kernel_nullifier_exists_write_offset); \ + [[maybe_unused]] auto kernel_nullifier_non_exists_write_offset = \ + View(new_term.kernel_nullifier_non_exists_write_offset); \ + [[maybe_unused]] auto kernel_q_public_input_kernel_add_to_table = \ + View(new_term.kernel_q_public_input_kernel_add_to_table); \ + [[maybe_unused]] auto kernel_q_public_input_kernel_out_add_to_table = \ + View(new_term.kernel_q_public_input_kernel_out_add_to_table); \ + [[maybe_unused]] auto kernel_side_effect_counter = View(new_term.kernel_side_effect_counter); \ + [[maybe_unused]] auto kernel_sload_write_offset = View(new_term.kernel_sload_write_offset); \ + [[maybe_unused]] auto kernel_sstore_write_offset = View(new_term.kernel_sstore_write_offset); \ + [[maybe_unused]] auto main_abs_da_rem_gas_hi = View(new_term.main_abs_da_rem_gas_hi); \ + [[maybe_unused]] auto main_abs_da_rem_gas_lo = View(new_term.main_abs_da_rem_gas_lo); \ + [[maybe_unused]] auto main_abs_l2_rem_gas_hi = View(new_term.main_abs_l2_rem_gas_hi); \ + [[maybe_unused]] auto main_abs_l2_rem_gas_lo = View(new_term.main_abs_l2_rem_gas_lo); \ + [[maybe_unused]] auto main_alu_in_tag = View(new_term.main_alu_in_tag); \ + [[maybe_unused]] auto main_alu_sel = View(new_term.main_alu_sel); \ + [[maybe_unused]] auto main_bin_op_id = View(new_term.main_bin_op_id); \ + [[maybe_unused]] auto main_bin_sel = View(new_term.main_bin_sel); \ + [[maybe_unused]] auto main_call_ptr = View(new_term.main_call_ptr); \ + [[maybe_unused]] auto main_da_gas_op = View(new_term.main_da_gas_op); \ + [[maybe_unused]] auto main_da_gas_remaining = View(new_term.main_da_gas_remaining); \ + [[maybe_unused]] auto main_da_out_of_gas = View(new_term.main_da_out_of_gas); \ + [[maybe_unused]] auto main_gas_cost_active = View(new_term.main_gas_cost_active); \ + [[maybe_unused]] auto main_ia = View(new_term.main_ia); \ + [[maybe_unused]] auto main_ib = View(new_term.main_ib); \ + [[maybe_unused]] auto main_ic = View(new_term.main_ic); \ + [[maybe_unused]] auto main_id = View(new_term.main_id); \ + [[maybe_unused]] auto main_id_zero = View(new_term.main_id_zero); \ + [[maybe_unused]] auto main_ind_a = View(new_term.main_ind_a); \ + [[maybe_unused]] auto main_ind_b = View(new_term.main_ind_b); \ + [[maybe_unused]] auto main_ind_c = View(new_term.main_ind_c); \ + [[maybe_unused]] auto main_ind_d = View(new_term.main_ind_d); \ + [[maybe_unused]] auto main_ind_op_a = View(new_term.main_ind_op_a); \ + [[maybe_unused]] auto main_ind_op_b = View(new_term.main_ind_op_b); \ + [[maybe_unused]] auto main_ind_op_c = View(new_term.main_ind_op_c); \ + [[maybe_unused]] auto main_ind_op_d = View(new_term.main_ind_op_d); \ + [[maybe_unused]] auto main_internal_return_ptr = View(new_term.main_internal_return_ptr); \ + [[maybe_unused]] auto main_inv = View(new_term.main_inv); \ + [[maybe_unused]] auto main_l2_gas_op = View(new_term.main_l2_gas_op); \ + [[maybe_unused]] auto main_l2_gas_remaining = View(new_term.main_l2_gas_remaining); \ + [[maybe_unused]] auto main_l2_out_of_gas = View(new_term.main_l2_out_of_gas); \ + [[maybe_unused]] auto main_last = View(new_term.main_last); \ + [[maybe_unused]] auto main_mem_idx_a = View(new_term.main_mem_idx_a); \ + [[maybe_unused]] auto main_mem_idx_b = View(new_term.main_mem_idx_b); \ + [[maybe_unused]] auto main_mem_idx_c = View(new_term.main_mem_idx_c); \ + [[maybe_unused]] auto main_mem_idx_d = View(new_term.main_mem_idx_d); \ + [[maybe_unused]] auto main_mem_op_a = View(new_term.main_mem_op_a); \ + [[maybe_unused]] auto main_mem_op_activate_gas = View(new_term.main_mem_op_activate_gas); \ + [[maybe_unused]] auto main_mem_op_b = View(new_term.main_mem_op_b); \ + [[maybe_unused]] auto main_mem_op_c = View(new_term.main_mem_op_c); \ + [[maybe_unused]] auto main_mem_op_d = View(new_term.main_mem_op_d); \ + [[maybe_unused]] auto main_op_err = View(new_term.main_op_err); \ + [[maybe_unused]] auto main_opcode_val = View(new_term.main_opcode_val); \ + [[maybe_unused]] auto main_pc = View(new_term.main_pc); \ + [[maybe_unused]] auto main_q_kernel_lookup = View(new_term.main_q_kernel_lookup); \ + [[maybe_unused]] auto main_q_kernel_output_lookup = View(new_term.main_q_kernel_output_lookup); \ + [[maybe_unused]] auto main_r_in_tag = View(new_term.main_r_in_tag); \ + [[maybe_unused]] auto main_rwa = View(new_term.main_rwa); \ + [[maybe_unused]] auto main_rwb = View(new_term.main_rwb); \ + [[maybe_unused]] auto main_rwc = View(new_term.main_rwc); \ + [[maybe_unused]] auto main_rwd = View(new_term.main_rwd); \ + [[maybe_unused]] auto main_sel_cmov = View(new_term.main_sel_cmov); \ + [[maybe_unused]] auto main_sel_external_call = View(new_term.main_sel_external_call); \ + [[maybe_unused]] auto main_sel_halt = View(new_term.main_sel_halt); \ + [[maybe_unused]] auto main_sel_internal_call = View(new_term.main_sel_internal_call); \ + [[maybe_unused]] auto main_sel_internal_return = View(new_term.main_sel_internal_return); \ + [[maybe_unused]] auto main_sel_jump = View(new_term.main_sel_jump); \ + [[maybe_unused]] auto main_sel_jumpi = View(new_term.main_sel_jumpi); \ + [[maybe_unused]] auto main_sel_mov = View(new_term.main_sel_mov); \ + [[maybe_unused]] auto main_sel_mov_a = View(new_term.main_sel_mov_a); \ + [[maybe_unused]] auto main_sel_mov_b = View(new_term.main_sel_mov_b); \ + [[maybe_unused]] auto main_sel_op_add = View(new_term.main_sel_op_add); \ + [[maybe_unused]] auto main_sel_op_address = View(new_term.main_sel_op_address); \ + [[maybe_unused]] auto main_sel_op_and = View(new_term.main_sel_op_and); \ + [[maybe_unused]] auto main_sel_op_block_number = View(new_term.main_sel_op_block_number); \ + [[maybe_unused]] auto main_sel_op_cast = View(new_term.main_sel_op_cast); \ + [[maybe_unused]] auto main_sel_op_chain_id = View(new_term.main_sel_op_chain_id); \ + [[maybe_unused]] auto main_sel_op_coinbase = View(new_term.main_sel_op_coinbase); \ + [[maybe_unused]] auto main_sel_op_dagasleft = View(new_term.main_sel_op_dagasleft); \ + [[maybe_unused]] auto main_sel_op_div = View(new_term.main_sel_op_div); \ + [[maybe_unused]] auto main_sel_op_emit_l2_to_l1_msg = View(new_term.main_sel_op_emit_l2_to_l1_msg); \ + [[maybe_unused]] auto main_sel_op_emit_note_hash = View(new_term.main_sel_op_emit_note_hash); \ + [[maybe_unused]] auto main_sel_op_emit_nullifier = View(new_term.main_sel_op_emit_nullifier); \ + [[maybe_unused]] auto main_sel_op_emit_unencrypted_log = View(new_term.main_sel_op_emit_unencrypted_log); \ + [[maybe_unused]] auto main_sel_op_eq = View(new_term.main_sel_op_eq); \ + [[maybe_unused]] auto main_sel_op_fdiv = View(new_term.main_sel_op_fdiv); \ + [[maybe_unused]] auto main_sel_op_fee_per_da_gas = View(new_term.main_sel_op_fee_per_da_gas); \ + [[maybe_unused]] auto main_sel_op_fee_per_l2_gas = View(new_term.main_sel_op_fee_per_l2_gas); \ + [[maybe_unused]] auto main_sel_op_get_contract_instance = View(new_term.main_sel_op_get_contract_instance); \ + [[maybe_unused]] auto main_sel_op_keccak = View(new_term.main_sel_op_keccak); \ + [[maybe_unused]] auto main_sel_op_l1_to_l2_msg_exists = View(new_term.main_sel_op_l1_to_l2_msg_exists); \ + [[maybe_unused]] auto main_sel_op_l2gasleft = View(new_term.main_sel_op_l2gasleft); \ + [[maybe_unused]] auto main_sel_op_lt = View(new_term.main_sel_op_lt); \ + [[maybe_unused]] auto main_sel_op_lte = View(new_term.main_sel_op_lte); \ + [[maybe_unused]] auto main_sel_op_mul = View(new_term.main_sel_op_mul); \ + [[maybe_unused]] auto main_sel_op_not = View(new_term.main_sel_op_not); \ + [[maybe_unused]] auto main_sel_op_note_hash_exists = View(new_term.main_sel_op_note_hash_exists); \ + [[maybe_unused]] auto main_sel_op_nullifier_exists = View(new_term.main_sel_op_nullifier_exists); \ + [[maybe_unused]] auto main_sel_op_or = View(new_term.main_sel_op_or); \ + [[maybe_unused]] auto main_sel_op_pedersen = View(new_term.main_sel_op_pedersen); \ + [[maybe_unused]] auto main_sel_op_poseidon2 = View(new_term.main_sel_op_poseidon2); \ + [[maybe_unused]] auto main_sel_op_radix_le = View(new_term.main_sel_op_radix_le); \ + [[maybe_unused]] auto main_sel_op_sender = View(new_term.main_sel_op_sender); \ + [[maybe_unused]] auto main_sel_op_sha256 = View(new_term.main_sel_op_sha256); \ + [[maybe_unused]] auto main_sel_op_shl = View(new_term.main_sel_op_shl); \ + [[maybe_unused]] auto main_sel_op_shr = View(new_term.main_sel_op_shr); \ + [[maybe_unused]] auto main_sel_op_sload = View(new_term.main_sel_op_sload); \ + [[maybe_unused]] auto main_sel_op_sstore = View(new_term.main_sel_op_sstore); \ + [[maybe_unused]] auto main_sel_op_storage_address = View(new_term.main_sel_op_storage_address); \ + [[maybe_unused]] auto main_sel_op_sub = View(new_term.main_sel_op_sub); \ + [[maybe_unused]] auto main_sel_op_timestamp = View(new_term.main_sel_op_timestamp); \ + [[maybe_unused]] auto main_sel_op_transaction_fee = View(new_term.main_sel_op_transaction_fee); \ + [[maybe_unused]] auto main_sel_op_version = View(new_term.main_sel_op_version); \ + [[maybe_unused]] auto main_sel_op_xor = View(new_term.main_sel_op_xor); \ + [[maybe_unused]] auto main_sel_rng_16 = View(new_term.main_sel_rng_16); \ + [[maybe_unused]] auto main_sel_rng_8 = View(new_term.main_sel_rng_8); \ + [[maybe_unused]] auto main_space_id = View(new_term.main_space_id); \ + [[maybe_unused]] auto main_table_pow_2 = View(new_term.main_table_pow_2); \ + [[maybe_unused]] auto main_tag_err = View(new_term.main_tag_err); \ + [[maybe_unused]] auto main_w_in_tag = View(new_term.main_w_in_tag); \ + [[maybe_unused]] auto mem_addr = View(new_term.mem_addr); \ + [[maybe_unused]] auto mem_clk = View(new_term.mem_clk); \ + [[maybe_unused]] auto mem_diff_hi = View(new_term.mem_diff_hi); \ + [[maybe_unused]] auto mem_diff_lo = View(new_term.mem_diff_lo); \ + [[maybe_unused]] auto mem_diff_mid = View(new_term.mem_diff_mid); \ + [[maybe_unused]] auto mem_glob_addr = View(new_term.mem_glob_addr); \ + [[maybe_unused]] auto mem_ind_op_a = View(new_term.mem_ind_op_a); \ + [[maybe_unused]] auto mem_ind_op_b = View(new_term.mem_ind_op_b); \ + [[maybe_unused]] auto mem_ind_op_c = View(new_term.mem_ind_op_c); \ + [[maybe_unused]] auto mem_ind_op_d = View(new_term.mem_ind_op_d); \ + [[maybe_unused]] auto mem_last = View(new_term.mem_last); \ + [[maybe_unused]] auto mem_lastAccess = View(new_term.mem_lastAccess); \ + [[maybe_unused]] auto mem_mem_sel = View(new_term.mem_mem_sel); \ + [[maybe_unused]] auto mem_one_min_inv = View(new_term.mem_one_min_inv); \ + [[maybe_unused]] auto mem_op_a = View(new_term.mem_op_a); \ + [[maybe_unused]] auto mem_op_b = View(new_term.mem_op_b); \ + [[maybe_unused]] auto mem_op_c = View(new_term.mem_op_c); \ + [[maybe_unused]] auto mem_op_d = View(new_term.mem_op_d); \ + [[maybe_unused]] auto mem_r_in_tag = View(new_term.mem_r_in_tag); \ + [[maybe_unused]] auto mem_rng_chk_sel = View(new_term.mem_rng_chk_sel); \ + [[maybe_unused]] auto mem_rw = View(new_term.mem_rw); \ + [[maybe_unused]] auto mem_sel_cmov = View(new_term.mem_sel_cmov); \ + [[maybe_unused]] auto mem_sel_mov_a = View(new_term.mem_sel_mov_a); \ + [[maybe_unused]] auto mem_sel_mov_b = View(new_term.mem_sel_mov_b); \ + [[maybe_unused]] auto mem_skip_check_tag = View(new_term.mem_skip_check_tag); \ + [[maybe_unused]] auto mem_space_id = View(new_term.mem_space_id); \ + [[maybe_unused]] auto mem_tag = View(new_term.mem_tag); \ + [[maybe_unused]] auto mem_tag_err = View(new_term.mem_tag_err); \ + [[maybe_unused]] auto mem_tsp = View(new_term.mem_tsp); \ + [[maybe_unused]] auto mem_val = View(new_term.mem_val); \ + [[maybe_unused]] auto mem_w_in_tag = View(new_term.mem_w_in_tag); \ + [[maybe_unused]] auto pedersen_clk = View(new_term.pedersen_clk); \ + [[maybe_unused]] auto pedersen_input = View(new_term.pedersen_input); \ + [[maybe_unused]] auto pedersen_output = View(new_term.pedersen_output); \ + [[maybe_unused]] auto pedersen_pedersen_sel = View(new_term.pedersen_pedersen_sel); \ + [[maybe_unused]] auto poseidon2_clk = View(new_term.poseidon2_clk); \ + [[maybe_unused]] auto poseidon2_input = View(new_term.poseidon2_input); \ + [[maybe_unused]] auto poseidon2_output = View(new_term.poseidon2_output); \ + [[maybe_unused]] auto poseidon2_poseidon_perm_sel = View(new_term.poseidon2_poseidon_perm_sel); \ + [[maybe_unused]] auto sha256_clk = View(new_term.sha256_clk); \ + [[maybe_unused]] auto sha256_input = View(new_term.sha256_input); \ + [[maybe_unused]] auto sha256_output = View(new_term.sha256_output); \ + [[maybe_unused]] auto sha256_sha256_compression_sel = View(new_term.sha256_sha256_compression_sel); \ + [[maybe_unused]] auto sha256_state = View(new_term.sha256_state); \ [[maybe_unused]] auto perm_main_alu = View(new_term.perm_main_alu); \ [[maybe_unused]] auto perm_main_bin = View(new_term.perm_main_bin); \ [[maybe_unused]] auto perm_main_conv = View(new_term.perm_main_conv); \ @@ -398,77 +393,76 @@ [[maybe_unused]] auto lookup_div_u16_5_counts = View(new_term.lookup_div_u16_5_counts); \ [[maybe_unused]] auto lookup_div_u16_6_counts = View(new_term.lookup_div_u16_6_counts); \ [[maybe_unused]] auto lookup_div_u16_7_counts = View(new_term.lookup_div_u16_7_counts); \ - [[maybe_unused]] auto avm_alu_a_hi_shift = View(new_term.avm_alu_a_hi_shift); \ - [[maybe_unused]] auto avm_alu_a_lo_shift = View(new_term.avm_alu_a_lo_shift); \ - [[maybe_unused]] auto avm_alu_alu_sel_shift = View(new_term.avm_alu_alu_sel_shift); \ - [[maybe_unused]] auto avm_alu_b_hi_shift = View(new_term.avm_alu_b_hi_shift); \ - [[maybe_unused]] auto avm_alu_b_lo_shift = View(new_term.avm_alu_b_lo_shift); \ - [[maybe_unused]] auto avm_alu_cmp_rng_ctr_shift = View(new_term.avm_alu_cmp_rng_ctr_shift); \ - [[maybe_unused]] auto avm_alu_cmp_sel_shift = View(new_term.avm_alu_cmp_sel_shift); \ - [[maybe_unused]] auto avm_alu_div_rng_chk_selector_shift = View(new_term.avm_alu_div_rng_chk_selector_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r0_shift = View(new_term.avm_alu_div_u16_r0_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r1_shift = View(new_term.avm_alu_div_u16_r1_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r2_shift = View(new_term.avm_alu_div_u16_r2_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r3_shift = View(new_term.avm_alu_div_u16_r3_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r4_shift = View(new_term.avm_alu_div_u16_r4_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r5_shift = View(new_term.avm_alu_div_u16_r5_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r6_shift = View(new_term.avm_alu_div_u16_r6_shift); \ - [[maybe_unused]] auto avm_alu_div_u16_r7_shift = View(new_term.avm_alu_div_u16_r7_shift); \ - [[maybe_unused]] auto avm_alu_op_add_shift = View(new_term.avm_alu_op_add_shift); \ - [[maybe_unused]] auto avm_alu_op_cast_prev_shift = View(new_term.avm_alu_op_cast_prev_shift); \ - [[maybe_unused]] auto avm_alu_op_cast_shift = View(new_term.avm_alu_op_cast_shift); \ - [[maybe_unused]] auto avm_alu_op_div_shift = View(new_term.avm_alu_op_div_shift); \ - [[maybe_unused]] auto avm_alu_op_mul_shift = View(new_term.avm_alu_op_mul_shift); \ - [[maybe_unused]] auto avm_alu_op_shl_shift = View(new_term.avm_alu_op_shl_shift); \ - [[maybe_unused]] auto avm_alu_op_shr_shift = View(new_term.avm_alu_op_shr_shift); \ - [[maybe_unused]] auto avm_alu_op_sub_shift = View(new_term.avm_alu_op_sub_shift); \ - [[maybe_unused]] auto avm_alu_p_sub_a_hi_shift = View(new_term.avm_alu_p_sub_a_hi_shift); \ - [[maybe_unused]] auto avm_alu_p_sub_a_lo_shift = View(new_term.avm_alu_p_sub_a_lo_shift); \ - [[maybe_unused]] auto avm_alu_p_sub_b_hi_shift = View(new_term.avm_alu_p_sub_b_hi_shift); \ - [[maybe_unused]] auto avm_alu_p_sub_b_lo_shift = View(new_term.avm_alu_p_sub_b_lo_shift); \ - [[maybe_unused]] auto avm_alu_rng_chk_lookup_selector_shift = \ - View(new_term.avm_alu_rng_chk_lookup_selector_shift); \ - [[maybe_unused]] auto avm_alu_rng_chk_sel_shift = View(new_term.avm_alu_rng_chk_sel_shift); \ - [[maybe_unused]] auto avm_alu_u16_r0_shift = View(new_term.avm_alu_u16_r0_shift); \ - [[maybe_unused]] auto avm_alu_u16_r1_shift = View(new_term.avm_alu_u16_r1_shift); \ - [[maybe_unused]] auto avm_alu_u16_r2_shift = View(new_term.avm_alu_u16_r2_shift); \ - [[maybe_unused]] auto avm_alu_u16_r3_shift = View(new_term.avm_alu_u16_r3_shift); \ - [[maybe_unused]] auto avm_alu_u16_r4_shift = View(new_term.avm_alu_u16_r4_shift); \ - [[maybe_unused]] auto avm_alu_u16_r5_shift = View(new_term.avm_alu_u16_r5_shift); \ - [[maybe_unused]] auto avm_alu_u16_r6_shift = View(new_term.avm_alu_u16_r6_shift); \ - [[maybe_unused]] auto avm_alu_u8_r0_shift = View(new_term.avm_alu_u8_r0_shift); \ - [[maybe_unused]] auto avm_alu_u8_r1_shift = View(new_term.avm_alu_u8_r1_shift); \ - [[maybe_unused]] auto avm_binary_acc_ia_shift = View(new_term.avm_binary_acc_ia_shift); \ - [[maybe_unused]] auto avm_binary_acc_ib_shift = View(new_term.avm_binary_acc_ib_shift); \ - [[maybe_unused]] auto avm_binary_acc_ic_shift = View(new_term.avm_binary_acc_ic_shift); \ - [[maybe_unused]] auto avm_binary_mem_tag_ctr_shift = View(new_term.avm_binary_mem_tag_ctr_shift); \ - [[maybe_unused]] auto avm_binary_op_id_shift = View(new_term.avm_binary_op_id_shift); \ - [[maybe_unused]] auto avm_kernel_emit_l2_to_l1_msg_write_offset_shift = \ - View(new_term.avm_kernel_emit_l2_to_l1_msg_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_emit_note_hash_write_offset_shift = \ - View(new_term.avm_kernel_emit_note_hash_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_emit_nullifier_write_offset_shift = \ - View(new_term.avm_kernel_emit_nullifier_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_emit_unencrypted_log_write_offset_shift = \ - View(new_term.avm_kernel_emit_unencrypted_log_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_l1_to_l2_msg_exists_write_offset_shift = \ - View(new_term.avm_kernel_l1_to_l2_msg_exists_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_note_hash_exist_write_offset_shift = \ - View(new_term.avm_kernel_note_hash_exist_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_nullifier_exists_write_offset_shift = \ - View(new_term.avm_kernel_nullifier_exists_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_nullifier_non_exists_write_offset_shift = \ - View(new_term.avm_kernel_nullifier_non_exists_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_side_effect_counter_shift = View(new_term.avm_kernel_side_effect_counter_shift); \ - [[maybe_unused]] auto avm_kernel_sload_write_offset_shift = View(new_term.avm_kernel_sload_write_offset_shift); \ - [[maybe_unused]] auto avm_kernel_sstore_write_offset_shift = View(new_term.avm_kernel_sstore_write_offset_shift); \ - [[maybe_unused]] auto avm_main_da_gas_remaining_shift = View(new_term.avm_main_da_gas_remaining_shift); \ - [[maybe_unused]] auto avm_main_internal_return_ptr_shift = View(new_term.avm_main_internal_return_ptr_shift); \ - [[maybe_unused]] auto avm_main_l2_gas_remaining_shift = View(new_term.avm_main_l2_gas_remaining_shift); \ - [[maybe_unused]] auto avm_main_pc_shift = View(new_term.avm_main_pc_shift); \ - [[maybe_unused]] auto avm_mem_glob_addr_shift = View(new_term.avm_mem_glob_addr_shift); \ - [[maybe_unused]] auto avm_mem_mem_sel_shift = View(new_term.avm_mem_mem_sel_shift); \ - [[maybe_unused]] auto avm_mem_rw_shift = View(new_term.avm_mem_rw_shift); \ - [[maybe_unused]] auto avm_mem_tag_shift = View(new_term.avm_mem_tag_shift); \ - [[maybe_unused]] auto avm_mem_tsp_shift = View(new_term.avm_mem_tsp_shift); \ - [[maybe_unused]] auto avm_mem_val_shift = View(new_term.avm_mem_val_shift); + [[maybe_unused]] auto alu_a_hi_shift = View(new_term.alu_a_hi_shift); \ + [[maybe_unused]] auto alu_a_lo_shift = View(new_term.alu_a_lo_shift); \ + [[maybe_unused]] auto alu_alu_sel_shift = View(new_term.alu_alu_sel_shift); \ + [[maybe_unused]] auto alu_b_hi_shift = View(new_term.alu_b_hi_shift); \ + [[maybe_unused]] auto alu_b_lo_shift = View(new_term.alu_b_lo_shift); \ + [[maybe_unused]] auto alu_cmp_rng_ctr_shift = View(new_term.alu_cmp_rng_ctr_shift); \ + [[maybe_unused]] auto alu_cmp_sel_shift = View(new_term.alu_cmp_sel_shift); \ + [[maybe_unused]] auto alu_div_rng_chk_selector_shift = View(new_term.alu_div_rng_chk_selector_shift); \ + [[maybe_unused]] auto alu_div_u16_r0_shift = View(new_term.alu_div_u16_r0_shift); \ + [[maybe_unused]] auto alu_div_u16_r1_shift = View(new_term.alu_div_u16_r1_shift); \ + [[maybe_unused]] auto alu_div_u16_r2_shift = View(new_term.alu_div_u16_r2_shift); \ + [[maybe_unused]] auto alu_div_u16_r3_shift = View(new_term.alu_div_u16_r3_shift); \ + [[maybe_unused]] auto alu_div_u16_r4_shift = View(new_term.alu_div_u16_r4_shift); \ + [[maybe_unused]] auto alu_div_u16_r5_shift = View(new_term.alu_div_u16_r5_shift); \ + [[maybe_unused]] auto alu_div_u16_r6_shift = View(new_term.alu_div_u16_r6_shift); \ + [[maybe_unused]] auto alu_div_u16_r7_shift = View(new_term.alu_div_u16_r7_shift); \ + [[maybe_unused]] auto alu_op_add_shift = View(new_term.alu_op_add_shift); \ + [[maybe_unused]] auto alu_op_cast_prev_shift = View(new_term.alu_op_cast_prev_shift); \ + [[maybe_unused]] auto alu_op_cast_shift = View(new_term.alu_op_cast_shift); \ + [[maybe_unused]] auto alu_op_div_shift = View(new_term.alu_op_div_shift); \ + [[maybe_unused]] auto alu_op_mul_shift = View(new_term.alu_op_mul_shift); \ + [[maybe_unused]] auto alu_op_shl_shift = View(new_term.alu_op_shl_shift); \ + [[maybe_unused]] auto alu_op_shr_shift = View(new_term.alu_op_shr_shift); \ + [[maybe_unused]] auto alu_op_sub_shift = View(new_term.alu_op_sub_shift); \ + [[maybe_unused]] auto alu_p_sub_a_hi_shift = View(new_term.alu_p_sub_a_hi_shift); \ + [[maybe_unused]] auto alu_p_sub_a_lo_shift = View(new_term.alu_p_sub_a_lo_shift); \ + [[maybe_unused]] auto alu_p_sub_b_hi_shift = View(new_term.alu_p_sub_b_hi_shift); \ + [[maybe_unused]] auto alu_p_sub_b_lo_shift = View(new_term.alu_p_sub_b_lo_shift); \ + [[maybe_unused]] auto alu_rng_chk_lookup_selector_shift = View(new_term.alu_rng_chk_lookup_selector_shift); \ + [[maybe_unused]] auto alu_rng_chk_sel_shift = View(new_term.alu_rng_chk_sel_shift); \ + [[maybe_unused]] auto alu_u16_r0_shift = View(new_term.alu_u16_r0_shift); \ + [[maybe_unused]] auto alu_u16_r1_shift = View(new_term.alu_u16_r1_shift); \ + [[maybe_unused]] auto alu_u16_r2_shift = View(new_term.alu_u16_r2_shift); \ + [[maybe_unused]] auto alu_u16_r3_shift = View(new_term.alu_u16_r3_shift); \ + [[maybe_unused]] auto alu_u16_r4_shift = View(new_term.alu_u16_r4_shift); \ + [[maybe_unused]] auto alu_u16_r5_shift = View(new_term.alu_u16_r5_shift); \ + [[maybe_unused]] auto alu_u16_r6_shift = View(new_term.alu_u16_r6_shift); \ + [[maybe_unused]] auto alu_u8_r0_shift = View(new_term.alu_u8_r0_shift); \ + [[maybe_unused]] auto alu_u8_r1_shift = View(new_term.alu_u8_r1_shift); \ + [[maybe_unused]] auto binary_acc_ia_shift = View(new_term.binary_acc_ia_shift); \ + [[maybe_unused]] auto binary_acc_ib_shift = View(new_term.binary_acc_ib_shift); \ + [[maybe_unused]] auto binary_acc_ic_shift = View(new_term.binary_acc_ic_shift); \ + [[maybe_unused]] auto binary_mem_tag_ctr_shift = View(new_term.binary_mem_tag_ctr_shift); \ + [[maybe_unused]] auto binary_op_id_shift = View(new_term.binary_op_id_shift); \ + [[maybe_unused]] auto kernel_emit_l2_to_l1_msg_write_offset_shift = \ + View(new_term.kernel_emit_l2_to_l1_msg_write_offset_shift); \ + [[maybe_unused]] auto kernel_emit_note_hash_write_offset_shift = \ + View(new_term.kernel_emit_note_hash_write_offset_shift); \ + [[maybe_unused]] auto kernel_emit_nullifier_write_offset_shift = \ + View(new_term.kernel_emit_nullifier_write_offset_shift); \ + [[maybe_unused]] auto kernel_emit_unencrypted_log_write_offset_shift = \ + View(new_term.kernel_emit_unencrypted_log_write_offset_shift); \ + [[maybe_unused]] auto kernel_l1_to_l2_msg_exists_write_offset_shift = \ + View(new_term.kernel_l1_to_l2_msg_exists_write_offset_shift); \ + [[maybe_unused]] auto kernel_note_hash_exist_write_offset_shift = \ + View(new_term.kernel_note_hash_exist_write_offset_shift); \ + [[maybe_unused]] auto kernel_nullifier_exists_write_offset_shift = \ + View(new_term.kernel_nullifier_exists_write_offset_shift); \ + [[maybe_unused]] auto kernel_nullifier_non_exists_write_offset_shift = \ + View(new_term.kernel_nullifier_non_exists_write_offset_shift); \ + [[maybe_unused]] auto kernel_side_effect_counter_shift = View(new_term.kernel_side_effect_counter_shift); \ + [[maybe_unused]] auto kernel_sload_write_offset_shift = View(new_term.kernel_sload_write_offset_shift); \ + [[maybe_unused]] auto kernel_sstore_write_offset_shift = View(new_term.kernel_sstore_write_offset_shift); \ + [[maybe_unused]] auto main_da_gas_remaining_shift = View(new_term.main_da_gas_remaining_shift); \ + [[maybe_unused]] auto main_internal_return_ptr_shift = View(new_term.main_internal_return_ptr_shift); \ + [[maybe_unused]] auto main_l2_gas_remaining_shift = View(new_term.main_l2_gas_remaining_shift); \ + [[maybe_unused]] auto main_pc_shift = View(new_term.main_pc_shift); \ + [[maybe_unused]] auto mem_glob_addr_shift = View(new_term.mem_glob_addr_shift); \ + [[maybe_unused]] auto mem_mem_sel_shift = View(new_term.mem_mem_sel_shift); \ + [[maybe_unused]] auto mem_rw_shift = View(new_term.mem_rw_shift); \ + [[maybe_unused]] auto mem_tag_shift = View(new_term.mem_tag_shift); \ + [[maybe_unused]] auto mem_tsp_shift = View(new_term.mem_tsp_shift); \ + [[maybe_unused]] auto mem_val_shift = View(new_term.mem_val_shift); diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp index cfb4885c4b5..c9caae3a4fb 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_main_tag_err.hpp @@ -87,7 +87,7 @@ class incl_main_tag_err_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_mem_tag_err == 1 || in.avm_main_tag_err == 1); + return (in.mem_tag_err == 1 || in.main_tag_err == 1); } /** @@ -104,8 +104,8 @@ class incl_main_tag_err_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_mem_tag_err); - const auto is_table_entry = View(in.avm_main_tag_err); + const auto is_operation = View(in.mem_tag_err); + const auto is_table_entry = View(in.main_tag_err); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class incl_main_tag_err_lookup_settings { return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, - in.avm_mem_tag_err, - in.avm_main_tag_err, - in.avm_mem_clk, - in.avm_main_clk); + in.mem_tag_err, + in.main_tag_err, + in.mem_clk, + in.main_clk); } /** @@ -153,10 +153,10 @@ class incl_main_tag_err_lookup_settings { return std::forward_as_tuple(in.incl_main_tag_err, in.incl_main_tag_err_counts, - in.avm_mem_tag_err, - in.avm_main_tag_err, - in.avm_mem_clk, - in.avm_main_clk); + in.mem_tag_err, + in.main_tag_err, + in.mem_clk, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp index 4055ceb7951..abbdf261766 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/incl_mem_tag_err.hpp @@ -87,7 +87,7 @@ class incl_mem_tag_err_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_tag_err == 1 || in.avm_mem_tag_err == 1); + return (in.main_tag_err == 1 || in.mem_tag_err == 1); } /** @@ -104,8 +104,8 @@ class incl_mem_tag_err_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_tag_err); - const auto is_table_entry = View(in.avm_mem_tag_err); + const auto is_operation = View(in.main_tag_err); + const auto is_table_entry = View(in.mem_tag_err); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -133,12 +133,8 @@ class incl_mem_tag_err_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.incl_mem_tag_err, - in.incl_mem_tag_err_counts, - in.avm_main_tag_err, - in.avm_mem_tag_err, - in.avm_main_clk, - in.avm_mem_clk); + return std::forward_as_tuple( + in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.main_tag_err, in.mem_tag_err, in.main_clk, in.mem_clk); } /** @@ -151,12 +147,8 @@ class incl_mem_tag_err_lookup_settings { template static inline auto get_nonconst_entities(AllEntities& in) { - return std::forward_as_tuple(in.incl_mem_tag_err, - in.incl_mem_tag_err_counts, - in.avm_main_tag_err, - in.avm_mem_tag_err, - in.avm_main_clk, - in.avm_mem_clk); + return std::forward_as_tuple( + in.incl_mem_tag_err, in.incl_mem_tag_err_counts, in.main_tag_err, in.mem_tag_err, in.main_clk, in.mem_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_sha256.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/keccakf1600.hpp similarity index 71% rename from barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_sha256.hpp rename to barretenberg/cpp/src/barretenberg/relations/generated/avm/keccakf1600.hpp index 5b18fa3fc57..4606c2d308d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_sha256.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/keccakf1600.hpp @@ -6,19 +6,19 @@ namespace bb::Avm_vm { -template struct Avm_sha256Row { - FF avm_sha256_sha256_compression_sel{}; +template struct Keccakf1600Row { + FF keccakf1600_keccakf1600_sel{}; [[maybe_unused]] static std::vector names(); }; -inline std::string get_relation_label_avm_sha256(int index) +inline std::string get_relation_label_keccakf1600(int index) { switch (index) {} return std::to_string(index); } -template class avm_sha256Impl { +template class keccakf1600Impl { public: using FF = FF_; @@ -37,13 +37,13 @@ template class avm_sha256Impl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_sha256_sha256_compression_sel * (-avm_sha256_sha256_compression_sel + FF(1))); + auto tmp = (keccakf1600_keccakf1600_sel * (-keccakf1600_keccakf1600_sel + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } } }; -template using avm_sha256 = Relation>; +template using keccakf1600 = Relation>; } // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel.hpp new file mode 100644 index 00000000000..8042d717539 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel.hpp @@ -0,0 +1,197 @@ + +#pragma once +#include "../../relation_parameters.hpp" +#include "../../relation_types.hpp" +#include "./declare_views.hpp" + +namespace bb::Avm_vm { + +template struct KernelRow { + FF kernel_emit_l2_to_l1_msg_write_offset{}; + FF kernel_emit_l2_to_l1_msg_write_offset_shift{}; + FF kernel_emit_note_hash_write_offset{}; + FF kernel_emit_note_hash_write_offset_shift{}; + FF kernel_emit_nullifier_write_offset{}; + FF kernel_emit_nullifier_write_offset_shift{}; + FF kernel_emit_unencrypted_log_write_offset{}; + FF kernel_emit_unencrypted_log_write_offset_shift{}; + FF kernel_l1_to_l2_msg_exists_write_offset{}; + FF kernel_l1_to_l2_msg_exists_write_offset_shift{}; + FF kernel_note_hash_exist_write_offset{}; + FF kernel_note_hash_exist_write_offset_shift{}; + FF kernel_nullifier_exists_write_offset{}; + FF kernel_nullifier_exists_write_offset_shift{}; + FF kernel_nullifier_non_exists_write_offset{}; + FF kernel_nullifier_non_exists_write_offset_shift{}; + FF kernel_sload_write_offset{}; + FF kernel_sload_write_offset_shift{}; + FF kernel_sstore_write_offset{}; + FF kernel_sstore_write_offset_shift{}; + FF main_ib{}; + FF main_last{}; + FF main_sel_op_emit_l2_to_l1_msg{}; + FF main_sel_op_emit_note_hash{}; + FF main_sel_op_emit_nullifier{}; + FF main_sel_op_emit_unencrypted_log{}; + FF main_sel_op_l1_to_l2_msg_exists{}; + FF main_sel_op_note_hash_exists{}; + FF main_sel_op_nullifier_exists{}; + FF main_sel_op_sload{}; + FF main_sel_op_sstore{}; + + [[maybe_unused]] static std::vector names(); +}; + +inline std::string get_relation_label_kernel(int index) +{ + switch (index) { + case 0: + return "NOTE_HASH_EXISTS_INC_CONSISTENCY_CHECK"; + + case 1: + return "EMIT_NOTE_HASH_INC_CONSISTENCY_CHECK"; + + case 2: + return "NULLIFIER_EXISTS_INC_CONSISTENCY_CHECK"; + + case 3: + return "NULLIFIER_NON_EXISTS_INC_CONSISTENCY_CHECK"; + + case 4: + return "EMIT_NULLIFIER_INC_CONSISTENCY_CHECK"; + + case 5: + return "L1_TO_L2_MSG_EXISTS_INC_CONSISTENCY_CHECK"; + + case 6: + return "EMIT_UNENCRYPTED_LOG_INC_CONSISTENCY_CHECK"; + + case 7: + return "EMIT_L2_TO_L1_MSG_INC_CONSISTENCY_CHECK"; + + case 8: + return "SLOAD_INC_CONSISTENCY_CHECK"; + + case 9: + return "SSTORE_INC_CONSISTENCY_CHECK"; + } + return std::to_string(index); +} + +template class kernelImpl { + public: + using FF = FF_; + + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ + 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, + }; + + template + void static accumulate(ContainerOverSubrelations& evals, + const AllEntities& new_term, + [[maybe_unused]] const RelationParameters&, + [[maybe_unused]] const FF& scaling_factor) + { + + // Contribution 0 + { + Avm_DECLARE_VIEWS(0); + + auto tmp = ((-main_last + FF(1)) * (kernel_note_hash_exist_write_offset_shift - + (kernel_note_hash_exist_write_offset + main_sel_op_note_hash_exists))); + tmp *= scaling_factor; + std::get<0>(evals) += tmp; + } + // Contribution 1 + { + Avm_DECLARE_VIEWS(1); + + auto tmp = ((-main_last + FF(1)) * (kernel_emit_note_hash_write_offset_shift - + (kernel_emit_note_hash_write_offset + main_sel_op_emit_note_hash))); + tmp *= scaling_factor; + std::get<1>(evals) += tmp; + } + // Contribution 2 + { + Avm_DECLARE_VIEWS(2); + + auto tmp = ((-main_last + FF(1)) * + (kernel_nullifier_exists_write_offset_shift - + (kernel_nullifier_exists_write_offset + (main_sel_op_nullifier_exists * main_ib)))); + tmp *= scaling_factor; + std::get<2>(evals) += tmp; + } + // Contribution 3 + { + Avm_DECLARE_VIEWS(3); + + auto tmp = + ((-main_last + FF(1)) * + (kernel_nullifier_non_exists_write_offset_shift - + (kernel_nullifier_non_exists_write_offset + (main_sel_op_nullifier_exists * (-main_ib + FF(1)))))); + tmp *= scaling_factor; + std::get<3>(evals) += tmp; + } + // Contribution 4 + { + Avm_DECLARE_VIEWS(4); + + auto tmp = ((-main_last + FF(1)) * (kernel_emit_nullifier_write_offset_shift - + (kernel_emit_nullifier_write_offset + main_sel_op_emit_nullifier))); + tmp *= scaling_factor; + std::get<4>(evals) += tmp; + } + // Contribution 5 + { + Avm_DECLARE_VIEWS(5); + + auto tmp = + ((-main_last + FF(1)) * (kernel_l1_to_l2_msg_exists_write_offset_shift - + (kernel_l1_to_l2_msg_exists_write_offset + main_sel_op_l1_to_l2_msg_exists))); + tmp *= scaling_factor; + std::get<5>(evals) += tmp; + } + // Contribution 6 + { + Avm_DECLARE_VIEWS(6); + + auto tmp = ((-main_last + FF(1)) * + (kernel_emit_unencrypted_log_write_offset_shift - + (kernel_emit_unencrypted_log_write_offset + main_sel_op_emit_unencrypted_log))); + tmp *= scaling_factor; + std::get<6>(evals) += tmp; + } + // Contribution 7 + { + Avm_DECLARE_VIEWS(7); + + auto tmp = + ((-main_last + FF(1)) * (kernel_emit_l2_to_l1_msg_write_offset_shift - + (kernel_emit_l2_to_l1_msg_write_offset + main_sel_op_emit_l2_to_l1_msg))); + tmp *= scaling_factor; + std::get<7>(evals) += tmp; + } + // Contribution 8 + { + Avm_DECLARE_VIEWS(8); + + auto tmp = ((-main_last + FF(1)) * + (kernel_sload_write_offset_shift - (kernel_sload_write_offset + main_sel_op_sload))); + tmp *= scaling_factor; + std::get<8>(evals) += tmp; + } + // Contribution 9 + { + Avm_DECLARE_VIEWS(9); + + auto tmp = ((-main_last + FF(1)) * + (kernel_sstore_write_offset_shift - (kernel_sstore_write_offset + main_sel_op_sstore))); + tmp *= scaling_factor; + std::get<9>(evals) += tmp; + } + } +}; + +template using kernel = Relation>; + +} // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp index d7c6f2c1e8c..b2cd49e9424 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/kernel_output_lookup.hpp @@ -87,7 +87,7 @@ class kernel_output_lookup_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_q_kernel_output_lookup == 1 || in.avm_kernel_q_public_input_kernel_out_add_to_table == 1); + return (in.main_q_kernel_output_lookup == 1 || in.kernel_q_public_input_kernel_out_add_to_table == 1); } /** @@ -104,8 +104,8 @@ class kernel_output_lookup_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_q_kernel_output_lookup); - const auto is_table_entry = View(in.avm_kernel_q_public_input_kernel_out_add_to_table); + const auto is_operation = View(in.main_q_kernel_output_lookup); + const auto is_table_entry = View(in.kernel_q_public_input_kernel_out_add_to_table); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,16 +135,16 @@ class kernel_output_lookup_lookup_settings { return std::forward_as_tuple(in.kernel_output_lookup, in.kernel_output_lookup_counts, - in.avm_main_q_kernel_output_lookup, - in.avm_kernel_q_public_input_kernel_out_add_to_table, - in.avm_kernel_kernel_out_offset, - in.avm_main_ia, - in.avm_kernel_side_effect_counter, - in.avm_main_ib, - in.avm_main_clk, - in.avm_kernel_kernel_value_out, - in.avm_kernel_kernel_side_effect_out, - in.avm_kernel_kernel_metadata_out); + in.main_q_kernel_output_lookup, + in.kernel_q_public_input_kernel_out_add_to_table, + in.kernel_kernel_out_offset, + in.main_ia, + in.kernel_side_effect_counter, + in.main_ib, + in.main_clk, + in.kernel_kernel_value_out, + in.kernel_kernel_side_effect_out, + in.kernel_kernel_metadata_out); } /** @@ -159,16 +159,16 @@ class kernel_output_lookup_lookup_settings { return std::forward_as_tuple(in.kernel_output_lookup, in.kernel_output_lookup_counts, - in.avm_main_q_kernel_output_lookup, - in.avm_kernel_q_public_input_kernel_out_add_to_table, - in.avm_kernel_kernel_out_offset, - in.avm_main_ia, - in.avm_kernel_side_effect_counter, - in.avm_main_ib, - in.avm_main_clk, - in.avm_kernel_kernel_value_out, - in.avm_kernel_kernel_side_effect_out, - in.avm_kernel_kernel_metadata_out); + in.main_q_kernel_output_lookup, + in.kernel_q_public_input_kernel_out_add_to_table, + in.kernel_kernel_out_offset, + in.main_ia, + in.kernel_side_effect_counter, + in.main_ib, + in.main_clk, + in.kernel_kernel_value_out, + in.kernel_kernel_side_effect_out, + in.kernel_kernel_metadata_out); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp index 66268991c7c..1c93a11b75a 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_lengths.hpp @@ -87,7 +87,7 @@ class lookup_byte_lengths_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_binary_start == 1 || in.avm_byte_lookup_bin_sel == 1); + return (in.binary_start == 1 || in.byte_lookup_bin_sel == 1); } /** @@ -104,8 +104,8 @@ class lookup_byte_lengths_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_binary_start); - const auto is_table_entry = View(in.avm_byte_lookup_bin_sel); + const auto is_operation = View(in.binary_start); + const auto is_table_entry = View(in.byte_lookup_bin_sel); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,12 +135,12 @@ class lookup_byte_lengths_lookup_settings { return std::forward_as_tuple(in.lookup_byte_lengths, in.lookup_byte_lengths_counts, - in.avm_binary_start, - in.avm_byte_lookup_bin_sel, - in.avm_binary_in_tag, - in.avm_binary_mem_tag_ctr, - in.avm_byte_lookup_table_in_tags, - in.avm_byte_lookup_table_byte_lengths); + in.binary_start, + in.byte_lookup_bin_sel, + in.binary_in_tag, + in.binary_mem_tag_ctr, + in.byte_lookup_table_in_tags, + in.byte_lookup_table_byte_lengths); } /** @@ -155,12 +155,12 @@ class lookup_byte_lengths_lookup_settings { return std::forward_as_tuple(in.lookup_byte_lengths, in.lookup_byte_lengths_counts, - in.avm_binary_start, - in.avm_byte_lookup_bin_sel, - in.avm_binary_in_tag, - in.avm_binary_mem_tag_ctr, - in.avm_byte_lookup_table_in_tags, - in.avm_byte_lookup_table_byte_lengths); + in.binary_start, + in.byte_lookup_bin_sel, + in.binary_in_tag, + in.binary_mem_tag_ctr, + in.byte_lookup_table_in_tags, + in.byte_lookup_table_byte_lengths); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp index baf2995fcb8..a91aa2dcb65 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_byte_operations.hpp @@ -87,7 +87,7 @@ class lookup_byte_operations_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_binary_bin_sel == 1 || in.avm_byte_lookup_bin_sel == 1); + return (in.binary_bin_sel == 1 || in.byte_lookup_bin_sel == 1); } /** @@ -104,8 +104,8 @@ class lookup_byte_operations_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_binary_bin_sel); - const auto is_table_entry = View(in.avm_byte_lookup_bin_sel); + const auto is_operation = View(in.binary_bin_sel); + const auto is_table_entry = View(in.byte_lookup_bin_sel); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,16 +135,16 @@ class lookup_byte_operations_lookup_settings { return std::forward_as_tuple(in.lookup_byte_operations, in.lookup_byte_operations_counts, - in.avm_binary_bin_sel, - in.avm_byte_lookup_bin_sel, - in.avm_binary_op_id, - in.avm_binary_ia_bytes, - in.avm_binary_ib_bytes, - in.avm_binary_ic_bytes, - in.avm_byte_lookup_table_op_id, - in.avm_byte_lookup_table_input_a, - in.avm_byte_lookup_table_input_b, - in.avm_byte_lookup_table_output); + in.binary_bin_sel, + in.byte_lookup_bin_sel, + in.binary_op_id, + in.binary_ia_bytes, + in.binary_ib_bytes, + in.binary_ic_bytes, + in.byte_lookup_table_op_id, + in.byte_lookup_table_input_a, + in.byte_lookup_table_input_b, + in.byte_lookup_table_output); } /** @@ -159,16 +159,16 @@ class lookup_byte_operations_lookup_settings { return std::forward_as_tuple(in.lookup_byte_operations, in.lookup_byte_operations_counts, - in.avm_binary_bin_sel, - in.avm_byte_lookup_bin_sel, - in.avm_binary_op_id, - in.avm_binary_ia_bytes, - in.avm_binary_ib_bytes, - in.avm_binary_ic_bytes, - in.avm_byte_lookup_table_op_id, - in.avm_byte_lookup_table_input_a, - in.avm_byte_lookup_table_input_b, - in.avm_byte_lookup_table_output); + in.binary_bin_sel, + in.byte_lookup_bin_sel, + in.binary_op_id, + in.binary_ia_bytes, + in.binary_ib_bytes, + in.binary_ic_bytes, + in.byte_lookup_table_op_id, + in.byte_lookup_table_input_a, + in.byte_lookup_table_input_b, + in.byte_lookup_table_output); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp index 67284e42972..efe5f4c138e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_0.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_0_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_0_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_0_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_0, in.lookup_div_u16_0_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r0, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r0, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_0_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_0, in.lookup_div_u16_0_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r0, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r0, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp index 38c6fd614f8..5f460892442 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_1.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_1_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_1_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_1_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_1, in.lookup_div_u16_1_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r1, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r1, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_1_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_1, in.lookup_div_u16_1_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r1, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r1, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp index 36c347a5ba9..85af9347a6d 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_2.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_2_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_2_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_2_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_2, in.lookup_div_u16_2_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r2, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r2, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_2_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_2, in.lookup_div_u16_2_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r2, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r2, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp index e167bae69bb..dd9c4f6b95c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_3.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_3_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_3_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_3_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_3, in.lookup_div_u16_3_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r3, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r3, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_3_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_3, in.lookup_div_u16_3_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r3, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r3, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp index 6248bc098d6..5b50c3a08db 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_4.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_4_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_4_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_4_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_4, in.lookup_div_u16_4_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r4, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r4, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_4_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_4, in.lookup_div_u16_4_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r4, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r4, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp index 052eafcaa3b..7b1a4bf30ec 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_5.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_5_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_5_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_5_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_5, in.lookup_div_u16_5_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r5, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r5, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_5_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_5, in.lookup_div_u16_5_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r5, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r5, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp index c52d71bdb99..fa2c31c2dee 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_6.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_6_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_6_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_6_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_6, in.lookup_div_u16_6_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r6, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r6, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_6_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_6, in.lookup_div_u16_6_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r6, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r6, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp index dde1e6f54b4..37b5c6ca133 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_div_u16_7.hpp @@ -87,7 +87,7 @@ class lookup_div_u16_7_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_div_rng_chk_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_div_rng_chk_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_div_u16_7_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_div_rng_chk_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_div_rng_chk_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_div_u16_7_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_7, in.lookup_div_u16_7_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r7, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r7, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_div_u16_7_lookup_settings { return std::forward_as_tuple(in.lookup_div_u16_7, in.lookup_div_u16_7_counts, - in.avm_alu_div_rng_chk_selector, - in.avm_main_sel_rng_16, - in.avm_alu_div_u16_r7, - in.avm_main_clk); + in.alu_div_rng_chk_selector, + in.main_sel_rng_16, + in.alu_div_u16_r7, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp index 28bb6402999..bf3f81dbe7b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_into_kernel.hpp @@ -87,7 +87,7 @@ class lookup_into_kernel_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_q_kernel_lookup == 1 || in.avm_kernel_q_public_input_kernel_add_to_table == 1); + return (in.main_q_kernel_lookup == 1 || in.kernel_q_public_input_kernel_add_to_table == 1); } /** @@ -104,8 +104,8 @@ class lookup_into_kernel_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_q_kernel_lookup); - const auto is_table_entry = View(in.avm_kernel_q_public_input_kernel_add_to_table); + const auto is_operation = View(in.main_q_kernel_lookup); + const auto is_table_entry = View(in.kernel_q_public_input_kernel_add_to_table); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,12 +135,12 @@ class lookup_into_kernel_lookup_settings { return std::forward_as_tuple(in.lookup_into_kernel, in.lookup_into_kernel_counts, - in.avm_main_q_kernel_lookup, - in.avm_kernel_q_public_input_kernel_add_to_table, - in.avm_main_ia, - in.avm_kernel_kernel_in_offset, - in.avm_kernel_kernel_inputs, - in.avm_main_clk); + in.main_q_kernel_lookup, + in.kernel_q_public_input_kernel_add_to_table, + in.main_ia, + in.kernel_kernel_in_offset, + in.kernel_kernel_inputs, + in.main_clk); } /** @@ -155,12 +155,12 @@ class lookup_into_kernel_lookup_settings { return std::forward_as_tuple(in.lookup_into_kernel, in.lookup_into_kernel_counts, - in.avm_main_q_kernel_lookup, - in.avm_kernel_q_public_input_kernel_add_to_table, - in.avm_main_ia, - in.avm_kernel_kernel_in_offset, - in.avm_kernel_kernel_inputs, - in.avm_main_clk); + in.main_q_kernel_lookup, + in.kernel_q_public_input_kernel_add_to_table, + in.main_ia, + in.kernel_kernel_in_offset, + in.kernel_kernel_inputs, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp index d982ee18fc0..2ddc7981d4b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_hi.hpp @@ -87,7 +87,7 @@ class lookup_mem_rng_chk_hi_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_mem_rng_chk_sel == 1 || in.avm_main_sel_rng_8 == 1); + return (in.mem_rng_chk_sel == 1 || in.main_sel_rng_8 == 1); } /** @@ -104,8 +104,8 @@ class lookup_mem_rng_chk_hi_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_mem_rng_chk_sel); - const auto is_table_entry = View(in.avm_main_sel_rng_8); + const auto is_operation = View(in.mem_rng_chk_sel); + const auto is_table_entry = View(in.main_sel_rng_8); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_mem_rng_chk_hi_lookup_settings { return std::forward_as_tuple(in.lookup_mem_rng_chk_hi, in.lookup_mem_rng_chk_hi_counts, - in.avm_mem_rng_chk_sel, - in.avm_main_sel_rng_8, - in.avm_mem_diff_hi, - in.avm_main_clk); + in.mem_rng_chk_sel, + in.main_sel_rng_8, + in.mem_diff_hi, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_mem_rng_chk_hi_lookup_settings { return std::forward_as_tuple(in.lookup_mem_rng_chk_hi, in.lookup_mem_rng_chk_hi_counts, - in.avm_mem_rng_chk_sel, - in.avm_main_sel_rng_8, - in.avm_mem_diff_hi, - in.avm_main_clk); + in.mem_rng_chk_sel, + in.main_sel_rng_8, + in.mem_diff_hi, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp index d59ef829c2d..dcfbcad3fea 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_lo.hpp @@ -87,7 +87,7 @@ class lookup_mem_rng_chk_lo_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_mem_rng_chk_sel == 1 || in.avm_main_sel_rng_16 == 1); + return (in.mem_rng_chk_sel == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_mem_rng_chk_lo_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_mem_rng_chk_sel); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.mem_rng_chk_sel); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_mem_rng_chk_lo_lookup_settings { return std::forward_as_tuple(in.lookup_mem_rng_chk_lo, in.lookup_mem_rng_chk_lo_counts, - in.avm_mem_rng_chk_sel, - in.avm_main_sel_rng_16, - in.avm_mem_diff_lo, - in.avm_main_clk); + in.mem_rng_chk_sel, + in.main_sel_rng_16, + in.mem_diff_lo, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_mem_rng_chk_lo_lookup_settings { return std::forward_as_tuple(in.lookup_mem_rng_chk_lo, in.lookup_mem_rng_chk_lo_counts, - in.avm_mem_rng_chk_sel, - in.avm_main_sel_rng_16, - in.avm_mem_diff_lo, - in.avm_main_clk); + in.mem_rng_chk_sel, + in.main_sel_rng_16, + in.mem_diff_lo, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp index bece75f6f1a..b739f3e0736 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_mem_rng_chk_mid.hpp @@ -87,7 +87,7 @@ class lookup_mem_rng_chk_mid_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_mem_rng_chk_sel == 1 || in.avm_main_sel_rng_16 == 1); + return (in.mem_rng_chk_sel == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_mem_rng_chk_mid_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_mem_rng_chk_sel); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.mem_rng_chk_sel); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_mem_rng_chk_mid_lookup_settings { return std::forward_as_tuple(in.lookup_mem_rng_chk_mid, in.lookup_mem_rng_chk_mid_counts, - in.avm_mem_rng_chk_sel, - in.avm_main_sel_rng_16, - in.avm_mem_diff_mid, - in.avm_main_clk); + in.mem_rng_chk_sel, + in.main_sel_rng_16, + in.mem_diff_mid, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_mem_rng_chk_mid_lookup_settings { return std::forward_as_tuple(in.lookup_mem_rng_chk_mid, in.lookup_mem_rng_chk_mid_counts, - in.avm_mem_rng_chk_sel, - in.avm_main_sel_rng_16, - in.avm_mem_diff_mid, - in.avm_main_clk); + in.mem_rng_chk_sel, + in.main_sel_rng_16, + in.mem_diff_mid, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp index fec6ee9753d..b6514706cf7 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_opcode_gas.hpp @@ -87,7 +87,7 @@ class lookup_opcode_gas_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_gas_cost_active == 1 || in.avm_gas_gas_cost_sel == 1); + return (in.main_gas_cost_active == 1 || in.gas_gas_cost_sel == 1); } /** @@ -104,8 +104,8 @@ class lookup_opcode_gas_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_gas_cost_active); - const auto is_table_entry = View(in.avm_gas_gas_cost_sel); + const auto is_operation = View(in.main_gas_cost_active); + const auto is_table_entry = View(in.gas_gas_cost_sel); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,14 +135,14 @@ class lookup_opcode_gas_lookup_settings { return std::forward_as_tuple(in.lookup_opcode_gas, in.lookup_opcode_gas_counts, - in.avm_main_gas_cost_active, - in.avm_gas_gas_cost_sel, - in.avm_main_opcode_val, - in.avm_main_l2_gas_op, - in.avm_main_da_gas_op, - in.avm_main_clk, - in.avm_gas_l2_gas_fixed_table, - in.avm_gas_da_gas_fixed_table); + in.main_gas_cost_active, + in.gas_gas_cost_sel, + in.main_opcode_val, + in.main_l2_gas_op, + in.main_da_gas_op, + in.main_clk, + in.gas_l2_gas_fixed_table, + in.gas_da_gas_fixed_table); } /** @@ -157,14 +157,14 @@ class lookup_opcode_gas_lookup_settings { return std::forward_as_tuple(in.lookup_opcode_gas, in.lookup_opcode_gas_counts, - in.avm_main_gas_cost_active, - in.avm_gas_gas_cost_sel, - in.avm_main_opcode_val, - in.avm_main_l2_gas_op, - in.avm_main_da_gas_op, - in.avm_main_clk, - in.avm_gas_l2_gas_fixed_table, - in.avm_gas_da_gas_fixed_table); + in.main_gas_cost_active, + in.gas_gas_cost_sel, + in.main_opcode_val, + in.main_l2_gas_op, + in.main_da_gas_op, + in.main_clk, + in.gas_l2_gas_fixed_table, + in.gas_da_gas_fixed_table); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp index a4629615a75..4fd7de1b9e9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_0.hpp @@ -87,7 +87,7 @@ class lookup_pow_2_0_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_shift_sel == 1 || in.avm_main_sel_rng_8 == 1); + return (in.alu_shift_sel == 1 || in.main_sel_rng_8 == 1); } /** @@ -104,8 +104,8 @@ class lookup_pow_2_0_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_shift_sel); - const auto is_table_entry = View(in.avm_main_sel_rng_8); + const auto is_operation = View(in.alu_shift_sel); + const auto is_table_entry = View(in.main_sel_rng_8); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,12 +135,12 @@ class lookup_pow_2_0_lookup_settings { return std::forward_as_tuple(in.lookup_pow_2_0, in.lookup_pow_2_0_counts, - in.avm_alu_shift_sel, - in.avm_main_sel_rng_8, - in.avm_alu_ib, - in.avm_alu_two_pow_s, - in.avm_main_clk, - in.avm_main_table_pow_2); + in.alu_shift_sel, + in.main_sel_rng_8, + in.alu_ib, + in.alu_two_pow_s, + in.main_clk, + in.main_table_pow_2); } /** @@ -155,12 +155,12 @@ class lookup_pow_2_0_lookup_settings { return std::forward_as_tuple(in.lookup_pow_2_0, in.lookup_pow_2_0_counts, - in.avm_alu_shift_sel, - in.avm_main_sel_rng_8, - in.avm_alu_ib, - in.avm_alu_two_pow_s, - in.avm_main_clk, - in.avm_main_table_pow_2); + in.alu_shift_sel, + in.main_sel_rng_8, + in.alu_ib, + in.alu_two_pow_s, + in.main_clk, + in.main_table_pow_2); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp index e1e7284056e..5b92f3143ca 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_pow_2_1.hpp @@ -87,7 +87,7 @@ class lookup_pow_2_1_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_shift_sel == 1 || in.avm_main_sel_rng_8 == 1); + return (in.alu_shift_sel == 1 || in.main_sel_rng_8 == 1); } /** @@ -104,8 +104,8 @@ class lookup_pow_2_1_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_shift_sel); - const auto is_table_entry = View(in.avm_main_sel_rng_8); + const auto is_operation = View(in.alu_shift_sel); + const auto is_table_entry = View(in.main_sel_rng_8); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,12 +135,12 @@ class lookup_pow_2_1_lookup_settings { return std::forward_as_tuple(in.lookup_pow_2_1, in.lookup_pow_2_1_counts, - in.avm_alu_shift_sel, - in.avm_main_sel_rng_8, - in.avm_alu_t_sub_s_bits, - in.avm_alu_two_pow_t_sub_s, - in.avm_main_clk, - in.avm_main_table_pow_2); + in.alu_shift_sel, + in.main_sel_rng_8, + in.alu_t_sub_s_bits, + in.alu_two_pow_t_sub_s, + in.main_clk, + in.main_table_pow_2); } /** @@ -155,12 +155,12 @@ class lookup_pow_2_1_lookup_settings { return std::forward_as_tuple(in.lookup_pow_2_1, in.lookup_pow_2_1_counts, - in.avm_alu_shift_sel, - in.avm_main_sel_rng_8, - in.avm_alu_t_sub_s_bits, - in.avm_alu_two_pow_t_sub_s, - in.avm_main_clk, - in.avm_main_table_pow_2); + in.alu_shift_sel, + in.main_sel_rng_8, + in.alu_t_sub_s_bits, + in.alu_two_pow_t_sub_s, + in.main_clk, + in.main_table_pow_2); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp index 67c79053609..26580888db1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_0.hpp @@ -87,7 +87,7 @@ class lookup_u16_0_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_0_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_0_lookup_settings { return std::forward_as_tuple(in.lookup_u16_0, in.lookup_u16_0_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r0, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r0, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_0_lookup_settings { return std::forward_as_tuple(in.lookup_u16_0, in.lookup_u16_0_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r0, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r0, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp index c5c39dd2f80..3094cc38164 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_1.hpp @@ -87,7 +87,7 @@ class lookup_u16_1_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_1_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_1_lookup_settings { return std::forward_as_tuple(in.lookup_u16_1, in.lookup_u16_1_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r1, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r1, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_1_lookup_settings { return std::forward_as_tuple(in.lookup_u16_1, in.lookup_u16_1_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r1, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r1, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp index 275dcb0f824..17c36672aa0 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_10.hpp @@ -87,7 +87,7 @@ class lookup_u16_10_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_10_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_10_lookup_settings { return std::forward_as_tuple(in.lookup_u16_10, in.lookup_u16_10_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r10, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r10, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_10_lookup_settings { return std::forward_as_tuple(in.lookup_u16_10, in.lookup_u16_10_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r10, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r10, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp index b94a5f65d84..60019c4ee62 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_11.hpp @@ -87,7 +87,7 @@ class lookup_u16_11_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_11_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_11_lookup_settings { return std::forward_as_tuple(in.lookup_u16_11, in.lookup_u16_11_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r11, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r11, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_11_lookup_settings { return std::forward_as_tuple(in.lookup_u16_11, in.lookup_u16_11_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r11, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r11, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp index 4fc5cca4ebe..f50760643e1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_12.hpp @@ -87,7 +87,7 @@ class lookup_u16_12_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_12_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_12_lookup_settings { return std::forward_as_tuple(in.lookup_u16_12, in.lookup_u16_12_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r12, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r12, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_12_lookup_settings { return std::forward_as_tuple(in.lookup_u16_12, in.lookup_u16_12_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r12, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r12, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp index 908d478b8ad..d942cd0dd5e 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_13.hpp @@ -87,7 +87,7 @@ class lookup_u16_13_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_13_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_13_lookup_settings { return std::forward_as_tuple(in.lookup_u16_13, in.lookup_u16_13_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r13, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r13, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_13_lookup_settings { return std::forward_as_tuple(in.lookup_u16_13, in.lookup_u16_13_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r13, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r13, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp index 735361f8e6c..bd4e9434213 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_14.hpp @@ -87,7 +87,7 @@ class lookup_u16_14_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_14_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_14_lookup_settings { return std::forward_as_tuple(in.lookup_u16_14, in.lookup_u16_14_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r14, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r14, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_14_lookup_settings { return std::forward_as_tuple(in.lookup_u16_14, in.lookup_u16_14_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r14, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r14, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp index 8aa66dc7a70..e794ef64b8b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_2.hpp @@ -87,7 +87,7 @@ class lookup_u16_2_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_2_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_2_lookup_settings { return std::forward_as_tuple(in.lookup_u16_2, in.lookup_u16_2_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r2, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r2, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_2_lookup_settings { return std::forward_as_tuple(in.lookup_u16_2, in.lookup_u16_2_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r2, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r2, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp index b1bda551024..aa25461f347 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_3.hpp @@ -87,7 +87,7 @@ class lookup_u16_3_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_3_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_3_lookup_settings { return std::forward_as_tuple(in.lookup_u16_3, in.lookup_u16_3_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r3, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r3, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_3_lookup_settings { return std::forward_as_tuple(in.lookup_u16_3, in.lookup_u16_3_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r3, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r3, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp index 5984e1a6e59..0f010b1eea5 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_4.hpp @@ -87,7 +87,7 @@ class lookup_u16_4_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_4_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_4_lookup_settings { return std::forward_as_tuple(in.lookup_u16_4, in.lookup_u16_4_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r4, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r4, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_4_lookup_settings { return std::forward_as_tuple(in.lookup_u16_4, in.lookup_u16_4_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r4, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r4, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp index d1bc6db3a29..a2028aa5a50 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_5.hpp @@ -87,7 +87,7 @@ class lookup_u16_5_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_5_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_5_lookup_settings { return std::forward_as_tuple(in.lookup_u16_5, in.lookup_u16_5_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r5, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r5, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_5_lookup_settings { return std::forward_as_tuple(in.lookup_u16_5, in.lookup_u16_5_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r5, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r5, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp index 3838f21e967..9c5a186ced0 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_6.hpp @@ -87,7 +87,7 @@ class lookup_u16_6_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_6_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_6_lookup_settings { return std::forward_as_tuple(in.lookup_u16_6, in.lookup_u16_6_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r6, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r6, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_6_lookup_settings { return std::forward_as_tuple(in.lookup_u16_6, in.lookup_u16_6_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r6, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r6, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp index 84b098172e9..3aa955f0de1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_7.hpp @@ -87,7 +87,7 @@ class lookup_u16_7_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_7_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_7_lookup_settings { return std::forward_as_tuple(in.lookup_u16_7, in.lookup_u16_7_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r7, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r7, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_7_lookup_settings { return std::forward_as_tuple(in.lookup_u16_7, in.lookup_u16_7_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r7, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r7, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp index f75f9fa9c28..09b10c634ef 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_8.hpp @@ -87,7 +87,7 @@ class lookup_u16_8_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_8_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_8_lookup_settings { return std::forward_as_tuple(in.lookup_u16_8, in.lookup_u16_8_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r8, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r8, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_8_lookup_settings { return std::forward_as_tuple(in.lookup_u16_8, in.lookup_u16_8_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r8, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r8, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp index 5e72a369ac4..30cebbf66dc 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u16_9.hpp @@ -87,7 +87,7 @@ class lookup_u16_9_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_16 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u16_9_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u16_9_lookup_settings { return std::forward_as_tuple(in.lookup_u16_9, in.lookup_u16_9_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r9, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r9, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u16_9_lookup_settings { return std::forward_as_tuple(in.lookup_u16_9, in.lookup_u16_9_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_16, - in.avm_alu_u16_r9, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_16, + in.alu_u16_r9, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp index 37b5936f008..d4fcf43ca73 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_0.hpp @@ -87,7 +87,7 @@ class lookup_u8_0_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_8 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_8 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u8_0_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_8); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_8); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u8_0_lookup_settings { return std::forward_as_tuple(in.lookup_u8_0, in.lookup_u8_0_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_8, - in.avm_alu_u8_r0, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_8, + in.alu_u8_r0, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u8_0_lookup_settings { return std::forward_as_tuple(in.lookup_u8_0, in.lookup_u8_0_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_8, - in.avm_alu_u8_r0, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_8, + in.alu_u8_r0, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp index 7941ecb1aee..5b30cce8eb5 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/lookup_u8_1.hpp @@ -87,7 +87,7 @@ class lookup_u8_1_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_alu_rng_chk_lookup_selector == 1 || in.avm_main_sel_rng_8 == 1); + return (in.alu_rng_chk_lookup_selector == 1 || in.main_sel_rng_8 == 1); } /** @@ -104,8 +104,8 @@ class lookup_u8_1_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_alu_rng_chk_lookup_selector); - const auto is_table_entry = View(in.avm_main_sel_rng_8); + const auto is_operation = View(in.alu_rng_chk_lookup_selector); + const auto is_table_entry = View(in.main_sel_rng_8); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class lookup_u8_1_lookup_settings { return std::forward_as_tuple(in.lookup_u8_1, in.lookup_u8_1_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_8, - in.avm_alu_u8_r1, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_8, + in.alu_u8_r1, + in.main_clk); } /** @@ -153,10 +153,10 @@ class lookup_u8_1_lookup_settings { return std::forward_as_tuple(in.lookup_u8_1, in.lookup_u8_1_counts, - in.avm_alu_rng_chk_lookup_selector, - in.avm_main_sel_rng_8, - in.avm_alu_u8_r1, - in.avm_main_clk); + in.alu_rng_chk_lookup_selector, + in.main_sel_rng_8, + in.alu_u8_r1, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp similarity index 50% rename from barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_main.hpp rename to barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index d6e22317c97..1adc1a1bd2b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -6,130 +6,130 @@ namespace bb::Avm_vm { -template struct Avm_mainRow { - FF avm_kernel_emit_l2_to_l1_msg_write_offset{}; - FF avm_kernel_emit_note_hash_write_offset{}; - FF avm_kernel_emit_nullifier_write_offset{}; - FF avm_kernel_emit_unencrypted_log_write_offset{}; - FF avm_kernel_kernel_in_offset{}; - FF avm_kernel_kernel_out_offset{}; - FF avm_kernel_l1_to_l2_msg_exists_write_offset{}; - FF avm_kernel_note_hash_exist_write_offset{}; - FF avm_kernel_nullifier_exists_write_offset{}; - FF avm_kernel_nullifier_non_exists_write_offset{}; - FF avm_kernel_side_effect_counter{}; - FF avm_kernel_side_effect_counter_shift{}; - FF avm_kernel_sload_write_offset{}; - FF avm_kernel_sstore_write_offset{}; - FF avm_main_abs_da_rem_gas_hi{}; - FF avm_main_abs_da_rem_gas_lo{}; - FF avm_main_abs_l2_rem_gas_hi{}; - FF avm_main_abs_l2_rem_gas_lo{}; - FF avm_main_alu_in_tag{}; - FF avm_main_alu_sel{}; - FF avm_main_bin_op_id{}; - FF avm_main_bin_sel{}; - FF avm_main_call_ptr{}; - FF avm_main_da_gas_op{}; - FF avm_main_da_gas_remaining{}; - FF avm_main_da_gas_remaining_shift{}; - FF avm_main_da_out_of_gas{}; - FF avm_main_first{}; - FF avm_main_gas_cost_active{}; - FF avm_main_ia{}; - FF avm_main_ib{}; - FF avm_main_ic{}; - FF avm_main_id{}; - FF avm_main_id_zero{}; - FF avm_main_ind_op_a{}; - FF avm_main_ind_op_b{}; - FF avm_main_ind_op_c{}; - FF avm_main_ind_op_d{}; - FF avm_main_internal_return_ptr{}; - FF avm_main_internal_return_ptr_shift{}; - FF avm_main_inv{}; - FF avm_main_l2_gas_op{}; - FF avm_main_l2_gas_remaining{}; - FF avm_main_l2_gas_remaining_shift{}; - FF avm_main_l2_out_of_gas{}; - FF avm_main_mem_idx_a{}; - FF avm_main_mem_idx_b{}; - FF avm_main_mem_op_a{}; - FF avm_main_mem_op_activate_gas{}; - FF avm_main_mem_op_b{}; - FF avm_main_mem_op_c{}; - FF avm_main_mem_op_d{}; - FF avm_main_op_err{}; - FF avm_main_pc{}; - FF avm_main_pc_shift{}; - FF avm_main_q_kernel_lookup{}; - FF avm_main_q_kernel_output_lookup{}; - FF avm_main_r_in_tag{}; - FF avm_main_rwa{}; - FF avm_main_rwb{}; - FF avm_main_rwc{}; - FF avm_main_rwd{}; - FF avm_main_sel_cmov{}; - FF avm_main_sel_external_call{}; - FF avm_main_sel_halt{}; - FF avm_main_sel_internal_call{}; - FF avm_main_sel_internal_return{}; - FF avm_main_sel_jump{}; - FF avm_main_sel_jumpi{}; - FF avm_main_sel_mov{}; - FF avm_main_sel_mov_a{}; - FF avm_main_sel_mov_b{}; - FF avm_main_sel_op_add{}; - FF avm_main_sel_op_address{}; - FF avm_main_sel_op_and{}; - FF avm_main_sel_op_block_number{}; - FF avm_main_sel_op_cast{}; - FF avm_main_sel_op_chain_id{}; - FF avm_main_sel_op_coinbase{}; - FF avm_main_sel_op_dagasleft{}; - FF avm_main_sel_op_div{}; - FF avm_main_sel_op_emit_l2_to_l1_msg{}; - FF avm_main_sel_op_emit_note_hash{}; - FF avm_main_sel_op_emit_nullifier{}; - FF avm_main_sel_op_emit_unencrypted_log{}; - FF avm_main_sel_op_eq{}; - FF avm_main_sel_op_fdiv{}; - FF avm_main_sel_op_fee_per_da_gas{}; - FF avm_main_sel_op_fee_per_l2_gas{}; - FF avm_main_sel_op_get_contract_instance{}; - FF avm_main_sel_op_keccak{}; - FF avm_main_sel_op_l1_to_l2_msg_exists{}; - FF avm_main_sel_op_l2gasleft{}; - FF avm_main_sel_op_lt{}; - FF avm_main_sel_op_lte{}; - FF avm_main_sel_op_mul{}; - FF avm_main_sel_op_not{}; - FF avm_main_sel_op_note_hash_exists{}; - FF avm_main_sel_op_nullifier_exists{}; - FF avm_main_sel_op_or{}; - FF avm_main_sel_op_pedersen{}; - FF avm_main_sel_op_poseidon2{}; - FF avm_main_sel_op_radix_le{}; - FF avm_main_sel_op_sender{}; - FF avm_main_sel_op_sha256{}; - FF avm_main_sel_op_shl{}; - FF avm_main_sel_op_shr{}; - FF avm_main_sel_op_sload{}; - FF avm_main_sel_op_sstore{}; - FF avm_main_sel_op_storage_address{}; - FF avm_main_sel_op_sub{}; - FF avm_main_sel_op_timestamp{}; - FF avm_main_sel_op_transaction_fee{}; - FF avm_main_sel_op_version{}; - FF avm_main_sel_op_xor{}; - FF avm_main_space_id{}; - FF avm_main_tag_err{}; - FF avm_main_w_in_tag{}; +template struct MainRow { + FF kernel_emit_l2_to_l1_msg_write_offset{}; + FF kernel_emit_note_hash_write_offset{}; + FF kernel_emit_nullifier_write_offset{}; + FF kernel_emit_unencrypted_log_write_offset{}; + FF kernel_kernel_in_offset{}; + FF kernel_kernel_out_offset{}; + FF kernel_l1_to_l2_msg_exists_write_offset{}; + FF kernel_note_hash_exist_write_offset{}; + FF kernel_nullifier_exists_write_offset{}; + FF kernel_nullifier_non_exists_write_offset{}; + FF kernel_side_effect_counter{}; + FF kernel_side_effect_counter_shift{}; + FF kernel_sload_write_offset{}; + FF kernel_sstore_write_offset{}; + FF main_abs_da_rem_gas_hi{}; + FF main_abs_da_rem_gas_lo{}; + FF main_abs_l2_rem_gas_hi{}; + FF main_abs_l2_rem_gas_lo{}; + FF main_alu_in_tag{}; + FF main_alu_sel{}; + FF main_bin_op_id{}; + FF main_bin_sel{}; + FF main_call_ptr{}; + FF main_da_gas_op{}; + FF main_da_gas_remaining{}; + FF main_da_gas_remaining_shift{}; + FF main_da_out_of_gas{}; + FF main_first{}; + FF main_gas_cost_active{}; + FF main_ia{}; + FF main_ib{}; + FF main_ic{}; + FF main_id{}; + FF main_id_zero{}; + FF main_ind_op_a{}; + FF main_ind_op_b{}; + FF main_ind_op_c{}; + FF main_ind_op_d{}; + FF main_internal_return_ptr{}; + FF main_internal_return_ptr_shift{}; + FF main_inv{}; + FF main_l2_gas_op{}; + FF main_l2_gas_remaining{}; + FF main_l2_gas_remaining_shift{}; + FF main_l2_out_of_gas{}; + FF main_mem_idx_a{}; + FF main_mem_idx_b{}; + FF main_mem_op_a{}; + FF main_mem_op_activate_gas{}; + FF main_mem_op_b{}; + FF main_mem_op_c{}; + FF main_mem_op_d{}; + FF main_op_err{}; + FF main_pc{}; + FF main_pc_shift{}; + FF main_q_kernel_lookup{}; + FF main_q_kernel_output_lookup{}; + FF main_r_in_tag{}; + FF main_rwa{}; + FF main_rwb{}; + FF main_rwc{}; + FF main_rwd{}; + FF main_sel_cmov{}; + FF main_sel_external_call{}; + FF main_sel_halt{}; + FF main_sel_internal_call{}; + FF main_sel_internal_return{}; + FF main_sel_jump{}; + FF main_sel_jumpi{}; + FF main_sel_mov{}; + FF main_sel_mov_a{}; + FF main_sel_mov_b{}; + FF main_sel_op_add{}; + FF main_sel_op_address{}; + FF main_sel_op_and{}; + FF main_sel_op_block_number{}; + FF main_sel_op_cast{}; + FF main_sel_op_chain_id{}; + FF main_sel_op_coinbase{}; + FF main_sel_op_dagasleft{}; + FF main_sel_op_div{}; + FF main_sel_op_emit_l2_to_l1_msg{}; + FF main_sel_op_emit_note_hash{}; + FF main_sel_op_emit_nullifier{}; + FF main_sel_op_emit_unencrypted_log{}; + FF main_sel_op_eq{}; + FF main_sel_op_fdiv{}; + FF main_sel_op_fee_per_da_gas{}; + FF main_sel_op_fee_per_l2_gas{}; + FF main_sel_op_get_contract_instance{}; + FF main_sel_op_keccak{}; + FF main_sel_op_l1_to_l2_msg_exists{}; + FF main_sel_op_l2gasleft{}; + FF main_sel_op_lt{}; + FF main_sel_op_lte{}; + FF main_sel_op_mul{}; + FF main_sel_op_not{}; + FF main_sel_op_note_hash_exists{}; + FF main_sel_op_nullifier_exists{}; + FF main_sel_op_or{}; + FF main_sel_op_pedersen{}; + FF main_sel_op_poseidon2{}; + FF main_sel_op_radix_le{}; + FF main_sel_op_sender{}; + FF main_sel_op_sha256{}; + FF main_sel_op_shl{}; + FF main_sel_op_shr{}; + FF main_sel_op_sload{}; + FF main_sel_op_sstore{}; + FF main_sel_op_storage_address{}; + FF main_sel_op_sub{}; + FF main_sel_op_timestamp{}; + FF main_sel_op_transaction_fee{}; + FF main_sel_op_version{}; + FF main_sel_op_xor{}; + FF main_space_id{}; + FF main_tag_err{}; + FF main_w_in_tag{}; [[maybe_unused]] static std::vector names(); }; -inline std::string get_relation_label_avm_main(int index) +inline std::string get_relation_label_main(int index) { switch (index) { case 2: @@ -285,7 +285,7 @@ inline std::string get_relation_label_avm_main(int index) return std::to_string(index); } -template class avm_mainImpl { +template class mainImpl { public: using FF = FF_; @@ -307,7 +307,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_main_l2_out_of_gas * (-avm_main_l2_out_of_gas + FF(1))); + auto tmp = (main_l2_out_of_gas * (-main_l2_out_of_gas + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } @@ -315,7 +315,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(1); - auto tmp = (avm_main_da_out_of_gas * (-avm_main_da_out_of_gas + FF(1))); + auto tmp = (main_da_out_of_gas * (-main_da_out_of_gas + FF(1))); tmp *= scaling_factor; std::get<1>(evals) += tmp; } @@ -323,8 +323,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(2); - auto tmp = (avm_main_gas_cost_active * - ((avm_main_l2_gas_remaining_shift - avm_main_l2_gas_remaining) + avm_main_l2_gas_op)); + auto tmp = + (main_gas_cost_active * ((main_l2_gas_remaining_shift - main_l2_gas_remaining) + main_l2_gas_op)); tmp *= scaling_factor; std::get<2>(evals) += tmp; } @@ -332,8 +332,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(3); - auto tmp = (avm_main_gas_cost_active * - ((avm_main_da_gas_remaining_shift - avm_main_da_gas_remaining) + avm_main_da_gas_op)); + auto tmp = + (main_gas_cost_active * ((main_da_gas_remaining_shift - main_da_gas_remaining) + main_da_gas_op)); tmp *= scaling_factor; std::get<3>(evals) += tmp; } @@ -341,7 +341,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(4); - auto tmp = ((-avm_main_gas_cost_active + FF(1)) * avm_main_l2_gas_op); + auto tmp = ((-main_gas_cost_active + FF(1)) * main_l2_gas_op); tmp *= scaling_factor; std::get<4>(evals) += tmp; } @@ -349,7 +349,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(5); - auto tmp = ((-avm_main_gas_cost_active + FF(1)) * avm_main_da_gas_op); + auto tmp = ((-main_gas_cost_active + FF(1)) * main_da_gas_op); tmp *= scaling_factor; std::get<5>(evals) += tmp; } @@ -357,10 +357,10 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(6); - auto tmp = (avm_main_gas_cost_active * - ((((-(avm_main_l2_out_of_gas * FF(2)) + FF(1)) * avm_main_l2_gas_remaining_shift) - - (avm_main_abs_l2_rem_gas_hi * FF(65536))) - - avm_main_abs_l2_rem_gas_lo)); + auto tmp = + (main_gas_cost_active * ((((-(main_l2_out_of_gas * FF(2)) + FF(1)) * main_l2_gas_remaining_shift) - + (main_abs_l2_rem_gas_hi * FF(65536))) - + main_abs_l2_rem_gas_lo)); tmp *= scaling_factor; std::get<6>(evals) += tmp; } @@ -368,10 +368,10 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(7); - auto tmp = (avm_main_gas_cost_active * - ((((-(avm_main_da_out_of_gas * FF(2)) + FF(1)) * avm_main_da_gas_remaining_shift) - - (avm_main_abs_da_rem_gas_hi * FF(65536))) - - avm_main_abs_da_rem_gas_lo)); + auto tmp = + (main_gas_cost_active * ((((-(main_da_out_of_gas * FF(2)) + FF(1)) * main_da_gas_remaining_shift) - + (main_abs_da_rem_gas_hi * FF(65536))) - + main_abs_da_rem_gas_lo)); tmp *= scaling_factor; std::get<7>(evals) += tmp; } @@ -379,7 +379,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(8); - auto tmp = (avm_main_sel_op_sender * (-avm_main_sel_op_sender + FF(1))); + auto tmp = (main_sel_op_sender * (-main_sel_op_sender + FF(1))); tmp *= scaling_factor; std::get<8>(evals) += tmp; } @@ -387,7 +387,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(9); - auto tmp = (avm_main_sel_op_address * (-avm_main_sel_op_address + FF(1))); + auto tmp = (main_sel_op_address * (-main_sel_op_address + FF(1))); tmp *= scaling_factor; std::get<9>(evals) += tmp; } @@ -395,7 +395,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(10); - auto tmp = (avm_main_sel_op_storage_address * (-avm_main_sel_op_storage_address + FF(1))); + auto tmp = (main_sel_op_storage_address * (-main_sel_op_storage_address + FF(1))); tmp *= scaling_factor; std::get<10>(evals) += tmp; } @@ -403,7 +403,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(11); - auto tmp = (avm_main_sel_op_chain_id * (-avm_main_sel_op_chain_id + FF(1))); + auto tmp = (main_sel_op_chain_id * (-main_sel_op_chain_id + FF(1))); tmp *= scaling_factor; std::get<11>(evals) += tmp; } @@ -411,7 +411,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(12); - auto tmp = (avm_main_sel_op_version * (-avm_main_sel_op_version + FF(1))); + auto tmp = (main_sel_op_version * (-main_sel_op_version + FF(1))); tmp *= scaling_factor; std::get<12>(evals) += tmp; } @@ -419,7 +419,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(13); - auto tmp = (avm_main_sel_op_block_number * (-avm_main_sel_op_block_number + FF(1))); + auto tmp = (main_sel_op_block_number * (-main_sel_op_block_number + FF(1))); tmp *= scaling_factor; std::get<13>(evals) += tmp; } @@ -427,7 +427,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(14); - auto tmp = (avm_main_sel_op_coinbase * (-avm_main_sel_op_coinbase + FF(1))); + auto tmp = (main_sel_op_coinbase * (-main_sel_op_coinbase + FF(1))); tmp *= scaling_factor; std::get<14>(evals) += tmp; } @@ -435,7 +435,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(15); - auto tmp = (avm_main_sel_op_timestamp * (-avm_main_sel_op_timestamp + FF(1))); + auto tmp = (main_sel_op_timestamp * (-main_sel_op_timestamp + FF(1))); tmp *= scaling_factor; std::get<15>(evals) += tmp; } @@ -443,7 +443,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(16); - auto tmp = (avm_main_sel_op_fee_per_l2_gas * (-avm_main_sel_op_fee_per_l2_gas + FF(1))); + auto tmp = (main_sel_op_fee_per_l2_gas * (-main_sel_op_fee_per_l2_gas + FF(1))); tmp *= scaling_factor; std::get<16>(evals) += tmp; } @@ -451,7 +451,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(17); - auto tmp = (avm_main_sel_op_fee_per_da_gas * (-avm_main_sel_op_fee_per_da_gas + FF(1))); + auto tmp = (main_sel_op_fee_per_da_gas * (-main_sel_op_fee_per_da_gas + FF(1))); tmp *= scaling_factor; std::get<17>(evals) += tmp; } @@ -459,7 +459,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(18); - auto tmp = (avm_main_sel_op_transaction_fee * (-avm_main_sel_op_transaction_fee + FF(1))); + auto tmp = (main_sel_op_transaction_fee * (-main_sel_op_transaction_fee + FF(1))); tmp *= scaling_factor; std::get<18>(evals) += tmp; } @@ -467,7 +467,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(19); - auto tmp = (avm_main_sel_op_l2gasleft * (-avm_main_sel_op_l2gasleft + FF(1))); + auto tmp = (main_sel_op_l2gasleft * (-main_sel_op_l2gasleft + FF(1))); tmp *= scaling_factor; std::get<19>(evals) += tmp; } @@ -475,7 +475,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(20); - auto tmp = (avm_main_sel_op_dagasleft * (-avm_main_sel_op_dagasleft + FF(1))); + auto tmp = (main_sel_op_dagasleft * (-main_sel_op_dagasleft + FF(1))); tmp *= scaling_factor; std::get<20>(evals) += tmp; } @@ -483,7 +483,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(21); - auto tmp = (avm_main_sel_op_note_hash_exists * (-avm_main_sel_op_note_hash_exists + FF(1))); + auto tmp = (main_sel_op_note_hash_exists * (-main_sel_op_note_hash_exists + FF(1))); tmp *= scaling_factor; std::get<21>(evals) += tmp; } @@ -491,7 +491,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(22); - auto tmp = (avm_main_sel_op_emit_note_hash * (-avm_main_sel_op_emit_note_hash + FF(1))); + auto tmp = (main_sel_op_emit_note_hash * (-main_sel_op_emit_note_hash + FF(1))); tmp *= scaling_factor; std::get<22>(evals) += tmp; } @@ -499,7 +499,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(23); - auto tmp = (avm_main_sel_op_nullifier_exists * (-avm_main_sel_op_nullifier_exists + FF(1))); + auto tmp = (main_sel_op_nullifier_exists * (-main_sel_op_nullifier_exists + FF(1))); tmp *= scaling_factor; std::get<23>(evals) += tmp; } @@ -507,7 +507,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(24); - auto tmp = (avm_main_sel_op_emit_nullifier * (-avm_main_sel_op_emit_nullifier + FF(1))); + auto tmp = (main_sel_op_emit_nullifier * (-main_sel_op_emit_nullifier + FF(1))); tmp *= scaling_factor; std::get<24>(evals) += tmp; } @@ -515,7 +515,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(25); - auto tmp = (avm_main_sel_op_l1_to_l2_msg_exists * (-avm_main_sel_op_l1_to_l2_msg_exists + FF(1))); + auto tmp = (main_sel_op_l1_to_l2_msg_exists * (-main_sel_op_l1_to_l2_msg_exists + FF(1))); tmp *= scaling_factor; std::get<25>(evals) += tmp; } @@ -523,7 +523,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(26); - auto tmp = (avm_main_sel_op_emit_unencrypted_log * (-avm_main_sel_op_emit_unencrypted_log + FF(1))); + auto tmp = (main_sel_op_emit_unencrypted_log * (-main_sel_op_emit_unencrypted_log + FF(1))); tmp *= scaling_factor; std::get<26>(evals) += tmp; } @@ -531,7 +531,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(27); - auto tmp = (avm_main_sel_op_emit_l2_to_l1_msg * (-avm_main_sel_op_emit_l2_to_l1_msg + FF(1))); + auto tmp = (main_sel_op_emit_l2_to_l1_msg * (-main_sel_op_emit_l2_to_l1_msg + FF(1))); tmp *= scaling_factor; std::get<27>(evals) += tmp; } @@ -539,7 +539,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(28); - auto tmp = (avm_main_sel_op_get_contract_instance * (-avm_main_sel_op_get_contract_instance + FF(1))); + auto tmp = (main_sel_op_get_contract_instance * (-main_sel_op_get_contract_instance + FF(1))); tmp *= scaling_factor; std::get<28>(evals) += tmp; } @@ -547,7 +547,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(29); - auto tmp = (avm_main_sel_op_sload * (-avm_main_sel_op_sload + FF(1))); + auto tmp = (main_sel_op_sload * (-main_sel_op_sload + FF(1))); tmp *= scaling_factor; std::get<29>(evals) += tmp; } @@ -555,7 +555,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(30); - auto tmp = (avm_main_sel_op_sstore * (-avm_main_sel_op_sstore + FF(1))); + auto tmp = (main_sel_op_sstore * (-main_sel_op_sstore + FF(1))); tmp *= scaling_factor; std::get<30>(evals) += tmp; } @@ -563,7 +563,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(31); - auto tmp = (avm_main_sel_op_radix_le * (-avm_main_sel_op_radix_le + FF(1))); + auto tmp = (main_sel_op_radix_le * (-main_sel_op_radix_le + FF(1))); tmp *= scaling_factor; std::get<31>(evals) += tmp; } @@ -571,7 +571,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(32); - auto tmp = (avm_main_sel_op_sha256 * (-avm_main_sel_op_sha256 + FF(1))); + auto tmp = (main_sel_op_sha256 * (-main_sel_op_sha256 + FF(1))); tmp *= scaling_factor; std::get<32>(evals) += tmp; } @@ -579,7 +579,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(33); - auto tmp = (avm_main_sel_op_poseidon2 * (-avm_main_sel_op_poseidon2 + FF(1))); + auto tmp = (main_sel_op_poseidon2 * (-main_sel_op_poseidon2 + FF(1))); tmp *= scaling_factor; std::get<33>(evals) += tmp; } @@ -587,7 +587,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(34); - auto tmp = (avm_main_sel_op_keccak * (-avm_main_sel_op_keccak + FF(1))); + auto tmp = (main_sel_op_keccak * (-main_sel_op_keccak + FF(1))); tmp *= scaling_factor; std::get<34>(evals) += tmp; } @@ -595,7 +595,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(35); - auto tmp = (avm_main_sel_op_pedersen * (-avm_main_sel_op_pedersen + FF(1))); + auto tmp = (main_sel_op_pedersen * (-main_sel_op_pedersen + FF(1))); tmp *= scaling_factor; std::get<35>(evals) += tmp; } @@ -603,7 +603,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(36); - auto tmp = (avm_main_sel_op_add * (-avm_main_sel_op_add + FF(1))); + auto tmp = (main_sel_op_add * (-main_sel_op_add + FF(1))); tmp *= scaling_factor; std::get<36>(evals) += tmp; } @@ -611,7 +611,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(37); - auto tmp = (avm_main_sel_op_sub * (-avm_main_sel_op_sub + FF(1))); + auto tmp = (main_sel_op_sub * (-main_sel_op_sub + FF(1))); tmp *= scaling_factor; std::get<37>(evals) += tmp; } @@ -619,7 +619,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(38); - auto tmp = (avm_main_sel_op_mul * (-avm_main_sel_op_mul + FF(1))); + auto tmp = (main_sel_op_mul * (-main_sel_op_mul + FF(1))); tmp *= scaling_factor; std::get<38>(evals) += tmp; } @@ -627,7 +627,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(39); - auto tmp = (avm_main_sel_op_div * (-avm_main_sel_op_div + FF(1))); + auto tmp = (main_sel_op_div * (-main_sel_op_div + FF(1))); tmp *= scaling_factor; std::get<39>(evals) += tmp; } @@ -635,7 +635,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(40); - auto tmp = (avm_main_sel_op_fdiv * (-avm_main_sel_op_fdiv + FF(1))); + auto tmp = (main_sel_op_fdiv * (-main_sel_op_fdiv + FF(1))); tmp *= scaling_factor; std::get<40>(evals) += tmp; } @@ -643,7 +643,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(41); - auto tmp = (avm_main_sel_op_not * (-avm_main_sel_op_not + FF(1))); + auto tmp = (main_sel_op_not * (-main_sel_op_not + FF(1))); tmp *= scaling_factor; std::get<41>(evals) += tmp; } @@ -651,7 +651,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(42); - auto tmp = (avm_main_sel_op_eq * (-avm_main_sel_op_eq + FF(1))); + auto tmp = (main_sel_op_eq * (-main_sel_op_eq + FF(1))); tmp *= scaling_factor; std::get<42>(evals) += tmp; } @@ -659,7 +659,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(43); - auto tmp = (avm_main_sel_op_and * (-avm_main_sel_op_and + FF(1))); + auto tmp = (main_sel_op_and * (-main_sel_op_and + FF(1))); tmp *= scaling_factor; std::get<43>(evals) += tmp; } @@ -667,7 +667,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(44); - auto tmp = (avm_main_sel_op_or * (-avm_main_sel_op_or + FF(1))); + auto tmp = (main_sel_op_or * (-main_sel_op_or + FF(1))); tmp *= scaling_factor; std::get<44>(evals) += tmp; } @@ -675,7 +675,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(45); - auto tmp = (avm_main_sel_op_xor * (-avm_main_sel_op_xor + FF(1))); + auto tmp = (main_sel_op_xor * (-main_sel_op_xor + FF(1))); tmp *= scaling_factor; std::get<45>(evals) += tmp; } @@ -683,7 +683,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(46); - auto tmp = (avm_main_sel_op_cast * (-avm_main_sel_op_cast + FF(1))); + auto tmp = (main_sel_op_cast * (-main_sel_op_cast + FF(1))); tmp *= scaling_factor; std::get<46>(evals) += tmp; } @@ -691,7 +691,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(47); - auto tmp = (avm_main_sel_op_lt * (-avm_main_sel_op_lt + FF(1))); + auto tmp = (main_sel_op_lt * (-main_sel_op_lt + FF(1))); tmp *= scaling_factor; std::get<47>(evals) += tmp; } @@ -699,7 +699,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(48); - auto tmp = (avm_main_sel_op_lte * (-avm_main_sel_op_lte + FF(1))); + auto tmp = (main_sel_op_lte * (-main_sel_op_lte + FF(1))); tmp *= scaling_factor; std::get<48>(evals) += tmp; } @@ -707,7 +707,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(49); - auto tmp = (avm_main_sel_op_shl * (-avm_main_sel_op_shl + FF(1))); + auto tmp = (main_sel_op_shl * (-main_sel_op_shl + FF(1))); tmp *= scaling_factor; std::get<49>(evals) += tmp; } @@ -715,7 +715,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(50); - auto tmp = (avm_main_sel_op_shr * (-avm_main_sel_op_shr + FF(1))); + auto tmp = (main_sel_op_shr * (-main_sel_op_shr + FF(1))); tmp *= scaling_factor; std::get<50>(evals) += tmp; } @@ -723,7 +723,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(51); - auto tmp = (avm_main_sel_internal_call * (-avm_main_sel_internal_call + FF(1))); + auto tmp = (main_sel_internal_call * (-main_sel_internal_call + FF(1))); tmp *= scaling_factor; std::get<51>(evals) += tmp; } @@ -731,7 +731,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(52); - auto tmp = (avm_main_sel_internal_return * (-avm_main_sel_internal_return + FF(1))); + auto tmp = (main_sel_internal_return * (-main_sel_internal_return + FF(1))); tmp *= scaling_factor; std::get<52>(evals) += tmp; } @@ -739,7 +739,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(53); - auto tmp = (avm_main_sel_jump * (-avm_main_sel_jump + FF(1))); + auto tmp = (main_sel_jump * (-main_sel_jump + FF(1))); tmp *= scaling_factor; std::get<53>(evals) += tmp; } @@ -747,7 +747,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(54); - auto tmp = (avm_main_sel_jumpi * (-avm_main_sel_jumpi + FF(1))); + auto tmp = (main_sel_jumpi * (-main_sel_jumpi + FF(1))); tmp *= scaling_factor; std::get<54>(evals) += tmp; } @@ -755,7 +755,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(55); - auto tmp = (avm_main_sel_halt * (-avm_main_sel_halt + FF(1))); + auto tmp = (main_sel_halt * (-main_sel_halt + FF(1))); tmp *= scaling_factor; std::get<55>(evals) += tmp; } @@ -763,7 +763,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(56); - auto tmp = (avm_main_sel_external_call * (-avm_main_sel_external_call + FF(1))); + auto tmp = (main_sel_external_call * (-main_sel_external_call + FF(1))); tmp *= scaling_factor; std::get<56>(evals) += tmp; } @@ -771,7 +771,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(57); - auto tmp = (avm_main_sel_mov * (-avm_main_sel_mov + FF(1))); + auto tmp = (main_sel_mov * (-main_sel_mov + FF(1))); tmp *= scaling_factor; std::get<57>(evals) += tmp; } @@ -779,7 +779,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(58); - auto tmp = (avm_main_sel_cmov * (-avm_main_sel_cmov + FF(1))); + auto tmp = (main_sel_cmov * (-main_sel_cmov + FF(1))); tmp *= scaling_factor; std::get<58>(evals) += tmp; } @@ -787,7 +787,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(59); - auto tmp = (avm_main_op_err * (-avm_main_op_err + FF(1))); + auto tmp = (main_op_err * (-main_op_err + FF(1))); tmp *= scaling_factor; std::get<59>(evals) += tmp; } @@ -795,7 +795,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(60); - auto tmp = (avm_main_tag_err * (-avm_main_tag_err + FF(1))); + auto tmp = (main_tag_err * (-main_tag_err + FF(1))); tmp *= scaling_factor; std::get<60>(evals) += tmp; } @@ -803,7 +803,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(61); - auto tmp = (avm_main_id_zero * (-avm_main_id_zero + FF(1))); + auto tmp = (main_id_zero * (-main_id_zero + FF(1))); tmp *= scaling_factor; std::get<61>(evals) += tmp; } @@ -811,7 +811,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(62); - auto tmp = (avm_main_mem_op_a * (-avm_main_mem_op_a + FF(1))); + auto tmp = (main_mem_op_a * (-main_mem_op_a + FF(1))); tmp *= scaling_factor; std::get<62>(evals) += tmp; } @@ -819,7 +819,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(63); - auto tmp = (avm_main_mem_op_b * (-avm_main_mem_op_b + FF(1))); + auto tmp = (main_mem_op_b * (-main_mem_op_b + FF(1))); tmp *= scaling_factor; std::get<63>(evals) += tmp; } @@ -827,7 +827,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(64); - auto tmp = (avm_main_mem_op_c * (-avm_main_mem_op_c + FF(1))); + auto tmp = (main_mem_op_c * (-main_mem_op_c + FF(1))); tmp *= scaling_factor; std::get<64>(evals) += tmp; } @@ -835,7 +835,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(65); - auto tmp = (avm_main_mem_op_d * (-avm_main_mem_op_d + FF(1))); + auto tmp = (main_mem_op_d * (-main_mem_op_d + FF(1))); tmp *= scaling_factor; std::get<65>(evals) += tmp; } @@ -843,7 +843,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(66); - auto tmp = (avm_main_rwa * (-avm_main_rwa + FF(1))); + auto tmp = (main_rwa * (-main_rwa + FF(1))); tmp *= scaling_factor; std::get<66>(evals) += tmp; } @@ -851,7 +851,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(67); - auto tmp = (avm_main_rwb * (-avm_main_rwb + FF(1))); + auto tmp = (main_rwb * (-main_rwb + FF(1))); tmp *= scaling_factor; std::get<67>(evals) += tmp; } @@ -859,7 +859,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(68); - auto tmp = (avm_main_rwc * (-avm_main_rwc + FF(1))); + auto tmp = (main_rwc * (-main_rwc + FF(1))); tmp *= scaling_factor; std::get<68>(evals) += tmp; } @@ -867,7 +867,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(69); - auto tmp = (avm_main_rwd * (-avm_main_rwd + FF(1))); + auto tmp = (main_rwd * (-main_rwd + FF(1))); tmp *= scaling_factor; std::get<69>(evals) += tmp; } @@ -875,7 +875,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(70); - auto tmp = (avm_main_ind_op_a * (-avm_main_ind_op_a + FF(1))); + auto tmp = (main_ind_op_a * (-main_ind_op_a + FF(1))); tmp *= scaling_factor; std::get<70>(evals) += tmp; } @@ -883,7 +883,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(71); - auto tmp = (avm_main_ind_op_b * (-avm_main_ind_op_b + FF(1))); + auto tmp = (main_ind_op_b * (-main_ind_op_b + FF(1))); tmp *= scaling_factor; std::get<71>(evals) += tmp; } @@ -891,7 +891,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(72); - auto tmp = (avm_main_ind_op_c * (-avm_main_ind_op_c + FF(1))); + auto tmp = (main_ind_op_c * (-main_ind_op_c + FF(1))); tmp *= scaling_factor; std::get<72>(evals) += tmp; } @@ -899,7 +899,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(73); - auto tmp = (avm_main_ind_op_d * (-avm_main_ind_op_d + FF(1))); + auto tmp = (main_ind_op_d * (-main_ind_op_d + FF(1))); tmp *= scaling_factor; std::get<73>(evals) += tmp; } @@ -907,8 +907,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(74); - auto tmp = - (((avm_main_sel_op_eq + avm_main_sel_op_lte) + avm_main_sel_op_lt) * (avm_main_w_in_tag - FF(1))); + auto tmp = (((main_sel_op_eq + main_sel_op_lte) + main_sel_op_lt) * (main_w_in_tag - FF(1))); tmp *= scaling_factor; std::get<74>(evals) += tmp; } @@ -916,8 +915,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(75); - auto tmp = - ((avm_main_sel_op_fdiv * (-avm_main_op_err + FF(1))) * ((avm_main_ic * avm_main_ib) - avm_main_ia)); + auto tmp = ((main_sel_op_fdiv * (-main_op_err + FF(1))) * ((main_ic * main_ib) - main_ia)); tmp *= scaling_factor; std::get<75>(evals) += tmp; } @@ -925,8 +923,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(76); - auto tmp = ((avm_main_sel_op_fdiv + avm_main_sel_op_div) * - (((avm_main_ib * avm_main_inv) - FF(1)) + avm_main_op_err)); + auto tmp = ((main_sel_op_fdiv + main_sel_op_div) * (((main_ib * main_inv) - FF(1)) + main_op_err)); tmp *= scaling_factor; std::get<76>(evals) += tmp; } @@ -934,7 +931,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(77); - auto tmp = (((avm_main_sel_op_fdiv + avm_main_sel_op_div) * avm_main_op_err) * (-avm_main_inv + FF(1))); + auto tmp = (((main_sel_op_fdiv + main_sel_op_div) * main_op_err) * (-main_inv + FF(1))); tmp *= scaling_factor; std::get<77>(evals) += tmp; } @@ -942,7 +939,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(78); - auto tmp = (avm_main_sel_op_fdiv * (avm_main_r_in_tag - FF(6))); + auto tmp = (main_sel_op_fdiv * (main_r_in_tag - FF(6))); tmp *= scaling_factor; std::get<78>(evals) += tmp; } @@ -950,7 +947,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(79); - auto tmp = (avm_main_sel_op_fdiv * (avm_main_w_in_tag - FF(6))); + auto tmp = (main_sel_op_fdiv * (main_w_in_tag - FF(6))); tmp *= scaling_factor; std::get<79>(evals) += tmp; } @@ -958,7 +955,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(80); - auto tmp = (avm_main_op_err * ((avm_main_sel_op_fdiv + avm_main_sel_op_div) - FF(1))); + auto tmp = (main_op_err * ((main_sel_op_fdiv + main_sel_op_div) - FF(1))); tmp *= scaling_factor; std::get<80>(evals) += tmp; } @@ -966,16 +963,16 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(81); - auto tmp = (((((((((((avm_main_sel_op_sender + avm_main_sel_op_address) + avm_main_sel_op_storage_address) + - avm_main_sel_op_chain_id) + - avm_main_sel_op_version) + - avm_main_sel_op_block_number) + - avm_main_sel_op_coinbase) + - avm_main_sel_op_timestamp) + - avm_main_sel_op_fee_per_l2_gas) + - avm_main_sel_op_fee_per_da_gas) + - avm_main_sel_op_transaction_fee) * - (-avm_main_q_kernel_lookup + FF(1))); + auto tmp = (((((((((((main_sel_op_sender + main_sel_op_address) + main_sel_op_storage_address) + + main_sel_op_chain_id) + + main_sel_op_version) + + main_sel_op_block_number) + + main_sel_op_coinbase) + + main_sel_op_timestamp) + + main_sel_op_fee_per_l2_gas) + + main_sel_op_fee_per_da_gas) + + main_sel_op_transaction_fee) * + (-main_q_kernel_lookup + FF(1))); tmp *= scaling_factor; std::get<81>(evals) += tmp; } @@ -983,13 +980,13 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(82); - auto tmp = (((((((avm_main_sel_op_note_hash_exists + avm_main_sel_op_emit_note_hash) + - avm_main_sel_op_nullifier_exists) + - avm_main_sel_op_emit_nullifier) + - avm_main_sel_op_l1_to_l2_msg_exists) + - avm_main_sel_op_emit_unencrypted_log) + - avm_main_sel_op_emit_l2_to_l1_msg) * - (-avm_main_q_kernel_output_lookup + FF(1))); + auto tmp = + (((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + + main_sel_op_emit_nullifier) + + main_sel_op_l1_to_l2_msg_exists) + + main_sel_op_emit_unencrypted_log) + + main_sel_op_emit_l2_to_l1_msg) * + (-main_q_kernel_output_lookup + FF(1))); tmp *= scaling_factor; std::get<82>(evals) += tmp; } @@ -997,7 +994,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(83); - auto tmp = (avm_main_sel_jump * (avm_main_pc_shift - avm_main_ia)); + auto tmp = (main_sel_jump * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<83>(evals) += tmp; } @@ -1005,8 +1002,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(84); - auto tmp = (avm_main_sel_jumpi * (((-avm_main_id_zero + FF(1)) * (avm_main_pc_shift - avm_main_ia)) + - (avm_main_id_zero * ((avm_main_pc_shift - avm_main_pc) - FF(1))))); + auto tmp = (main_sel_jumpi * (((-main_id_zero + FF(1)) * (main_pc_shift - main_ia)) + + (main_id_zero * ((main_pc_shift - main_pc) - FF(1))))); tmp *= scaling_factor; std::get<84>(evals) += tmp; } @@ -1014,8 +1011,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(85); - auto tmp = (avm_main_sel_internal_call * - (avm_main_internal_return_ptr_shift - (avm_main_internal_return_ptr + FF(1)))); + auto tmp = (main_sel_internal_call * (main_internal_return_ptr_shift - (main_internal_return_ptr + FF(1)))); tmp *= scaling_factor; std::get<85>(evals) += tmp; } @@ -1023,7 +1019,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(86); - auto tmp = (avm_main_sel_internal_call * (avm_main_internal_return_ptr - avm_main_mem_idx_b)); + auto tmp = (main_sel_internal_call * (main_internal_return_ptr - main_mem_idx_b)); tmp *= scaling_factor; std::get<86>(evals) += tmp; } @@ -1031,7 +1027,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(87); - auto tmp = (avm_main_sel_internal_call * (avm_main_pc_shift - avm_main_ia)); + auto tmp = (main_sel_internal_call * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<87>(evals) += tmp; } @@ -1039,7 +1035,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(88); - auto tmp = (avm_main_sel_internal_call * ((avm_main_pc + FF(1)) - avm_main_ib)); + auto tmp = (main_sel_internal_call * ((main_pc + FF(1)) - main_ib)); tmp *= scaling_factor; std::get<88>(evals) += tmp; } @@ -1047,7 +1043,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(89); - auto tmp = (avm_main_sel_internal_call * (avm_main_rwb - FF(1))); + auto tmp = (main_sel_internal_call * (main_rwb - FF(1))); tmp *= scaling_factor; std::get<89>(evals) += tmp; } @@ -1055,7 +1051,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(90); - auto tmp = (avm_main_sel_internal_call * (avm_main_mem_op_b - FF(1))); + auto tmp = (main_sel_internal_call * (main_mem_op_b - FF(1))); tmp *= scaling_factor; std::get<90>(evals) += tmp; } @@ -1063,8 +1059,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(91); - auto tmp = (avm_main_sel_internal_return * - (avm_main_internal_return_ptr_shift - (avm_main_internal_return_ptr - FF(1)))); + auto tmp = + (main_sel_internal_return * (main_internal_return_ptr_shift - (main_internal_return_ptr - FF(1)))); tmp *= scaling_factor; std::get<91>(evals) += tmp; } @@ -1072,7 +1068,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(92); - auto tmp = (avm_main_sel_internal_return * ((avm_main_internal_return_ptr - FF(1)) - avm_main_mem_idx_a)); + auto tmp = (main_sel_internal_return * ((main_internal_return_ptr - FF(1)) - main_mem_idx_a)); tmp *= scaling_factor; std::get<92>(evals) += tmp; } @@ -1080,7 +1076,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(93); - auto tmp = (avm_main_sel_internal_return * (avm_main_pc_shift - avm_main_ia)); + auto tmp = (main_sel_internal_return * (main_pc_shift - main_ia)); tmp *= scaling_factor; std::get<93>(evals) += tmp; } @@ -1088,7 +1084,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(94); - auto tmp = (avm_main_sel_internal_return * avm_main_rwa); + auto tmp = (main_sel_internal_return * main_rwa); tmp *= scaling_factor; std::get<94>(evals) += tmp; } @@ -1096,7 +1092,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(95); - auto tmp = (avm_main_sel_internal_return * (avm_main_mem_op_a - FF(1))); + auto tmp = (main_sel_internal_return * (main_mem_op_a - FF(1))); tmp *= scaling_factor; std::get<95>(evals) += tmp; } @@ -1105,43 +1101,40 @@ template class avm_mainImpl { Avm_DECLARE_VIEWS(96); auto tmp = - (((((avm_main_gas_cost_active - - (((((((avm_main_sel_op_fdiv + - ((((((((((avm_main_sel_op_add + avm_main_sel_op_sub) + avm_main_sel_op_mul) + - avm_main_sel_op_div) + - avm_main_sel_op_not) + - avm_main_sel_op_eq) + - avm_main_sel_op_lt) + - avm_main_sel_op_lte) + - avm_main_sel_op_shr) + - avm_main_sel_op_shl) + - avm_main_sel_op_cast)) + - ((avm_main_sel_op_and + avm_main_sel_op_or) + avm_main_sel_op_xor)) + - (avm_main_sel_cmov + avm_main_sel_mov)) + - ((((avm_main_sel_op_radix_le + avm_main_sel_op_sha256) + avm_main_sel_op_poseidon2) + - avm_main_sel_op_keccak) + - avm_main_sel_op_pedersen)) + - ((((((((((avm_main_sel_op_sender + avm_main_sel_op_address) + avm_main_sel_op_storage_address) + - avm_main_sel_op_chain_id) + - avm_main_sel_op_version) + - avm_main_sel_op_block_number) + - avm_main_sel_op_coinbase) + - avm_main_sel_op_timestamp) + - avm_main_sel_op_fee_per_l2_gas) + - avm_main_sel_op_fee_per_da_gas) + - avm_main_sel_op_transaction_fee)) + - ((((((avm_main_sel_op_note_hash_exists + avm_main_sel_op_emit_note_hash) + - avm_main_sel_op_nullifier_exists) + - avm_main_sel_op_emit_nullifier) + - avm_main_sel_op_l1_to_l2_msg_exists) + - avm_main_sel_op_emit_unencrypted_log) + - avm_main_sel_op_emit_l2_to_l1_msg)) + - (avm_main_sel_op_dagasleft + avm_main_sel_op_l2gasleft))) - - (((avm_main_sel_jump + avm_main_sel_jumpi) + avm_main_sel_internal_call) + - avm_main_sel_internal_return)) - - avm_main_sel_op_sload) - - avm_main_sel_op_sstore) - - avm_main_mem_op_activate_gas); + (((((main_gas_cost_active - + (((((((main_sel_op_fdiv + + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + + main_sel_op_not) + + main_sel_op_eq) + + main_sel_op_lt) + + main_sel_op_lte) + + main_sel_op_shr) + + main_sel_op_shl) + + main_sel_op_cast)) + + ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)) + + (main_sel_cmov + main_sel_mov)) + + ((((main_sel_op_radix_le + main_sel_op_sha256) + main_sel_op_poseidon2) + main_sel_op_keccak) + + main_sel_op_pedersen)) + + ((((((((((main_sel_op_sender + main_sel_op_address) + main_sel_op_storage_address) + + main_sel_op_chain_id) + + main_sel_op_version) + + main_sel_op_block_number) + + main_sel_op_coinbase) + + main_sel_op_timestamp) + + main_sel_op_fee_per_l2_gas) + + main_sel_op_fee_per_da_gas) + + main_sel_op_transaction_fee)) + + ((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + + main_sel_op_nullifier_exists) + + main_sel_op_emit_nullifier) + + main_sel_op_l1_to_l2_msg_exists) + + main_sel_op_emit_unencrypted_log) + + main_sel_op_emit_l2_to_l1_msg)) + + (main_sel_op_dagasleft + main_sel_op_l2gasleft))) - + (((main_sel_jump + main_sel_jumpi) + main_sel_internal_call) + main_sel_internal_return)) - + main_sel_op_sload) - + main_sel_op_sstore) - + main_mem_op_activate_gas); tmp *= scaling_factor; std::get<96>(evals) += tmp; } @@ -1150,39 +1143,36 @@ template class avm_mainImpl { Avm_DECLARE_VIEWS(97); auto tmp = - ((((-avm_main_first + FF(1)) * (-avm_main_sel_halt + FF(1))) * - (((((((avm_main_sel_op_fdiv + - ((((((((((avm_main_sel_op_add + avm_main_sel_op_sub) + avm_main_sel_op_mul) + - avm_main_sel_op_div) + - avm_main_sel_op_not) + - avm_main_sel_op_eq) + - avm_main_sel_op_lt) + - avm_main_sel_op_lte) + - avm_main_sel_op_shr) + - avm_main_sel_op_shl) + - avm_main_sel_op_cast)) + - ((avm_main_sel_op_and + avm_main_sel_op_or) + avm_main_sel_op_xor)) + - (avm_main_sel_cmov + avm_main_sel_mov)) + - ((((avm_main_sel_op_radix_le + avm_main_sel_op_sha256) + avm_main_sel_op_poseidon2) + - avm_main_sel_op_keccak) + - avm_main_sel_op_pedersen)) + - ((((((((((avm_main_sel_op_sender + avm_main_sel_op_address) + avm_main_sel_op_storage_address) + - avm_main_sel_op_chain_id) + - avm_main_sel_op_version) + - avm_main_sel_op_block_number) + - avm_main_sel_op_coinbase) + - avm_main_sel_op_timestamp) + - avm_main_sel_op_fee_per_l2_gas) + - avm_main_sel_op_fee_per_da_gas) + - avm_main_sel_op_transaction_fee)) + - ((((((avm_main_sel_op_note_hash_exists + avm_main_sel_op_emit_note_hash) + - avm_main_sel_op_nullifier_exists) + - avm_main_sel_op_emit_nullifier) + - avm_main_sel_op_l1_to_l2_msg_exists) + - avm_main_sel_op_emit_unencrypted_log) + - avm_main_sel_op_emit_l2_to_l1_msg)) + - (avm_main_sel_op_dagasleft + avm_main_sel_op_l2gasleft))) * - (avm_main_pc_shift - (avm_main_pc + FF(1)))); + ((((-main_first + FF(1)) * (-main_sel_halt + FF(1))) * + (((((((main_sel_op_fdiv + + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + + main_sel_op_not) + + main_sel_op_eq) + + main_sel_op_lt) + + main_sel_op_lte) + + main_sel_op_shr) + + main_sel_op_shl) + + main_sel_op_cast)) + + ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)) + + (main_sel_cmov + main_sel_mov)) + + ((((main_sel_op_radix_le + main_sel_op_sha256) + main_sel_op_poseidon2) + main_sel_op_keccak) + + main_sel_op_pedersen)) + + ((((((((((main_sel_op_sender + main_sel_op_address) + main_sel_op_storage_address) + + main_sel_op_chain_id) + + main_sel_op_version) + + main_sel_op_block_number) + + main_sel_op_coinbase) + + main_sel_op_timestamp) + + main_sel_op_fee_per_l2_gas) + + main_sel_op_fee_per_da_gas) + + main_sel_op_transaction_fee)) + + ((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + + main_sel_op_emit_nullifier) + + main_sel_op_l1_to_l2_msg_exists) + + main_sel_op_emit_unencrypted_log) + + main_sel_op_emit_l2_to_l1_msg)) + + (main_sel_op_dagasleft + main_sel_op_l2gasleft))) * + (main_pc_shift - (main_pc + FF(1)))); tmp *= scaling_factor; std::get<97>(evals) += tmp; } @@ -1190,10 +1180,9 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(98); - auto tmp = ((-(((avm_main_first + avm_main_sel_internal_call) + avm_main_sel_internal_return) + - avm_main_sel_halt) + - FF(1)) * - (avm_main_internal_return_ptr_shift - avm_main_internal_return_ptr)); + auto tmp = + ((-(((main_first + main_sel_internal_call) + main_sel_internal_return) + main_sel_halt) + FF(1)) * + (main_internal_return_ptr_shift - main_internal_return_ptr)); tmp *= scaling_factor; std::get<98>(evals) += tmp; } @@ -1201,7 +1190,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(99); - auto tmp = ((avm_main_sel_internal_call + avm_main_sel_internal_return) * (avm_main_space_id - FF(255))); + auto tmp = ((main_sel_internal_call + main_sel_internal_return) * (main_space_id - FF(255))); tmp *= scaling_factor; std::get<99>(evals) += tmp; } @@ -1210,38 +1199,35 @@ template class avm_mainImpl { Avm_DECLARE_VIEWS(100); auto tmp = - ((((((((avm_main_sel_op_fdiv + - ((((((((((avm_main_sel_op_add + avm_main_sel_op_sub) + avm_main_sel_op_mul) + - avm_main_sel_op_div) + - avm_main_sel_op_not) + - avm_main_sel_op_eq) + - avm_main_sel_op_lt) + - avm_main_sel_op_lte) + - avm_main_sel_op_shr) + - avm_main_sel_op_shl) + - avm_main_sel_op_cast)) + - ((avm_main_sel_op_and + avm_main_sel_op_or) + avm_main_sel_op_xor)) + - (avm_main_sel_cmov + avm_main_sel_mov)) + - ((((avm_main_sel_op_radix_le + avm_main_sel_op_sha256) + avm_main_sel_op_poseidon2) + - avm_main_sel_op_keccak) + - avm_main_sel_op_pedersen)) + - ((((((((((avm_main_sel_op_sender + avm_main_sel_op_address) + avm_main_sel_op_storage_address) + - avm_main_sel_op_chain_id) + - avm_main_sel_op_version) + - avm_main_sel_op_block_number) + - avm_main_sel_op_coinbase) + - avm_main_sel_op_timestamp) + - avm_main_sel_op_fee_per_l2_gas) + - avm_main_sel_op_fee_per_da_gas) + - avm_main_sel_op_transaction_fee)) + - ((((((avm_main_sel_op_note_hash_exists + avm_main_sel_op_emit_note_hash) + - avm_main_sel_op_nullifier_exists) + - avm_main_sel_op_emit_nullifier) + - avm_main_sel_op_l1_to_l2_msg_exists) + - avm_main_sel_op_emit_unencrypted_log) + - avm_main_sel_op_emit_l2_to_l1_msg)) + - (avm_main_sel_op_dagasleft + avm_main_sel_op_l2gasleft)) * - (avm_main_call_ptr - avm_main_space_id)); + ((((((((main_sel_op_fdiv + + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + + main_sel_op_not) + + main_sel_op_eq) + + main_sel_op_lt) + + main_sel_op_lte) + + main_sel_op_shr) + + main_sel_op_shl) + + main_sel_op_cast)) + + ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)) + + (main_sel_cmov + main_sel_mov)) + + ((((main_sel_op_radix_le + main_sel_op_sha256) + main_sel_op_poseidon2) + main_sel_op_keccak) + + main_sel_op_pedersen)) + + ((((((((((main_sel_op_sender + main_sel_op_address) + main_sel_op_storage_address) + + main_sel_op_chain_id) + + main_sel_op_version) + + main_sel_op_block_number) + + main_sel_op_coinbase) + + main_sel_op_timestamp) + + main_sel_op_fee_per_l2_gas) + + main_sel_op_fee_per_da_gas) + + main_sel_op_transaction_fee)) + + ((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + + main_sel_op_emit_nullifier) + + main_sel_op_l1_to_l2_msg_exists) + + main_sel_op_emit_unencrypted_log) + + main_sel_op_emit_l2_to_l1_msg)) + + (main_sel_op_dagasleft + main_sel_op_l2gasleft)) * + (main_call_ptr - main_space_id)); tmp *= scaling_factor; std::get<100>(evals) += tmp; } @@ -1249,8 +1235,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(101); - auto tmp = ((avm_main_sel_cmov + avm_main_sel_jumpi) * - (((avm_main_id * avm_main_inv) - FF(1)) + avm_main_id_zero)); + auto tmp = ((main_sel_cmov + main_sel_jumpi) * (((main_id * main_inv) - FF(1)) + main_id_zero)); tmp *= scaling_factor; std::get<101>(evals) += tmp; } @@ -1258,7 +1243,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(102); - auto tmp = (((avm_main_sel_cmov + avm_main_sel_jumpi) * avm_main_id_zero) * (-avm_main_inv + FF(1))); + auto tmp = (((main_sel_cmov + main_sel_jumpi) * main_id_zero) * (-main_inv + FF(1))); tmp *= scaling_factor; std::get<102>(evals) += tmp; } @@ -1266,7 +1251,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(103); - auto tmp = (avm_main_sel_mov_a - (avm_main_sel_mov + (avm_main_sel_cmov * (-avm_main_id_zero + FF(1))))); + auto tmp = (main_sel_mov_a - (main_sel_mov + (main_sel_cmov * (-main_id_zero + FF(1))))); tmp *= scaling_factor; std::get<103>(evals) += tmp; } @@ -1274,7 +1259,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(104); - auto tmp = (avm_main_sel_mov_b - (avm_main_sel_cmov * avm_main_id_zero)); + auto tmp = (main_sel_mov_b - (main_sel_cmov * main_id_zero)); tmp *= scaling_factor; std::get<104>(evals) += tmp; } @@ -1282,7 +1267,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(105); - auto tmp = (avm_main_sel_mov_a * (avm_main_ia - avm_main_ic)); + auto tmp = (main_sel_mov_a * (main_ia - main_ic)); tmp *= scaling_factor; std::get<105>(evals) += tmp; } @@ -1290,7 +1275,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(106); - auto tmp = (avm_main_sel_mov_b * (avm_main_ib - avm_main_ic)); + auto tmp = (main_sel_mov_b * (main_ib - main_ic)); tmp *= scaling_factor; std::get<106>(evals) += tmp; } @@ -1298,7 +1283,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(107); - auto tmp = ((avm_main_sel_mov + avm_main_sel_cmov) * (avm_main_r_in_tag - avm_main_w_in_tag)); + auto tmp = ((main_sel_mov + main_sel_cmov) * (main_r_in_tag - main_w_in_tag)); tmp *= scaling_factor; std::get<107>(evals) += tmp; } @@ -1307,17 +1292,16 @@ template class avm_mainImpl { Avm_DECLARE_VIEWS(108); auto tmp = - (avm_main_alu_sel - - ((((((((((((avm_main_sel_op_add + avm_main_sel_op_sub) + avm_main_sel_op_mul) + avm_main_sel_op_div) + - avm_main_sel_op_not) + - avm_main_sel_op_eq) + - avm_main_sel_op_lt) + - avm_main_sel_op_lte) + - avm_main_sel_op_shr) + - avm_main_sel_op_shl) + - avm_main_sel_op_cast) * - (-avm_main_tag_err + FF(1))) * - (-avm_main_op_err + FF(1)))); + (main_alu_sel - ((((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + + main_sel_op_not) + + main_sel_op_eq) + + main_sel_op_lt) + + main_sel_op_lte) + + main_sel_op_shr) + + main_sel_op_shl) + + main_sel_op_cast) * + (-main_tag_err + FF(1))) * + (-main_op_err + FF(1)))); tmp *= scaling_factor; std::get<108>(evals) += tmp; } @@ -1326,14 +1310,13 @@ template class avm_mainImpl { Avm_DECLARE_VIEWS(109); auto tmp = - ((((((((((avm_main_sel_op_add + avm_main_sel_op_sub) + avm_main_sel_op_mul) + avm_main_sel_op_div) + - avm_main_sel_op_not) + - avm_main_sel_op_eq) + - avm_main_sel_op_lt) + - avm_main_sel_op_lte) + - avm_main_sel_op_shr) + - avm_main_sel_op_shl) * - (avm_main_alu_in_tag - avm_main_r_in_tag)); + ((((((((((main_sel_op_add + main_sel_op_sub) + main_sel_op_mul) + main_sel_op_div) + main_sel_op_not) + + main_sel_op_eq) + + main_sel_op_lt) + + main_sel_op_lte) + + main_sel_op_shr) + + main_sel_op_shl) * + (main_alu_in_tag - main_r_in_tag)); tmp *= scaling_factor; std::get<109>(evals) += tmp; } @@ -1341,7 +1324,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(110); - auto tmp = (avm_main_sel_op_cast * (avm_main_alu_in_tag - avm_main_w_in_tag)); + auto tmp = (main_sel_op_cast * (main_alu_in_tag - main_w_in_tag)); tmp *= scaling_factor; std::get<110>(evals) += tmp; } @@ -1349,7 +1332,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(111); - auto tmp = (avm_main_sel_op_l2gasleft * (avm_main_ia - avm_main_l2_gas_remaining_shift)); + auto tmp = (main_sel_op_l2gasleft * (main_ia - main_l2_gas_remaining_shift)); tmp *= scaling_factor; std::get<111>(evals) += tmp; } @@ -1357,7 +1340,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(112); - auto tmp = (avm_main_sel_op_dagasleft * (avm_main_ia - avm_main_da_gas_remaining_shift)); + auto tmp = (main_sel_op_dagasleft * (main_ia - main_da_gas_remaining_shift)); tmp *= scaling_factor; std::get<112>(evals) += tmp; } @@ -1365,7 +1348,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(113); - auto tmp = (avm_main_sel_op_sender * (avm_kernel_kernel_in_offset - FF(0))); + auto tmp = (main_sel_op_sender * (kernel_kernel_in_offset - FF(0))); tmp *= scaling_factor; std::get<113>(evals) += tmp; } @@ -1373,7 +1356,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(114); - auto tmp = (avm_main_sel_op_address * (avm_kernel_kernel_in_offset - FF(1))); + auto tmp = (main_sel_op_address * (kernel_kernel_in_offset - FF(1))); tmp *= scaling_factor; std::get<114>(evals) += tmp; } @@ -1381,7 +1364,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(115); - auto tmp = (avm_main_sel_op_storage_address * (avm_kernel_kernel_in_offset - FF(2))); + auto tmp = (main_sel_op_storage_address * (kernel_kernel_in_offset - FF(2))); tmp *= scaling_factor; std::get<115>(evals) += tmp; } @@ -1389,7 +1372,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(116); - auto tmp = (avm_main_sel_op_fee_per_da_gas * (avm_kernel_kernel_in_offset - FF(35))); + auto tmp = (main_sel_op_fee_per_da_gas * (kernel_kernel_in_offset - FF(35))); tmp *= scaling_factor; std::get<116>(evals) += tmp; } @@ -1397,7 +1380,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(117); - auto tmp = (avm_main_sel_op_fee_per_l2_gas * (avm_kernel_kernel_in_offset - FF(36))); + auto tmp = (main_sel_op_fee_per_l2_gas * (kernel_kernel_in_offset - FF(36))); tmp *= scaling_factor; std::get<117>(evals) += tmp; } @@ -1405,7 +1388,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(118); - auto tmp = (avm_main_sel_op_transaction_fee * (avm_kernel_kernel_in_offset - FF(40))); + auto tmp = (main_sel_op_transaction_fee * (kernel_kernel_in_offset - FF(40))); tmp *= scaling_factor; std::get<118>(evals) += tmp; } @@ -1413,7 +1396,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(119); - auto tmp = (avm_main_sel_op_chain_id * (avm_kernel_kernel_in_offset - FF(29))); + auto tmp = (main_sel_op_chain_id * (kernel_kernel_in_offset - FF(29))); tmp *= scaling_factor; std::get<119>(evals) += tmp; } @@ -1421,7 +1404,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(120); - auto tmp = (avm_main_sel_op_version * (avm_kernel_kernel_in_offset - FF(30))); + auto tmp = (main_sel_op_version * (kernel_kernel_in_offset - FF(30))); tmp *= scaling_factor; std::get<120>(evals) += tmp; } @@ -1429,7 +1412,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(121); - auto tmp = (avm_main_sel_op_block_number * (avm_kernel_kernel_in_offset - FF(31))); + auto tmp = (main_sel_op_block_number * (kernel_kernel_in_offset - FF(31))); tmp *= scaling_factor; std::get<121>(evals) += tmp; } @@ -1437,7 +1420,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(122); - auto tmp = (avm_main_sel_op_coinbase * (avm_kernel_kernel_in_offset - FF(33))); + auto tmp = (main_sel_op_coinbase * (kernel_kernel_in_offset - FF(33))); tmp *= scaling_factor; std::get<122>(evals) += tmp; } @@ -1445,7 +1428,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(123); - auto tmp = (avm_main_sel_op_timestamp * (avm_kernel_kernel_in_offset - FF(32))); + auto tmp = (main_sel_op_timestamp * (kernel_kernel_in_offset - FF(32))); tmp *= scaling_factor; std::get<123>(evals) += tmp; } @@ -1453,8 +1436,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(124); - auto tmp = (avm_main_sel_op_note_hash_exists * - (avm_kernel_kernel_out_offset - (avm_kernel_note_hash_exist_write_offset + FF(0)))); + auto tmp = (main_sel_op_note_hash_exists * + (kernel_kernel_out_offset - (kernel_note_hash_exist_write_offset + FF(0)))); tmp *= scaling_factor; std::get<124>(evals) += tmp; } @@ -1462,7 +1445,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(125); - auto tmp = (avm_main_first * avm_kernel_note_hash_exist_write_offset); + auto tmp = (main_first * kernel_note_hash_exist_write_offset); tmp *= scaling_factor; std::get<125>(evals) += tmp; } @@ -1470,8 +1453,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(126); - auto tmp = (avm_main_sel_op_emit_note_hash * - (avm_kernel_kernel_out_offset - (avm_kernel_emit_note_hash_write_offset + FF(176)))); + auto tmp = (main_sel_op_emit_note_hash * + (kernel_kernel_out_offset - (kernel_emit_note_hash_write_offset + FF(176)))); tmp *= scaling_factor; std::get<126>(evals) += tmp; } @@ -1479,7 +1462,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(127); - auto tmp = (avm_main_first * avm_kernel_emit_note_hash_write_offset); + auto tmp = (main_first * kernel_emit_note_hash_write_offset); tmp *= scaling_factor; std::get<127>(evals) += tmp; } @@ -1487,10 +1470,10 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(128); - auto tmp = (avm_main_sel_op_nullifier_exists * - (avm_kernel_kernel_out_offset - - ((avm_main_ib * (avm_kernel_nullifier_exists_write_offset + FF(32))) + - ((-avm_main_ib + FF(1)) * (avm_kernel_nullifier_non_exists_write_offset + FF(64)))))); + auto tmp = (main_sel_op_nullifier_exists * + (kernel_kernel_out_offset - + ((main_ib * (kernel_nullifier_exists_write_offset + FF(32))) + + ((-main_ib + FF(1)) * (kernel_nullifier_non_exists_write_offset + FF(64)))))); tmp *= scaling_factor; std::get<128>(evals) += tmp; } @@ -1498,7 +1481,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(129); - auto tmp = (avm_main_first * avm_kernel_nullifier_exists_write_offset); + auto tmp = (main_first * kernel_nullifier_exists_write_offset); tmp *= scaling_factor; std::get<129>(evals) += tmp; } @@ -1506,7 +1489,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(130); - auto tmp = (avm_main_first * avm_kernel_nullifier_non_exists_write_offset); + auto tmp = (main_first * kernel_nullifier_non_exists_write_offset); tmp *= scaling_factor; std::get<130>(evals) += tmp; } @@ -1514,8 +1497,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(131); - auto tmp = (avm_main_sel_op_emit_nullifier * - (avm_kernel_kernel_out_offset - (avm_kernel_emit_nullifier_write_offset + FF(192)))); + auto tmp = (main_sel_op_emit_nullifier * + (kernel_kernel_out_offset - (kernel_emit_nullifier_write_offset + FF(192)))); tmp *= scaling_factor; std::get<131>(evals) += tmp; } @@ -1523,7 +1506,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(132); - auto tmp = (avm_main_first * avm_kernel_emit_nullifier_write_offset); + auto tmp = (main_first * kernel_emit_nullifier_write_offset); tmp *= scaling_factor; std::get<132>(evals) += tmp; } @@ -1531,8 +1514,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(133); - auto tmp = (avm_main_sel_op_l1_to_l2_msg_exists * - (avm_kernel_kernel_out_offset - (avm_kernel_l1_to_l2_msg_exists_write_offset + FF(96)))); + auto tmp = (main_sel_op_l1_to_l2_msg_exists * + (kernel_kernel_out_offset - (kernel_l1_to_l2_msg_exists_write_offset + FF(96)))); tmp *= scaling_factor; std::get<133>(evals) += tmp; } @@ -1540,7 +1523,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(134); - auto tmp = (avm_main_first * avm_kernel_l1_to_l2_msg_exists_write_offset); + auto tmp = (main_first * kernel_l1_to_l2_msg_exists_write_offset); tmp *= scaling_factor; std::get<134>(evals) += tmp; } @@ -1548,8 +1531,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(135); - auto tmp = (avm_main_sel_op_emit_unencrypted_log * - (avm_kernel_kernel_out_offset - (avm_kernel_emit_unencrypted_log_write_offset + FF(210)))); + auto tmp = (main_sel_op_emit_unencrypted_log * + (kernel_kernel_out_offset - (kernel_emit_unencrypted_log_write_offset + FF(210)))); tmp *= scaling_factor; std::get<135>(evals) += tmp; } @@ -1557,7 +1540,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(136); - auto tmp = (avm_main_first * avm_kernel_emit_unencrypted_log_write_offset); + auto tmp = (main_first * kernel_emit_unencrypted_log_write_offset); tmp *= scaling_factor; std::get<136>(evals) += tmp; } @@ -1565,8 +1548,8 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(137); - auto tmp = (avm_main_sel_op_emit_l2_to_l1_msg * - (avm_kernel_kernel_out_offset - (avm_kernel_emit_l2_to_l1_msg_write_offset + FF(208)))); + auto tmp = (main_sel_op_emit_l2_to_l1_msg * + (kernel_kernel_out_offset - (kernel_emit_l2_to_l1_msg_write_offset + FF(208)))); tmp *= scaling_factor; std::get<137>(evals) += tmp; } @@ -1574,7 +1557,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(138); - auto tmp = (avm_main_first * avm_kernel_emit_l2_to_l1_msg_write_offset); + auto tmp = (main_first * kernel_emit_l2_to_l1_msg_write_offset); tmp *= scaling_factor; std::get<138>(evals) += tmp; } @@ -1582,8 +1565,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(139); - auto tmp = - (avm_main_sel_op_sload * (avm_kernel_kernel_out_offset - (avm_kernel_sload_write_offset + FF(144)))); + auto tmp = (main_sel_op_sload * (kernel_kernel_out_offset - (kernel_sload_write_offset + FF(144)))); tmp *= scaling_factor; std::get<139>(evals) += tmp; } @@ -1591,7 +1573,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(140); - auto tmp = (avm_main_first * avm_kernel_sload_write_offset); + auto tmp = (main_first * kernel_sload_write_offset); tmp *= scaling_factor; std::get<140>(evals) += tmp; } @@ -1599,8 +1581,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(141); - auto tmp = - (avm_main_sel_op_sstore * (avm_kernel_kernel_out_offset - (avm_kernel_sstore_write_offset + FF(112)))); + auto tmp = (main_sel_op_sstore * (kernel_kernel_out_offset - (kernel_sstore_write_offset + FF(112)))); tmp *= scaling_factor; std::get<141>(evals) += tmp; } @@ -1608,7 +1589,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(142); - auto tmp = (avm_main_first * avm_kernel_sstore_write_offset); + auto tmp = (main_first * kernel_sstore_write_offset); tmp *= scaling_factor; std::get<142>(evals) += tmp; } @@ -1616,13 +1597,13 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(143); - auto tmp = (((((((avm_main_sel_op_note_hash_exists + avm_main_sel_op_emit_note_hash) + - avm_main_sel_op_nullifier_exists) + - avm_main_sel_op_emit_nullifier) + - avm_main_sel_op_l1_to_l2_msg_exists) + - avm_main_sel_op_emit_unencrypted_log) + - avm_main_sel_op_emit_l2_to_l1_msg) * - (avm_kernel_side_effect_counter_shift - (avm_kernel_side_effect_counter + FF(1)))); + auto tmp = + (((((((main_sel_op_note_hash_exists + main_sel_op_emit_note_hash) + main_sel_op_nullifier_exists) + + main_sel_op_emit_nullifier) + + main_sel_op_l1_to_l2_msg_exists) + + main_sel_op_emit_unencrypted_log) + + main_sel_op_emit_l2_to_l1_msg) * + (kernel_side_effect_counter_shift - (kernel_side_effect_counter + FF(1)))); tmp *= scaling_factor; std::get<143>(evals) += tmp; } @@ -1630,7 +1611,7 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(144); - auto tmp = (avm_main_bin_op_id - (avm_main_sel_op_or + (avm_main_sel_op_xor * FF(2)))); + auto tmp = (main_bin_op_id - (main_sel_op_or + (main_sel_op_xor * FF(2)))); tmp *= scaling_factor; std::get<144>(evals) += tmp; } @@ -1638,13 +1619,13 @@ template class avm_mainImpl { { Avm_DECLARE_VIEWS(145); - auto tmp = (avm_main_bin_sel - ((avm_main_sel_op_and + avm_main_sel_op_or) + avm_main_sel_op_xor)); + auto tmp = (main_bin_sel - ((main_sel_op_and + main_sel_op_or) + main_sel_op_xor)); tmp *= scaling_factor; std::get<145>(evals) += tmp; } } }; -template using avm_main = Relation>; +template using main = Relation>; } // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_mem.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp similarity index 59% rename from barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_mem.hpp rename to barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp index e6ef54aa6c4..c3a5a9805e1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_mem.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/mem.hpp @@ -6,50 +6,50 @@ namespace bb::Avm_vm { -template struct Avm_memRow { - FF avm_main_first{}; - FF avm_mem_addr{}; - FF avm_mem_clk{}; - FF avm_mem_diff_hi{}; - FF avm_mem_diff_lo{}; - FF avm_mem_diff_mid{}; - FF avm_mem_glob_addr{}; - FF avm_mem_glob_addr_shift{}; - FF avm_mem_ind_op_a{}; - FF avm_mem_ind_op_b{}; - FF avm_mem_ind_op_c{}; - FF avm_mem_ind_op_d{}; - FF avm_mem_last{}; - FF avm_mem_lastAccess{}; - FF avm_mem_mem_sel{}; - FF avm_mem_mem_sel_shift{}; - FF avm_mem_one_min_inv{}; - FF avm_mem_op_a{}; - FF avm_mem_op_b{}; - FF avm_mem_op_c{}; - FF avm_mem_op_d{}; - FF avm_mem_r_in_tag{}; - FF avm_mem_rng_chk_sel{}; - FF avm_mem_rw{}; - FF avm_mem_rw_shift{}; - FF avm_mem_sel_cmov{}; - FF avm_mem_sel_mov_a{}; - FF avm_mem_sel_mov_b{}; - FF avm_mem_skip_check_tag{}; - FF avm_mem_space_id{}; - FF avm_mem_tag{}; - FF avm_mem_tag_err{}; - FF avm_mem_tag_shift{}; - FF avm_mem_tsp{}; - FF avm_mem_tsp_shift{}; - FF avm_mem_val{}; - FF avm_mem_val_shift{}; - FF avm_mem_w_in_tag{}; +template struct MemRow { + FF main_first{}; + FF mem_addr{}; + FF mem_clk{}; + FF mem_diff_hi{}; + FF mem_diff_lo{}; + FF mem_diff_mid{}; + FF mem_glob_addr{}; + FF mem_glob_addr_shift{}; + FF mem_ind_op_a{}; + FF mem_ind_op_b{}; + FF mem_ind_op_c{}; + FF mem_ind_op_d{}; + FF mem_last{}; + FF mem_lastAccess{}; + FF mem_mem_sel{}; + FF mem_mem_sel_shift{}; + FF mem_one_min_inv{}; + FF mem_op_a{}; + FF mem_op_b{}; + FF mem_op_c{}; + FF mem_op_d{}; + FF mem_r_in_tag{}; + FF mem_rng_chk_sel{}; + FF mem_rw{}; + FF mem_rw_shift{}; + FF mem_sel_cmov{}; + FF mem_sel_mov_a{}; + FF mem_sel_mov_b{}; + FF mem_skip_check_tag{}; + FF mem_space_id{}; + FF mem_tag{}; + FF mem_tag_err{}; + FF mem_tag_shift{}; + FF mem_tsp{}; + FF mem_tsp_shift{}; + FF mem_val{}; + FF mem_val_shift{}; + FF mem_w_in_tag{}; [[maybe_unused]] static std::vector names(); }; -inline std::string get_relation_label_avm_mem(int index) +inline std::string get_relation_label_mem(int index) { switch (index) { case 14: @@ -106,7 +106,7 @@ inline std::string get_relation_label_avm_mem(int index) return std::to_string(index); } -template class avm_memImpl { +template class memImpl { public: using FF = FF_; @@ -126,7 +126,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_mem_lastAccess * (-avm_mem_lastAccess + FF(1))); + auto tmp = (mem_lastAccess * (-mem_lastAccess + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } @@ -134,7 +134,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(1); - auto tmp = (avm_mem_last * (-avm_mem_last + FF(1))); + auto tmp = (mem_last * (-mem_last + FF(1))); tmp *= scaling_factor; std::get<1>(evals) += tmp; } @@ -142,7 +142,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(2); - auto tmp = (avm_mem_rw * (-avm_mem_rw + FF(1))); + auto tmp = (mem_rw * (-mem_rw + FF(1))); tmp *= scaling_factor; std::get<2>(evals) += tmp; } @@ -150,7 +150,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(3); - auto tmp = (avm_mem_tag_err * (-avm_mem_tag_err + FF(1))); + auto tmp = (mem_tag_err * (-mem_tag_err + FF(1))); tmp *= scaling_factor; std::get<3>(evals) += tmp; } @@ -158,7 +158,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(4); - auto tmp = (avm_mem_op_a * (-avm_mem_op_a + FF(1))); + auto tmp = (mem_op_a * (-mem_op_a + FF(1))); tmp *= scaling_factor; std::get<4>(evals) += tmp; } @@ -166,7 +166,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(5); - auto tmp = (avm_mem_op_b * (-avm_mem_op_b + FF(1))); + auto tmp = (mem_op_b * (-mem_op_b + FF(1))); tmp *= scaling_factor; std::get<5>(evals) += tmp; } @@ -174,7 +174,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(6); - auto tmp = (avm_mem_op_c * (-avm_mem_op_c + FF(1))); + auto tmp = (mem_op_c * (-mem_op_c + FF(1))); tmp *= scaling_factor; std::get<6>(evals) += tmp; } @@ -182,7 +182,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(7); - auto tmp = (avm_mem_op_d * (-avm_mem_op_d + FF(1))); + auto tmp = (mem_op_d * (-mem_op_d + FF(1))); tmp *= scaling_factor; std::get<7>(evals) += tmp; } @@ -190,7 +190,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(8); - auto tmp = (avm_mem_ind_op_a * (-avm_mem_ind_op_a + FF(1))); + auto tmp = (mem_ind_op_a * (-mem_ind_op_a + FF(1))); tmp *= scaling_factor; std::get<8>(evals) += tmp; } @@ -198,7 +198,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(9); - auto tmp = (avm_mem_ind_op_b * (-avm_mem_ind_op_b + FF(1))); + auto tmp = (mem_ind_op_b * (-mem_ind_op_b + FF(1))); tmp *= scaling_factor; std::get<9>(evals) += tmp; } @@ -206,7 +206,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(10); - auto tmp = (avm_mem_ind_op_c * (-avm_mem_ind_op_c + FF(1))); + auto tmp = (mem_ind_op_c * (-mem_ind_op_c + FF(1))); tmp *= scaling_factor; std::get<10>(evals) += tmp; } @@ -214,7 +214,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(11); - auto tmp = (avm_mem_ind_op_d * (-avm_mem_ind_op_d + FF(1))); + auto tmp = (mem_ind_op_d * (-mem_ind_op_d + FF(1))); tmp *= scaling_factor; std::get<11>(evals) += tmp; } @@ -222,11 +222,10 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(12); - auto tmp = (avm_mem_mem_sel - - (((((((avm_mem_op_a + avm_mem_op_b) + avm_mem_op_c) + avm_mem_op_d) + avm_mem_ind_op_a) + - avm_mem_ind_op_b) + - avm_mem_ind_op_c) + - avm_mem_ind_op_d)); + auto tmp = + (mem_mem_sel - + (((((((mem_op_a + mem_op_b) + mem_op_c) + mem_op_d) + mem_ind_op_a) + mem_ind_op_b) + mem_ind_op_c) + + mem_ind_op_d)); tmp *= scaling_factor; std::get<12>(evals) += tmp; } @@ -234,7 +233,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(13); - auto tmp = (avm_mem_mem_sel * (avm_mem_mem_sel - FF(1))); + auto tmp = (mem_mem_sel * (mem_mem_sel - FF(1))); tmp *= scaling_factor; std::get<13>(evals) += tmp; } @@ -242,7 +241,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(14); - auto tmp = (((-avm_main_first + FF(1)) * avm_mem_mem_sel_shift) * (-avm_mem_mem_sel + FF(1))); + auto tmp = (((-main_first + FF(1)) * mem_mem_sel_shift) * (-mem_mem_sel + FF(1))); tmp *= scaling_factor; std::get<14>(evals) += tmp; } @@ -250,7 +249,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(15); - auto tmp = (avm_main_first * avm_mem_mem_sel); + auto tmp = (main_first * mem_mem_sel); tmp *= scaling_factor; std::get<15>(evals) += tmp; } @@ -258,7 +257,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(16); - auto tmp = (((-avm_mem_last + FF(1)) * avm_mem_mem_sel) * (-avm_mem_mem_sel_shift + FF(1))); + auto tmp = (((-mem_last + FF(1)) * mem_mem_sel) * (-mem_mem_sel_shift + FF(1))); tmp *= scaling_factor; std::get<16>(evals) += tmp; } @@ -266,7 +265,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(17); - auto tmp = (avm_mem_rng_chk_sel - (avm_mem_mem_sel * (-avm_mem_last + FF(1)))); + auto tmp = (mem_rng_chk_sel - (mem_mem_sel * (-mem_last + FF(1)))); tmp *= scaling_factor; std::get<17>(evals) += tmp; } @@ -275,14 +274,12 @@ template class avm_memImpl { Avm_DECLARE_VIEWS(18); auto tmp = - (avm_mem_tsp - - ((avm_mem_clk * FF(12)) + - (avm_mem_mem_sel * - ((((avm_mem_ind_op_b + avm_mem_op_b) + ((avm_mem_ind_op_c + avm_mem_op_c) * FF(2))) + - ((avm_mem_ind_op_d + avm_mem_op_d) * FF(3))) + - (((-(((avm_mem_ind_op_a + avm_mem_ind_op_b) + avm_mem_ind_op_c) + avm_mem_ind_op_d) + FF(1)) + - avm_mem_rw) * - FF(4)))))); + (mem_tsp - + ((mem_clk * FF(12)) + + (mem_mem_sel * + ((((mem_ind_op_b + mem_op_b) + ((mem_ind_op_c + mem_op_c) * FF(2))) + + ((mem_ind_op_d + mem_op_d) * FF(3))) + + (((-(((mem_ind_op_a + mem_ind_op_b) + mem_ind_op_c) + mem_ind_op_d) + FF(1)) + mem_rw) * FF(4)))))); tmp *= scaling_factor; std::get<18>(evals) += tmp; } @@ -290,7 +287,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(19); - auto tmp = (avm_mem_glob_addr - ((avm_mem_space_id * FF(4294967296UL)) + avm_mem_addr)); + auto tmp = (mem_glob_addr - ((mem_space_id * FF(4294967296UL)) + mem_addr)); tmp *= scaling_factor; std::get<19>(evals) += tmp; } @@ -298,7 +295,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(20); - auto tmp = (avm_main_first * (-avm_mem_lastAccess + FF(1))); + auto tmp = (main_first * (-mem_lastAccess + FF(1))); tmp *= scaling_factor; std::get<20>(evals) += tmp; } @@ -306,7 +303,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(21); - auto tmp = ((-avm_mem_lastAccess + FF(1)) * (avm_mem_glob_addr_shift - avm_mem_glob_addr)); + auto tmp = ((-mem_lastAccess + FF(1)) * (mem_glob_addr_shift - mem_glob_addr)); tmp *= scaling_factor; std::get<21>(evals) += tmp; } @@ -314,11 +311,11 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(22); - auto tmp = (avm_mem_rng_chk_sel * (((((avm_mem_lastAccess * (avm_mem_glob_addr_shift - avm_mem_glob_addr)) + - ((-avm_mem_lastAccess + FF(1)) * (avm_mem_tsp_shift - avm_mem_tsp))) - - (avm_mem_diff_hi * FF(4294967296UL))) - - (avm_mem_diff_mid * FF(65536))) - - avm_mem_diff_lo)); + auto tmp = (mem_rng_chk_sel * (((((mem_lastAccess * (mem_glob_addr_shift - mem_glob_addr)) + + ((-mem_lastAccess + FF(1)) * (mem_tsp_shift - mem_tsp))) - + (mem_diff_hi * FF(4294967296UL))) - + (mem_diff_mid * FF(65536))) - + mem_diff_lo)); tmp *= scaling_factor; std::get<22>(evals) += tmp; } @@ -326,8 +323,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(23); - auto tmp = - (((-avm_mem_lastAccess + FF(1)) * (-avm_mem_rw_shift + FF(1))) * (avm_mem_val_shift - avm_mem_val)); + auto tmp = (((-mem_lastAccess + FF(1)) * (-mem_rw_shift + FF(1))) * (mem_val_shift - mem_val)); tmp *= scaling_factor; std::get<23>(evals) += tmp; } @@ -335,8 +331,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(24); - auto tmp = - (((-avm_mem_lastAccess + FF(1)) * (-avm_mem_rw_shift + FF(1))) * (avm_mem_tag_shift - avm_mem_tag)); + auto tmp = (((-mem_lastAccess + FF(1)) * (-mem_rw_shift + FF(1))) * (mem_tag_shift - mem_tag)); tmp *= scaling_factor; std::get<24>(evals) += tmp; } @@ -344,7 +339,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(25); - auto tmp = ((avm_mem_lastAccess * (-avm_mem_rw_shift + FF(1))) * avm_mem_val_shift); + auto tmp = ((mem_lastAccess * (-mem_rw_shift + FF(1))) * mem_val_shift); tmp *= scaling_factor; std::get<25>(evals) += tmp; } @@ -352,9 +347,8 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(26); - auto tmp = (avm_mem_skip_check_tag - - (avm_mem_sel_cmov * ((avm_mem_op_d + (avm_mem_op_a * (-avm_mem_sel_mov_a + FF(1)))) + - (avm_mem_op_b * (-avm_mem_sel_mov_b + FF(1)))))); + auto tmp = (mem_skip_check_tag - (mem_sel_cmov * ((mem_op_d + (mem_op_a * (-mem_sel_mov_a + FF(1)))) + + (mem_op_b * (-mem_sel_mov_b + FF(1)))))); tmp *= scaling_factor; std::get<26>(evals) += tmp; } @@ -362,8 +356,8 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(27); - auto tmp = (((-avm_mem_skip_check_tag + FF(1)) * (-avm_mem_rw + FF(1))) * - (((avm_mem_r_in_tag - avm_mem_tag) * (-avm_mem_one_min_inv + FF(1))) - avm_mem_tag_err)); + auto tmp = (((-mem_skip_check_tag + FF(1)) * (-mem_rw + FF(1))) * + (((mem_r_in_tag - mem_tag) * (-mem_one_min_inv + FF(1))) - mem_tag_err)); tmp *= scaling_factor; std::get<27>(evals) += tmp; } @@ -371,7 +365,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(28); - auto tmp = ((-avm_mem_tag_err + FF(1)) * avm_mem_one_min_inv); + auto tmp = ((-mem_tag_err + FF(1)) * mem_one_min_inv); tmp *= scaling_factor; std::get<28>(evals) += tmp; } @@ -379,7 +373,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(29); - auto tmp = ((avm_mem_skip_check_tag + avm_mem_rw) * avm_mem_tag_err); + auto tmp = ((mem_skip_check_tag + mem_rw) * mem_tag_err); tmp *= scaling_factor; std::get<29>(evals) += tmp; } @@ -387,7 +381,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(30); - auto tmp = (avm_mem_rw * (avm_mem_w_in_tag - avm_mem_tag)); + auto tmp = (mem_rw * (mem_w_in_tag - mem_tag)); tmp *= scaling_factor; std::get<30>(evals) += tmp; } @@ -395,7 +389,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(31); - auto tmp = (avm_mem_rw * avm_mem_tag_err); + auto tmp = (mem_rw * mem_tag_err); tmp *= scaling_factor; std::get<31>(evals) += tmp; } @@ -403,7 +397,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(32); - auto tmp = (avm_mem_ind_op_a * (avm_mem_r_in_tag - FF(3))); + auto tmp = (mem_ind_op_a * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<32>(evals) += tmp; } @@ -411,7 +405,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(33); - auto tmp = (avm_mem_ind_op_b * (avm_mem_r_in_tag - FF(3))); + auto tmp = (mem_ind_op_b * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<33>(evals) += tmp; } @@ -419,7 +413,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(34); - auto tmp = (avm_mem_ind_op_c * (avm_mem_r_in_tag - FF(3))); + auto tmp = (mem_ind_op_c * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<34>(evals) += tmp; } @@ -427,7 +421,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(35); - auto tmp = (avm_mem_ind_op_d * (avm_mem_r_in_tag - FF(3))); + auto tmp = (mem_ind_op_d * (mem_r_in_tag - FF(3))); tmp *= scaling_factor; std::get<35>(evals) += tmp; } @@ -435,7 +429,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(36); - auto tmp = (avm_mem_ind_op_a * avm_mem_rw); + auto tmp = (mem_ind_op_a * mem_rw); tmp *= scaling_factor; std::get<36>(evals) += tmp; } @@ -443,7 +437,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(37); - auto tmp = (avm_mem_ind_op_b * avm_mem_rw); + auto tmp = (mem_ind_op_b * mem_rw); tmp *= scaling_factor; std::get<37>(evals) += tmp; } @@ -451,7 +445,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(38); - auto tmp = (avm_mem_ind_op_c * avm_mem_rw); + auto tmp = (mem_ind_op_c * mem_rw); tmp *= scaling_factor; std::get<38>(evals) += tmp; } @@ -459,7 +453,7 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(39); - auto tmp = (avm_mem_ind_op_d * avm_mem_rw); + auto tmp = (mem_ind_op_d * mem_rw); tmp *= scaling_factor; std::get<39>(evals) += tmp; } @@ -467,13 +461,13 @@ template class avm_memImpl { { Avm_DECLARE_VIEWS(40); - auto tmp = ((avm_mem_sel_mov_a + avm_mem_sel_mov_b) * avm_mem_tag_err); + auto tmp = ((mem_sel_mov_a + mem_sel_mov_b) * mem_tag_err); tmp *= scaling_factor; std::get<40>(evals) += tmp; } } }; -template using avm_mem = Relation>; +template using mem = Relation>; } // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_poseidon2.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/pedersen.hpp similarity index 70% rename from barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_poseidon2.hpp rename to barretenberg/cpp/src/barretenberg/relations/generated/avm/pedersen.hpp index 807e1d50341..e50a9f0a87f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_poseidon2.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/pedersen.hpp @@ -6,19 +6,19 @@ namespace bb::Avm_vm { -template struct Avm_poseidon2Row { - FF avm_poseidon2_poseidon_perm_sel{}; +template struct PedersenRow { + FF pedersen_pedersen_sel{}; [[maybe_unused]] static std::vector names(); }; -inline std::string get_relation_label_avm_poseidon2(int index) +inline std::string get_relation_label_pedersen(int index) { switch (index) {} return std::to_string(index); } -template class avm_poseidon2Impl { +template class pedersenImpl { public: using FF = FF_; @@ -37,13 +37,13 @@ template class avm_poseidon2Impl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_poseidon2_poseidon_perm_sel * (-avm_poseidon2_poseidon_perm_sel + FF(1))); + auto tmp = (pedersen_pedersen_sel * (-pedersen_pedersen_sel + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } } }; -template using avm_poseidon2 = Relation>; +template using pedersen = Relation>; } // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp index 83506a187ff..56eea2340b2 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_alu.hpp @@ -23,7 +23,7 @@ class perm_main_alu_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_alu_sel == 1 || in.avm_alu_alu_sel == 1); + return (in.main_alu_sel == 1 || in.alu_alu_sel == 1); } /** @@ -47,41 +47,41 @@ class perm_main_alu_permutation_settings { { return std::forward_as_tuple(in.perm_main_alu, - in.avm_main_alu_sel, - in.avm_main_alu_sel, - in.avm_alu_alu_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ib, - in.avm_main_ic, - in.avm_main_sel_op_add, - in.avm_main_sel_op_sub, - in.avm_main_sel_op_mul, - in.avm_main_sel_op_div, - in.avm_main_sel_op_eq, - in.avm_main_sel_op_not, - in.avm_main_sel_op_cast, - in.avm_main_sel_op_lt, - in.avm_main_sel_op_lte, - in.avm_main_sel_op_shr, - in.avm_main_sel_op_shl, - in.avm_main_alu_in_tag, - in.avm_alu_clk, - in.avm_alu_ia, - in.avm_alu_ib, - in.avm_alu_ic, - in.avm_alu_op_add, - in.avm_alu_op_sub, - in.avm_alu_op_mul, - in.avm_alu_op_div, - in.avm_alu_op_eq, - in.avm_alu_op_not, - in.avm_alu_op_cast, - in.avm_alu_op_lt, - in.avm_alu_op_lte, - in.avm_alu_op_shr, - in.avm_alu_op_shl, - in.avm_alu_in_tag); + in.main_alu_sel, + in.main_alu_sel, + in.alu_alu_sel, + in.main_clk, + in.main_ia, + in.main_ib, + in.main_ic, + in.main_sel_op_add, + in.main_sel_op_sub, + in.main_sel_op_mul, + in.main_sel_op_div, + in.main_sel_op_eq, + in.main_sel_op_not, + in.main_sel_op_cast, + in.main_sel_op_lt, + in.main_sel_op_lte, + in.main_sel_op_shr, + in.main_sel_op_shl, + in.main_alu_in_tag, + in.alu_clk, + in.alu_ia, + in.alu_ib, + in.alu_ic, + in.alu_op_add, + in.alu_op_sub, + in.alu_op_mul, + in.alu_op_div, + in.alu_op_eq, + in.alu_op_not, + in.alu_op_cast, + in.alu_op_lt, + in.alu_op_lte, + in.alu_op_shr, + in.alu_op_shl, + in.alu_in_tag); } /** @@ -105,41 +105,41 @@ class perm_main_alu_permutation_settings { { return std::forward_as_tuple(in.perm_main_alu, - in.avm_main_alu_sel, - in.avm_main_alu_sel, - in.avm_alu_alu_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ib, - in.avm_main_ic, - in.avm_main_sel_op_add, - in.avm_main_sel_op_sub, - in.avm_main_sel_op_mul, - in.avm_main_sel_op_div, - in.avm_main_sel_op_eq, - in.avm_main_sel_op_not, - in.avm_main_sel_op_cast, - in.avm_main_sel_op_lt, - in.avm_main_sel_op_lte, - in.avm_main_sel_op_shr, - in.avm_main_sel_op_shl, - in.avm_main_alu_in_tag, - in.avm_alu_clk, - in.avm_alu_ia, - in.avm_alu_ib, - in.avm_alu_ic, - in.avm_alu_op_add, - in.avm_alu_op_sub, - in.avm_alu_op_mul, - in.avm_alu_op_div, - in.avm_alu_op_eq, - in.avm_alu_op_not, - in.avm_alu_op_cast, - in.avm_alu_op_lt, - in.avm_alu_op_lte, - in.avm_alu_op_shr, - in.avm_alu_op_shl, - in.avm_alu_in_tag); + in.main_alu_sel, + in.main_alu_sel, + in.alu_alu_sel, + in.main_clk, + in.main_ia, + in.main_ib, + in.main_ic, + in.main_sel_op_add, + in.main_sel_op_sub, + in.main_sel_op_mul, + in.main_sel_op_div, + in.main_sel_op_eq, + in.main_sel_op_not, + in.main_sel_op_cast, + in.main_sel_op_lt, + in.main_sel_op_lte, + in.main_sel_op_shr, + in.main_sel_op_shl, + in.main_alu_in_tag, + in.alu_clk, + in.alu_ia, + in.alu_ib, + in.alu_ic, + in.alu_op_add, + in.alu_op_sub, + in.alu_op_mul, + in.alu_op_div, + in.alu_op_eq, + in.alu_op_not, + in.alu_op_cast, + in.alu_op_lt, + in.alu_op_lte, + in.alu_op_shr, + in.alu_op_shl, + in.alu_in_tag); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp index 0e3533051d1..55974efbadf 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_bin.hpp @@ -23,7 +23,7 @@ class perm_main_bin_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_bin_sel == 1 || in.avm_binary_start == 1); + return (in.main_bin_sel == 1 || in.binary_start == 1); } /** @@ -47,21 +47,21 @@ class perm_main_bin_permutation_settings { { return std::forward_as_tuple(in.perm_main_bin, - in.avm_main_bin_sel, - in.avm_main_bin_sel, - in.avm_binary_start, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ib, - in.avm_main_ic, - in.avm_main_bin_op_id, - in.avm_main_r_in_tag, - in.avm_binary_clk, - in.avm_binary_acc_ia, - in.avm_binary_acc_ib, - in.avm_binary_acc_ic, - in.avm_binary_op_id, - in.avm_binary_in_tag); + in.main_bin_sel, + in.main_bin_sel, + in.binary_start, + in.main_clk, + in.main_ia, + in.main_ib, + in.main_ic, + in.main_bin_op_id, + in.main_r_in_tag, + in.binary_clk, + in.binary_acc_ia, + in.binary_acc_ib, + in.binary_acc_ic, + in.binary_op_id, + in.binary_in_tag); } /** @@ -85,21 +85,21 @@ class perm_main_bin_permutation_settings { { return std::forward_as_tuple(in.perm_main_bin, - in.avm_main_bin_sel, - in.avm_main_bin_sel, - in.avm_binary_start, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ib, - in.avm_main_ic, - in.avm_main_bin_op_id, - in.avm_main_r_in_tag, - in.avm_binary_clk, - in.avm_binary_acc_ia, - in.avm_binary_acc_ib, - in.avm_binary_acc_ic, - in.avm_binary_op_id, - in.avm_binary_in_tag); + in.main_bin_sel, + in.main_bin_sel, + in.binary_start, + in.main_clk, + in.main_ia, + in.main_ib, + in.main_ic, + in.main_bin_op_id, + in.main_r_in_tag, + in.binary_clk, + in.binary_acc_ia, + in.binary_acc_ib, + in.binary_acc_ic, + in.binary_op_id, + in.binary_in_tag); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp index 2d7ac39f44e..fd66c691f4a 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_conv.hpp @@ -23,7 +23,7 @@ class perm_main_conv_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_sel_op_radix_le == 1 || in.avm_conversion_to_radix_le_sel == 1); + return (in.main_sel_op_radix_le == 1 || in.conversion_to_radix_le_sel == 1); } /** @@ -47,17 +47,17 @@ class perm_main_conv_permutation_settings { { return std::forward_as_tuple(in.perm_main_conv, - in.avm_main_sel_op_radix_le, - in.avm_main_sel_op_radix_le, - in.avm_conversion_to_radix_le_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ic, - in.avm_main_id, - in.avm_conversion_clk, - in.avm_conversion_input, - in.avm_conversion_radix, - in.avm_conversion_num_limbs); + in.main_sel_op_radix_le, + in.main_sel_op_radix_le, + in.conversion_to_radix_le_sel, + in.main_clk, + in.main_ia, + in.main_ic, + in.main_id, + in.conversion_clk, + in.conversion_input, + in.conversion_radix, + in.conversion_num_limbs); } /** @@ -81,17 +81,17 @@ class perm_main_conv_permutation_settings { { return std::forward_as_tuple(in.perm_main_conv, - in.avm_main_sel_op_radix_le, - in.avm_main_sel_op_radix_le, - in.avm_conversion_to_radix_le_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ic, - in.avm_main_id, - in.avm_conversion_clk, - in.avm_conversion_input, - in.avm_conversion_radix, - in.avm_conversion_num_limbs); + in.main_sel_op_radix_le, + in.main_sel_op_radix_le, + in.conversion_to_radix_le_sel, + in.main_clk, + in.main_ia, + in.main_ic, + in.main_id, + in.conversion_clk, + in.conversion_input, + in.conversion_radix, + in.conversion_num_limbs); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp index d7647bcc463..5d5d3b423ec 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_a.hpp @@ -23,7 +23,7 @@ class perm_main_mem_a_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_mem_op_a == 1 || in.avm_mem_op_a == 1); + return (in.main_mem_op_a == 1 || in.mem_op_a == 1); } /** @@ -47,27 +47,27 @@ class perm_main_mem_a_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_a, - in.avm_main_mem_op_a, - in.avm_main_mem_op_a, - in.avm_mem_op_a, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_a, - in.avm_main_ia, - in.avm_main_rwa, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_main_sel_mov_a, - in.avm_main_sel_cmov, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag, - in.avm_mem_sel_mov_a, - in.avm_mem_sel_cmov); + in.main_mem_op_a, + in.main_mem_op_a, + in.mem_op_a, + in.main_clk, + in.main_space_id, + in.main_mem_idx_a, + in.main_ia, + in.main_rwa, + in.main_r_in_tag, + in.main_w_in_tag, + in.main_sel_mov_a, + in.main_sel_cmov, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag, + in.mem_sel_mov_a, + in.mem_sel_cmov); } /** @@ -91,27 +91,27 @@ class perm_main_mem_a_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_a, - in.avm_main_mem_op_a, - in.avm_main_mem_op_a, - in.avm_mem_op_a, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_a, - in.avm_main_ia, - in.avm_main_rwa, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_main_sel_mov_a, - in.avm_main_sel_cmov, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag, - in.avm_mem_sel_mov_a, - in.avm_mem_sel_cmov); + in.main_mem_op_a, + in.main_mem_op_a, + in.mem_op_a, + in.main_clk, + in.main_space_id, + in.main_mem_idx_a, + in.main_ia, + in.main_rwa, + in.main_r_in_tag, + in.main_w_in_tag, + in.main_sel_mov_a, + in.main_sel_cmov, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag, + in.mem_sel_mov_a, + in.mem_sel_cmov); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp index 7d873de8722..da9f4ac02a9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_b.hpp @@ -23,7 +23,7 @@ class perm_main_mem_b_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_mem_op_b == 1 || in.avm_mem_op_b == 1); + return (in.main_mem_op_b == 1 || in.mem_op_b == 1); } /** @@ -47,27 +47,27 @@ class perm_main_mem_b_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_b, - in.avm_main_mem_op_b, - in.avm_main_mem_op_b, - in.avm_mem_op_b, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_b, - in.avm_main_ib, - in.avm_main_rwb, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_main_sel_mov_b, - in.avm_main_sel_cmov, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag, - in.avm_mem_sel_mov_b, - in.avm_mem_sel_cmov); + in.main_mem_op_b, + in.main_mem_op_b, + in.mem_op_b, + in.main_clk, + in.main_space_id, + in.main_mem_idx_b, + in.main_ib, + in.main_rwb, + in.main_r_in_tag, + in.main_w_in_tag, + in.main_sel_mov_b, + in.main_sel_cmov, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag, + in.mem_sel_mov_b, + in.mem_sel_cmov); } /** @@ -91,27 +91,27 @@ class perm_main_mem_b_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_b, - in.avm_main_mem_op_b, - in.avm_main_mem_op_b, - in.avm_mem_op_b, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_b, - in.avm_main_ib, - in.avm_main_rwb, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_main_sel_mov_b, - in.avm_main_sel_cmov, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag, - in.avm_mem_sel_mov_b, - in.avm_mem_sel_cmov); + in.main_mem_op_b, + in.main_mem_op_b, + in.mem_op_b, + in.main_clk, + in.main_space_id, + in.main_mem_idx_b, + in.main_ib, + in.main_rwb, + in.main_r_in_tag, + in.main_w_in_tag, + in.main_sel_mov_b, + in.main_sel_cmov, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag, + in.mem_sel_mov_b, + in.mem_sel_cmov); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp index 64919b1ca3d..814dae9a4f2 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_c.hpp @@ -23,7 +23,7 @@ class perm_main_mem_c_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_mem_op_c == 1 || in.avm_mem_op_c == 1); + return (in.main_mem_op_c == 1 || in.mem_op_c == 1); } /** @@ -47,23 +47,23 @@ class perm_main_mem_c_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_c, - in.avm_main_mem_op_c, - in.avm_main_mem_op_c, - in.avm_mem_op_c, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_c, - in.avm_main_ic, - in.avm_main_rwc, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag); + in.main_mem_op_c, + in.main_mem_op_c, + in.mem_op_c, + in.main_clk, + in.main_space_id, + in.main_mem_idx_c, + in.main_ic, + in.main_rwc, + in.main_r_in_tag, + in.main_w_in_tag, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag); } /** @@ -87,23 +87,23 @@ class perm_main_mem_c_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_c, - in.avm_main_mem_op_c, - in.avm_main_mem_op_c, - in.avm_mem_op_c, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_c, - in.avm_main_ic, - in.avm_main_rwc, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag); + in.main_mem_op_c, + in.main_mem_op_c, + in.mem_op_c, + in.main_clk, + in.main_space_id, + in.main_mem_idx_c, + in.main_ic, + in.main_rwc, + in.main_r_in_tag, + in.main_w_in_tag, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp index b6f64c60a27..308d47089e9 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_d.hpp @@ -23,7 +23,7 @@ class perm_main_mem_d_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_mem_op_d == 1 || in.avm_mem_op_d == 1); + return (in.main_mem_op_d == 1 || in.mem_op_d == 1); } /** @@ -47,25 +47,25 @@ class perm_main_mem_d_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_d, - in.avm_main_mem_op_d, - in.avm_main_mem_op_d, - in.avm_mem_op_d, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_d, - in.avm_main_id, - in.avm_main_rwd, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_main_sel_cmov, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag, - in.avm_mem_sel_cmov); + in.main_mem_op_d, + in.main_mem_op_d, + in.mem_op_d, + in.main_clk, + in.main_space_id, + in.main_mem_idx_d, + in.main_id, + in.main_rwd, + in.main_r_in_tag, + in.main_w_in_tag, + in.main_sel_cmov, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag, + in.mem_sel_cmov); } /** @@ -89,25 +89,25 @@ class perm_main_mem_d_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_d, - in.avm_main_mem_op_d, - in.avm_main_mem_op_d, - in.avm_mem_op_d, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_mem_idx_d, - in.avm_main_id, - in.avm_main_rwd, - in.avm_main_r_in_tag, - in.avm_main_w_in_tag, - in.avm_main_sel_cmov, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val, - in.avm_mem_rw, - in.avm_mem_r_in_tag, - in.avm_mem_w_in_tag, - in.avm_mem_sel_cmov); + in.main_mem_op_d, + in.main_mem_op_d, + in.mem_op_d, + in.main_clk, + in.main_space_id, + in.main_mem_idx_d, + in.main_id, + in.main_rwd, + in.main_r_in_tag, + in.main_w_in_tag, + in.main_sel_cmov, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val, + in.mem_rw, + in.mem_r_in_tag, + in.mem_w_in_tag, + in.mem_sel_cmov); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp index fde1c682370..9b6a52ff11f 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_a.hpp @@ -23,7 +23,7 @@ class perm_main_mem_ind_a_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_ind_op_a == 1 || in.avm_mem_ind_op_a == 1); + return (in.main_ind_op_a == 1 || in.mem_ind_op_a == 1); } /** @@ -47,17 +47,17 @@ class perm_main_mem_ind_a_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_a, - in.avm_main_ind_op_a, - in.avm_main_ind_op_a, - in.avm_mem_ind_op_a, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_a, - in.avm_main_mem_idx_a, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_a, + in.main_ind_op_a, + in.mem_ind_op_a, + in.main_clk, + in.main_space_id, + in.main_ind_a, + in.main_mem_idx_a, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } /** @@ -81,17 +81,17 @@ class perm_main_mem_ind_a_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_a, - in.avm_main_ind_op_a, - in.avm_main_ind_op_a, - in.avm_mem_ind_op_a, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_a, - in.avm_main_mem_idx_a, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_a, + in.main_ind_op_a, + in.mem_ind_op_a, + in.main_clk, + in.main_space_id, + in.main_ind_a, + in.main_mem_idx_a, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp index 0fb572b5302..72ab0700455 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_b.hpp @@ -23,7 +23,7 @@ class perm_main_mem_ind_b_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_ind_op_b == 1 || in.avm_mem_ind_op_b == 1); + return (in.main_ind_op_b == 1 || in.mem_ind_op_b == 1); } /** @@ -47,17 +47,17 @@ class perm_main_mem_ind_b_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_b, - in.avm_main_ind_op_b, - in.avm_main_ind_op_b, - in.avm_mem_ind_op_b, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_b, - in.avm_main_mem_idx_b, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_b, + in.main_ind_op_b, + in.mem_ind_op_b, + in.main_clk, + in.main_space_id, + in.main_ind_b, + in.main_mem_idx_b, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } /** @@ -81,17 +81,17 @@ class perm_main_mem_ind_b_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_b, - in.avm_main_ind_op_b, - in.avm_main_ind_op_b, - in.avm_mem_ind_op_b, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_b, - in.avm_main_mem_idx_b, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_b, + in.main_ind_op_b, + in.mem_ind_op_b, + in.main_clk, + in.main_space_id, + in.main_ind_b, + in.main_mem_idx_b, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp index 98676a0d8b3..b9ecdd5c592 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_c.hpp @@ -23,7 +23,7 @@ class perm_main_mem_ind_c_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_ind_op_c == 1 || in.avm_mem_ind_op_c == 1); + return (in.main_ind_op_c == 1 || in.mem_ind_op_c == 1); } /** @@ -47,17 +47,17 @@ class perm_main_mem_ind_c_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_c, - in.avm_main_ind_op_c, - in.avm_main_ind_op_c, - in.avm_mem_ind_op_c, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_c, - in.avm_main_mem_idx_c, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_c, + in.main_ind_op_c, + in.mem_ind_op_c, + in.main_clk, + in.main_space_id, + in.main_ind_c, + in.main_mem_idx_c, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } /** @@ -81,17 +81,17 @@ class perm_main_mem_ind_c_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_c, - in.avm_main_ind_op_c, - in.avm_main_ind_op_c, - in.avm_mem_ind_op_c, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_c, - in.avm_main_mem_idx_c, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_c, + in.main_ind_op_c, + in.mem_ind_op_c, + in.main_clk, + in.main_space_id, + in.main_ind_c, + in.main_mem_idx_c, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_d.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_d.hpp index c66b01e035a..75e73cf25fd 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_d.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_mem_ind_d.hpp @@ -23,7 +23,7 @@ class perm_main_mem_ind_d_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_ind_op_d == 1 || in.avm_mem_ind_op_d == 1); + return (in.main_ind_op_d == 1 || in.mem_ind_op_d == 1); } /** @@ -47,17 +47,17 @@ class perm_main_mem_ind_d_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_d, - in.avm_main_ind_op_d, - in.avm_main_ind_op_d, - in.avm_mem_ind_op_d, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_d, - in.avm_main_mem_idx_d, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_d, + in.main_ind_op_d, + in.mem_ind_op_d, + in.main_clk, + in.main_space_id, + in.main_ind_d, + in.main_mem_idx_d, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } /** @@ -81,17 +81,17 @@ class perm_main_mem_ind_d_permutation_settings { { return std::forward_as_tuple(in.perm_main_mem_ind_d, - in.avm_main_ind_op_d, - in.avm_main_ind_op_d, - in.avm_mem_ind_op_d, - in.avm_main_clk, - in.avm_main_space_id, - in.avm_main_ind_d, - in.avm_main_mem_idx_d, - in.avm_mem_clk, - in.avm_mem_space_id, - in.avm_mem_addr, - in.avm_mem_val); + in.main_ind_op_d, + in.main_ind_op_d, + in.mem_ind_op_d, + in.main_clk, + in.main_space_id, + in.main_ind_d, + in.main_mem_idx_d, + in.mem_clk, + in.mem_space_id, + in.mem_addr, + in.mem_val); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp index 75d4809336f..0370064020b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pedersen.hpp @@ -23,7 +23,7 @@ class perm_main_pedersen_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_sel_op_pedersen == 1 || in.avm_pedersen_pedersen_sel == 1); + return (in.main_sel_op_pedersen == 1 || in.pedersen_pedersen_sel == 1); } /** @@ -47,13 +47,13 @@ class perm_main_pedersen_permutation_settings { { return std::forward_as_tuple(in.perm_main_pedersen, - in.avm_main_sel_op_pedersen, - in.avm_main_sel_op_pedersen, - in.avm_pedersen_pedersen_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_pedersen_clk, - in.avm_pedersen_input); + in.main_sel_op_pedersen, + in.main_sel_op_pedersen, + in.pedersen_pedersen_sel, + in.main_clk, + in.main_ia, + in.pedersen_clk, + in.pedersen_input); } /** @@ -77,13 +77,13 @@ class perm_main_pedersen_permutation_settings { { return std::forward_as_tuple(in.perm_main_pedersen, - in.avm_main_sel_op_pedersen, - in.avm_main_sel_op_pedersen, - in.avm_pedersen_pedersen_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_pedersen_clk, - in.avm_pedersen_input); + in.main_sel_op_pedersen, + in.main_sel_op_pedersen, + in.pedersen_pedersen_sel, + in.main_clk, + in.main_ia, + in.pedersen_clk, + in.pedersen_input); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp index e75d3658eca..3ff0cf467e2 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp @@ -23,7 +23,7 @@ class perm_main_pos2_perm_permutation_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_sel_op_poseidon2 == 1 || in.avm_poseidon2_poseidon_perm_sel == 1); + return (in.main_sel_op_poseidon2 == 1 || in.poseidon2_poseidon_perm_sel == 1); } /** @@ -47,15 +47,15 @@ class perm_main_pos2_perm_permutation_settings { { return std::forward_as_tuple(in.perm_main_pos2_perm, - in.avm_main_sel_op_poseidon2, - in.avm_main_sel_op_poseidon2, - in.avm_poseidon2_poseidon_perm_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ib, - in.avm_poseidon2_clk, - in.avm_poseidon2_input, - in.avm_poseidon2_output); + in.main_sel_op_poseidon2, + in.main_sel_op_poseidon2, + in.poseidon2_poseidon_perm_sel, + in.main_clk, + in.main_ia, + in.main_ib, + in.poseidon2_clk, + in.poseidon2_input, + in.poseidon2_output); } /** @@ -79,15 +79,15 @@ class perm_main_pos2_perm_permutation_settings { { return std::forward_as_tuple(in.perm_main_pos2_perm, - in.avm_main_sel_op_poseidon2, - in.avm_main_sel_op_poseidon2, - in.avm_poseidon2_poseidon_perm_sel, - in.avm_main_clk, - in.avm_main_ia, - in.avm_main_ib, - in.avm_poseidon2_clk, - in.avm_poseidon2_input, - in.avm_poseidon2_output); + in.main_sel_op_poseidon2, + in.main_sel_op_poseidon2, + in.poseidon2_poseidon_perm_sel, + in.main_clk, + in.main_ia, + in.main_ib, + in.poseidon2_clk, + in.poseidon2_input, + in.poseidon2_output); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_conversion.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/poseidon2.hpp similarity index 70% rename from barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_conversion.hpp rename to barretenberg/cpp/src/barretenberg/relations/generated/avm/poseidon2.hpp index b269078f03b..53acb113223 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/avm_conversion.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/poseidon2.hpp @@ -6,19 +6,19 @@ namespace bb::Avm_vm { -template struct Avm_conversionRow { - FF avm_conversion_to_radix_le_sel{}; +template struct Poseidon2Row { + FF poseidon2_poseidon_perm_sel{}; [[maybe_unused]] static std::vector names(); }; -inline std::string get_relation_label_avm_conversion(int index) +inline std::string get_relation_label_poseidon2(int index) { switch (index) {} return std::to_string(index); } -template class avm_conversionImpl { +template class poseidon2Impl { public: using FF = FF_; @@ -37,13 +37,13 @@ template class avm_conversionImpl { { Avm_DECLARE_VIEWS(0); - auto tmp = (avm_conversion_to_radix_le_sel * (-avm_conversion_to_radix_le_sel + FF(1))); + auto tmp = (poseidon2_poseidon_perm_sel * (-poseidon2_poseidon_perm_sel + FF(1))); tmp *= scaling_factor; std::get<0>(evals) += tmp; } } }; -template using avm_conversion = Relation>; +template using poseidon2 = Relation>; } // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp index 6b68d3b90cb..8b888f37c33 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp @@ -87,7 +87,7 @@ class range_check_da_gas_hi_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_gas_cost_active == 1 || in.avm_main_sel_rng_16 == 1); + return (in.main_gas_cost_active == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class range_check_da_gas_hi_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_gas_cost_active); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.main_gas_cost_active); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class range_check_da_gas_hi_lookup_settings { return std::forward_as_tuple(in.range_check_da_gas_hi, in.range_check_da_gas_hi_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_da_rem_gas_hi, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_da_rem_gas_hi, + in.main_clk); } /** @@ -153,10 +153,10 @@ class range_check_da_gas_hi_lookup_settings { return std::forward_as_tuple(in.range_check_da_gas_hi, in.range_check_da_gas_hi_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_da_rem_gas_hi, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_da_rem_gas_hi, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp index 0ab6e798dac..6629b297c6b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp @@ -87,7 +87,7 @@ class range_check_da_gas_lo_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_gas_cost_active == 1 || in.avm_main_sel_rng_16 == 1); + return (in.main_gas_cost_active == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class range_check_da_gas_lo_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_gas_cost_active); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.main_gas_cost_active); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class range_check_da_gas_lo_lookup_settings { return std::forward_as_tuple(in.range_check_da_gas_lo, in.range_check_da_gas_lo_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_da_rem_gas_lo, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_da_rem_gas_lo, + in.main_clk); } /** @@ -153,10 +153,10 @@ class range_check_da_gas_lo_lookup_settings { return std::forward_as_tuple(in.range_check_da_gas_lo, in.range_check_da_gas_lo_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_da_rem_gas_lo, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_da_rem_gas_lo, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp index 913f0cec89e..6bc44b44371 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp @@ -87,7 +87,7 @@ class range_check_l2_gas_hi_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_gas_cost_active == 1 || in.avm_main_sel_rng_16 == 1); + return (in.main_gas_cost_active == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class range_check_l2_gas_hi_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_gas_cost_active); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.main_gas_cost_active); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class range_check_l2_gas_hi_lookup_settings { return std::forward_as_tuple(in.range_check_l2_gas_hi, in.range_check_l2_gas_hi_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_l2_rem_gas_hi, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_l2_rem_gas_hi, + in.main_clk); } /** @@ -153,10 +153,10 @@ class range_check_l2_gas_hi_lookup_settings { return std::forward_as_tuple(in.range_check_l2_gas_hi, in.range_check_l2_gas_hi_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_l2_rem_gas_hi, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_l2_rem_gas_hi, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp index 0b5ffedb068..79eb843b6b4 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp @@ -87,7 +87,7 @@ class range_check_l2_gas_lo_lookup_settings { template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { - return (in.avm_main_gas_cost_active == 1 || in.avm_main_sel_rng_16 == 1); + return (in.main_gas_cost_active == 1 || in.main_sel_rng_16 == 1); } /** @@ -104,8 +104,8 @@ class range_check_l2_gas_lo_lookup_settings { static inline auto compute_inverse_exists(const AllEntities& in) { using View = typename Accumulator::View; - const auto is_operation = View(in.avm_main_gas_cost_active); - const auto is_table_entry = View(in.avm_main_sel_rng_16); + const auto is_operation = View(in.main_gas_cost_active); + const auto is_table_entry = View(in.main_sel_rng_16); return (is_operation + is_table_entry - is_operation * is_table_entry); } @@ -135,10 +135,10 @@ class range_check_l2_gas_lo_lookup_settings { return std::forward_as_tuple(in.range_check_l2_gas_lo, in.range_check_l2_gas_lo_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_l2_rem_gas_lo, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_l2_rem_gas_lo, + in.main_clk); } /** @@ -153,10 +153,10 @@ class range_check_l2_gas_lo_lookup_settings { return std::forward_as_tuple(in.range_check_l2_gas_lo, in.range_check_l2_gas_lo_counts, - in.avm_main_gas_cost_active, - in.avm_main_sel_rng_16, - in.avm_main_abs_l2_rem_gas_lo, - in.avm_main_clk); + in.main_gas_cost_active, + in.main_sel_rng_16, + in.main_abs_l2_rem_gas_lo, + in.main_clk); } }; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/sha256.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/sha256.hpp new file mode 100644 index 00000000000..63a81bceb92 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/sha256.hpp @@ -0,0 +1,49 @@ + +#pragma once +#include "../../relation_parameters.hpp" +#include "../../relation_types.hpp" +#include "./declare_views.hpp" + +namespace bb::Avm_vm { + +template struct Sha256Row { + FF sha256_sha256_compression_sel{}; + + [[maybe_unused]] static std::vector names(); +}; + +inline std::string get_relation_label_sha256(int index) +{ + switch (index) {} + return std::to_string(index); +} + +template class sha256Impl { + public: + using FF = FF_; + + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ + 3, + }; + + template + void static accumulate(ContainerOverSubrelations& evals, + const AllEntities& new_term, + [[maybe_unused]] const RelationParameters&, + [[maybe_unused]] const FF& scaling_factor) + { + + // Contribution 0 + { + Avm_DECLARE_VIEWS(0); + + auto tmp = (sha256_sha256_compression_sel * (-sha256_sha256_compression_sel + FF(1))); + tmp *= scaling_factor; + std::get<0>(evals) += tmp; + } + } +}; + +template using sha256 = Relation>; + +} // namespace bb::Avm_vm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp index 13c74741223..21f9a569172 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_helper.cpp @@ -25,84 +25,84 @@ void log_avm_trace(std::vector const& trace, size_t beg, size_t end, bool e info("====================================================================================="); info("=======MEMORY TRACE=================================================================="); - info("m_addr: ", trace.at(i).avm_mem_addr); - info("m_clk: ", trace.at(i).avm_mem_clk); - info("m_tsp: ", trace.at(i).avm_mem_tsp); - info("m_sub_clk: ", uint32_t(trace.at(i).avm_mem_tsp) % AvmMemTraceBuilder::NUM_SUB_CLK); - info("m_val: ", trace.at(i).avm_mem_val); - info("m_rw: ", trace.at(i).avm_mem_rw); - info("m_tag: ", trace.at(i).avm_mem_tag); - info("r_in_tag: ", trace.at(i).avm_mem_r_in_tag); - info("w_in_tag: ", trace.at(i).avm_mem_w_in_tag); - info("m_tag_err: ", trace.at(i).avm_mem_tag_err); - info("m_one_min_inv: ", trace.at(i).avm_mem_one_min_inv); - - info("m_lastAccess: ", trace.at(i).avm_mem_lastAccess); - info("m_last: ", trace.at(i).avm_mem_last); - info("m_val_shift: ", trace.at(i).avm_mem_val_shift); + info("m_addr: ", trace.at(i).mem_addr); + info("m_clk: ", trace.at(i).mem_clk); + info("m_tsp: ", trace.at(i).mem_tsp); + info("m_sub_clk: ", uint32_t(trace.at(i).mem_tsp) % AvmMemTraceBuilder::NUM_SUB_CLK); + info("m_val: ", trace.at(i).mem_val); + info("m_rw: ", trace.at(i).mem_rw); + info("m_tag: ", trace.at(i).mem_tag); + info("r_in_tag: ", trace.at(i).mem_r_in_tag); + info("w_in_tag: ", trace.at(i).mem_w_in_tag); + info("m_tag_err: ", trace.at(i).mem_tag_err); + info("m_one_min_inv: ", trace.at(i).mem_one_min_inv); + + info("m_lastAccess: ", trace.at(i).mem_lastAccess); + info("m_last: ", trace.at(i).mem_last); + info("m_val_shift: ", trace.at(i).mem_val_shift); info("=======CONTROL_FLOW==================================================================="); - info("pc: ", trace.at(i).avm_main_pc); - info("internal_call: ", trace.at(i).avm_main_sel_internal_call); - info("internal_return: ", trace.at(i).avm_main_sel_internal_return); - info("internal_return_ptr:", trace.at(i).avm_main_internal_return_ptr); + info("pc: ", trace.at(i).main_pc); + info("internal_call: ", trace.at(i).main_sel_internal_call); + info("internal_return: ", trace.at(i).main_sel_internal_return); + info("internal_return_ptr:", trace.at(i).main_internal_return_ptr); info("=======ALU TRACE====================================================================="); - info("alu_clk ", trace.at(i).avm_alu_clk); - info("alu_ia ", trace.at(i).avm_alu_ia); - info("alu_ib ", trace.at(i).avm_alu_ib); - info("alu_ic ", trace.at(i).avm_alu_ic); + info("alu_clk ", trace.at(i).alu_clk); + info("alu_ia ", trace.at(i).alu_ia); + info("alu_ib ", trace.at(i).alu_ib); + info("alu_ic ", trace.at(i).alu_ic); info("=======MAIN TRACE===================================================================="); - info("clk: ", trace.at(i).avm_main_clk); - info("ia: ", trace.at(i).avm_main_ia); - info("ib: ", trace.at(i).avm_main_ib); - info("ic: ", trace.at(i).avm_main_ic); - info("r_in_tag ", trace.at(i).avm_main_r_in_tag); - info("w_in_tag ", trace.at(i).avm_main_w_in_tag); - info("tag_err ", trace.at(i).avm_main_tag_err); - info("first: ", trace.at(i).avm_main_first); - info("last: ", trace.at(i).avm_main_last); + info("clk: ", trace.at(i).main_clk); + info("ia: ", trace.at(i).main_ia); + info("ib: ", trace.at(i).main_ib); + info("ic: ", trace.at(i).main_ic); + info("r_in_tag ", trace.at(i).main_r_in_tag); + info("w_in_tag ", trace.at(i).main_w_in_tag); + info("tag_err ", trace.at(i).main_tag_err); + info("first: ", trace.at(i).main_first); + info("last: ", trace.at(i).main_last); info("=======MEM_OP_A======================================================================"); - info("mem_op_a: ", trace.at(i).avm_main_mem_op_a); - info("mem_idx_a: ", trace.at(i).avm_main_mem_idx_a); - info("rwa: ", trace.at(i).avm_main_rwa); + info("mem_op_a: ", trace.at(i).main_mem_op_a); + info("mem_idx_a: ", trace.at(i).main_mem_idx_a); + info("rwa: ", trace.at(i).main_rwa); info("=======MEM_OP_B======================================================================"); - info("mem_op_b: ", trace.at(i).avm_main_mem_op_b); - info("mem_idx_b: ", trace.at(i).avm_main_mem_idx_b); - info("rwb: ", trace.at(i).avm_main_rwb); + info("mem_op_b: ", trace.at(i).main_mem_op_b); + info("mem_idx_b: ", trace.at(i).main_mem_idx_b); + info("rwb: ", trace.at(i).main_rwb); info("=======MEM_OP_C======================================================================"); - info("mem_op_c: ", trace.at(i).avm_main_mem_op_c); - info("mem_idx_c: ", trace.at(i).avm_main_mem_idx_c); - info("rwc: ", trace.at(i).avm_main_rwc); - info("diff_hi: ", trace.at(i).avm_mem_diff_hi); - info("diff_mid: ", trace.at(i).avm_mem_diff_mid); - info("diff_lo: ", trace.at(i).avm_mem_diff_lo); + info("mem_op_c: ", trace.at(i).main_mem_op_c); + info("mem_idx_c: ", trace.at(i).main_mem_idx_c); + info("rwc: ", trace.at(i).main_rwc); + info("diff_hi: ", trace.at(i).mem_diff_hi); + info("diff_mid: ", trace.at(i).mem_diff_mid); + info("diff_lo: ", trace.at(i).mem_diff_lo); info("=======GAS ACCOUNTING================================================================"); - info("opcode active: ", trace.at(i).avm_main_gas_cost_active); - info("l2_gas_remaining: ", trace.at(i).avm_main_l2_gas_remaining); - info("da_gas_remaining: ", trace.at(i).avm_main_da_gas_remaining); - info("l2_gas_op: ", trace.at(i).avm_main_l2_gas_op); - info("da_gas_op: ", trace.at(i).avm_main_da_gas_op); - info("l2_out_of_gas: ", trace.at(i).avm_main_l2_out_of_gas); - info("da_out_of_gas: ", trace.at(i).avm_main_da_out_of_gas); - info("abs_l2_hi_rem_gas: ", trace.at(i).avm_main_abs_l2_rem_gas_hi); - info("abs_l2_lo_rem_gas: ", trace.at(i).avm_main_abs_l2_rem_gas_lo); - info("abs_da_hi_rem_gas: ", trace.at(i).avm_main_abs_da_rem_gas_hi); - info("abs_da_lo_rem_gas: ", trace.at(i).avm_main_abs_da_rem_gas_lo); + info("opcode active: ", trace.at(i).main_gas_cost_active); + info("l2_gas_remaining: ", trace.at(i).main_l2_gas_remaining); + info("da_gas_remaining: ", trace.at(i).main_da_gas_remaining); + info("l2_gas_op: ", trace.at(i).main_l2_gas_op); + info("da_gas_op: ", trace.at(i).main_da_gas_op); + info("l2_out_of_gas: ", trace.at(i).main_l2_out_of_gas); + info("da_out_of_gas: ", trace.at(i).main_da_out_of_gas); + info("abs_l2_hi_rem_gas: ", trace.at(i).main_abs_l2_rem_gas_hi); + info("abs_l2_lo_rem_gas: ", trace.at(i).main_abs_l2_rem_gas_lo); + info("abs_da_hi_rem_gas: ", trace.at(i).main_abs_da_rem_gas_hi); + info("abs_da_lo_rem_gas: ", trace.at(i).main_abs_da_rem_gas_lo); if (enable_selectors) { info("=======SELECTORS======================================================================"); - info("sel_op_add: ", trace.at(i).avm_main_sel_op_add); - info("sel_op_sub: ", trace.at(i).avm_main_sel_op_sub); - info("sel_op_mul: ", trace.at(i).avm_main_sel_op_mul); - info("sel_op_eq: ", trace.at(i).avm_main_sel_op_eq); - info("sel_op_not: ", trace.at(i).avm_main_sel_op_not); - info("sel_op_sel_alu: ", trace.at(i).avm_main_alu_sel); + info("sel_op_add: ", trace.at(i).main_sel_op_add); + info("sel_op_sub: ", trace.at(i).main_sel_op_sub); + info("sel_op_mul: ", trace.at(i).main_sel_op_mul); + info("sel_op_eq: ", trace.at(i).main_sel_op_eq); + info("sel_op_not: ", trace.at(i).main_sel_op_not); + info("sel_op_sel_alu: ", trace.at(i).main_alu_sel); } info("\n"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp index 4ee754de507..07a218358c5 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp @@ -152,31 +152,31 @@ void AvmTraceBuilder::op_add( gas_trace_builder.constrain_gas_lookup(clk, OpCode::ADD); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_add = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_add = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -220,31 +220,31 @@ void AvmTraceBuilder::op_sub( gas_trace_builder.constrain_gas_lookup(clk, OpCode::SUB); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_sub = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_sub = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -288,31 +288,31 @@ void AvmTraceBuilder::op_mul( gas_trace_builder.constrain_gas_lookup(clk, OpCode::MUL); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_mul = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_mul = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -365,32 +365,32 @@ void AvmTraceBuilder::op_fdiv(uint8_t indirect, uint32_t a_offset, uint32_t b_of gas_trace_builder.constrain_gas_lookup(clk, OpCode::FDIV); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = tag_match ? a : FF(0), - .avm_main_ib = tag_match ? b : FF(0), - .avm_main_ic = tag_match ? c : FF(0), - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_inv = tag_match ? inv : FF(1), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_op_err = tag_match ? error : FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_fdiv = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = tag_match ? a : FF(0), + .main_ib = tag_match ? b : FF(0), + .main_ic = tag_match ? c : FF(0), + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_inv = tag_match ? inv : FF(1), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_op_err = tag_match ? error : FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_rwc = FF(1), + .main_sel_op_fdiv = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); } @@ -445,26 +445,26 @@ void AvmTraceBuilder::op_not(uint8_t indirect, uint32_t a_offset, uint32_t dst_o gas_trace_builder.constrain_gas_lookup(clk, OpCode::NOT); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ic = c, - .avm_main_ind_a = indirect_a_flag ? FF(a_offset) : FF(0), - .avm_main_ind_c = indirect_c_flag ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_a_flag)), - .avm_main_ind_op_c = FF(static_cast(indirect_c_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_a_offset), - .avm_main_mem_idx_c = FF(direct_dst_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_not = FF(1), - .avm_main_tag_err = FF(static_cast(!read_a.tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ic = c, + .main_ind_a = indirect_a_flag ? FF(a_offset) : FF(0), + .main_ind_c = indirect_c_flag ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_a_flag)), + .main_ind_op_c = FF(static_cast(indirect_c_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_a_offset), + .main_mem_idx_c = FF(direct_dst_offset), + .main_mem_op_a = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_not = FF(1), + .main_tag_err = FF(static_cast(!read_a.tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -508,31 +508,31 @@ void AvmTraceBuilder::op_eq( gas_trace_builder.constrain_gas_lookup(clk, OpCode::EQ); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_eq = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_eq = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); } @@ -563,32 +563,32 @@ void AvmTraceBuilder::op_and( gas_trace_builder.constrain_gas_lookup(clk, OpCode::AND); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_bin_op_id = FF(0), - .avm_main_bin_sel = FF(1), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_and = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_bin_op_id = FF(0), + .main_bin_sel = FF(1), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_and = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -619,32 +619,32 @@ void AvmTraceBuilder::op_or( gas_trace_builder.constrain_gas_lookup(clk, OpCode::OR); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_bin_op_id = FF(1), - .avm_main_bin_sel = FF(1), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_or = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_bin_op_id = FF(1), + .main_bin_sel = FF(1), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_or = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -675,32 +675,32 @@ void AvmTraceBuilder::op_xor( gas_trace_builder.constrain_gas_lookup(clk, OpCode::XOR); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_bin_op_id = FF(2), - .avm_main_bin_sel = FF(1), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_xor = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_bin_op_id = FF(2), + .main_bin_sel = FF(1), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_xor = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -732,31 +732,31 @@ void AvmTraceBuilder::op_lt( gas_trace_builder.constrain_gas_lookup(clk, OpCode::LT); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_lt = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_lt = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); } @@ -788,31 +788,31 @@ void AvmTraceBuilder::op_lte( gas_trace_builder.constrain_gas_lookup(clk, OpCode::LTE); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_lte = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_lte = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); } @@ -844,31 +844,31 @@ void AvmTraceBuilder::op_shr( gas_trace_builder.constrain_gas_lookup(clk, OpCode::SHR); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_shr = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_shr = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -899,31 +899,31 @@ void AvmTraceBuilder::op_shl( gas_trace_builder.constrain_gas_lookup(clk, OpCode::SHL); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_shl = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_shl = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -963,19 +963,19 @@ void AvmTraceBuilder::op_set(uint8_t indirect, uint128_t val, uint32_t dst_offse gas_trace_builder.constrain_gas_lookup(clk, OpCode::SET); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ic = val_ff, - .avm_main_ind_c = indirect_dst_flag ? dst_offset : 0, - .avm_main_ind_op_c = static_cast(indirect_dst_flag), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_c = direct_dst_offset, - .avm_main_mem_op_activate_gas = 1, // TODO: remove in the long term - .avm_main_mem_op_c = 1, - .avm_main_pc = pc++, - .avm_main_rwc = 1, - .avm_main_tag_err = static_cast(!tag_match), - .avm_main_w_in_tag = static_cast(in_tag), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ic = val_ff, + .main_ind_c = indirect_dst_flag ? dst_offset : 0, + .main_ind_op_c = static_cast(indirect_dst_flag), + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_c = direct_dst_offset, + .main_mem_op_activate_gas = 1, // TODO: remove in the long term + .main_mem_op_c = 1, + .main_pc = pc++, + .main_rwc = 1, + .main_tag_err = static_cast(!tag_match), + .main_w_in_tag = static_cast(in_tag), }); } @@ -1021,26 +1021,26 @@ void AvmTraceBuilder::op_mov(uint8_t indirect, uint32_t src_offset, uint32_t dst gas_trace_builder.constrain_gas_lookup(clk, OpCode::MOV); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = val, - .avm_main_ic = val, - .avm_main_ind_a = indirect_src_flag ? src_offset : 0, - .avm_main_ind_c = indirect_dst_flag ? dst_offset : 0, - .avm_main_ind_op_a = static_cast(indirect_src_flag), - .avm_main_ind_op_c = static_cast(indirect_dst_flag), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_src_offset, - .avm_main_mem_idx_c = direct_dst_offset, - .avm_main_mem_op_a = 1, - .avm_main_mem_op_c = 1, - .avm_main_pc = pc++, - .avm_main_r_in_tag = static_cast(tag), - .avm_main_rwc = 1, - .avm_main_sel_mov = 1, - .avm_main_sel_mov_a = 1, - .avm_main_tag_err = static_cast(!tag_match), - .avm_main_w_in_tag = static_cast(tag), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = val, + .main_ic = val, + .main_ind_a = indirect_src_flag ? src_offset : 0, + .main_ind_c = indirect_dst_flag ? dst_offset : 0, + .main_ind_op_a = static_cast(indirect_src_flag), + .main_ind_op_c = static_cast(indirect_dst_flag), + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_src_offset, + .main_mem_idx_c = direct_dst_offset, + .main_mem_op_a = 1, + .main_mem_op_c = 1, + .main_pc = pc++, + .main_r_in_tag = static_cast(tag), + .main_rwc = 1, + .main_sel_mov = 1, + .main_sel_mov_a = 1, + .main_tag_err = static_cast(!tag_match), + .main_w_in_tag = static_cast(tag), }); } @@ -1121,39 +1121,39 @@ void AvmTraceBuilder::op_cmov( gas_trace_builder.constrain_gas_lookup(clk, OpCode::CMOV); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a_mem_entry.val, - .avm_main_ib = b_mem_entry.val, - .avm_main_ic = val, - .avm_main_id = cond_mem_entry.val, - .avm_main_id_zero = static_cast(id_zero), - .avm_main_ind_a = indirect_a_flag ? a_offset : 0, - .avm_main_ind_b = indirect_b_flag ? b_offset : 0, - .avm_main_ind_c = indirect_dst_flag ? dst_offset : 0, - .avm_main_ind_d = indirect_cond_flag ? cond_offset : 0, - .avm_main_ind_op_a = static_cast(indirect_a_flag), - .avm_main_ind_op_b = static_cast(indirect_b_flag), - .avm_main_ind_op_c = static_cast(indirect_dst_flag), - .avm_main_ind_op_d = static_cast(indirect_cond_flag), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_inv = inv, - .avm_main_mem_idx_a = direct_a_offset, - .avm_main_mem_idx_b = direct_b_offset, - .avm_main_mem_idx_c = direct_dst_offset, - .avm_main_mem_idx_d = direct_cond_offset, - .avm_main_mem_op_a = 1, - .avm_main_mem_op_b = 1, - .avm_main_mem_op_c = 1, - .avm_main_mem_op_d = 1, - .avm_main_pc = pc++, - .avm_main_r_in_tag = static_cast(tag), - .avm_main_rwc = 1, - .avm_main_sel_cmov = 1, - .avm_main_sel_mov_a = static_cast(!id_zero), - .avm_main_sel_mov_b = static_cast(id_zero), - .avm_main_tag_err = static_cast(!tag_match), - .avm_main_w_in_tag = static_cast(tag), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = a_mem_entry.val, + .main_ib = b_mem_entry.val, + .main_ic = val, + .main_id = cond_mem_entry.val, + .main_id_zero = static_cast(id_zero), + .main_ind_a = indirect_a_flag ? a_offset : 0, + .main_ind_b = indirect_b_flag ? b_offset : 0, + .main_ind_c = indirect_dst_flag ? dst_offset : 0, + .main_ind_d = indirect_cond_flag ? cond_offset : 0, + .main_ind_op_a = static_cast(indirect_a_flag), + .main_ind_op_b = static_cast(indirect_b_flag), + .main_ind_op_c = static_cast(indirect_dst_flag), + .main_ind_op_d = static_cast(indirect_cond_flag), + .main_internal_return_ptr = internal_return_ptr, + .main_inv = inv, + .main_mem_idx_a = direct_a_offset, + .main_mem_idx_b = direct_b_offset, + .main_mem_idx_c = direct_dst_offset, + .main_mem_idx_d = direct_cond_offset, + .main_mem_op_a = 1, + .main_mem_op_b = 1, + .main_mem_op_c = 1, + .main_mem_op_d = 1, + .main_pc = pc++, + .main_r_in_tag = static_cast(tag), + .main_rwc = 1, + .main_sel_cmov = 1, + .main_sel_mov_a = static_cast(!id_zero), + .main_sel_mov_b = static_cast(id_zero), + .main_tag_err = static_cast(!tag_match), + .main_w_in_tag = static_cast(tag), }); } @@ -1177,19 +1177,19 @@ Row AvmTraceBuilder::create_kernel_lookup_opcode( mem_trace_builder.write_into_memory(call_ptr, clk, IntermRegister::IA, direct_dst_offset, value, r_tag, w_tag); return Row{ - .avm_main_clk = clk, - .avm_kernel_kernel_in_offset = selector, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = value, - .avm_main_ind_a = indirect ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect)), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_dst_offset, - .avm_main_mem_op_a = 1, - .avm_main_pc = pc++, - .avm_main_q_kernel_lookup = 1, - .avm_main_rwa = 1, - .avm_main_w_in_tag = static_cast(w_tag), + .main_clk = clk, + .kernel_kernel_in_offset = selector, + .main_call_ptr = call_ptr, + .main_ia = value, + .main_ind_a = indirect ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect)), + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_dst_offset, + .main_mem_op_a = 1, + .main_pc = pc++, + .main_q_kernel_lookup = 1, + .main_rwa = 1, + .main_w_in_tag = static_cast(w_tag), }; } @@ -1200,10 +1200,10 @@ void AvmTraceBuilder::op_storage_address(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode( indirect_dst_flag, dst_offset, STORAGE_ADDRESS_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_storage_address = FF(1); + row.main_sel_op_storage_address = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::STORAGEADDRESS); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::STORAGEADDRESS); main_trace.push_back(row); } @@ -1214,10 +1214,10 @@ void AvmTraceBuilder::op_sender(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, SENDER_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_sender = FF(1); + row.main_sel_op_sender = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::SENDER); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::SENDER); main_trace.push_back(row); } @@ -1228,10 +1228,10 @@ void AvmTraceBuilder::op_address(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, ADDRESS_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_address = FF(1); + row.main_sel_op_address = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::ADDRESS); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::ADDRESS); main_trace.push_back(row); } @@ -1243,10 +1243,10 @@ void AvmTraceBuilder::op_fee_per_da_gas(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, FEE_PER_DA_GAS_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_fee_per_da_gas = FF(1); + row.main_sel_op_fee_per_da_gas = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::FEEPERDAGAS); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::FEEPERDAGAS); main_trace.push_back(row); } @@ -1258,10 +1258,10 @@ void AvmTraceBuilder::op_fee_per_l2_gas(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, FEE_PER_L2_GAS_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_fee_per_l2_gas = FF(1); + row.main_sel_op_fee_per_l2_gas = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::FEEPERL2GAS); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::FEEPERL2GAS); main_trace.push_back(row); } @@ -1273,10 +1273,10 @@ void AvmTraceBuilder::op_transaction_fee(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode( indirect_dst_flag, dst_offset, TRANSACTION_FEE_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_transaction_fee = FF(1); + row.main_sel_op_transaction_fee = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::TRANSACTIONFEE); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::TRANSACTIONFEE); main_trace.push_back(row); } @@ -1287,10 +1287,10 @@ void AvmTraceBuilder::op_chain_id(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, CHAIN_ID_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_chain_id = FF(1); + row.main_sel_op_chain_id = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::CHAINID); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::CHAINID); main_trace.push_back(row); } @@ -1301,10 +1301,10 @@ void AvmTraceBuilder::op_version(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, VERSION_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_version = FF(1); + row.main_sel_op_version = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::VERSION); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::VERSION); main_trace.push_back(row); } @@ -1316,10 +1316,10 @@ void AvmTraceBuilder::op_block_number(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, BLOCK_NUMBER_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_block_number = FF(1); + row.main_sel_op_block_number = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::BLOCKNUMBER); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::BLOCKNUMBER); main_trace.push_back(row); } @@ -1330,10 +1330,10 @@ void AvmTraceBuilder::op_coinbase(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, COINBASE_SELECTOR, ia_value, AvmMemoryTag::FF); - row.avm_main_sel_op_coinbase = FF(1); + row.main_sel_op_coinbase = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::COINBASE); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::COINBASE); main_trace.push_back(row); } @@ -1345,10 +1345,10 @@ void AvmTraceBuilder::op_timestamp(uint8_t indirect, uint32_t dst_offset) bool indirect_dst_flag = is_operand_indirect(indirect, 0); Row row = create_kernel_lookup_opcode(indirect_dst_flag, dst_offset, TIMESTAMP_SELECTOR, ia_value, AvmMemoryTag::U64); - row.avm_main_sel_op_timestamp = FF(1); + row.main_sel_op_timestamp = FF(1); // Constrain gas cost - gas_trace_builder.constrain_gas_lookup(static_cast(row.avm_main_clk), OpCode::TIMESTAMP); + gas_trace_builder.constrain_gas_lookup(static_cast(row.main_clk), OpCode::TIMESTAMP); main_trace.push_back(row); } @@ -1371,17 +1371,17 @@ Row AvmTraceBuilder::create_kernel_output_opcode(uint8_t indirect, uint32_t clk, call_ptr, clk, IntermRegister::IA, direct_data_offset, AvmMemoryTag::FF, AvmMemoryTag::U0); return Row{ - .avm_main_clk = clk, - .avm_main_ia = read_a.val, - .avm_main_ind_a = indirect_data_flag ? FF(data_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect)), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_data_offset, - .avm_main_mem_op_a = 1, - .avm_main_pc = pc++, - .avm_main_q_kernel_output_lookup = 1, - .avm_main_r_in_tag = static_cast(AvmMemoryTag::FF), - .avm_main_rwa = 0, + .main_clk = clk, + .main_ia = read_a.val, + .main_ind_a = indirect_data_flag ? FF(data_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect)), + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_data_offset, + .main_mem_op_a = 1, + .main_pc = pc++, + .main_q_kernel_output_lookup = 1, + .main_r_in_tag = static_cast(AvmMemoryTag::FF), + .main_rwa = 0, }; } @@ -1421,23 +1421,23 @@ Row AvmTraceBuilder::create_kernel_output_opcode_with_metadata(uint8_t indirect, call_ptr, clk, IntermRegister::IB, direct_metadata_offset, metadata_r_tag, AvmMemoryTag::U0); return Row{ - .avm_main_clk = clk, - .avm_main_ia = read_a.val, - .avm_main_ib = read_b.val, - .avm_main_ind_a = indirect_a_flag ? data_offset : FF(0), - .avm_main_ind_b = indirect_b_flag ? metadata_offset : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_a_flag)), - .avm_main_ind_op_b = FF(static_cast(indirect_b_flag)), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_data_offset, - .avm_main_mem_idx_b = direct_metadata_offset, - .avm_main_mem_op_a = 1, - .avm_main_mem_op_b = 1, - .avm_main_pc = pc++, - .avm_main_q_kernel_output_lookup = 1, - .avm_main_r_in_tag = static_cast(data_r_tag), - .avm_main_rwa = 0, - .avm_main_rwb = 0, + .main_clk = clk, + .main_ia = read_a.val, + .main_ib = read_b.val, + .main_ind_a = indirect_a_flag ? data_offset : FF(0), + .main_ind_b = indirect_b_flag ? metadata_offset : FF(0), + .main_ind_op_a = FF(static_cast(indirect_a_flag)), + .main_ind_op_b = FF(static_cast(indirect_b_flag)), + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_data_offset, + .main_mem_idx_b = direct_metadata_offset, + .main_mem_op_a = 1, + .main_mem_op_b = 1, + .main_pc = pc++, + .main_q_kernel_output_lookup = 1, + .main_r_in_tag = static_cast(data_r_tag), + .main_rwa = 0, + .main_rwb = 0, }; } @@ -1479,24 +1479,24 @@ Row AvmTraceBuilder::create_kernel_output_opcode_with_set_metadata_output_from_h call_ptr, clk, IntermRegister::IB, direct_metadata_offset, exists, AvmMemoryTag::FF, AvmMemoryTag::U8); return Row{ - .avm_main_clk = clk, - .avm_main_ia = read_a.val, - .avm_main_ib = exists, - .avm_main_ind_a = indirect_a_flag ? data_offset : FF(0), - .avm_main_ind_b = indirect_b_flag ? metadata_offset : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_a_flag)), - .avm_main_ind_op_b = FF(static_cast(indirect_b_flag)), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_data_offset, - .avm_main_mem_idx_b = direct_metadata_offset, - .avm_main_mem_op_a = 1, - .avm_main_mem_op_b = 1, - .avm_main_pc = pc++, - .avm_main_q_kernel_output_lookup = 1, - .avm_main_r_in_tag = static_cast(AvmMemoryTag::FF), - .avm_main_rwa = 0, - .avm_main_rwb = 1, - .avm_main_w_in_tag = static_cast(AvmMemoryTag::U8), + .main_clk = clk, + .main_ia = read_a.val, + .main_ib = exists, + .main_ind_a = indirect_a_flag ? data_offset : FF(0), + .main_ind_b = indirect_b_flag ? metadata_offset : FF(0), + .main_ind_op_a = FF(static_cast(indirect_a_flag)), + .main_ind_op_b = FF(static_cast(indirect_b_flag)), + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_data_offset, + .main_mem_idx_b = direct_metadata_offset, + .main_mem_op_a = 1, + .main_mem_op_b = 1, + .main_pc = pc++, + .main_q_kernel_output_lookup = 1, + .main_r_in_tag = static_cast(AvmMemoryTag::FF), + .main_rwa = 0, + .main_rwb = 1, + .main_w_in_tag = static_cast(AvmMemoryTag::U8), }; } @@ -1533,24 +1533,24 @@ Row AvmTraceBuilder::create_kernel_output_opcode_with_set_value_from_hint(uint8_ call_ptr, clk, IntermRegister::IB, direct_metadata_offset, AvmMemoryTag::FF, AvmMemoryTag::FF); return Row{ - .avm_main_clk = clk, - .avm_main_ia = value, - .avm_main_ib = read_b.val, - .avm_main_ind_a = indirect_a_flag ? data_offset : FF(0), - .avm_main_ind_b = indirect_b_flag ? metadata_offset : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_a_flag)), - .avm_main_ind_op_b = FF(static_cast(indirect_b_flag)), - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_data_offset, - .avm_main_mem_idx_b = direct_metadata_offset, - .avm_main_mem_op_a = 1, - .avm_main_mem_op_b = 1, - .avm_main_pc = pc, // No PC increment here since we do it in the specific ops - .avm_main_q_kernel_output_lookup = 1, - .avm_main_r_in_tag = static_cast(AvmMemoryTag::FF), - .avm_main_rwa = 1, - .avm_main_rwb = 0, - .avm_main_w_in_tag = static_cast(AvmMemoryTag::FF), + .main_clk = clk, + .main_ia = value, + .main_ib = read_b.val, + .main_ind_a = indirect_a_flag ? data_offset : FF(0), + .main_ind_b = indirect_b_flag ? metadata_offset : FF(0), + .main_ind_op_a = FF(static_cast(indirect_a_flag)), + .main_ind_op_b = FF(static_cast(indirect_b_flag)), + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_data_offset, + .main_mem_idx_b = direct_metadata_offset, + .main_mem_op_a = 1, + .main_mem_op_b = 1, + .main_pc = pc, // No PC increment here since we do it in the specific ops + .main_q_kernel_output_lookup = 1, + .main_r_in_tag = static_cast(AvmMemoryTag::FF), + .main_rwa = 1, + .main_rwb = 0, + .main_w_in_tag = static_cast(AvmMemoryTag::FF), }; } @@ -1559,8 +1559,8 @@ void AvmTraceBuilder::op_emit_note_hash(uint8_t indirect, uint32_t note_hash_off auto const clk = static_cast(main_trace.size()) + 1; Row row = create_kernel_output_opcode(indirect, clk, note_hash_offset); - kernel_trace_builder.op_emit_note_hash(clk, side_effect_counter, row.avm_main_ia); - row.avm_main_sel_op_emit_note_hash = FF(1); + kernel_trace_builder.op_emit_note_hash(clk, side_effect_counter, row.main_ia); + row.main_sel_op_emit_note_hash = FF(1); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::EMITNOTEHASH); @@ -1574,8 +1574,8 @@ void AvmTraceBuilder::op_emit_nullifier(uint8_t indirect, uint32_t nullifier_off auto const clk = static_cast(main_trace.size()) + 1; Row row = create_kernel_output_opcode(indirect, clk, nullifier_offset); - kernel_trace_builder.op_emit_nullifier(clk, side_effect_counter, row.avm_main_ia); - row.avm_main_sel_op_emit_nullifier = FF(1); + kernel_trace_builder.op_emit_nullifier(clk, side_effect_counter, row.main_ia); + row.main_sel_op_emit_nullifier = FF(1); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::EMITNULLIFIER); @@ -1591,8 +1591,8 @@ void AvmTraceBuilder::op_emit_l2_to_l1_msg(uint8_t indirect, uint32_t recipient_ // Note: unorthadox order - as seen in L2ToL1Message struct in TS Row row = create_kernel_output_opcode_with_metadata( indirect, clk, msg_offset, AvmMemoryTag::FF, recipient_offset, AvmMemoryTag::FF); - kernel_trace_builder.op_emit_l2_to_l1_msg(clk, side_effect_counter, row.avm_main_ia, row.avm_main_ib); - row.avm_main_sel_op_emit_l2_to_l1_msg = FF(1); + kernel_trace_builder.op_emit_l2_to_l1_msg(clk, side_effect_counter, row.main_ia, row.main_ib); + row.main_sel_op_emit_l2_to_l1_msg = FF(1); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::SENDL2TOL1MSG); @@ -1606,8 +1606,8 @@ void AvmTraceBuilder::op_emit_unencrypted_log(uint8_t indirect, uint32_t log_off auto const clk = static_cast(main_trace.size()) + 1; Row row = create_kernel_output_opcode(indirect, clk, log_offset); - kernel_trace_builder.op_emit_unencrypted_log(clk, side_effect_counter, row.avm_main_ia); - row.avm_main_sel_op_emit_unencrypted_log = FF(1); + kernel_trace_builder.op_emit_unencrypted_log(clk, side_effect_counter, row.main_ia); + row.main_sel_op_emit_unencrypted_log = FF(1); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::EMITUNENCRYPTEDLOG); @@ -1623,8 +1623,8 @@ void AvmTraceBuilder::op_l1_to_l2_msg_exists(uint8_t indirect, uint32_t log_offs Row row = create_kernel_output_opcode_with_set_metadata_output_from_hint(indirect, clk, log_offset, dest_offset); kernel_trace_builder.op_l1_to_l2_msg_exists( - clk, side_effect_counter, row.avm_main_ia, /*safe*/ static_cast(row.avm_main_ib)); - row.avm_main_sel_op_l1_to_l2_msg_exists = FF(1); + clk, side_effect_counter, row.main_ia, /*safe*/ static_cast(row.main_ib)); + row.main_sel_op_l1_to_l2_msg_exists = FF(1); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::L1TOL2MSGEXISTS); @@ -1639,8 +1639,8 @@ void AvmTraceBuilder::op_note_hash_exists(uint8_t indirect, uint32_t note_offset Row row = create_kernel_output_opcode_with_set_metadata_output_from_hint(indirect, clk, note_offset, dest_offset); kernel_trace_builder.op_note_hash_exists( - clk, side_effect_counter, row.avm_main_ia, /*safe*/ static_cast(row.avm_main_ib)); - row.avm_main_sel_op_note_hash_exists = FF(1); + clk, side_effect_counter, row.main_ia, /*safe*/ static_cast(row.main_ib)); + row.main_sel_op_note_hash_exists = FF(1); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::NOTEHASHEXISTS); @@ -1656,8 +1656,8 @@ void AvmTraceBuilder::op_nullifier_exists(uint8_t indirect, uint32_t nullifier_o Row row = create_kernel_output_opcode_with_set_metadata_output_from_hint(indirect, clk, nullifier_offset, dest_offset); kernel_trace_builder.op_nullifier_exists( - clk, side_effect_counter, row.avm_main_ia, /*safe*/ static_cast(row.avm_main_ib)); - row.avm_main_sel_op_nullifier_exists = FF(1); + clk, side_effect_counter, row.main_ia, /*safe*/ static_cast(row.main_ib)); + row.main_sel_op_nullifier_exists = FF(1); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::NULLIFIEREXISTS); @@ -1687,19 +1687,19 @@ void AvmTraceBuilder::op_sload(uint8_t indirect, uint32_t slot_offset, uint32_t call_ptr, clk, IntermRegister::IB, slot_offset, AvmMemoryTag::FF, AvmMemoryTag::FF); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = read_dest_value.val, - .avm_main_ib = read_slot.val, - .avm_main_ind_a = dest_offset_is_indirect ? dest_offset : 0, - .avm_main_ind_op_a = FF(static_cast(dest_offset_is_indirect)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_dest_offset), - .avm_main_mem_idx_b = FF(slot_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = pc, // No PC increment here since this is the same opcode as the rows created below - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = read_dest_value.val, + .main_ib = read_slot.val, + .main_ind_a = dest_offset_is_indirect ? dest_offset : 0, + .main_ind_op_a = FF(static_cast(dest_offset_is_indirect)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_dest_offset), + .main_mem_idx_b = FF(slot_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = pc, // No PC increment here since this is the same opcode as the rows created below + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); clk++; @@ -1710,22 +1710,22 @@ void AvmTraceBuilder::op_sload(uint8_t indirect, uint32_t slot_offset, uint32_t call_ptr, clk, IntermRegister::IA, direct_dest_offset + i, value, AvmMemoryTag::FF, AvmMemoryTag::FF); auto row = Row{ - .avm_main_clk = clk, - .avm_main_ia = value, - .avm_main_ib = read_slot.val + i, // slot increments each time - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_dest_offset + i, - .avm_main_mem_op_a = 1, - .avm_main_pc = pc, // No PC increment here since this is the same opcode for all loop iterations - .avm_main_q_kernel_output_lookup = 1, - .avm_main_r_in_tag = static_cast(AvmMemoryTag::FF), - .avm_main_rwa = 1, - .avm_main_sel_op_sload = FF(1), - .avm_main_w_in_tag = static_cast(AvmMemoryTag::FF), + .main_clk = clk, + .main_ia = value, + .main_ib = read_slot.val + i, // slot increments each time + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_dest_offset + i, + .main_mem_op_a = 1, + .main_pc = pc, // No PC increment here since this is the same opcode for all loop iterations + .main_q_kernel_output_lookup = 1, + .main_r_in_tag = static_cast(AvmMemoryTag::FF), + .main_rwa = 1, + .main_sel_op_sload = FF(1), + .main_w_in_tag = static_cast(AvmMemoryTag::FF), }; // Output storage read to kernel outputs (performs lookup) - kernel_trace_builder.op_sload(clk, side_effect_counter, row.avm_main_ib, row.avm_main_ia); + kernel_trace_builder.op_sload(clk, side_effect_counter, row.main_ib, row.main_ia); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::SLOAD); @@ -1759,19 +1759,19 @@ void AvmTraceBuilder::op_sstore(uint8_t indirect, uint32_t src_offset, uint32_t call_ptr, clk, IntermRegister::IB, slot_offset, AvmMemoryTag::FF, AvmMemoryTag::FF); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = read_src_value.val, - .avm_main_ib = read_slot.val, - .avm_main_ind_a = src_offset_is_indirect ? src_offset : 0, - .avm_main_ind_op_a = FF(static_cast(src_offset_is_indirect)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_src_offset), - .avm_main_mem_idx_b = FF(slot_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = pc, // No PC increment here since this is the same opcode as the rows created below - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = read_src_value.val, + .main_ib = read_slot.val, + .main_ind_a = src_offset_is_indirect ? src_offset : 0, + .main_ind_op_a = FF(static_cast(src_offset_is_indirect)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_src_offset), + .main_mem_idx_b = FF(slot_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = pc, // No PC increment here since this is the same opcode as the rows created below + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); clk++; @@ -1780,18 +1780,18 @@ void AvmTraceBuilder::op_sstore(uint8_t indirect, uint32_t src_offset, uint32_t call_ptr, clk, IntermRegister::IA, direct_src_offset + i, AvmMemoryTag::FF, AvmMemoryTag::U0); Row row = Row{ - .avm_main_clk = clk, - .avm_main_ia = read_a.val, - .avm_main_ib = read_slot.val + i, // slot increments each time - .avm_main_internal_return_ptr = internal_return_ptr, - .avm_main_mem_idx_a = direct_src_offset + i, - .avm_main_mem_op_a = 1, - .avm_main_pc = pc, - .avm_main_q_kernel_output_lookup = 1, - .avm_main_r_in_tag = static_cast(AvmMemoryTag::FF), + .main_clk = clk, + .main_ia = read_a.val, + .main_ib = read_slot.val + i, // slot increments each time + .main_internal_return_ptr = internal_return_ptr, + .main_mem_idx_a = direct_src_offset + i, + .main_mem_op_a = 1, + .main_pc = pc, + .main_q_kernel_output_lookup = 1, + .main_r_in_tag = static_cast(AvmMemoryTag::FF), }; - row.avm_main_sel_op_sstore = FF(1); - kernel_trace_builder.op_sstore(clk, side_effect_counter, row.avm_main_ib, row.avm_main_ia); + row.main_sel_op_sstore = FF(1); + kernel_trace_builder.op_sstore(clk, side_effect_counter, row.main_ib, row.main_ia); // Constrain gas cost gas_trace_builder.constrain_gas_lookup(clk, OpCode::SSTORE); @@ -1852,26 +1852,26 @@ void AvmTraceBuilder::op_cast(uint8_t indirect, uint32_t a_offset, uint32_t dst_ gas_trace_builder.constrain_gas_lookup(clk, OpCode::CAST); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(dst_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ic = c, - .avm_main_ind_a = indirect_a_flag ? FF(a_offset) : FF(0), - .avm_main_ind_c = indirect_dst_flag ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_a_flag)), - .avm_main_ind_op_c = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_a_offset), - .avm_main_mem_idx_c = FF(direct_dst_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(memEntry.tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_cast = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(dst_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(dst_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ic = c, + .main_ind_a = indirect_a_flag ? FF(a_offset) : FF(0), + .main_ind_c = indirect_dst_flag ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_a_flag)), + .main_ind_op_c = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_a_offset), + .main_mem_idx_c = FF(direct_dst_offset), + .main_mem_op_a = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(memEntry.tag)), + .main_rwc = FF(1), + .main_sel_op_cast = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(dst_tag)), }); } /** @@ -1927,33 +1927,33 @@ void AvmTraceBuilder::op_div( gas_trace_builder.constrain_gas_lookup(clk, OpCode::DIV); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_alu_in_tag = FF(static_cast(in_tag)), - .avm_main_call_ptr = call_ptr, - .avm_main_ia = a, - .avm_main_ib = b, - .avm_main_ic = c, - .avm_main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_inv = tag_match ? inv : FF(1), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_op_err = tag_match ? error : FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(in_tag)), - .avm_main_rwc = FF(1), - .avm_main_sel_op_div = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(in_tag)), + .main_clk = clk, + .main_alu_in_tag = FF(static_cast(in_tag)), + .main_call_ptr = call_ptr, + .main_ia = a, + .main_ib = b, + .main_ic = c, + .main_ind_a = res.indirect_flag_a ? FF(a_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(b_offset) : FF(0), + .main_ind_c = res.indirect_flag_c ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_inv = tag_match ? inv : FF(1), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_op_err = tag_match ? error : FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(in_tag)), + .main_rwc = FF(1), + .main_sel_op_div = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(in_tag)), }); } @@ -2049,28 +2049,28 @@ void AvmTraceBuilder::calldata_copy( } main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = ia, - .avm_main_ib = ib, - .avm_main_ic = ic, - .avm_main_ind_a = indirect_flag ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(mem_idx_a), - .avm_main_mem_idx_b = FF(mem_idx_b), - .avm_main_mem_idx_c = FF(mem_idx_c), - .avm_main_mem_op_a = FF(mem_op_a), - .avm_main_mem_op_activate_gas = FF(static_cast( + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = ia, + .main_ib = ib, + .main_ic = ic, + .main_ind_a = indirect_flag ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(mem_idx_a), + .main_mem_idx_b = FF(mem_idx_b), + .main_mem_idx_c = FF(mem_idx_c), + .main_mem_op_a = FF(mem_op_a), + .main_mem_op_activate_gas = FF(static_cast( pos == 0)), // TODO: remove in the long term. This activate gas only for the first row. - .avm_main_mem_op_b = FF(mem_op_b), - .avm_main_mem_op_c = FF(mem_op_c), - .avm_main_pc = FF(pc), - .avm_main_rwa = FF(rwa), - .avm_main_rwb = FF(rwb), - .avm_main_rwc = FF(rwc), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_mem_op_b = FF(mem_op_b), + .main_mem_op_c = FF(mem_op_c), + .main_pc = FF(pc), + .main_rwa = FF(rwa), + .main_rwb = FF(rwb), + .main_rwc = FF(rwc), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); if (copy_size - pos > 2) { // Guard to prevent overflow if copy_size is close to uint32_t maximum value. @@ -2184,27 +2184,27 @@ std::vector AvmTraceBuilder::return_op(uint8_t indirect, uint32_t ret_offset } main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = ia, - .avm_main_ib = ib, - .avm_main_ic = ic, - .avm_main_ind_a = indirect_flag ? FF(ret_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(mem_idx_a), - .avm_main_mem_idx_b = FF(mem_idx_b), - .avm_main_mem_idx_c = FF(mem_idx_c), - .avm_main_mem_op_a = FF(mem_op_a), - .avm_main_mem_op_activate_gas = FF(static_cast( + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = ia, + .main_ib = ib, + .main_ic = ic, + .main_ind_a = indirect_flag ? FF(ret_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(mem_idx_a), + .main_mem_idx_b = FF(mem_idx_b), + .main_mem_idx_c = FF(mem_idx_c), + .main_mem_op_a = FF(mem_op_a), + .main_mem_op_activate_gas = FF(static_cast( pos == 0)), // TODO: remove in the long term. This activate gas only for the first row. - .avm_main_mem_op_b = FF(mem_op_b), - .avm_main_mem_op_c = FF(mem_op_c), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_sel_halt = FF(1), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_mem_op_b = FF(mem_op_b), + .main_mem_op_c = FF(mem_op_c), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_sel_halt = FF(1), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); if (ret_size - pos > 2) { // Guard to prevent overflow if ret_size is close to uint32_t maximum value. @@ -2228,11 +2228,11 @@ void AvmTraceBuilder::halt() auto clk = main_trace.size() + 1; main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_pc = FF(pc), - .avm_main_sel_halt = FF(1), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_pc = FF(pc), + .main_sel_halt = FF(1), }); pc = UINT32_MAX; // This ensures that no subsequent opcode will be executed. @@ -2277,22 +2277,22 @@ void AvmTraceBuilder::execute_gasleft(OpCode opcode, uint8_t indirect, uint32_t AvmMemoryTag::FF); // TODO: probably will be U32 in final version main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = gas_remaining, - .avm_main_ind_a = indirect_dst_flag ? FF(dst_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_dst_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U0)), - .avm_main_rwa = FF(1), - .avm_main_sel_op_dagasleft = (opcode == OpCode::DAGASLEFT) ? FF(1) : FF(0), - .avm_main_sel_op_l2gasleft = (opcode == OpCode::L2GASLEFT) ? FF(1) : FF(0), - .avm_main_tag_err = FF(static_cast(!tag_match)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), // TODO: probably will be U32 in final version - // Should the circuit (pil) constrain U32? + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = gas_remaining, + .main_ind_a = indirect_dst_flag ? FF(dst_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_dst_offset), + .main_mem_op_a = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U0)), + .main_rwa = FF(1), + .main_sel_op_dagasleft = (opcode == OpCode::DAGASLEFT) ? FF(1) : FF(0), + .main_sel_op_l2gasleft = (opcode == OpCode::L2GASLEFT) ? FF(1) : FF(0), + .main_tag_err = FF(static_cast(!tag_match)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), // TODO: probably will be U32 in final version + // Should the circuit (pil) constrain U32? }); } @@ -2322,12 +2322,12 @@ void AvmTraceBuilder::jump(uint32_t jmp_dest) gas_trace_builder.constrain_gas_lookup(clk, OpCode::JUMP); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = FF(jmp_dest), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_pc = FF(pc), - .avm_main_sel_jump = FF(1), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = FF(jmp_dest), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_pc = FF(pc), + .main_sel_jump = FF(1), }); // Adjust parameters for the next row @@ -2371,22 +2371,22 @@ void AvmTraceBuilder::jumpi(uint8_t indirect, uint32_t jmp_dest, uint32_t cond_o gas_trace_builder.constrain_gas_lookup(clk, OpCode::JUMPI); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = FF(next_pc), - .avm_main_id = read_d.val, - .avm_main_id_zero = static_cast(id_zero), - .avm_main_ind_d = indirect_cond_flag ? cond_offset : 0, - .avm_main_ind_op_d = static_cast(indirect_cond_flag), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_inv = inv, - .avm_main_mem_idx_d = direct_cond_offset, - .avm_main_mem_op_d = 1, - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = static_cast(read_d.tag), - .avm_main_sel_jumpi = FF(1), - .avm_main_tag_err = static_cast(!tag_match), - .avm_main_w_in_tag = static_cast(read_d.tag), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = FF(next_pc), + .main_id = read_d.val, + .main_id_zero = static_cast(id_zero), + .main_ind_d = indirect_cond_flag ? cond_offset : 0, + .main_ind_op_d = static_cast(indirect_cond_flag), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_inv = inv, + .main_mem_idx_d = direct_cond_offset, + .main_mem_op_d = 1, + .main_pc = FF(pc), + .main_r_in_tag = static_cast(read_d.tag), + .main_sel_jumpi = FF(1), + .main_tag_err = static_cast(!tag_match), + .main_w_in_tag = static_cast(read_d.tag), }); // Adjust parameters for the next row @@ -2423,17 +2423,17 @@ void AvmTraceBuilder::internal_call(uint32_t jmp_dest) gas_trace_builder.constrain_gas_lookup(clk, OpCode::INTERNALCALL); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = FF(jmp_dest), - .avm_main_ib = FF(pc + 1), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_b = FF(internal_return_ptr), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_rwb = FF(1), - .avm_main_sel_internal_call = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = FF(jmp_dest), + .main_ib = FF(pc + 1), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_b = FF(internal_return_ptr), + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_rwb = FF(1), + .main_sel_internal_call = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); // Adjust parameters for the next row @@ -2465,17 +2465,17 @@ void AvmTraceBuilder::internal_return() gas_trace_builder.constrain_gas_lookup(clk, OpCode::INTERNALRETURN); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = read_a.val, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(internal_return_ptr - 1), - .avm_main_mem_op_a = FF(1), - .avm_main_pc = pc, - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_rwa = FF(0), - .avm_main_sel_internal_return = FF(1), - .avm_main_tag_err = FF(static_cast(!read_a.tag_match)), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = read_a.val, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(internal_return_ptr - 1), + .main_mem_op_a = FF(1), + .main_pc = pc, + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_rwa = FF(0), + .main_sel_internal_return = FF(1), + .main_tag_err = FF(static_cast(!read_a.tag_match)), }); pc = uint32_t(read_a.val); @@ -2498,11 +2498,11 @@ void AvmTraceBuilder::write_slice_to_memory(uint8_t space_id, static_cast(slice.size()) / 4 + static_cast(slice.size() % 4 != 0); for (uint32_t i = 0; i < num_main_rows; i++) { Row main_row{ - .avm_main_clk = clk + i, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(r_tag)), - .avm_main_w_in_tag = FF(static_cast(w_tag)), + .main_clk = clk + i, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(r_tag)), + .main_w_in_tag = FF(static_cast(w_tag)), }; // Write 4 values to memory in each_row for (uint32_t j = 0; j < 4; j++) { @@ -2515,25 +2515,25 @@ void AvmTraceBuilder::write_slice_to_memory(uint8_t space_id, space_id, clk + i, register_order[j], dst_offset + offset, slice.at(offset), r_tag, w_tag); // This looks a bit gross, but it is fine for now. if (j == 0) { - main_row.avm_main_ia = slice.at(offset); - main_row.avm_main_mem_idx_a = FF(dst_offset + offset); - main_row.avm_main_mem_op_a = FF(1); - main_row.avm_main_rwa = FF(1); + main_row.main_ia = slice.at(offset); + main_row.main_mem_idx_a = FF(dst_offset + offset); + main_row.main_mem_op_a = FF(1); + main_row.main_rwa = FF(1); } else if (j == 1) { - main_row.avm_main_ib = slice.at(offset); - main_row.avm_main_mem_idx_b = FF(dst_offset + offset); - main_row.avm_main_mem_op_b = FF(1); - main_row.avm_main_rwb = FF(1); + main_row.main_ib = slice.at(offset); + main_row.main_mem_idx_b = FF(dst_offset + offset); + main_row.main_mem_op_b = FF(1); + main_row.main_rwb = FF(1); } else if (j == 2) { - main_row.avm_main_ic = slice.at(offset); - main_row.avm_main_mem_idx_c = FF(dst_offset + offset); - main_row.avm_main_mem_op_c = FF(1); - main_row.avm_main_rwc = FF(1); + main_row.main_ic = slice.at(offset); + main_row.main_mem_idx_c = FF(dst_offset + offset); + main_row.main_mem_op_c = FF(1); + main_row.main_rwc = FF(1); } else { - main_row.avm_main_id = slice.at(offset); - main_row.avm_main_mem_idx_d = FF(dst_offset + offset); - main_row.avm_main_mem_op_d = FF(1); - main_row.avm_main_rwd = FF(1); + main_row.main_id = slice.at(offset); + main_row.main_mem_idx_d = FF(dst_offset + offset); + main_row.main_mem_op_d = FF(1); + main_row.main_rwd = FF(1); } } main_trace.emplace_back(main_row); @@ -2566,11 +2566,11 @@ uint32_t AvmTraceBuilder::read_slice_to_memory(uint8_t space_id, uint32_t const num_main_rows = static_cast(slice_len) / 4 + static_cast(slice_len % 4 != 0); for (uint32_t i = 0; i < num_main_rows; i++) { Row main_row{ - .avm_main_clk = clk + i, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(r_tag)), - .avm_main_w_in_tag = FF(static_cast(w_tag)), + .main_clk = clk + i, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(r_tag)), + .main_w_in_tag = FF(static_cast(w_tag)), }; // Write 4 values to memory in each_row for (uint32_t j = 0; j < 4; j++) { @@ -2584,25 +2584,25 @@ uint32_t AvmTraceBuilder::read_slice_to_memory(uint8_t space_id, slice.emplace_back(MEM(mem_read.val)); // This looks a bit gross, but it is fine for now. if (j == 0) { - main_row.avm_main_ia = slice.at(offset); - main_row.avm_main_mem_idx_a = FF(src_offset + offset); - main_row.avm_main_mem_op_a = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_ia = slice.at(offset); + main_row.main_mem_idx_a = FF(src_offset + offset); + main_row.main_mem_op_a = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } else if (j == 1) { - main_row.avm_main_ib = slice.at(offset); - main_row.avm_main_mem_idx_b = FF(src_offset + offset); - main_row.avm_main_mem_op_b = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_ib = slice.at(offset); + main_row.main_mem_idx_b = FF(src_offset + offset); + main_row.main_mem_op_b = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } else if (j == 2) { - main_row.avm_main_ic = slice.at(offset); - main_row.avm_main_mem_idx_c = FF(src_offset + offset); - main_row.avm_main_mem_op_c = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_ic = slice.at(offset); + main_row.main_mem_idx_c = FF(src_offset + offset); + main_row.main_mem_op_c = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } else { - main_row.avm_main_id = slice.at(offset); - main_row.avm_main_mem_idx_d = FF(src_offset + offset); - main_row.avm_main_mem_op_d = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_id = slice.at(offset); + main_row.main_mem_idx_d = FF(src_offset + offset); + main_row.main_mem_op_d = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } } main_trace.emplace_back(main_row); @@ -2668,24 +2668,24 @@ void AvmTraceBuilder::op_call([[maybe_unused]] uint8_t indirect, // We read the input and output addresses in one row as they should contain FF elements main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = first_row_values[0], /* gas_offset */ - .avm_main_ib = first_row_values[1], /* addr_offset */ - .avm_main_ic = first_row_values[2], /* args_offset */ - .avm_main_ind_a = gas_offset, - .avm_main_ind_c = args_offset, - .avm_main_ind_op_a = FF(1), - .avm_main_ind_op_c = FF(1), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = read_ind_gas_offset.val, - .avm_main_mem_idx_b = addr_offset, - .avm_main_mem_idx_c = read_ind_args_offset.val, - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_sel_external_call = FF(1), + .main_clk = clk, + .main_ia = first_row_values[0], /* gas_offset */ + .main_ib = first_row_values[1], /* addr_offset */ + .main_ic = first_row_values[2], /* args_offset */ + .main_ind_a = gas_offset, + .main_ind_c = args_offset, + .main_ind_op_a = FF(1), + .main_ind_op_c = FF(1), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = read_ind_gas_offset.val, + .main_mem_idx_b = addr_offset, + .main_mem_idx_c = read_ind_args_offset.val, + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_sel_external_call = FF(1), }); clk++; // Read the rest on a separate line, remember that the 4th operand is indirect @@ -2695,27 +2695,27 @@ void AvmTraceBuilder::op_call([[maybe_unused]] uint8_t indirect, auto mem_read_ret = mem_trace_builder.read_and_load_from_memory( call_ptr, clk, IntermRegister::IA, uint32_t(read_ind_ret_offset.val), AvmMemoryTag::FF, AvmMemoryTag::U0); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = mem_read_ret.val, /* ret_offset */ - .avm_main_ind_a = ret_offset, - .avm_main_ind_op_a = FF(1), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = read_ind_ret_offset.val, - .avm_main_mem_op_a = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = mem_read_ret.val, /* ret_offset */ + .main_ind_a = ret_offset, + .main_ind_op_a = FF(1), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = read_ind_ret_offset.val, + .main_mem_op_a = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); clk++; auto mem_read_success = mem_trace_builder.read_and_load_from_memory( call_ptr, clk, IntermRegister::IA, success_offset, AvmMemoryTag::U32, AvmMemoryTag::U0); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = mem_read_success.val, /* success_offset */ - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(success_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_clk = clk, + .main_ia = mem_read_success.val, /* success_offset */ + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(success_offset), + .main_mem_op_a = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); clk++; write_slice_to_memory(call_ptr, @@ -2764,22 +2764,22 @@ void AvmTraceBuilder::op_get_contract_instance(uint8_t indirect, uint32_t addres gas_trace_builder.constrain_gas_lookup(clk, OpCode::GETCONTRACTINSTANCE); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = read_address.val, - .avm_main_ib = read_dst.val, - .avm_main_ind_a = indirect_address_flag ? address_offset : 0, - .avm_main_ind_b = indirect_dst_flag ? dst_offset : 0, - .avm_main_ind_op_a = FF(static_cast(indirect_address_flag)), - .avm_main_ind_op_b = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_address_offset), - .avm_main_mem_idx_b = FF(direct_dst_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_activate_gas = FF(1), // TODO: remove in the long term - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_sel_op_get_contract_instance = FF(1), + .main_clk = clk, + .main_ia = read_address.val, + .main_ib = read_dst.val, + .main_ind_a = indirect_address_flag ? address_offset : 0, + .main_ind_b = indirect_dst_flag ? dst_offset : 0, + .main_ind_op_a = FF(static_cast(indirect_address_flag)), + .main_ind_op_b = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_address_offset), + .main_mem_idx_b = FF(direct_dst_offset), + .main_mem_op_a = FF(1), + .main_mem_op_activate_gas = FF(1), // TODO: remove in the long term + .main_mem_op_b = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_sel_op_get_contract_instance = FF(1), }); clk++; // Read the contract instance @@ -2856,25 +2856,25 @@ void AvmTraceBuilder::op_to_radix_le( // This is the row that contains the selector to trigger the sel_op_radix_le // In this row, we read the input value and the destination address into register A and B respectively main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_call_ptr = call_ptr, - .avm_main_ia = input, - .avm_main_ib = dst_addr, - .avm_main_ic = radix, - .avm_main_id = num_limbs, - .avm_main_ind_a = indirect_src_flag ? src_offset : 0, - .avm_main_ind_b = indirect_dst_flag ? dst_offset : 0, - .avm_main_ind_op_a = FF(static_cast(indirect_src_flag)), - .avm_main_ind_op_b = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_src_offset), - .avm_main_mem_idx_b = FF(direct_dst_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_sel_op_radix_le = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_call_ptr = call_ptr, + .main_ia = input, + .main_ib = dst_addr, + .main_ic = radix, + .main_id = num_limbs, + .main_ind_a = indirect_src_flag ? src_offset : 0, + .main_ind_b = indirect_dst_flag ? dst_offset : 0, + .main_ind_op_a = FF(static_cast(indirect_src_flag)), + .main_ind_op_b = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_src_offset), + .main_mem_idx_b = FF(direct_dst_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_sel_op_radix_le = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); // Increment the clock so we dont write at the same clock cycle // Instead we temporarily encode the writes into the subsequent rows of the main trace @@ -2932,27 +2932,27 @@ void AvmTraceBuilder::op_sha256_compression(uint8_t indirect, // Note: we could avoid output being zero if we loaded the input and state beforehand (with a new function that // did not lay down constraints), but this is a simplification main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = read_a.val, // First element of output (trivially 0) - .avm_main_ib = read_b.val, // First element of state - .avm_main_ic = read_c.val, // First element of input - .avm_main_ind_a = res.indirect_flag_a ? FF(h_init_offset) : FF(0), - .avm_main_ind_b = res.indirect_flag_b ? FF(input_offset) : FF(0), - .avm_main_ind_c = res.indirect_flag_a ? FF(output_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(res.indirect_flag_a)), - .avm_main_ind_op_b = FF(static_cast(res.indirect_flag_b)), - .avm_main_ind_op_c = FF(static_cast(res.indirect_flag_c)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(res.direct_a_offset), - .avm_main_mem_idx_b = FF(res.direct_b_offset), - .avm_main_mem_idx_c = FF(res.direct_c_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_sel_op_sha256 = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_clk = clk, + .main_ia = read_a.val, // First element of output (trivially 0) + .main_ib = read_b.val, // First element of state + .main_ic = read_c.val, // First element of input + .main_ind_a = res.indirect_flag_a ? FF(h_init_offset) : FF(0), + .main_ind_b = res.indirect_flag_b ? FF(input_offset) : FF(0), + .main_ind_c = res.indirect_flag_a ? FF(output_offset) : FF(0), + .main_ind_op_a = FF(static_cast(res.indirect_flag_a)), + .main_ind_op_b = FF(static_cast(res.indirect_flag_b)), + .main_ind_op_c = FF(static_cast(res.indirect_flag_c)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(res.direct_a_offset), + .main_mem_idx_b = FF(res.direct_b_offset), + .main_mem_idx_c = FF(res.direct_c_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_sel_op_sha256 = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); // We store the current clk this main trace row occurred so that we can line up the sha256 gadget operation at // the same clk later. @@ -3053,35 +3053,35 @@ void AvmTraceBuilder::op_sha256(uint8_t indirect, // Store the clock time that we will use to line up the gadget later auto sha256_op_clk = clk; main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = input_read.val, // First element of input - .avm_main_ic = output_read.val, // First element of output - .avm_main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), - .avm_main_ind_c = indirect_dst_flag ? FF(output_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_src_flag)), - .avm_main_ind_op_c = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_src_offset), // input - .avm_main_mem_idx_c = FF(direct_dst_offset), // output - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), - .avm_main_sel_op_sha256 = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_ia = input_read.val, // First element of input + .main_ic = output_read.val, // First element of output + .main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), + .main_ind_c = indirect_dst_flag ? FF(output_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_src_flag)), + .main_ind_op_c = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_src_offset), // input + .main_mem_idx_c = FF(direct_dst_offset), // output + .main_mem_op_a = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_sel_op_sha256 = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); clk++; auto input_length_read = mem_trace_builder.read_and_load_from_memory( call_ptr, clk, IntermRegister::IB, input_size_offset, AvmMemoryTag::U32, AvmMemoryTag::U32); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ib = input_length_read.val, // Message Length - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_b = FF(input_size_offset), // length - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_clk = clk, + .main_ib = input_length_read.val, // Message Length + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_b = FF(input_size_offset), // length + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); clk++; @@ -3096,11 +3096,11 @@ void AvmTraceBuilder::op_sha256(uint8_t indirect, static_cast(uint32_t(input_length_read.val) % 4 != 0); for (uint32_t i = 0; i < num_main_rows; i++) { Row main_row{ - .avm_main_clk = clk + i, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk + i, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }; // Write 4 values to memory in each_row for (uint32_t j = 0; j < 4; j++) { @@ -3114,25 +3114,25 @@ void AvmTraceBuilder::op_sha256(uint8_t indirect, input.emplace_back(uint8_t(mem_read.val)); // This looks a bit gross, but it is fine for now. if (j == 0) { - main_row.avm_main_ia = input.at(offset); - main_row.avm_main_mem_idx_a = FF(direct_src_offset + offset); - main_row.avm_main_mem_op_a = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_ia = input.at(offset); + main_row.main_mem_idx_a = FF(direct_src_offset + offset); + main_row.main_mem_op_a = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } else if (j == 1) { - main_row.avm_main_ib = input.at(offset); - main_row.avm_main_mem_idx_b = FF(direct_src_offset + offset); - main_row.avm_main_mem_op_b = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_ib = input.at(offset); + main_row.main_mem_idx_b = FF(direct_src_offset + offset); + main_row.main_mem_op_b = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } else if (j == 2) { - main_row.avm_main_ic = input.at(offset); - main_row.avm_main_mem_idx_c = FF(direct_src_offset + offset); - main_row.avm_main_mem_op_c = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_ic = input.at(offset); + main_row.main_mem_idx_c = FF(direct_src_offset + offset); + main_row.main_mem_op_c = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } else { - main_row.avm_main_id = input.at(offset); - main_row.avm_main_mem_idx_d = FF(direct_src_offset + offset); - main_row.avm_main_mem_op_d = FF(1); - main_row.avm_main_tag_err = FF(static_cast(!mem_read.tag_match)); + main_row.main_id = input.at(offset); + main_row.main_mem_idx_d = FF(direct_src_offset + offset); + main_row.main_mem_op_d = FF(1); + main_row.main_tag_err = FF(static_cast(!mem_read.tag_match)); } } main_trace.emplace_back(main_row); @@ -3197,22 +3197,22 @@ void AvmTraceBuilder::op_poseidon2_permutation(uint8_t indirect, uint32_t input_ gas_trace_builder.constrain_gas_lookup(clk, OpCode::POSEIDON2); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = read_a.val, // First element of input - .avm_main_ib = read_b.val, // First element of output (trivially zero) - .avm_main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), - .avm_main_ind_b = indirect_dst_flag ? FF(output_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_src_flag)), - .avm_main_ind_op_b = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_src_offset), - .avm_main_mem_idx_b = FF(direct_dst_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_sel_op_poseidon2 = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = read_a.val, // First element of input + .main_ib = read_b.val, // First element of output (trivially zero) + .main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), + .main_ind_b = indirect_dst_flag ? FF(output_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_src_flag)), + .main_ind_op_b = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_src_offset), + .main_mem_idx_b = FF(direct_dst_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_sel_op_poseidon2 = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); // We store the current clk this main trace row occurred so that we can line up the poseidon2 gadget operation // at the same clk later. @@ -3287,22 +3287,22 @@ void AvmTraceBuilder::op_keccakf1600(uint8_t indirect, gas_trace_builder.constrain_gas_lookup(clk, OpCode::KECCAKF1600); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = input_read.val, // First element of input - .avm_main_ic = output_read.val, // First element of output - .avm_main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), - .avm_main_ind_c = indirect_dst_flag ? FF(output_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_src_flag)), - .avm_main_ind_op_c = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_src_offset), // input - .avm_main_mem_idx_c = FF(direct_dst_offset), // output - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U64)), - .avm_main_sel_op_keccak = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U64)), + .main_clk = clk, + .main_ia = input_read.val, // First element of input + .main_ic = output_read.val, // First element of output + .main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), + .main_ind_c = indirect_dst_flag ? FF(output_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_src_flag)), + .main_ind_op_c = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_src_offset), // input + .main_mem_idx_c = FF(direct_dst_offset), // output + .main_mem_op_a = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U64)), + .main_sel_op_keccak = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U64)), }); // We store the current clk this main trace row occurred so that we can line up the keccak gadget operation // at the same clk later. @@ -3312,14 +3312,14 @@ void AvmTraceBuilder::op_keccakf1600(uint8_t indirect, auto input_length_read = mem_trace_builder.read_and_load_from_memory( call_ptr, clk, IntermRegister::IB, input_size_offset, AvmMemoryTag::U32, AvmMemoryTag::U32); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ib = input_length_read.val, // Message Length - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_b = FF(input_size_offset), // length - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_clk = clk, + .main_ib = input_length_read.val, // Message Length + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_b = FF(input_size_offset), // length + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); clk++; // Array input is fixed to 1600 bits @@ -3395,35 +3395,35 @@ void AvmTraceBuilder::op_keccak(uint8_t indirect, // Store the clock time that we will use to line up the gadget later auto keccak_op_clk = clk; main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = input_read.val, // First element of input - .avm_main_ic = output_read.val, // First element of output - .avm_main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), - .avm_main_ind_c = indirect_dst_flag ? FF(output_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_src_flag)), - .avm_main_ind_op_c = FF(static_cast(indirect_dst_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_src_offset), // input - .avm_main_mem_idx_c = FF(direct_dst_offset), // output - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), - .avm_main_sel_op_keccak = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_ia = input_read.val, // First element of input + .main_ic = output_read.val, // First element of output + .main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), + .main_ind_c = indirect_dst_flag ? FF(output_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_src_flag)), + .main_ind_op_c = FF(static_cast(indirect_dst_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_src_offset), // input + .main_mem_idx_c = FF(direct_dst_offset), // output + .main_mem_op_a = FF(1), + .main_mem_op_c = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_sel_op_keccak = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); clk++; auto input_length_read = mem_trace_builder.read_and_load_from_memory( call_ptr, clk, IntermRegister::IB, input_size_offset, AvmMemoryTag::U32, AvmMemoryTag::U32); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ib = input_length_read.val, // Message Length - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_b = FF(input_size_offset), // length - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_clk = clk, + .main_ib = input_length_read.val, // Message Length + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_b = FF(input_size_offset), // length + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); clk++; @@ -3480,17 +3480,17 @@ void AvmTraceBuilder::op_pedersen_hash(uint8_t indirect, uint32_t pedersen_clk = clk; // We read the input and output addresses in one row as they should contain FF elements main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = input_read.val, // First element of input - .avm_main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_src_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_src_offset), // input - .avm_main_mem_op_a = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_sel_op_pedersen = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = input_read.val, // First element of input + .main_ind_a = indirect_src_flag ? FF(input_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_src_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_src_offset), // input + .main_mem_op_a = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_sel_op_pedersen = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); clk++; // We read the input size and gen_ctx addresses in one row as they should contain U32 elements @@ -3499,17 +3499,17 @@ void AvmTraceBuilder::op_pedersen_hash(uint8_t indirect, auto gen_ctx_read = mem_trace_builder.read_and_load_from_memory( call_ptr, clk, IntermRegister::IB, gen_ctx_offset, AvmMemoryTag::U32, AvmMemoryTag::U32); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = input_size_read.val, - .avm_main_ib = gen_ctx_read.val, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(input_size_offset), - .avm_main_mem_idx_b = FF(gen_ctx_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_clk = clk, + .main_ia = input_size_read.val, + .main_ib = gen_ctx_read.val, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(input_size_offset), + .main_mem_idx_b = FF(gen_ctx_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U32)), }); clk++; @@ -3552,22 +3552,22 @@ void AvmTraceBuilder::op_ec_add(uint8_t indirect, // Save this clk time to line up with the gadget op. auto ecc_clk = clk; main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = lhs_x_read.val, - .avm_main_ib = lhs_y_read.val, - .avm_main_ic = rhs_x_read.val, - .avm_main_id = rhs_y_read.val, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(lhs_x_offset), - .avm_main_mem_idx_b = FF(lhs_y_offset), - .avm_main_mem_idx_c = FF(rhs_x_offset), - .avm_main_mem_idx_d = FF(rhs_y_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_mem_op_d = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = lhs_x_read.val, + .main_ib = lhs_y_read.val, + .main_ic = rhs_x_read.val, + .main_id = rhs_y_read.val, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(lhs_x_offset), + .main_mem_idx_b = FF(lhs_y_offset), + .main_mem_idx_c = FF(rhs_x_offset), + .main_mem_idx_d = FF(rhs_y_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_mem_op_d = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); clk++; // Load the infinite bools separately since they have a different memory tag @@ -3577,16 +3577,16 @@ void AvmTraceBuilder::op_ec_add(uint8_t indirect, call_ptr, clk, IntermRegister::IB, rhs_is_inf_offset, AvmMemoryTag::U8, AvmMemoryTag::U0); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = lhs_is_inf_read.val, - .avm_main_ib = rhs_is_inf_read.val, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(lhs_is_inf_offset), - .avm_main_mem_idx_b = FF(rhs_is_inf_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_ia = lhs_is_inf_read.val, + .main_ib = rhs_is_inf_read.val, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(lhs_is_inf_offset), + .main_mem_idx_b = FF(rhs_is_inf_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); clk++; grumpkin::g1::affine_element lhs = uint8_t(lhs_is_inf_read.val) == 1 @@ -3610,20 +3610,20 @@ void AvmTraceBuilder::op_ec_add(uint8_t indirect, mem_trace_builder.write_into_memory( call_ptr, clk, IntermRegister::IB, direct_output_offset + 1, result.y, AvmMemoryTag::U0, AvmMemoryTag::FF); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = result.x, - .avm_main_ib = result.y, - .avm_main_ind_a = indirect_flag_output ? FF(output_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_flag_output)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_output_offset), - .avm_main_mem_idx_b = FF(direct_output_offset + 1), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_rwa = FF(1), - .avm_main_rwb = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = result.x, + .main_ib = result.y, + .main_ind_a = indirect_flag_output ? FF(output_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_flag_output)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_output_offset), + .main_mem_idx_b = FF(direct_output_offset + 1), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_rwa = FF(1), + .main_rwb = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); clk++; write_slice_to_memory(call_ptr, @@ -3677,21 +3677,21 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, // In the refactor we will have the read_slice function handle indirects as well main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = read_points.val, - .avm_main_ib = read_scalars.val, - .avm_main_ind_a = indirect_points_flag ? FF(points_offset) : FF(0), - .avm_main_ind_b = indirect_scalars_flag ? FF(scalars_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_points_flag)), - .avm_main_ind_op_b = FF(static_cast(indirect_scalars_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_points_offset), - .avm_main_mem_idx_b = FF(direct_scalars_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc++), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_tag_err = FF(static_cast(!tag_match)), + .main_clk = clk, + .main_ia = read_points.val, + .main_ib = read_scalars.val, + .main_ind_a = indirect_points_flag ? FF(points_offset) : FF(0), + .main_ind_b = indirect_scalars_flag ? FF(scalars_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_points_flag)), + .main_ind_op_b = FF(static_cast(indirect_scalars_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_points_offset), + .main_mem_idx_b = FF(direct_scalars_offset), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = FF(pc++), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_tag_err = FF(static_cast(!tag_match)), }); clk++; @@ -3699,14 +3699,14 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, auto points_length_read = mem_trace_builder.read_and_load_from_memory( call_ptr, clk, IntermRegister::IA, point_length_offset, AvmMemoryTag::U32, AvmMemoryTag::U0); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = points_length_read.val, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(point_length_offset), - .avm_main_mem_op_a = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), - .avm_main_tag_err = FF(static_cast(!points_length_read.tag_match)), + .main_clk = clk, + .main_ia = points_length_read.val, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(point_length_offset), + .main_mem_op_a = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U32)), + .main_tag_err = FF(static_cast(!points_length_read.tag_match)), }); clk++; @@ -3737,23 +3737,23 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, points_coords_vec.insert(points_coords_vec.end(), { point_x1_read.val, point_y1_read.val, point_x2_read.val, point_y2_read.val }); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = point_x1_read.val, - .avm_main_ib = point_y1_read.val, - .avm_main_ic = point_x2_read.val, - .avm_main_id = point_y2_read.val, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_points_offset + i * 3), - .avm_main_mem_idx_b = FF(direct_points_offset + i * 3 + 1), - .avm_main_mem_idx_c = FF(direct_points_offset + (i + 1) * 3), - .avm_main_mem_idx_d = FF(direct_points_offset + (i + 1) * 3 + 1), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_mem_op_d = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), - .avm_main_tag_err = FF(static_cast(!tag_match)), + .main_clk = clk, + .main_ia = point_x1_read.val, + .main_ib = point_y1_read.val, + .main_ic = point_x2_read.val, + .main_id = point_y2_read.val, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_points_offset + i * 3), + .main_mem_idx_b = FF(direct_points_offset + i * 3 + 1), + .main_mem_idx_c = FF(direct_points_offset + (i + 1) * 3), + .main_mem_idx_d = FF(direct_points_offset + (i + 1) * 3 + 1), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_mem_op_d = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_tag_err = FF(static_cast(!tag_match)), }); clk++; } @@ -3782,23 +3782,23 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, bool tag_match = point_inf1_read.tag_match && point_inf2_read.tag_match && point_inf3_read.tag_match && point_inf4_read.tag_match; main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = point_inf1_read.val, - .avm_main_ib = point_inf2_read.val, - .avm_main_ic = point_inf3_read.val, - .avm_main_id = point_inf4_read.val, - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_points_offset + i * 3 + 2), - .avm_main_mem_idx_b = FF(direct_points_offset + (i + 1) * 3 + 2), - .avm_main_mem_idx_c = FF(direct_points_offset + (i + 2) * 3 + 2), - .avm_main_mem_idx_d = FF(direct_points_offset + (i + 3) * 3 + 2), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_mem_op_c = FF(1), - .avm_main_mem_op_d = FF(1), - .avm_main_pc = FF(pc), - .avm_main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), - .avm_main_tag_err = FF(static_cast(!tag_match)), + .main_clk = clk, + .main_ia = point_inf1_read.val, + .main_ib = point_inf2_read.val, + .main_ic = point_inf3_read.val, + .main_id = point_inf4_read.val, + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_points_offset + i * 3 + 2), + .main_mem_idx_b = FF(direct_points_offset + (i + 1) * 3 + 2), + .main_mem_idx_c = FF(direct_points_offset + (i + 2) * 3 + 2), + .main_mem_idx_d = FF(direct_points_offset + (i + 3) * 3 + 2), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_mem_op_c = FF(1), + .main_mem_op_d = FF(1), + .main_pc = FF(pc), + .main_r_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_tag_err = FF(static_cast(!tag_match)), }); clk++; } @@ -3848,20 +3848,20 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, mem_trace_builder.write_into_memory( call_ptr, clk, IntermRegister::IB, direct_output_offset + 1, result.y, AvmMemoryTag::U0, AvmMemoryTag::FF); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = result.x, - .avm_main_ib = result.y, - .avm_main_ind_a = indirect_output_flag ? FF(output_offset) : FF(0), - .avm_main_ind_op_a = FF(static_cast(indirect_output_flag)), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_output_offset), - .avm_main_mem_idx_b = FF(direct_output_offset + 1), - .avm_main_mem_op_a = FF(1), - .avm_main_mem_op_b = FF(1), - .avm_main_pc = FF(pc), - .avm_main_rwa = FF(1), - .avm_main_rwb = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), + .main_clk = clk, + .main_ia = result.x, + .main_ib = result.y, + .main_ind_a = indirect_output_flag ? FF(output_offset) : FF(0), + .main_ind_op_a = FF(static_cast(indirect_output_flag)), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_output_offset), + .main_mem_idx_b = FF(direct_output_offset + 1), + .main_mem_op_a = FF(1), + .main_mem_op_b = FF(1), + .main_pc = FF(pc), + .main_rwa = FF(1), + .main_rwb = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::FF)), }); clk++; // Write the infinity @@ -3873,14 +3873,14 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect, AvmMemoryTag::U0, AvmMemoryTag::U8); main_trace.push_back(Row{ - .avm_main_clk = clk, - .avm_main_ia = static_cast(result.is_point_at_infinity()), - .avm_main_internal_return_ptr = FF(internal_return_ptr), - .avm_main_mem_idx_a = FF(direct_output_offset + 2), - .avm_main_mem_op_a = FF(1), - .avm_main_pc = FF(pc), - .avm_main_rwa = FF(1), - .avm_main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), + .main_clk = clk, + .main_ia = static_cast(result.is_point_at_infinity()), + .main_internal_return_ptr = FF(internal_return_ptr), + .main_mem_idx_a = FF(direct_output_offset + 2), + .main_mem_op_a = FF(1), + .main_pc = FF(pc), + .main_rwa = FF(1), + .main_w_in_tag = FF(static_cast(AvmMemoryTag::U8)), }); } // Finalise Lookup Counts @@ -3919,21 +3919,21 @@ uint32_t finalize_bin_trace_lookup_for_testing(std::vector& main_trace, Avm } if (clk > (main_trace.size() - 1)) { main_trace.push_back(Row{ - .avm_main_clk = FF(clk), - .avm_byte_lookup_bin_sel = FF(1), - .avm_byte_lookup_table_input_a = a, - .avm_byte_lookup_table_input_b = b, - .avm_byte_lookup_table_op_id = op_id, - .avm_byte_lookup_table_output = bit_op, + .main_clk = FF(clk), + .byte_lookup_bin_sel = FF(1), + .byte_lookup_table_input_a = a, + .byte_lookup_table_input_b = b, + .byte_lookup_table_op_id = op_id, + .byte_lookup_table_output = bit_op, .lookup_byte_operations_counts = count, }); } else { main_trace.at(clk).lookup_byte_operations_counts = count; - main_trace.at(clk).avm_byte_lookup_bin_sel = FF(1); - main_trace.at(clk).avm_byte_lookup_table_op_id = op_id; - main_trace.at(clk).avm_byte_lookup_table_input_a = a; - main_trace.at(clk).avm_byte_lookup_table_input_b = b; - main_trace.at(clk).avm_byte_lookup_table_output = bit_op; + main_trace.at(clk).byte_lookup_bin_sel = FF(1); + main_trace.at(clk).byte_lookup_table_op_id = op_id; + main_trace.at(clk).byte_lookup_table_input_a = a; + main_trace.at(clk).byte_lookup_table_input_b = b; + main_trace.at(clk).byte_lookup_table_output = bit_op; } // Add the counter value stored throughout the execution } @@ -4009,7 +4009,7 @@ uint32_t finalize_rng_chks_for_testing( auto old_size = main_trace.size(); for (auto const& clk : custom_clk) { if (clk >= old_size) { - main_trace.push_back(Row{ .avm_main_clk = FF(clk) }); + main_trace.push_back(Row{ .main_clk = FF(clk) }); } } @@ -4070,16 +4070,16 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c main_trace_size = *trace_size; main_trace.resize(*trace_size, {}); - main_trace.at(*trace_size - 1).avm_main_last = FF(1); + main_trace.at(*trace_size - 1).main_last = FF(1); // Memory trace inclusion // We compute in the main loop the timestamp and global address for next row. // Perform initialization for index 0 outside of the loop provided that mem trace exists. if (mem_trace_size > 0) { - main_trace.at(0).avm_mem_tsp = + main_trace.at(0).mem_tsp = FF(AvmMemTraceBuilder::NUM_SUB_CLK * mem_trace.at(0).m_clk + mem_trace.at(0).m_sub_clk); - main_trace.at(0).avm_mem_glob_addr = + main_trace.at(0).mem_glob_addr = FF(mem_trace.at(0).m_addr + (static_cast(mem_trace.at(0).m_space_id) << 32)); } @@ -4087,92 +4087,92 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c auto const& src = mem_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_mem_mem_sel = FF(1); - dest.avm_mem_clk = FF(src.m_clk); - dest.avm_mem_addr = FF(src.m_addr); - dest.avm_mem_space_id = FF(src.m_space_id); - dest.avm_mem_val = src.m_val; - dest.avm_mem_rw = FF(static_cast(src.m_rw)); - dest.avm_mem_r_in_tag = FF(static_cast(src.r_in_tag)); - dest.avm_mem_w_in_tag = FF(static_cast(src.w_in_tag)); - dest.avm_mem_tag = FF(static_cast(src.m_tag)); - dest.avm_mem_tag_err = FF(static_cast(src.m_tag_err)); - dest.avm_mem_one_min_inv = src.m_one_min_inv; - dest.avm_mem_sel_mov_a = FF(static_cast(src.m_sel_mov_a)); - dest.avm_mem_sel_mov_b = FF(static_cast(src.m_sel_mov_b)); - dest.avm_mem_sel_cmov = FF(static_cast(src.m_sel_cmov)); + dest.mem_mem_sel = FF(1); + dest.mem_clk = FF(src.m_clk); + dest.mem_addr = FF(src.m_addr); + dest.mem_space_id = FF(src.m_space_id); + dest.mem_val = src.m_val; + dest.mem_rw = FF(static_cast(src.m_rw)); + dest.mem_r_in_tag = FF(static_cast(src.r_in_tag)); + dest.mem_w_in_tag = FF(static_cast(src.w_in_tag)); + dest.mem_tag = FF(static_cast(src.m_tag)); + dest.mem_tag_err = FF(static_cast(src.m_tag_err)); + dest.mem_one_min_inv = src.m_one_min_inv; + dest.mem_sel_mov_a = FF(static_cast(src.m_sel_mov_a)); + dest.mem_sel_mov_b = FF(static_cast(src.m_sel_mov_b)); + dest.mem_sel_cmov = FF(static_cast(src.m_sel_cmov)); dest.incl_mem_tag_err_counts = FF(static_cast(src.m_tag_err_count_relevant)); switch (src.m_sub_clk) { case AvmMemTraceBuilder::SUB_CLK_LOAD_A: case AvmMemTraceBuilder::SUB_CLK_STORE_A: - dest.avm_mem_op_a = 1; + dest.mem_op_a = 1; break; case AvmMemTraceBuilder::SUB_CLK_LOAD_B: case AvmMemTraceBuilder::SUB_CLK_STORE_B: - dest.avm_mem_op_b = 1; + dest.mem_op_b = 1; break; case AvmMemTraceBuilder::SUB_CLK_LOAD_C: case AvmMemTraceBuilder::SUB_CLK_STORE_C: - dest.avm_mem_op_c = 1; + dest.mem_op_c = 1; break; case AvmMemTraceBuilder::SUB_CLK_LOAD_D: case AvmMemTraceBuilder::SUB_CLK_STORE_D: - dest.avm_mem_op_d = 1; + dest.mem_op_d = 1; break; case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_A: - dest.avm_mem_ind_op_a = 1; + dest.mem_ind_op_a = 1; break; case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_B: - dest.avm_mem_ind_op_b = 1; + dest.mem_ind_op_b = 1; break; case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_C: - dest.avm_mem_ind_op_c = 1; + dest.mem_ind_op_c = 1; break; case AvmMemTraceBuilder::SUB_CLK_IND_LOAD_D: - dest.avm_mem_ind_op_d = 1; + dest.mem_ind_op_d = 1; break; default: break; } if (src.m_sel_cmov) { - dest.avm_mem_skip_check_tag = dest.avm_mem_op_d + dest.avm_mem_op_a * (-dest.avm_mem_sel_mov_a + 1) + - dest.avm_mem_op_b * (-dest.avm_mem_sel_mov_b + 1); + dest.mem_skip_check_tag = + dest.mem_op_d + dest.mem_op_a * (-dest.mem_sel_mov_a + 1) + dest.mem_op_b * (-dest.mem_sel_mov_b + 1); } if (i + 1 < mem_trace_size) { auto const& next = mem_trace.at(i + 1); auto& dest_next = main_trace.at(i + 1); - dest_next.avm_mem_tsp = FF(AvmMemTraceBuilder::NUM_SUB_CLK * next.m_clk + next.m_sub_clk); - dest_next.avm_mem_glob_addr = FF(next.m_addr + (static_cast(next.m_space_id) << 32)); + dest_next.mem_tsp = FF(AvmMemTraceBuilder::NUM_SUB_CLK * next.m_clk + next.m_sub_clk); + dest_next.mem_glob_addr = FF(next.m_addr + (static_cast(next.m_space_id) << 32)); FF diff{}; - if (dest_next.avm_mem_glob_addr == dest.avm_mem_glob_addr) { - diff = dest_next.avm_mem_tsp - dest.avm_mem_tsp; + if (dest_next.mem_glob_addr == dest.mem_glob_addr) { + diff = dest_next.mem_tsp - dest.mem_tsp; } else { - diff = dest_next.avm_mem_glob_addr - dest.avm_mem_glob_addr; - dest.avm_mem_lastAccess = FF(1); + diff = dest_next.mem_glob_addr - dest.mem_glob_addr; + dest.mem_lastAccess = FF(1); } - dest.avm_mem_rng_chk_sel = FF(1); + dest.mem_rng_chk_sel = FF(1); // Decomposition of diff auto const diff_64 = uint64_t(diff); auto const diff_hi = static_cast(diff_64 >> 32); auto const diff_mid = static_cast((diff_64 & UINT32_MAX) >> 16); auto const diff_lo = static_cast(diff_64 & UINT16_MAX); - dest.avm_mem_diff_hi = FF(diff_hi); - dest.avm_mem_diff_mid = FF(diff_mid); - dest.avm_mem_diff_lo = FF(diff_lo); + dest.mem_diff_hi = FF(diff_hi); + dest.mem_diff_mid = FF(diff_mid); + dest.mem_diff_lo = FF(diff_lo); // Add the range checks counts mem_rng_check_hi_counts[diff_hi]++; mem_rng_check_mid_counts[diff_mid]++; mem_rng_check_lo_counts[diff_lo]++; } else { - dest.avm_mem_lastAccess = FF(1); - dest.avm_mem_last = FF(1); + dest.mem_lastAccess = FF(1); + dest.mem_last = FF(1); } } @@ -4181,146 +4181,145 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c auto const& src = alu_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_alu_clk = FF(static_cast(src.alu_clk)); - - dest.avm_alu_op_add = FF(static_cast(src.alu_op_add)); - dest.avm_alu_op_sub = FF(static_cast(src.alu_op_sub)); - dest.avm_alu_op_mul = FF(static_cast(src.alu_op_mul)); - dest.avm_alu_op_not = FF(static_cast(src.alu_op_not)); - dest.avm_alu_op_eq = FF(static_cast(src.alu_op_eq)); - dest.avm_alu_op_lt = FF(static_cast(src.alu_op_lt)); - dest.avm_alu_op_lte = FF(static_cast(src.alu_op_lte)); - dest.avm_alu_op_cast = FF(static_cast(src.alu_op_cast)); - dest.avm_alu_op_cast_prev = FF(static_cast(src.alu_op_cast_prev)); - dest.avm_alu_cmp_sel = FF(static_cast(src.alu_op_lt) + static_cast(src.alu_op_lte)); - dest.avm_alu_rng_chk_sel = FF(static_cast(src.rng_chk_sel)); - dest.avm_alu_op_shr = FF(static_cast(src.alu_op_shr)); - dest.avm_alu_op_shl = FF(static_cast(src.alu_op_shl)); - dest.avm_alu_op_div = FF(static_cast(src.alu_op_div)); - - dest.avm_alu_ff_tag = FF(static_cast(src.alu_ff_tag)); - dest.avm_alu_u8_tag = FF(static_cast(src.alu_u8_tag)); - dest.avm_alu_u16_tag = FF(static_cast(src.alu_u16_tag)); - dest.avm_alu_u32_tag = FF(static_cast(src.alu_u32_tag)); - dest.avm_alu_u64_tag = FF(static_cast(src.alu_u64_tag)); - dest.avm_alu_u128_tag = FF(static_cast(src.alu_u128_tag)); - - dest.avm_alu_in_tag = dest.avm_alu_u8_tag + FF(2) * dest.avm_alu_u16_tag + FF(3) * dest.avm_alu_u32_tag + - FF(4) * dest.avm_alu_u64_tag + FF(5) * dest.avm_alu_u128_tag + - FF(6) * dest.avm_alu_ff_tag; - - dest.avm_alu_ia = src.alu_ia; - dest.avm_alu_ib = src.alu_ib; - dest.avm_alu_ic = src.alu_ic; - - dest.avm_alu_cf = FF(static_cast(src.alu_cf)); - - dest.avm_alu_u8_r0 = FF(src.alu_u8_r0); - dest.avm_alu_u8_r1 = FF(src.alu_u8_r1); - - dest.avm_alu_u16_r0 = FF(src.alu_u16_reg.at(0)); - dest.avm_alu_u16_r1 = FF(src.alu_u16_reg.at(1)); - dest.avm_alu_u16_r2 = FF(src.alu_u16_reg.at(2)); - dest.avm_alu_u16_r3 = FF(src.alu_u16_reg.at(3)); - dest.avm_alu_u16_r4 = FF(src.alu_u16_reg.at(4)); - dest.avm_alu_u16_r5 = FF(src.alu_u16_reg.at(5)); - dest.avm_alu_u16_r6 = FF(src.alu_u16_reg.at(6)); - dest.avm_alu_u16_r7 = FF(src.alu_u16_reg.at(7)); - dest.avm_alu_u16_r8 = FF(src.alu_u16_reg.at(8)); - dest.avm_alu_u16_r9 = FF(src.alu_u16_reg.at(9)); - dest.avm_alu_u16_r10 = FF(src.alu_u16_reg.at(10)); - dest.avm_alu_u16_r11 = FF(src.alu_u16_reg.at(11)); - dest.avm_alu_u16_r12 = FF(src.alu_u16_reg.at(12)); - dest.avm_alu_u16_r13 = FF(src.alu_u16_reg.at(13)); - dest.avm_alu_u16_r14 = FF(src.alu_u16_reg.at(14)); - - dest.avm_alu_div_rng_chk_selector = FF(static_cast(src.div_u64_range_chk_sel)); - dest.avm_alu_div_u16_r0 = FF(src.div_u64_range_chk.at(0)); - dest.avm_alu_div_u16_r1 = FF(src.div_u64_range_chk.at(1)); - dest.avm_alu_div_u16_r2 = FF(src.div_u64_range_chk.at(2)); - dest.avm_alu_div_u16_r3 = FF(src.div_u64_range_chk.at(3)); - dest.avm_alu_div_u16_r4 = FF(src.div_u64_range_chk.at(4)); - dest.avm_alu_div_u16_r5 = FF(src.div_u64_range_chk.at(5)); - dest.avm_alu_div_u16_r6 = FF(src.div_u64_range_chk.at(6)); - dest.avm_alu_div_u16_r7 = FF(src.div_u64_range_chk.at(7)); - dest.avm_alu_op_eq_diff_inv = FF(src.alu_op_eq_diff_inv); + dest.alu_clk = FF(static_cast(src.alu_clk)); + + dest.alu_op_add = FF(static_cast(src.alu_op_add)); + dest.alu_op_sub = FF(static_cast(src.alu_op_sub)); + dest.alu_op_mul = FF(static_cast(src.alu_op_mul)); + dest.alu_op_not = FF(static_cast(src.alu_op_not)); + dest.alu_op_eq = FF(static_cast(src.alu_op_eq)); + dest.alu_op_lt = FF(static_cast(src.alu_op_lt)); + dest.alu_op_lte = FF(static_cast(src.alu_op_lte)); + dest.alu_op_cast = FF(static_cast(src.alu_op_cast)); + dest.alu_op_cast_prev = FF(static_cast(src.alu_op_cast_prev)); + dest.alu_cmp_sel = FF(static_cast(src.alu_op_lt) + static_cast(src.alu_op_lte)); + dest.alu_rng_chk_sel = FF(static_cast(src.rng_chk_sel)); + dest.alu_op_shr = FF(static_cast(src.alu_op_shr)); + dest.alu_op_shl = FF(static_cast(src.alu_op_shl)); + dest.alu_op_div = FF(static_cast(src.alu_op_div)); + + dest.alu_ff_tag = FF(static_cast(src.alu_ff_tag)); + dest.alu_u8_tag = FF(static_cast(src.alu_u8_tag)); + dest.alu_u16_tag = FF(static_cast(src.alu_u16_tag)); + dest.alu_u32_tag = FF(static_cast(src.alu_u32_tag)); + dest.alu_u64_tag = FF(static_cast(src.alu_u64_tag)); + dest.alu_u128_tag = FF(static_cast(src.alu_u128_tag)); + + dest.alu_in_tag = dest.alu_u8_tag + FF(2) * dest.alu_u16_tag + FF(3) * dest.alu_u32_tag + + FF(4) * dest.alu_u64_tag + FF(5) * dest.alu_u128_tag + FF(6) * dest.alu_ff_tag; + + dest.alu_ia = src.alu_ia; + dest.alu_ib = src.alu_ib; + dest.alu_ic = src.alu_ic; + + dest.alu_cf = FF(static_cast(src.alu_cf)); + + dest.alu_u8_r0 = FF(src.alu_u8_r0); + dest.alu_u8_r1 = FF(src.alu_u8_r1); + + dest.alu_u16_r0 = FF(src.alu_u16_reg.at(0)); + dest.alu_u16_r1 = FF(src.alu_u16_reg.at(1)); + dest.alu_u16_r2 = FF(src.alu_u16_reg.at(2)); + dest.alu_u16_r3 = FF(src.alu_u16_reg.at(3)); + dest.alu_u16_r4 = FF(src.alu_u16_reg.at(4)); + dest.alu_u16_r5 = FF(src.alu_u16_reg.at(5)); + dest.alu_u16_r6 = FF(src.alu_u16_reg.at(6)); + dest.alu_u16_r7 = FF(src.alu_u16_reg.at(7)); + dest.alu_u16_r8 = FF(src.alu_u16_reg.at(8)); + dest.alu_u16_r9 = FF(src.alu_u16_reg.at(9)); + dest.alu_u16_r10 = FF(src.alu_u16_reg.at(10)); + dest.alu_u16_r11 = FF(src.alu_u16_reg.at(11)); + dest.alu_u16_r12 = FF(src.alu_u16_reg.at(12)); + dest.alu_u16_r13 = FF(src.alu_u16_reg.at(13)); + dest.alu_u16_r14 = FF(src.alu_u16_reg.at(14)); + + dest.alu_div_rng_chk_selector = FF(static_cast(src.div_u64_range_chk_sel)); + dest.alu_div_u16_r0 = FF(src.div_u64_range_chk.at(0)); + dest.alu_div_u16_r1 = FF(src.div_u64_range_chk.at(1)); + dest.alu_div_u16_r2 = FF(src.div_u64_range_chk.at(2)); + dest.alu_div_u16_r3 = FF(src.div_u64_range_chk.at(3)); + dest.alu_div_u16_r4 = FF(src.div_u64_range_chk.at(4)); + dest.alu_div_u16_r5 = FF(src.div_u64_range_chk.at(5)); + dest.alu_div_u16_r6 = FF(src.div_u64_range_chk.at(6)); + dest.alu_div_u16_r7 = FF(src.div_u64_range_chk.at(7)); + dest.alu_op_eq_diff_inv = FF(src.alu_op_eq_diff_inv); // Not all rows in ALU are enabled with a selector. For instance, // multiplication over u128 and cast is taking two lines. if (AvmAluTraceBuilder::is_alu_row_enabled(src)) { - dest.avm_alu_alu_sel = FF(1); + dest.alu_alu_sel = FF(1); } - if (dest.avm_alu_cmp_sel == FF(1) || dest.avm_alu_rng_chk_sel == FF(1)) { - dest.avm_alu_a_lo = FF(src.hi_lo_limbs.at(0)); - dest.avm_alu_a_hi = FF(src.hi_lo_limbs.at(1)); - dest.avm_alu_b_lo = FF(src.hi_lo_limbs.at(2)); - dest.avm_alu_b_hi = FF(src.hi_lo_limbs.at(3)); - dest.avm_alu_p_sub_a_lo = FF(src.hi_lo_limbs.at(4)); - dest.avm_alu_p_sub_a_hi = FF(src.hi_lo_limbs.at(5)); - dest.avm_alu_p_sub_b_lo = FF(src.hi_lo_limbs.at(6)); - dest.avm_alu_p_sub_b_hi = FF(src.hi_lo_limbs.at(7)); - dest.avm_alu_res_lo = FF(src.hi_lo_limbs.at(8)); - dest.avm_alu_res_hi = FF(src.hi_lo_limbs.at(9)); - dest.avm_alu_p_a_borrow = FF(static_cast(src.p_a_borrow)); - dest.avm_alu_p_b_borrow = FF(static_cast(src.p_b_borrow)); - dest.avm_alu_borrow = FF(static_cast(src.borrow)); - dest.avm_alu_cmp_rng_ctr = FF(static_cast(src.cmp_rng_ctr)); - dest.avm_alu_rng_chk_lookup_selector = FF(1); + if (dest.alu_cmp_sel == FF(1) || dest.alu_rng_chk_sel == FF(1)) { + dest.alu_a_lo = FF(src.hi_lo_limbs.at(0)); + dest.alu_a_hi = FF(src.hi_lo_limbs.at(1)); + dest.alu_b_lo = FF(src.hi_lo_limbs.at(2)); + dest.alu_b_hi = FF(src.hi_lo_limbs.at(3)); + dest.alu_p_sub_a_lo = FF(src.hi_lo_limbs.at(4)); + dest.alu_p_sub_a_hi = FF(src.hi_lo_limbs.at(5)); + dest.alu_p_sub_b_lo = FF(src.hi_lo_limbs.at(6)); + dest.alu_p_sub_b_hi = FF(src.hi_lo_limbs.at(7)); + dest.alu_res_lo = FF(src.hi_lo_limbs.at(8)); + dest.alu_res_hi = FF(src.hi_lo_limbs.at(9)); + dest.alu_p_a_borrow = FF(static_cast(src.p_a_borrow)); + dest.alu_p_b_borrow = FF(static_cast(src.p_b_borrow)); + dest.alu_borrow = FF(static_cast(src.borrow)); + dest.alu_cmp_rng_ctr = FF(static_cast(src.cmp_rng_ctr)); + dest.alu_rng_chk_lookup_selector = FF(1); } - if (dest.avm_alu_op_div == FF(1)) { - dest.avm_alu_op_div_std = uint256_t(src.alu_ia) >= uint256_t(src.alu_ib); - dest.avm_alu_op_div_a_lt_b = uint256_t(src.alu_ia) < uint256_t(src.alu_ib); - dest.avm_alu_rng_chk_lookup_selector = FF(1); - dest.avm_alu_a_lo = FF(src.hi_lo_limbs.at(0)); - dest.avm_alu_a_hi = FF(src.hi_lo_limbs.at(1)); - dest.avm_alu_b_lo = FF(src.hi_lo_limbs.at(2)); - dest.avm_alu_b_hi = FF(src.hi_lo_limbs.at(3)); - dest.avm_alu_p_sub_a_lo = FF(src.hi_lo_limbs.at(4)); - dest.avm_alu_p_sub_a_hi = FF(src.hi_lo_limbs.at(5)); - dest.avm_alu_remainder = src.remainder; - dest.avm_alu_divisor_lo = src.divisor_lo; - dest.avm_alu_divisor_hi = src.divisor_hi; - dest.avm_alu_quotient_lo = src.quotient_lo; - dest.avm_alu_quotient_hi = src.quotient_hi; - dest.avm_alu_partial_prod_lo = src.partial_prod_lo; - dest.avm_alu_partial_prod_hi = src.partial_prod_hi; + if (dest.alu_op_div == FF(1)) { + dest.alu_op_div_std = uint256_t(src.alu_ia) >= uint256_t(src.alu_ib); + dest.alu_op_div_a_lt_b = uint256_t(src.alu_ia) < uint256_t(src.alu_ib); + dest.alu_rng_chk_lookup_selector = FF(1); + dest.alu_a_lo = FF(src.hi_lo_limbs.at(0)); + dest.alu_a_hi = FF(src.hi_lo_limbs.at(1)); + dest.alu_b_lo = FF(src.hi_lo_limbs.at(2)); + dest.alu_b_hi = FF(src.hi_lo_limbs.at(3)); + dest.alu_p_sub_a_lo = FF(src.hi_lo_limbs.at(4)); + dest.alu_p_sub_a_hi = FF(src.hi_lo_limbs.at(5)); + dest.alu_remainder = src.remainder; + dest.alu_divisor_lo = src.divisor_lo; + dest.alu_divisor_hi = src.divisor_hi; + dest.alu_quotient_lo = src.quotient_lo; + dest.alu_quotient_hi = src.quotient_hi; + dest.alu_partial_prod_lo = src.partial_prod_lo; + dest.alu_partial_prod_hi = src.partial_prod_hi; } - if (dest.avm_alu_op_add == FF(1) || dest.avm_alu_op_sub == FF(1) || dest.avm_alu_op_mul == FF(1)) { - dest.avm_alu_rng_chk_lookup_selector = FF(1); + if (dest.alu_op_add == FF(1) || dest.alu_op_sub == FF(1) || dest.alu_op_mul == FF(1)) { + dest.alu_rng_chk_lookup_selector = FF(1); } - if (dest.avm_alu_op_cast == FF(1)) { - dest.avm_alu_a_lo = FF(src.hi_lo_limbs.at(0)); - dest.avm_alu_a_hi = FF(src.hi_lo_limbs.at(1)); - dest.avm_alu_p_sub_a_lo = FF(src.hi_lo_limbs.at(2)); - dest.avm_alu_p_sub_a_hi = FF(src.hi_lo_limbs.at(3)); - dest.avm_alu_p_a_borrow = FF(static_cast(src.p_a_borrow)); - dest.avm_alu_rng_chk_lookup_selector = FF(1); + if (dest.alu_op_cast == FF(1)) { + dest.alu_a_lo = FF(src.hi_lo_limbs.at(0)); + dest.alu_a_hi = FF(src.hi_lo_limbs.at(1)); + dest.alu_p_sub_a_lo = FF(src.hi_lo_limbs.at(2)); + dest.alu_p_sub_a_hi = FF(src.hi_lo_limbs.at(3)); + dest.alu_p_a_borrow = FF(static_cast(src.p_a_borrow)); + dest.alu_rng_chk_lookup_selector = FF(1); } - if (dest.avm_alu_op_cast_prev == FF(1)) { - dest.avm_alu_a_lo = FF(src.hi_lo_limbs.at(0)); - dest.avm_alu_a_hi = FF(src.hi_lo_limbs.at(1)); - dest.avm_alu_rng_chk_lookup_selector = FF(1); + if (dest.alu_op_cast_prev == FF(1)) { + dest.alu_a_lo = FF(src.hi_lo_limbs.at(0)); + dest.alu_a_hi = FF(src.hi_lo_limbs.at(1)); + dest.alu_rng_chk_lookup_selector = FF(1); } // Multiplication over u128 expands over two rows. - if (dest.avm_alu_op_mul == FF(1) && dest.avm_alu_u128_tag) { - main_trace.at(i + 1).avm_alu_rng_chk_lookup_selector = FF(1); + if (dest.alu_op_mul == FF(1) && dest.alu_u128_tag) { + main_trace.at(i + 1).alu_rng_chk_lookup_selector = FF(1); } if (src.alu_op_shr || src.alu_op_shl) { - dest.avm_alu_a_lo = FF(src.hi_lo_limbs[0]); - dest.avm_alu_a_hi = FF(src.hi_lo_limbs[1]); - dest.avm_alu_b_lo = FF(src.hi_lo_limbs[2]); - dest.avm_alu_b_hi = FF(src.hi_lo_limbs[3]); - dest.avm_alu_shift_sel = FF(1); - dest.avm_alu_shift_lt_bit_len = FF(static_cast(src.shift_lt_bit_len)); - dest.avm_alu_t_sub_s_bits = FF(src.mem_tag_sub_shift); - dest.avm_alu_two_pow_s = FF(uint256_t(1) << dest.avm_alu_ib); - dest.avm_alu_two_pow_t_sub_s = FF(uint256_t(1) << uint256_t(dest.avm_alu_t_sub_s_bits)); - dest.avm_alu_rng_chk_lookup_selector = FF(1); + dest.alu_a_lo = FF(src.hi_lo_limbs[0]); + dest.alu_a_hi = FF(src.hi_lo_limbs[1]); + dest.alu_b_lo = FF(src.hi_lo_limbs[2]); + dest.alu_b_hi = FF(src.hi_lo_limbs[3]); + dest.alu_shift_sel = FF(1); + dest.alu_shift_lt_bit_len = FF(static_cast(src.shift_lt_bit_len)); + dest.alu_t_sub_s_bits = FF(src.mem_tag_sub_shift); + dest.alu_two_pow_s = FF(uint256_t(1) << dest.alu_ib); + dest.alu_two_pow_t_sub_s = FF(uint256_t(1) << uint256_t(dest.alu_t_sub_s_bits)); + dest.alu_rng_chk_lookup_selector = FF(1); } } @@ -4328,73 +4327,73 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c for (size_t i = 0; i < conv_trace_size; i++) { auto const& src = conv_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_conversion_to_radix_le_sel = FF(static_cast(src.to_radix_le_sel)); - dest.avm_conversion_clk = FF(src.conversion_clk); - dest.avm_conversion_input = src.input; - dest.avm_conversion_radix = FF(src.radix); - dest.avm_conversion_num_limbs = FF(src.num_limbs); + dest.conversion_to_radix_le_sel = FF(static_cast(src.to_radix_le_sel)); + dest.conversion_clk = FF(src.conversion_clk); + dest.conversion_input = src.input; + dest.conversion_radix = FF(src.radix); + dest.conversion_num_limbs = FF(src.num_limbs); } // Add SHA256 Gadget table for (size_t i = 0; i < sha256_trace_size; i++) { auto const& src = sha256_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_sha256_clk = FF(src.clk); - dest.avm_sha256_input = src.input[0]; + dest.sha256_clk = FF(src.clk); + dest.sha256_input = src.input[0]; // TODO: This will need to be enabled later - // dest.avm_sha256_output = src.output[0]; - dest.avm_sha256_sha256_compression_sel = FF(1); - dest.avm_sha256_state = src.state[0]; + // dest.sha256_output = src.output[0]; + dest.sha256_sha256_compression_sel = FF(1); + dest.sha256_state = src.state[0]; } // Add Poseidon2 Gadget table for (size_t i = 0; i < poseidon2_trace_size; i++) { auto const& src = poseidon2_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_poseidon2_clk = FF(src.clk); - dest.avm_poseidon2_input = src.input[0]; + dest.poseidon2_clk = FF(src.clk); + dest.poseidon2_input = src.input[0]; // TODO: This will need to be enabled later - // dest.avm_poseidon2_output = src.output[0]; - dest.avm_poseidon2_poseidon_perm_sel = FF(1); + // dest.poseidon2_output = src.output[0]; + dest.poseidon2_poseidon_perm_sel = FF(1); } // Add KeccakF1600 Gadget table for (size_t i = 0; i < keccak_trace_size; i++) { auto const& src = keccak_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_keccakf1600_clk = FF(src.clk); - dest.avm_keccakf1600_input = FF(src.input[0]); + dest.keccakf1600_clk = FF(src.clk); + dest.keccakf1600_input = FF(src.input[0]); // TODO: This will need to be enabled later - // dest.avm_keccakf1600_output = src.output[0]; - dest.avm_keccakf1600_keccakf1600_sel = FF(1); + // dest.keccakf1600_output = src.output[0]; + dest.keccakf1600_keccakf1600_sel = FF(1); } // Add Pedersen Gadget table for (size_t i = 0; i < pedersen_trace_size; i++) { auto const& src = pedersen_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_pedersen_clk = FF(src.clk); - dest.avm_pedersen_input = FF(src.input[0]); - dest.avm_pedersen_pedersen_sel = FF(1); + dest.pedersen_clk = FF(src.clk); + dest.pedersen_input = FF(src.input[0]); + dest.pedersen_pedersen_sel = FF(1); } // Add Binary Trace table for (size_t i = 0; i < bin_trace_size; i++) { auto const& src = bin_trace.at(i); auto& dest = main_trace.at(i); - dest.avm_binary_clk = src.binary_clk; - dest.avm_binary_bin_sel = static_cast(src.bin_sel); - dest.avm_binary_acc_ia = src.acc_ia; - dest.avm_binary_acc_ib = src.acc_ib; - dest.avm_binary_acc_ic = src.acc_ic; - dest.avm_binary_in_tag = src.in_tag; - dest.avm_binary_op_id = src.op_id; - dest.avm_binary_ia_bytes = src.bin_ia_bytes; - dest.avm_binary_ib_bytes = src.bin_ib_bytes; - dest.avm_binary_ic_bytes = src.bin_ic_bytes; - dest.avm_binary_start = FF(static_cast(src.start)); - dest.avm_binary_mem_tag_ctr = src.mem_tag_ctr; - dest.avm_binary_mem_tag_ctr_inv = src.mem_tag_ctr_inv; + dest.binary_clk = src.binary_clk; + dest.binary_bin_sel = static_cast(src.bin_sel); + dest.binary_acc_ia = src.acc_ia; + dest.binary_acc_ib = src.acc_ib; + dest.binary_acc_ic = src.acc_ic; + dest.binary_in_tag = src.in_tag; + dest.binary_op_id = src.op_id; + dest.binary_ia_bytes = src.bin_ia_bytes; + dest.binary_ib_bytes = src.bin_ib_bytes; + dest.binary_ic_bytes = src.bin_ic_bytes; + dest.binary_start = FF(static_cast(src.start)); + dest.binary_mem_tag_ctr = src.mem_tag_ctr; + dest.binary_mem_tag_ctr_inv = src.mem_tag_ctr_inv; } // Only generate precomputed byte tables if we are actually going to use them in this main trace. @@ -4412,19 +4411,19 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c // Derive a unique row index given op_id, a, and b. auto main_trace_index = (op_id << 16) + (input_a << 8) + b; - main_trace.at(main_trace_index).avm_byte_lookup_bin_sel = FF(1); - main_trace.at(main_trace_index).avm_byte_lookup_table_op_id = op_id; - main_trace.at(main_trace_index).avm_byte_lookup_table_input_a = a; - main_trace.at(main_trace_index).avm_byte_lookup_table_input_b = b; + main_trace.at(main_trace_index).byte_lookup_bin_sel = FF(1); + main_trace.at(main_trace_index).byte_lookup_table_op_id = op_id; + main_trace.at(main_trace_index).byte_lookup_table_input_a = a; + main_trace.at(main_trace_index).byte_lookup_table_input_b = b; // Add the counter value stored throughout the execution main_trace.at(main_trace_index).lookup_byte_operations_counts = bin_trace_builder.byte_operation_counter[main_trace_index]; if (op_id == 0) { - main_trace.at(main_trace_index).avm_byte_lookup_table_output = a & b; + main_trace.at(main_trace_index).byte_lookup_table_output = a & b; } else if (op_id == 1) { - main_trace.at(main_trace_index).avm_byte_lookup_table_output = a | b; + main_trace.at(main_trace_index).byte_lookup_table_output = a | b; } else { - main_trace.at(main_trace_index).avm_byte_lookup_table_output = a ^ b; + main_trace.at(main_trace_index).byte_lookup_table_output = a ^ b; } } } @@ -4435,9 +4434,9 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c for (uint8_t avm_in_tag = 0; avm_in_tag < 5; avm_in_tag++) { // The +1 here is because the instruction tags we care about (i.e excl U0 and FF) has the range // [1,5] - main_trace.at(avm_in_tag).avm_byte_lookup_bin_sel = FF(1); - main_trace.at(avm_in_tag).avm_byte_lookup_table_in_tags = avm_in_tag + 1; - main_trace.at(avm_in_tag).avm_byte_lookup_table_byte_lengths = static_cast(pow(2, avm_in_tag)); + main_trace.at(avm_in_tag).byte_lookup_bin_sel = FF(1); + main_trace.at(avm_in_tag).byte_lookup_table_in_tags = avm_in_tag + 1; + main_trace.at(avm_in_tag).byte_lookup_table_byte_lengths = static_cast(pow(2, avm_in_tag)); main_trace.at(avm_in_tag).lookup_byte_lengths_counts = bin_trace_builder.byte_length_counter[avm_in_tag + 1]; } @@ -4452,12 +4451,12 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c // Add the gas accounting for each row // We can assume that the gas trace will never be larger than the main trace - // We infer that a row is active for gas (.avm_main_gas_cost_active = 1) based on the presence + // We infer that a row is active for gas (.main_gas_cost_active = 1) based on the presence // of a gas entry row. // Set the initial gas auto& first_opcode_row = main_trace.at(0); - first_opcode_row.avm_main_l2_gas_remaining = gas_trace_builder.initial_l2_gas; - first_opcode_row.avm_main_da_gas_remaining = gas_trace_builder.initial_da_gas; + first_opcode_row.main_l2_gas_remaining = gas_trace_builder.initial_l2_gas; + first_opcode_row.main_da_gas_remaining = gas_trace_builder.initial_da_gas; uint32_t current_clk = 1; uint32_t current_l2_gas_remaining = gas_trace_builder.initial_l2_gas; uint32_t current_da_gas_remaining = gas_trace_builder.initial_da_gas; @@ -4477,8 +4476,8 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c // Remaining gas values remain unchanged. while (gas_entry.clk > current_clk) { auto& next = main_trace.at(current_clk); - next.avm_main_l2_gas_remaining = current_l2_gas_remaining; - next.avm_main_da_gas_remaining = current_da_gas_remaining; + next.main_l2_gas_remaining = current_l2_gas_remaining; + next.main_da_gas_remaining = current_da_gas_remaining; current_clk++; } @@ -4486,9 +4485,9 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c auto& next = main_trace.at(gas_entry.clk); // Write each of the relevant gas accounting values - dest.avm_main_opcode_val = static_cast(gas_entry.opcode); - dest.avm_main_l2_gas_op = gas_entry.l2_gas_cost; - dest.avm_main_da_gas_op = gas_entry.da_gas_cost; + dest.main_opcode_val = static_cast(gas_entry.opcode); + dest.main_l2_gas_op = gas_entry.l2_gas_cost; + dest.main_da_gas_op = gas_entry.da_gas_cost; // If gas remaining is increasing, it means we underflowed in uint32_t bool l2_out_of_gas = current_l2_gas_remaining < gas_entry.remaining_l2_gas; @@ -4497,30 +4496,30 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c uint32_t abs_l2_gas_remaining = l2_out_of_gas ? -gas_entry.remaining_l2_gas : gas_entry.remaining_l2_gas; uint32_t abs_da_gas_remaining = da_out_of_gas ? -gas_entry.remaining_da_gas : gas_entry.remaining_da_gas; - dest.avm_main_abs_l2_rem_gas_hi = abs_l2_gas_remaining >> 16; - dest.avm_main_abs_da_rem_gas_hi = abs_da_gas_remaining >> 16; - dest.avm_main_abs_l2_rem_gas_lo = static_cast(abs_l2_gas_remaining); - dest.avm_main_abs_da_rem_gas_lo = static_cast(abs_da_gas_remaining); + dest.main_abs_l2_rem_gas_hi = abs_l2_gas_remaining >> 16; + dest.main_abs_da_rem_gas_hi = abs_da_gas_remaining >> 16; + dest.main_abs_l2_rem_gas_lo = static_cast(abs_l2_gas_remaining); + dest.main_abs_da_rem_gas_lo = static_cast(abs_da_gas_remaining); // TODO: gas is not constrained for external call at this time if (gas_entry.opcode != OpCode::CALL) { - dest.avm_main_gas_cost_active = FF(1); + dest.main_gas_cost_active = FF(1); // lookups counting - rem_gas_rng_check_counts[L2_HI_GAS_COUNTS_IDX][static_cast(dest.avm_main_abs_l2_rem_gas_hi)]++; - rem_gas_rng_check_counts[L2_LO_GAS_COUNTS_IDX][static_cast(dest.avm_main_abs_l2_rem_gas_lo)]++; - rem_gas_rng_check_counts[DA_HI_GAS_COUNTS_IDX][static_cast(dest.avm_main_abs_da_rem_gas_hi)]++; - rem_gas_rng_check_counts[DA_LO_GAS_COUNTS_IDX][static_cast(dest.avm_main_abs_da_rem_gas_lo)]++; + rem_gas_rng_check_counts[L2_HI_GAS_COUNTS_IDX][static_cast(dest.main_abs_l2_rem_gas_hi)]++; + rem_gas_rng_check_counts[L2_LO_GAS_COUNTS_IDX][static_cast(dest.main_abs_l2_rem_gas_lo)]++; + rem_gas_rng_check_counts[DA_HI_GAS_COUNTS_IDX][static_cast(dest.main_abs_da_rem_gas_hi)]++; + rem_gas_rng_check_counts[DA_LO_GAS_COUNTS_IDX][static_cast(dest.main_abs_da_rem_gas_lo)]++; } - dest.avm_main_l2_out_of_gas = static_cast(l2_out_of_gas); - dest.avm_main_da_out_of_gas = static_cast(da_out_of_gas); + dest.main_l2_out_of_gas = static_cast(l2_out_of_gas); + dest.main_da_out_of_gas = static_cast(da_out_of_gas); current_l2_gas_remaining = gas_entry.remaining_l2_gas; current_da_gas_remaining = gas_entry.remaining_da_gas; - next.avm_main_l2_gas_remaining = + next.main_l2_gas_remaining = l2_out_of_gas ? FF::modulus - uint256_t(abs_l2_gas_remaining) : current_l2_gas_remaining; - next.avm_main_da_gas_remaining = + next.main_da_gas_remaining = da_out_of_gas ? FF::modulus - uint256_t(abs_da_gas_remaining) : current_da_gas_remaining; current_clk++; @@ -4529,14 +4528,14 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c // Pad the rest of the trace with the same gas remaining for (size_t i = current_clk; i < main_trace_size; i++) { auto& dest = main_trace.at(i); - dest.avm_main_l2_gas_remaining = current_l2_gas_remaining; - dest.avm_main_da_gas_remaining = current_da_gas_remaining; + dest.main_l2_gas_remaining = current_l2_gas_remaining; + dest.main_da_gas_remaining = current_da_gas_remaining; } /////////// END OF GAS ACCOUNTING ////////////////////////// // Adding extra row for the shifted values at the top of the execution trace. - Row first_row = Row{ .avm_main_first = FF(1), .avm_mem_lastAccess = FF(1) }; + Row first_row = Row{ .main_first = FF(1), .mem_lastAccess = FF(1) }; main_trace.insert(main_trace.begin(), first_row); auto const old_trace_size = main_trace.size(); @@ -4551,22 +4550,22 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c for (size_t i = 0; i < new_trace_size; i++) { auto& r = main_trace.at(i); - if ((r.avm_main_sel_op_add == FF(1) || r.avm_main_sel_op_sub == FF(1) || r.avm_main_sel_op_mul == FF(1) || - r.avm_main_sel_op_eq == FF(1) || r.avm_main_sel_op_not == FF(1) || r.avm_main_sel_op_lt == FF(1) || - r.avm_main_sel_op_lte == FF(1) || r.avm_main_sel_op_cast == FF(1) || r.avm_main_sel_op_shr == FF(1) || - r.avm_main_sel_op_shl == FF(1) || r.avm_main_sel_op_div == FF(1)) && - r.avm_main_tag_err == FF(0) && r.avm_main_op_err == FF(0)) { - r.avm_main_alu_sel = FF(1); + if ((r.main_sel_op_add == FF(1) || r.main_sel_op_sub == FF(1) || r.main_sel_op_mul == FF(1) || + r.main_sel_op_eq == FF(1) || r.main_sel_op_not == FF(1) || r.main_sel_op_lt == FF(1) || + r.main_sel_op_lte == FF(1) || r.main_sel_op_cast == FF(1) || r.main_sel_op_shr == FF(1) || + r.main_sel_op_shl == FF(1) || r.main_sel_op_div == FF(1)) && + r.main_tag_err == FF(0) && r.main_op_err == FF(0)) { + r.main_alu_sel = FF(1); } - if (r.avm_main_sel_internal_call == FF(1) || r.avm_main_sel_internal_return == FF(1)) { - r.avm_main_space_id = INTERNAL_CALL_SPACE_ID; + if (r.main_sel_internal_call == FF(1) || r.main_sel_internal_return == FF(1)) { + r.main_space_id = INTERNAL_CALL_SPACE_ID; } else { - r.avm_main_space_id = r.avm_main_call_ptr; + r.main_space_id = r.main_call_ptr; }; - r.avm_main_clk = i >= old_trace_size ? r.avm_main_clk : FF(i); - auto counter = i >= old_trace_size ? static_cast(r.avm_main_clk) : static_cast(i); + r.main_clk = i >= old_trace_size ? r.main_clk : FF(i); + auto counter = i >= old_trace_size ? static_cast(r.main_clk) : static_cast(i); r.incl_main_tag_err_counts = mem_trace_builder.m_tag_err_lookup_counts[static_cast(counter)]; if (counter <= UINT8_MAX) { @@ -4575,8 +4574,8 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c r.lookup_pow_2_0_counts = alu_trace_builder.u8_pow_2_counters[0][static_cast(counter)]; r.lookup_pow_2_1_counts = alu_trace_builder.u8_pow_2_counters[1][static_cast(counter)]; r.lookup_mem_rng_chk_hi_counts = mem_rng_check_hi_counts[static_cast(counter)]; - r.avm_main_sel_rng_8 = FF(1); - r.avm_main_table_pow_2 = uint256_t(1) << uint256_t(counter); + r.main_sel_rng_8 = FF(1); + r.main_table_pow_2 = uint256_t(1) << uint256_t(counter); } if (counter <= UINT16_MAX) { @@ -4620,7 +4619,7 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c r.range_check_da_gas_lo_counts = rem_gas_rng_check_counts[DA_LO_GAS_COUNTS_IDX][static_cast(counter)]; - r.avm_main_sel_rng_16 = FF(1); + r.main_sel_rng_16 = FF(1); } } @@ -4638,7 +4637,7 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c // Index 1 corresponds here to the first active row of the main execution trace, as // we already prepended the extra row for shifted columns. Therefore, initialization // of side_effect_counter occurs occurs on this row. - main_trace.at(1).avm_kernel_side_effect_counter = initial_side_effect_counter; + main_trace.at(1).kernel_side_effect_counter = initial_side_effect_counter; // External loop iterates over the kernel entries which are sorted by increasing clk. // Internal loop iterates to fill the gap in main trace between each kernel entries. @@ -4653,66 +4652,65 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c auto const& prev = main_trace.at(j); auto& dest = main_trace.at(j + 1); - dest.avm_kernel_note_hash_exist_write_offset = prev.avm_kernel_note_hash_exist_write_offset; - dest.avm_kernel_emit_note_hash_write_offset = prev.avm_kernel_emit_note_hash_write_offset; - dest.avm_kernel_nullifier_exists_write_offset = prev.avm_kernel_nullifier_exists_write_offset; - dest.avm_kernel_nullifier_non_exists_write_offset = prev.avm_kernel_nullifier_non_exists_write_offset; - dest.avm_kernel_emit_nullifier_write_offset = prev.avm_kernel_emit_nullifier_write_offset; - dest.avm_kernel_emit_l2_to_l1_msg_write_offset = prev.avm_kernel_emit_l2_to_l1_msg_write_offset; - dest.avm_kernel_emit_unencrypted_log_write_offset = prev.avm_kernel_emit_unencrypted_log_write_offset; - dest.avm_kernel_l1_to_l2_msg_exists_write_offset = prev.avm_kernel_l1_to_l2_msg_exists_write_offset; - dest.avm_kernel_sload_write_offset = prev.avm_kernel_sload_write_offset; - dest.avm_kernel_sstore_write_offset = prev.avm_kernel_sstore_write_offset; - dest.avm_kernel_side_effect_counter = prev.avm_kernel_side_effect_counter; + dest.kernel_note_hash_exist_write_offset = prev.kernel_note_hash_exist_write_offset; + dest.kernel_emit_note_hash_write_offset = prev.kernel_emit_note_hash_write_offset; + dest.kernel_nullifier_exists_write_offset = prev.kernel_nullifier_exists_write_offset; + dest.kernel_nullifier_non_exists_write_offset = prev.kernel_nullifier_non_exists_write_offset; + dest.kernel_emit_nullifier_write_offset = prev.kernel_emit_nullifier_write_offset; + dest.kernel_emit_l2_to_l1_msg_write_offset = prev.kernel_emit_l2_to_l1_msg_write_offset; + dest.kernel_emit_unencrypted_log_write_offset = prev.kernel_emit_unencrypted_log_write_offset; + dest.kernel_l1_to_l2_msg_exists_write_offset = prev.kernel_l1_to_l2_msg_exists_write_offset; + dest.kernel_sload_write_offset = prev.kernel_sload_write_offset; + dest.kernel_sstore_write_offset = prev.kernel_sstore_write_offset; + dest.kernel_side_effect_counter = prev.kernel_side_effect_counter; } Row& curr = main_trace.at(clk); // Read in values from kernel trace // Lookup values - curr.avm_kernel_kernel_in_offset = src.kernel_in_offset; - curr.avm_kernel_kernel_out_offset = src.kernel_out_offset; - curr.avm_main_q_kernel_lookup = static_cast(src.q_kernel_lookup); - curr.avm_main_q_kernel_output_lookup = static_cast(src.q_kernel_output_lookup); + curr.kernel_kernel_in_offset = src.kernel_in_offset; + curr.kernel_kernel_out_offset = src.kernel_out_offset; + curr.main_q_kernel_lookup = static_cast(src.q_kernel_lookup); + curr.main_q_kernel_output_lookup = static_cast(src.q_kernel_output_lookup); // Operation selectors - curr.avm_main_sel_op_note_hash_exists = static_cast(src.op_note_hash_exists); - curr.avm_main_sel_op_emit_note_hash = static_cast(src.op_emit_note_hash); - curr.avm_main_sel_op_nullifier_exists = static_cast(src.op_nullifier_exists); - curr.avm_main_sel_op_emit_nullifier = static_cast(src.op_emit_nullifier); - curr.avm_main_sel_op_l1_to_l2_msg_exists = static_cast(src.op_l1_to_l2_msg_exists); - curr.avm_main_sel_op_emit_unencrypted_log = static_cast(src.op_emit_unencrypted_log); - curr.avm_main_sel_op_emit_l2_to_l1_msg = static_cast(src.op_emit_l2_to_l1_msg); - curr.avm_main_sel_op_sload = static_cast(src.op_sload); - curr.avm_main_sel_op_sstore = static_cast(src.op_sstore); + curr.main_sel_op_note_hash_exists = static_cast(src.op_note_hash_exists); + curr.main_sel_op_emit_note_hash = static_cast(src.op_emit_note_hash); + curr.main_sel_op_nullifier_exists = static_cast(src.op_nullifier_exists); + curr.main_sel_op_emit_nullifier = static_cast(src.op_emit_nullifier); + curr.main_sel_op_l1_to_l2_msg_exists = static_cast(src.op_l1_to_l2_msg_exists); + curr.main_sel_op_emit_unencrypted_log = static_cast(src.op_emit_unencrypted_log); + curr.main_sel_op_emit_l2_to_l1_msg = static_cast(src.op_emit_l2_to_l1_msg); + curr.main_sel_op_sload = static_cast(src.op_sload); + curr.main_sel_op_sstore = static_cast(src.op_sstore); if (clk < old_trace_size) { Row& next = main_trace.at(clk + 1); // Increment the write offset counter for the following row - next.avm_kernel_note_hash_exist_write_offset = - curr.avm_kernel_note_hash_exist_write_offset + static_cast(src.op_note_hash_exists); - next.avm_kernel_emit_note_hash_write_offset = - curr.avm_kernel_emit_note_hash_write_offset + static_cast(src.op_emit_note_hash); - next.avm_kernel_emit_nullifier_write_offset = - curr.avm_kernel_emit_nullifier_write_offset + static_cast(src.op_emit_nullifier); - next.avm_kernel_nullifier_exists_write_offset = - curr.avm_kernel_nullifier_exists_write_offset + - (static_cast(src.op_nullifier_exists) * curr.avm_main_ib); - next.avm_kernel_nullifier_non_exists_write_offset = - curr.avm_kernel_nullifier_non_exists_write_offset + - (static_cast(src.op_nullifier_exists) * (FF(1) - curr.avm_main_ib)); - next.avm_kernel_l1_to_l2_msg_exists_write_offset = - curr.avm_kernel_l1_to_l2_msg_exists_write_offset + static_cast(src.op_l1_to_l2_msg_exists); - next.avm_kernel_emit_l2_to_l1_msg_write_offset = - curr.avm_kernel_emit_l2_to_l1_msg_write_offset + static_cast(src.op_emit_l2_to_l1_msg); - next.avm_kernel_emit_unencrypted_log_write_offset = - curr.avm_kernel_emit_unencrypted_log_write_offset + static_cast(src.op_emit_unencrypted_log); - next.avm_kernel_sload_write_offset = curr.avm_kernel_sload_write_offset + static_cast(src.op_sload); - next.avm_kernel_sstore_write_offset = curr.avm_kernel_sstore_write_offset + static_cast(src.op_sstore); + next.kernel_note_hash_exist_write_offset = + curr.kernel_note_hash_exist_write_offset + static_cast(src.op_note_hash_exists); + next.kernel_emit_note_hash_write_offset = + curr.kernel_emit_note_hash_write_offset + static_cast(src.op_emit_note_hash); + next.kernel_emit_nullifier_write_offset = + curr.kernel_emit_nullifier_write_offset + static_cast(src.op_emit_nullifier); + next.kernel_nullifier_exists_write_offset = + curr.kernel_nullifier_exists_write_offset + (static_cast(src.op_nullifier_exists) * curr.main_ib); + next.kernel_nullifier_non_exists_write_offset = + curr.kernel_nullifier_non_exists_write_offset + + (static_cast(src.op_nullifier_exists) * (FF(1) - curr.main_ib)); + next.kernel_l1_to_l2_msg_exists_write_offset = + curr.kernel_l1_to_l2_msg_exists_write_offset + static_cast(src.op_l1_to_l2_msg_exists); + next.kernel_emit_l2_to_l1_msg_write_offset = + curr.kernel_emit_l2_to_l1_msg_write_offset + static_cast(src.op_emit_l2_to_l1_msg); + next.kernel_emit_unencrypted_log_write_offset = + curr.kernel_emit_unencrypted_log_write_offset + static_cast(src.op_emit_unencrypted_log); + next.kernel_sload_write_offset = curr.kernel_sload_write_offset + static_cast(src.op_sload); + next.kernel_sstore_write_offset = curr.kernel_sstore_write_offset + static_cast(src.op_sstore); // The side effect counter will increment regardless of the offset value - next.avm_kernel_side_effect_counter = curr.avm_kernel_side_effect_counter + 1; + next.kernel_side_effect_counter = curr.kernel_side_effect_counter + 1; } kernel_padding_main_trace_bottom = clk + 1; @@ -4726,29 +4724,29 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c // Setting all of the counters to 0 after the IS_LAST check so we can satisfy the constraints until the end if (i == old_trace_size) { - dest.avm_kernel_note_hash_exist_write_offset = 0; - dest.avm_kernel_emit_note_hash_write_offset = 0; - dest.avm_kernel_nullifier_exists_write_offset = 0; - dest.avm_kernel_nullifier_non_exists_write_offset = 0; - dest.avm_kernel_emit_nullifier_write_offset = 0; - dest.avm_kernel_l1_to_l2_msg_exists_write_offset = 0; - dest.avm_kernel_emit_unencrypted_log_write_offset = 0; - dest.avm_kernel_emit_l2_to_l1_msg_write_offset = 0; - dest.avm_kernel_sload_write_offset = 0; - dest.avm_kernel_sstore_write_offset = 0; - dest.avm_kernel_side_effect_counter = 0; + dest.kernel_note_hash_exist_write_offset = 0; + dest.kernel_emit_note_hash_write_offset = 0; + dest.kernel_nullifier_exists_write_offset = 0; + dest.kernel_nullifier_non_exists_write_offset = 0; + dest.kernel_emit_nullifier_write_offset = 0; + dest.kernel_l1_to_l2_msg_exists_write_offset = 0; + dest.kernel_emit_unencrypted_log_write_offset = 0; + dest.kernel_emit_l2_to_l1_msg_write_offset = 0; + dest.kernel_sload_write_offset = 0; + dest.kernel_sstore_write_offset = 0; + dest.kernel_side_effect_counter = 0; } else { - dest.avm_kernel_note_hash_exist_write_offset = prev.avm_kernel_note_hash_exist_write_offset; - dest.avm_kernel_emit_note_hash_write_offset = prev.avm_kernel_emit_note_hash_write_offset; - dest.avm_kernel_nullifier_exists_write_offset = prev.avm_kernel_nullifier_exists_write_offset; - dest.avm_kernel_nullifier_non_exists_write_offset = prev.avm_kernel_nullifier_non_exists_write_offset; - dest.avm_kernel_emit_nullifier_write_offset = prev.avm_kernel_emit_nullifier_write_offset; - dest.avm_kernel_l1_to_l2_msg_exists_write_offset = prev.avm_kernel_l1_to_l2_msg_exists_write_offset; - dest.avm_kernel_emit_unencrypted_log_write_offset = prev.avm_kernel_emit_unencrypted_log_write_offset; - dest.avm_kernel_emit_l2_to_l1_msg_write_offset = prev.avm_kernel_emit_l2_to_l1_msg_write_offset; - dest.avm_kernel_sload_write_offset = prev.avm_kernel_sload_write_offset; - dest.avm_kernel_sstore_write_offset = prev.avm_kernel_sstore_write_offset; - dest.avm_kernel_side_effect_counter = prev.avm_kernel_side_effect_counter; + dest.kernel_note_hash_exist_write_offset = prev.kernel_note_hash_exist_write_offset; + dest.kernel_emit_note_hash_write_offset = prev.kernel_emit_note_hash_write_offset; + dest.kernel_nullifier_exists_write_offset = prev.kernel_nullifier_exists_write_offset; + dest.kernel_nullifier_non_exists_write_offset = prev.kernel_nullifier_non_exists_write_offset; + dest.kernel_emit_nullifier_write_offset = prev.kernel_emit_nullifier_write_offset; + dest.kernel_l1_to_l2_msg_exists_write_offset = prev.kernel_l1_to_l2_msg_exists_write_offset; + dest.kernel_emit_unencrypted_log_write_offset = prev.kernel_emit_unencrypted_log_write_offset; + dest.kernel_emit_l2_to_l1_msg_write_offset = prev.kernel_emit_l2_to_l1_msg_write_offset; + dest.kernel_sload_write_offset = prev.kernel_sload_write_offset; + dest.kernel_sstore_write_offset = prev.kernel_sstore_write_offset; + dest.kernel_side_effect_counter = prev.kernel_side_effect_counter; } } @@ -4761,13 +4759,13 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c if (value != kernel_trace_builder.kernel_input_selector_counter.end()) { auto& dest = main_trace.at(i); dest.lookup_into_kernel_counts = FF(value->second); - dest.avm_kernel_q_public_input_kernel_add_to_table = FF(1); + dest.kernel_q_public_input_kernel_add_to_table = FF(1); } } // Copy the kernel input public inputs for (size_t i = 0; i < KERNEL_INPUTS_LENGTH; i++) { - main_trace.at(i).avm_kernel_kernel_inputs = std::get(kernel_trace_builder.public_inputs).at(i); + main_trace.at(i).kernel_kernel_inputs = std::get(kernel_trace_builder.public_inputs).at(i); } // Write lookup counts for outputs @@ -4776,19 +4774,19 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c if (value != kernel_trace_builder.kernel_output_selector_counter.end()) { auto& dest = main_trace.at(i); dest.kernel_output_lookup_counts = FF(value->second); - dest.avm_kernel_q_public_input_kernel_out_add_to_table = FF(1); + dest.kernel_q_public_input_kernel_out_add_to_table = FF(1); } } // Copy the kernel outputs counts into the main trace for (size_t i = 0; i < KERNEL_OUTPUTS_LENGTH; i++) { - main_trace.at(i).avm_kernel_kernel_value_out = + main_trace.at(i).kernel_kernel_value_out = std::get(kernel_trace_builder.public_inputs).at(i); - main_trace.at(i).avm_kernel_kernel_side_effect_out = + main_trace.at(i).kernel_kernel_side_effect_out = std::get(kernel_trace_builder.public_inputs).at(i); - main_trace.at(i).avm_kernel_kernel_metadata_out = + main_trace.at(i).kernel_kernel_metadata_out = std::get(kernel_trace_builder.public_inputs).at(i); } @@ -4802,9 +4800,9 @@ std::vector AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c for (auto const& [opcode, gas_entry] : GAS_COST_TABLE) { auto& dest = main_trace.at(static_cast(opcode)); - dest.avm_gas_gas_cost_sel = FF(1); - dest.avm_gas_l2_gas_fixed_table = gas_entry.l2_fixed_gas_cost; - dest.avm_gas_da_gas_fixed_table = gas_entry.da_fixed_gas_cost; + dest.gas_gas_cost_sel = FF(1); + dest.gas_l2_gas_fixed_table = gas_entry.l2_fixed_gas_cost; + dest.gas_da_gas_fixed_table = gas_entry.da_fixed_gas_cost; } // Finalise gas left lookup counts diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp index b675830a2e8..fc2f8b5a3a5 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.cpp @@ -18,296 +18,296 @@ template std::string field_to_string(const FF& ff) template std::vector AvmFullRow::names() { - return { "avm_main_clk", - "avm_main_first", - "avm_alu_a_hi", - "avm_alu_a_lo", - "avm_alu_alu_sel", - "avm_alu_b_hi", - "avm_alu_b_lo", - "avm_alu_borrow", - "avm_alu_cf", - "avm_alu_clk", - "avm_alu_cmp_rng_ctr", - "avm_alu_cmp_sel", - "avm_alu_div_rng_chk_selector", - "avm_alu_div_u16_r0", - "avm_alu_div_u16_r1", - "avm_alu_div_u16_r2", - "avm_alu_div_u16_r3", - "avm_alu_div_u16_r4", - "avm_alu_div_u16_r5", - "avm_alu_div_u16_r6", - "avm_alu_div_u16_r7", - "avm_alu_divisor_hi", - "avm_alu_divisor_lo", - "avm_alu_ff_tag", - "avm_alu_ia", - "avm_alu_ib", - "avm_alu_ic", - "avm_alu_in_tag", - "avm_alu_op_add", - "avm_alu_op_cast", - "avm_alu_op_cast_prev", - "avm_alu_op_div", - "avm_alu_op_div_a_lt_b", - "avm_alu_op_div_std", - "avm_alu_op_eq", - "avm_alu_op_eq_diff_inv", - "avm_alu_op_lt", - "avm_alu_op_lte", - "avm_alu_op_mul", - "avm_alu_op_not", - "avm_alu_op_shl", - "avm_alu_op_shr", - "avm_alu_op_sub", - "avm_alu_p_a_borrow", - "avm_alu_p_b_borrow", - "avm_alu_p_sub_a_hi", - "avm_alu_p_sub_a_lo", - "avm_alu_p_sub_b_hi", - "avm_alu_p_sub_b_lo", - "avm_alu_partial_prod_hi", - "avm_alu_partial_prod_lo", - "avm_alu_quotient_hi", - "avm_alu_quotient_lo", - "avm_alu_remainder", - "avm_alu_res_hi", - "avm_alu_res_lo", - "avm_alu_rng_chk_lookup_selector", - "avm_alu_rng_chk_sel", - "avm_alu_shift_lt_bit_len", - "avm_alu_shift_sel", - "avm_alu_t_sub_s_bits", - "avm_alu_two_pow_s", - "avm_alu_two_pow_t_sub_s", - "avm_alu_u128_tag", - "avm_alu_u16_r0", - "avm_alu_u16_r1", - "avm_alu_u16_r10", - "avm_alu_u16_r11", - "avm_alu_u16_r12", - "avm_alu_u16_r13", - "avm_alu_u16_r14", - "avm_alu_u16_r2", - "avm_alu_u16_r3", - "avm_alu_u16_r4", - "avm_alu_u16_r5", - "avm_alu_u16_r6", - "avm_alu_u16_r7", - "avm_alu_u16_r8", - "avm_alu_u16_r9", - "avm_alu_u16_tag", - "avm_alu_u32_tag", - "avm_alu_u64_tag", - "avm_alu_u8_r0", - "avm_alu_u8_r1", - "avm_alu_u8_tag", - "avm_binary_acc_ia", - "avm_binary_acc_ib", - "avm_binary_acc_ic", - "avm_binary_bin_sel", - "avm_binary_clk", - "avm_binary_ia_bytes", - "avm_binary_ib_bytes", - "avm_binary_ic_bytes", - "avm_binary_in_tag", - "avm_binary_mem_tag_ctr", - "avm_binary_mem_tag_ctr_inv", - "avm_binary_op_id", - "avm_binary_start", - "avm_byte_lookup_bin_sel", - "avm_byte_lookup_table_byte_lengths", - "avm_byte_lookup_table_in_tags", - "avm_byte_lookup_table_input_a", - "avm_byte_lookup_table_input_b", - "avm_byte_lookup_table_op_id", - "avm_byte_lookup_table_output", - "avm_conversion_clk", - "avm_conversion_input", - "avm_conversion_num_limbs", - "avm_conversion_radix", - "avm_conversion_to_radix_le_sel", - "avm_gas_da_gas_fixed_table", - "avm_gas_gas_cost_sel", - "avm_gas_l2_gas_fixed_table", - "avm_keccakf1600_clk", - "avm_keccakf1600_input", - "avm_keccakf1600_keccakf1600_sel", - "avm_keccakf1600_output", - "avm_kernel_emit_l2_to_l1_msg_write_offset", - "avm_kernel_emit_note_hash_write_offset", - "avm_kernel_emit_nullifier_write_offset", - "avm_kernel_emit_unencrypted_log_write_offset", - "avm_kernel_kernel_in_offset", - "avm_kernel_kernel_inputs", - "avm_kernel_kernel_metadata_out", - "avm_kernel_kernel_out_offset", - "avm_kernel_kernel_side_effect_out", - "avm_kernel_kernel_value_out", - "avm_kernel_l1_to_l2_msg_exists_write_offset", - "avm_kernel_note_hash_exist_write_offset", - "avm_kernel_nullifier_exists_write_offset", - "avm_kernel_nullifier_non_exists_write_offset", - "avm_kernel_q_public_input_kernel_add_to_table", - "avm_kernel_q_public_input_kernel_out_add_to_table", - "avm_kernel_side_effect_counter", - "avm_kernel_sload_write_offset", - "avm_kernel_sstore_write_offset", - "avm_main_abs_da_rem_gas_hi", - "avm_main_abs_da_rem_gas_lo", - "avm_main_abs_l2_rem_gas_hi", - "avm_main_abs_l2_rem_gas_lo", - "avm_main_alu_in_tag", - "avm_main_alu_sel", - "avm_main_bin_op_id", - "avm_main_bin_sel", - "avm_main_call_ptr", - "avm_main_da_gas_op", - "avm_main_da_gas_remaining", - "avm_main_da_out_of_gas", - "avm_main_gas_cost_active", - "avm_main_ia", - "avm_main_ib", - "avm_main_ic", - "avm_main_id", - "avm_main_id_zero", - "avm_main_ind_a", - "avm_main_ind_b", - "avm_main_ind_c", - "avm_main_ind_d", - "avm_main_ind_op_a", - "avm_main_ind_op_b", - "avm_main_ind_op_c", - "avm_main_ind_op_d", - "avm_main_internal_return_ptr", - "avm_main_inv", - "avm_main_l2_gas_op", - "avm_main_l2_gas_remaining", - "avm_main_l2_out_of_gas", - "avm_main_last", - "avm_main_mem_idx_a", - "avm_main_mem_idx_b", - "avm_main_mem_idx_c", - "avm_main_mem_idx_d", - "avm_main_mem_op_a", - "avm_main_mem_op_activate_gas", - "avm_main_mem_op_b", - "avm_main_mem_op_c", - "avm_main_mem_op_d", - "avm_main_op_err", - "avm_main_opcode_val", - "avm_main_pc", - "avm_main_q_kernel_lookup", - "avm_main_q_kernel_output_lookup", - "avm_main_r_in_tag", - "avm_main_rwa", - "avm_main_rwb", - "avm_main_rwc", - "avm_main_rwd", - "avm_main_sel_cmov", - "avm_main_sel_external_call", - "avm_main_sel_halt", - "avm_main_sel_internal_call", - "avm_main_sel_internal_return", - "avm_main_sel_jump", - "avm_main_sel_jumpi", - "avm_main_sel_mov", - "avm_main_sel_mov_a", - "avm_main_sel_mov_b", - "avm_main_sel_op_add", - "avm_main_sel_op_address", - "avm_main_sel_op_and", - "avm_main_sel_op_block_number", - "avm_main_sel_op_cast", - "avm_main_sel_op_chain_id", - "avm_main_sel_op_coinbase", - "avm_main_sel_op_dagasleft", - "avm_main_sel_op_div", - "avm_main_sel_op_emit_l2_to_l1_msg", - "avm_main_sel_op_emit_note_hash", - "avm_main_sel_op_emit_nullifier", - "avm_main_sel_op_emit_unencrypted_log", - "avm_main_sel_op_eq", - "avm_main_sel_op_fdiv", - "avm_main_sel_op_fee_per_da_gas", - "avm_main_sel_op_fee_per_l2_gas", - "avm_main_sel_op_get_contract_instance", - "avm_main_sel_op_keccak", - "avm_main_sel_op_l1_to_l2_msg_exists", - "avm_main_sel_op_l2gasleft", - "avm_main_sel_op_lt", - "avm_main_sel_op_lte", - "avm_main_sel_op_mul", - "avm_main_sel_op_not", - "avm_main_sel_op_note_hash_exists", - "avm_main_sel_op_nullifier_exists", - "avm_main_sel_op_or", - "avm_main_sel_op_pedersen", - "avm_main_sel_op_poseidon2", - "avm_main_sel_op_radix_le", - "avm_main_sel_op_sender", - "avm_main_sel_op_sha256", - "avm_main_sel_op_shl", - "avm_main_sel_op_shr", - "avm_main_sel_op_sload", - "avm_main_sel_op_sstore", - "avm_main_sel_op_storage_address", - "avm_main_sel_op_sub", - "avm_main_sel_op_timestamp", - "avm_main_sel_op_transaction_fee", - "avm_main_sel_op_version", - "avm_main_sel_op_xor", - "avm_main_sel_rng_16", - "avm_main_sel_rng_8", - "avm_main_space_id", - "avm_main_table_pow_2", - "avm_main_tag_err", - "avm_main_w_in_tag", - "avm_mem_addr", - "avm_mem_clk", - "avm_mem_diff_hi", - "avm_mem_diff_lo", - "avm_mem_diff_mid", - "avm_mem_glob_addr", - "avm_mem_ind_op_a", - "avm_mem_ind_op_b", - "avm_mem_ind_op_c", - "avm_mem_ind_op_d", - "avm_mem_last", - "avm_mem_lastAccess", - "avm_mem_mem_sel", - "avm_mem_one_min_inv", - "avm_mem_op_a", - "avm_mem_op_b", - "avm_mem_op_c", - "avm_mem_op_d", - "avm_mem_r_in_tag", - "avm_mem_rng_chk_sel", - "avm_mem_rw", - "avm_mem_sel_cmov", - "avm_mem_sel_mov_a", - "avm_mem_sel_mov_b", - "avm_mem_skip_check_tag", - "avm_mem_space_id", - "avm_mem_tag", - "avm_mem_tag_err", - "avm_mem_tsp", - "avm_mem_val", - "avm_mem_w_in_tag", - "avm_pedersen_clk", - "avm_pedersen_input", - "avm_pedersen_output", - "avm_pedersen_pedersen_sel", - "avm_poseidon2_clk", - "avm_poseidon2_input", - "avm_poseidon2_output", - "avm_poseidon2_poseidon_perm_sel", - "avm_sha256_clk", - "avm_sha256_input", - "avm_sha256_output", - "avm_sha256_sha256_compression_sel", - "avm_sha256_state", + return { "main_clk", + "main_first", + "alu_a_hi", + "alu_a_lo", + "alu_alu_sel", + "alu_b_hi", + "alu_b_lo", + "alu_borrow", + "alu_cf", + "alu_clk", + "alu_cmp_rng_ctr", + "alu_cmp_sel", + "alu_div_rng_chk_selector", + "alu_div_u16_r0", + "alu_div_u16_r1", + "alu_div_u16_r2", + "alu_div_u16_r3", + "alu_div_u16_r4", + "alu_div_u16_r5", + "alu_div_u16_r6", + "alu_div_u16_r7", + "alu_divisor_hi", + "alu_divisor_lo", + "alu_ff_tag", + "alu_ia", + "alu_ib", + "alu_ic", + "alu_in_tag", + "alu_op_add", + "alu_op_cast", + "alu_op_cast_prev", + "alu_op_div", + "alu_op_div_a_lt_b", + "alu_op_div_std", + "alu_op_eq", + "alu_op_eq_diff_inv", + "alu_op_lt", + "alu_op_lte", + "alu_op_mul", + "alu_op_not", + "alu_op_shl", + "alu_op_shr", + "alu_op_sub", + "alu_p_a_borrow", + "alu_p_b_borrow", + "alu_p_sub_a_hi", + "alu_p_sub_a_lo", + "alu_p_sub_b_hi", + "alu_p_sub_b_lo", + "alu_partial_prod_hi", + "alu_partial_prod_lo", + "alu_quotient_hi", + "alu_quotient_lo", + "alu_remainder", + "alu_res_hi", + "alu_res_lo", + "alu_rng_chk_lookup_selector", + "alu_rng_chk_sel", + "alu_shift_lt_bit_len", + "alu_shift_sel", + "alu_t_sub_s_bits", + "alu_two_pow_s", + "alu_two_pow_t_sub_s", + "alu_u128_tag", + "alu_u16_r0", + "alu_u16_r1", + "alu_u16_r10", + "alu_u16_r11", + "alu_u16_r12", + "alu_u16_r13", + "alu_u16_r14", + "alu_u16_r2", + "alu_u16_r3", + "alu_u16_r4", + "alu_u16_r5", + "alu_u16_r6", + "alu_u16_r7", + "alu_u16_r8", + "alu_u16_r9", + "alu_u16_tag", + "alu_u32_tag", + "alu_u64_tag", + "alu_u8_r0", + "alu_u8_r1", + "alu_u8_tag", + "binary_acc_ia", + "binary_acc_ib", + "binary_acc_ic", + "binary_bin_sel", + "binary_clk", + "binary_ia_bytes", + "binary_ib_bytes", + "binary_ic_bytes", + "binary_in_tag", + "binary_mem_tag_ctr", + "binary_mem_tag_ctr_inv", + "binary_op_id", + "binary_start", + "byte_lookup_bin_sel", + "byte_lookup_table_byte_lengths", + "byte_lookup_table_in_tags", + "byte_lookup_table_input_a", + "byte_lookup_table_input_b", + "byte_lookup_table_op_id", + "byte_lookup_table_output", + "conversion_clk", + "conversion_input", + "conversion_num_limbs", + "conversion_radix", + "conversion_to_radix_le_sel", + "gas_da_gas_fixed_table", + "gas_gas_cost_sel", + "gas_l2_gas_fixed_table", + "keccakf1600_clk", + "keccakf1600_input", + "keccakf1600_keccakf1600_sel", + "keccakf1600_output", + "kernel_emit_l2_to_l1_msg_write_offset", + "kernel_emit_note_hash_write_offset", + "kernel_emit_nullifier_write_offset", + "kernel_emit_unencrypted_log_write_offset", + "kernel_kernel_in_offset", + "kernel_kernel_inputs", + "kernel_kernel_metadata_out", + "kernel_kernel_out_offset", + "kernel_kernel_side_effect_out", + "kernel_kernel_value_out", + "kernel_l1_to_l2_msg_exists_write_offset", + "kernel_note_hash_exist_write_offset", + "kernel_nullifier_exists_write_offset", + "kernel_nullifier_non_exists_write_offset", + "kernel_q_public_input_kernel_add_to_table", + "kernel_q_public_input_kernel_out_add_to_table", + "kernel_side_effect_counter", + "kernel_sload_write_offset", + "kernel_sstore_write_offset", + "main_abs_da_rem_gas_hi", + "main_abs_da_rem_gas_lo", + "main_abs_l2_rem_gas_hi", + "main_abs_l2_rem_gas_lo", + "main_alu_in_tag", + "main_alu_sel", + "main_bin_op_id", + "main_bin_sel", + "main_call_ptr", + "main_da_gas_op", + "main_da_gas_remaining", + "main_da_out_of_gas", + "main_gas_cost_active", + "main_ia", + "main_ib", + "main_ic", + "main_id", + "main_id_zero", + "main_ind_a", + "main_ind_b", + "main_ind_c", + "main_ind_d", + "main_ind_op_a", + "main_ind_op_b", + "main_ind_op_c", + "main_ind_op_d", + "main_internal_return_ptr", + "main_inv", + "main_l2_gas_op", + "main_l2_gas_remaining", + "main_l2_out_of_gas", + "main_last", + "main_mem_idx_a", + "main_mem_idx_b", + "main_mem_idx_c", + "main_mem_idx_d", + "main_mem_op_a", + "main_mem_op_activate_gas", + "main_mem_op_b", + "main_mem_op_c", + "main_mem_op_d", + "main_op_err", + "main_opcode_val", + "main_pc", + "main_q_kernel_lookup", + "main_q_kernel_output_lookup", + "main_r_in_tag", + "main_rwa", + "main_rwb", + "main_rwc", + "main_rwd", + "main_sel_cmov", + "main_sel_external_call", + "main_sel_halt", + "main_sel_internal_call", + "main_sel_internal_return", + "main_sel_jump", + "main_sel_jumpi", + "main_sel_mov", + "main_sel_mov_a", + "main_sel_mov_b", + "main_sel_op_add", + "main_sel_op_address", + "main_sel_op_and", + "main_sel_op_block_number", + "main_sel_op_cast", + "main_sel_op_chain_id", + "main_sel_op_coinbase", + "main_sel_op_dagasleft", + "main_sel_op_div", + "main_sel_op_emit_l2_to_l1_msg", + "main_sel_op_emit_note_hash", + "main_sel_op_emit_nullifier", + "main_sel_op_emit_unencrypted_log", + "main_sel_op_eq", + "main_sel_op_fdiv", + "main_sel_op_fee_per_da_gas", + "main_sel_op_fee_per_l2_gas", + "main_sel_op_get_contract_instance", + "main_sel_op_keccak", + "main_sel_op_l1_to_l2_msg_exists", + "main_sel_op_l2gasleft", + "main_sel_op_lt", + "main_sel_op_lte", + "main_sel_op_mul", + "main_sel_op_not", + "main_sel_op_note_hash_exists", + "main_sel_op_nullifier_exists", + "main_sel_op_or", + "main_sel_op_pedersen", + "main_sel_op_poseidon2", + "main_sel_op_radix_le", + "main_sel_op_sender", + "main_sel_op_sha256", + "main_sel_op_shl", + "main_sel_op_shr", + "main_sel_op_sload", + "main_sel_op_sstore", + "main_sel_op_storage_address", + "main_sel_op_sub", + "main_sel_op_timestamp", + "main_sel_op_transaction_fee", + "main_sel_op_version", + "main_sel_op_xor", + "main_sel_rng_16", + "main_sel_rng_8", + "main_space_id", + "main_table_pow_2", + "main_tag_err", + "main_w_in_tag", + "mem_addr", + "mem_clk", + "mem_diff_hi", + "mem_diff_lo", + "mem_diff_mid", + "mem_glob_addr", + "mem_ind_op_a", + "mem_ind_op_b", + "mem_ind_op_c", + "mem_ind_op_d", + "mem_last", + "mem_lastAccess", + "mem_mem_sel", + "mem_one_min_inv", + "mem_op_a", + "mem_op_b", + "mem_op_c", + "mem_op_d", + "mem_r_in_tag", + "mem_rng_chk_sel", + "mem_rw", + "mem_sel_cmov", + "mem_sel_mov_a", + "mem_sel_mov_b", + "mem_skip_check_tag", + "mem_space_id", + "mem_tag", + "mem_tag_err", + "mem_tsp", + "mem_val", + "mem_w_in_tag", + "pedersen_clk", + "pedersen_input", + "pedersen_output", + "pedersen_pedersen_sel", + "poseidon2_clk", + "poseidon2_input", + "poseidon2_output", + "poseidon2_poseidon_perm_sel", + "sha256_clk", + "sha256_input", + "sha256_output", + "sha256_sha256_compression_sel", + "sha256_state", "perm_main_alu", "perm_main_bin", "perm_main_conv", @@ -409,198 +409,186 @@ template std::vector AvmFullRow::names() template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row) { return os - << field_to_string(row.avm_main_clk) << "," << field_to_string(row.avm_main_first) << "," - << field_to_string(row.avm_alu_a_hi) << "," << field_to_string(row.avm_alu_a_lo) << "," - << field_to_string(row.avm_alu_alu_sel) << "," << field_to_string(row.avm_alu_b_hi) << "," - << field_to_string(row.avm_alu_b_lo) << "," << field_to_string(row.avm_alu_borrow) << "," - << field_to_string(row.avm_alu_cf) << "," << field_to_string(row.avm_alu_clk) << "," - << field_to_string(row.avm_alu_cmp_rng_ctr) << "," << field_to_string(row.avm_alu_cmp_sel) << "," - << field_to_string(row.avm_alu_div_rng_chk_selector) << "," << field_to_string(row.avm_alu_div_u16_r0) << "," - << field_to_string(row.avm_alu_div_u16_r1) << "," << field_to_string(row.avm_alu_div_u16_r2) << "," - << field_to_string(row.avm_alu_div_u16_r3) << "," << field_to_string(row.avm_alu_div_u16_r4) << "," - << field_to_string(row.avm_alu_div_u16_r5) << "," << field_to_string(row.avm_alu_div_u16_r6) << "," - << field_to_string(row.avm_alu_div_u16_r7) << "," << field_to_string(row.avm_alu_divisor_hi) << "," - << field_to_string(row.avm_alu_divisor_lo) << "," << field_to_string(row.avm_alu_ff_tag) << "," - << field_to_string(row.avm_alu_ia) << "," << field_to_string(row.avm_alu_ib) << "," - << field_to_string(row.avm_alu_ic) << "," << field_to_string(row.avm_alu_in_tag) << "," - << field_to_string(row.avm_alu_op_add) << "," << field_to_string(row.avm_alu_op_cast) << "," - << field_to_string(row.avm_alu_op_cast_prev) << "," << field_to_string(row.avm_alu_op_div) << "," - << field_to_string(row.avm_alu_op_div_a_lt_b) << "," << field_to_string(row.avm_alu_op_div_std) << "," - << field_to_string(row.avm_alu_op_eq) << "," << field_to_string(row.avm_alu_op_eq_diff_inv) << "," - << field_to_string(row.avm_alu_op_lt) << "," << field_to_string(row.avm_alu_op_lte) << "," - << field_to_string(row.avm_alu_op_mul) << "," << field_to_string(row.avm_alu_op_not) << "," - << field_to_string(row.avm_alu_op_shl) << "," << field_to_string(row.avm_alu_op_shr) << "," - << field_to_string(row.avm_alu_op_sub) << "," << field_to_string(row.avm_alu_p_a_borrow) << "," - << field_to_string(row.avm_alu_p_b_borrow) << "," << field_to_string(row.avm_alu_p_sub_a_hi) << "," - << field_to_string(row.avm_alu_p_sub_a_lo) << "," << field_to_string(row.avm_alu_p_sub_b_hi) << "," - << field_to_string(row.avm_alu_p_sub_b_lo) << "," << field_to_string(row.avm_alu_partial_prod_hi) << "," - << field_to_string(row.avm_alu_partial_prod_lo) << "," << field_to_string(row.avm_alu_quotient_hi) << "," - << field_to_string(row.avm_alu_quotient_lo) << "," << field_to_string(row.avm_alu_remainder) << "," - << field_to_string(row.avm_alu_res_hi) << "," << field_to_string(row.avm_alu_res_lo) << "," - << field_to_string(row.avm_alu_rng_chk_lookup_selector) << "," << field_to_string(row.avm_alu_rng_chk_sel) - << "," << field_to_string(row.avm_alu_shift_lt_bit_len) << "," << field_to_string(row.avm_alu_shift_sel) - << "," << field_to_string(row.avm_alu_t_sub_s_bits) << "," << field_to_string(row.avm_alu_two_pow_s) << "," - << field_to_string(row.avm_alu_two_pow_t_sub_s) << "," << field_to_string(row.avm_alu_u128_tag) << "," - << field_to_string(row.avm_alu_u16_r0) << "," << field_to_string(row.avm_alu_u16_r1) << "," - << field_to_string(row.avm_alu_u16_r10) << "," << field_to_string(row.avm_alu_u16_r11) << "," - << field_to_string(row.avm_alu_u16_r12) << "," << field_to_string(row.avm_alu_u16_r13) << "," - << field_to_string(row.avm_alu_u16_r14) << "," << field_to_string(row.avm_alu_u16_r2) << "," - << field_to_string(row.avm_alu_u16_r3) << "," << field_to_string(row.avm_alu_u16_r4) << "," - << field_to_string(row.avm_alu_u16_r5) << "," << field_to_string(row.avm_alu_u16_r6) << "," - << field_to_string(row.avm_alu_u16_r7) << "," << field_to_string(row.avm_alu_u16_r8) << "," - << field_to_string(row.avm_alu_u16_r9) << "," << field_to_string(row.avm_alu_u16_tag) << "," - << field_to_string(row.avm_alu_u32_tag) << "," << field_to_string(row.avm_alu_u64_tag) << "," - << field_to_string(row.avm_alu_u8_r0) << "," << field_to_string(row.avm_alu_u8_r1) << "," - << field_to_string(row.avm_alu_u8_tag) << "," << field_to_string(row.avm_binary_acc_ia) << "," - << field_to_string(row.avm_binary_acc_ib) << "," << field_to_string(row.avm_binary_acc_ic) << "," - << field_to_string(row.avm_binary_bin_sel) << "," << field_to_string(row.avm_binary_clk) << "," - << field_to_string(row.avm_binary_ia_bytes) << "," << field_to_string(row.avm_binary_ib_bytes) << "," - << field_to_string(row.avm_binary_ic_bytes) << "," << field_to_string(row.avm_binary_in_tag) << "," - << field_to_string(row.avm_binary_mem_tag_ctr) << "," << field_to_string(row.avm_binary_mem_tag_ctr_inv) - << "," << field_to_string(row.avm_binary_op_id) << "," << field_to_string(row.avm_binary_start) << "," - << field_to_string(row.avm_byte_lookup_bin_sel) << "," - << field_to_string(row.avm_byte_lookup_table_byte_lengths) << "," - << field_to_string(row.avm_byte_lookup_table_in_tags) << "," - << field_to_string(row.avm_byte_lookup_table_input_a) << "," - << field_to_string(row.avm_byte_lookup_table_input_b) << "," - << field_to_string(row.avm_byte_lookup_table_op_id) << "," - << field_to_string(row.avm_byte_lookup_table_output) << "," << field_to_string(row.avm_conversion_clk) << "," - << field_to_string(row.avm_conversion_input) << "," << field_to_string(row.avm_conversion_num_limbs) << "," - << field_to_string(row.avm_conversion_radix) << "," << field_to_string(row.avm_conversion_to_radix_le_sel) - << "," << field_to_string(row.avm_gas_da_gas_fixed_table) << "," << field_to_string(row.avm_gas_gas_cost_sel) - << "," << field_to_string(row.avm_gas_l2_gas_fixed_table) << "," << field_to_string(row.avm_keccakf1600_clk) - << "," << field_to_string(row.avm_keccakf1600_input) << "," - << field_to_string(row.avm_keccakf1600_keccakf1600_sel) << "," << field_to_string(row.avm_keccakf1600_output) - << "," << field_to_string(row.avm_kernel_emit_l2_to_l1_msg_write_offset) << "," - << field_to_string(row.avm_kernel_emit_note_hash_write_offset) << "," - << field_to_string(row.avm_kernel_emit_nullifier_write_offset) << "," - << field_to_string(row.avm_kernel_emit_unencrypted_log_write_offset) << "," - << field_to_string(row.avm_kernel_kernel_in_offset) << "," << field_to_string(row.avm_kernel_kernel_inputs) - << "," << field_to_string(row.avm_kernel_kernel_metadata_out) << "," - << field_to_string(row.avm_kernel_kernel_out_offset) << "," - << field_to_string(row.avm_kernel_kernel_side_effect_out) << "," - << field_to_string(row.avm_kernel_kernel_value_out) << "," - << field_to_string(row.avm_kernel_l1_to_l2_msg_exists_write_offset) << "," - << field_to_string(row.avm_kernel_note_hash_exist_write_offset) << "," - << field_to_string(row.avm_kernel_nullifier_exists_write_offset) << "," - << field_to_string(row.avm_kernel_nullifier_non_exists_write_offset) << "," - << field_to_string(row.avm_kernel_q_public_input_kernel_add_to_table) << "," - << field_to_string(row.avm_kernel_q_public_input_kernel_out_add_to_table) << "," - << field_to_string(row.avm_kernel_side_effect_counter) << "," - << field_to_string(row.avm_kernel_sload_write_offset) << "," - << field_to_string(row.avm_kernel_sstore_write_offset) << "," - << field_to_string(row.avm_main_abs_da_rem_gas_hi) << "," << field_to_string(row.avm_main_abs_da_rem_gas_lo) - << "," << field_to_string(row.avm_main_abs_l2_rem_gas_hi) << "," - << field_to_string(row.avm_main_abs_l2_rem_gas_lo) << "," << field_to_string(row.avm_main_alu_in_tag) << "," - << field_to_string(row.avm_main_alu_sel) << "," << field_to_string(row.avm_main_bin_op_id) << "," - << field_to_string(row.avm_main_bin_sel) << "," << field_to_string(row.avm_main_call_ptr) << "," - << field_to_string(row.avm_main_da_gas_op) << "," << field_to_string(row.avm_main_da_gas_remaining) << "," - << field_to_string(row.avm_main_da_out_of_gas) << "," << field_to_string(row.avm_main_gas_cost_active) << "," - << field_to_string(row.avm_main_ia) << "," << field_to_string(row.avm_main_ib) << "," - << field_to_string(row.avm_main_ic) << "," << field_to_string(row.avm_main_id) << "," - << field_to_string(row.avm_main_id_zero) << "," << field_to_string(row.avm_main_ind_a) << "," - << field_to_string(row.avm_main_ind_b) << "," << field_to_string(row.avm_main_ind_c) << "," - << field_to_string(row.avm_main_ind_d) << "," << field_to_string(row.avm_main_ind_op_a) << "," - << field_to_string(row.avm_main_ind_op_b) << "," << field_to_string(row.avm_main_ind_op_c) << "," - << field_to_string(row.avm_main_ind_op_d) << "," << field_to_string(row.avm_main_internal_return_ptr) << "," - << field_to_string(row.avm_main_inv) << "," << field_to_string(row.avm_main_l2_gas_op) << "," - << field_to_string(row.avm_main_l2_gas_remaining) << "," << field_to_string(row.avm_main_l2_out_of_gas) - << "," << field_to_string(row.avm_main_last) << "," << field_to_string(row.avm_main_mem_idx_a) << "," - << field_to_string(row.avm_main_mem_idx_b) << "," << field_to_string(row.avm_main_mem_idx_c) << "," - << field_to_string(row.avm_main_mem_idx_d) << "," << field_to_string(row.avm_main_mem_op_a) << "," - << field_to_string(row.avm_main_mem_op_activate_gas) << "," << field_to_string(row.avm_main_mem_op_b) << "," - << field_to_string(row.avm_main_mem_op_c) << "," << field_to_string(row.avm_main_mem_op_d) << "," - << field_to_string(row.avm_main_op_err) << "," << field_to_string(row.avm_main_opcode_val) << "," - << field_to_string(row.avm_main_pc) << "," << field_to_string(row.avm_main_q_kernel_lookup) << "," - << field_to_string(row.avm_main_q_kernel_output_lookup) << "," << field_to_string(row.avm_main_r_in_tag) - << "," << field_to_string(row.avm_main_rwa) << "," << field_to_string(row.avm_main_rwb) << "," - << field_to_string(row.avm_main_rwc) << "," << field_to_string(row.avm_main_rwd) << "," - << field_to_string(row.avm_main_sel_cmov) << "," << field_to_string(row.avm_main_sel_external_call) << "," - << field_to_string(row.avm_main_sel_halt) << "," << field_to_string(row.avm_main_sel_internal_call) << "," - << field_to_string(row.avm_main_sel_internal_return) << "," << field_to_string(row.avm_main_sel_jump) << "," - << field_to_string(row.avm_main_sel_jumpi) << "," << field_to_string(row.avm_main_sel_mov) << "," - << field_to_string(row.avm_main_sel_mov_a) << "," << field_to_string(row.avm_main_sel_mov_b) << "," - << field_to_string(row.avm_main_sel_op_add) << "," << field_to_string(row.avm_main_sel_op_address) << "," - << field_to_string(row.avm_main_sel_op_and) << "," << field_to_string(row.avm_main_sel_op_block_number) - << "," << field_to_string(row.avm_main_sel_op_cast) << "," << field_to_string(row.avm_main_sel_op_chain_id) - << "," << field_to_string(row.avm_main_sel_op_coinbase) << "," - << field_to_string(row.avm_main_sel_op_dagasleft) << "," << field_to_string(row.avm_main_sel_op_div) << "," - << field_to_string(row.avm_main_sel_op_emit_l2_to_l1_msg) << "," - << field_to_string(row.avm_main_sel_op_emit_note_hash) << "," - << field_to_string(row.avm_main_sel_op_emit_nullifier) << "," - << field_to_string(row.avm_main_sel_op_emit_unencrypted_log) << "," - << field_to_string(row.avm_main_sel_op_eq) << "," << field_to_string(row.avm_main_sel_op_fdiv) << "," - << field_to_string(row.avm_main_sel_op_fee_per_da_gas) << "," - << field_to_string(row.avm_main_sel_op_fee_per_l2_gas) << "," - << field_to_string(row.avm_main_sel_op_get_contract_instance) << "," - << field_to_string(row.avm_main_sel_op_keccak) << "," - << field_to_string(row.avm_main_sel_op_l1_to_l2_msg_exists) << "," - << field_to_string(row.avm_main_sel_op_l2gasleft) << "," << field_to_string(row.avm_main_sel_op_lt) << "," - << field_to_string(row.avm_main_sel_op_lte) << "," << field_to_string(row.avm_main_sel_op_mul) << "," - << field_to_string(row.avm_main_sel_op_not) << "," << field_to_string(row.avm_main_sel_op_note_hash_exists) - << "," << field_to_string(row.avm_main_sel_op_nullifier_exists) << "," - << field_to_string(row.avm_main_sel_op_or) << "," << field_to_string(row.avm_main_sel_op_pedersen) << "," - << field_to_string(row.avm_main_sel_op_poseidon2) << "," << field_to_string(row.avm_main_sel_op_radix_le) - << "," << field_to_string(row.avm_main_sel_op_sender) << "," << field_to_string(row.avm_main_sel_op_sha256) - << "," << field_to_string(row.avm_main_sel_op_shl) << "," << field_to_string(row.avm_main_sel_op_shr) << "," - << field_to_string(row.avm_main_sel_op_sload) << "," << field_to_string(row.avm_main_sel_op_sstore) << "," - << field_to_string(row.avm_main_sel_op_storage_address) << "," << field_to_string(row.avm_main_sel_op_sub) - << "," << field_to_string(row.avm_main_sel_op_timestamp) << "," - << field_to_string(row.avm_main_sel_op_transaction_fee) << "," - << field_to_string(row.avm_main_sel_op_version) << "," << field_to_string(row.avm_main_sel_op_xor) << "," - << field_to_string(row.avm_main_sel_rng_16) << "," << field_to_string(row.avm_main_sel_rng_8) << "," - << field_to_string(row.avm_main_space_id) << "," << field_to_string(row.avm_main_table_pow_2) << "," - << field_to_string(row.avm_main_tag_err) << "," << field_to_string(row.avm_main_w_in_tag) << "," - << field_to_string(row.avm_mem_addr) << "," << field_to_string(row.avm_mem_clk) << "," - << field_to_string(row.avm_mem_diff_hi) << "," << field_to_string(row.avm_mem_diff_lo) << "," - << field_to_string(row.avm_mem_diff_mid) << "," << field_to_string(row.avm_mem_glob_addr) << "," - << field_to_string(row.avm_mem_ind_op_a) << "," << field_to_string(row.avm_mem_ind_op_b) << "," - << field_to_string(row.avm_mem_ind_op_c) << "," << field_to_string(row.avm_mem_ind_op_d) << "," - << field_to_string(row.avm_mem_last) << "," << field_to_string(row.avm_mem_lastAccess) << "," - << field_to_string(row.avm_mem_mem_sel) << "," << field_to_string(row.avm_mem_one_min_inv) << "," - << field_to_string(row.avm_mem_op_a) << "," << field_to_string(row.avm_mem_op_b) << "," - << field_to_string(row.avm_mem_op_c) << "," << field_to_string(row.avm_mem_op_d) << "," - << field_to_string(row.avm_mem_r_in_tag) << "," << field_to_string(row.avm_mem_rng_chk_sel) << "," - << field_to_string(row.avm_mem_rw) << "," << field_to_string(row.avm_mem_sel_cmov) << "," - << field_to_string(row.avm_mem_sel_mov_a) << "," << field_to_string(row.avm_mem_sel_mov_b) << "," - << field_to_string(row.avm_mem_skip_check_tag) << "," << field_to_string(row.avm_mem_space_id) << "," - << field_to_string(row.avm_mem_tag) << "," << field_to_string(row.avm_mem_tag_err) << "," - << field_to_string(row.avm_mem_tsp) << "," << field_to_string(row.avm_mem_val) << "," - << field_to_string(row.avm_mem_w_in_tag) << "," << field_to_string(row.avm_pedersen_clk) << "," - << field_to_string(row.avm_pedersen_input) << "," << field_to_string(row.avm_pedersen_output) << "," - << field_to_string(row.avm_pedersen_pedersen_sel) << "," << field_to_string(row.avm_poseidon2_clk) << "," - << field_to_string(row.avm_poseidon2_input) << "," << field_to_string(row.avm_poseidon2_output) << "," - << field_to_string(row.avm_poseidon2_poseidon_perm_sel) << "," << field_to_string(row.avm_sha256_clk) << "," - << field_to_string(row.avm_sha256_input) << "," << field_to_string(row.avm_sha256_output) << "," - << field_to_string(row.avm_sha256_sha256_compression_sel) << "," << field_to_string(row.avm_sha256_state) - << "," << field_to_string(row.perm_main_alu) << "," << field_to_string(row.perm_main_bin) << "," - << field_to_string(row.perm_main_conv) << "," << field_to_string(row.perm_main_pos2_perm) << "," - << field_to_string(row.perm_main_pedersen) << "," << field_to_string(row.perm_main_mem_a) << "," - << field_to_string(row.perm_main_mem_b) << "," << field_to_string(row.perm_main_mem_c) << "," - << field_to_string(row.perm_main_mem_d) << "," << field_to_string(row.perm_main_mem_ind_a) << "," - << field_to_string(row.perm_main_mem_ind_b) << "," << field_to_string(row.perm_main_mem_ind_c) << "," - << field_to_string(row.perm_main_mem_ind_d) << "," << field_to_string(row.lookup_byte_lengths) << "," - << field_to_string(row.lookup_byte_operations) << "," << field_to_string(row.lookup_opcode_gas) << "," - << field_to_string(row.range_check_l2_gas_hi) << "," << field_to_string(row.range_check_l2_gas_lo) << "," - << field_to_string(row.range_check_da_gas_hi) << "," << field_to_string(row.range_check_da_gas_lo) << "," - << field_to_string(row.kernel_output_lookup) << "," << field_to_string(row.lookup_into_kernel) << "," - << field_to_string(row.incl_main_tag_err) << "," << field_to_string(row.incl_mem_tag_err) << "," - << field_to_string(row.lookup_mem_rng_chk_lo) << "," << field_to_string(row.lookup_mem_rng_chk_mid) << "," - << field_to_string(row.lookup_mem_rng_chk_hi) << "," << field_to_string(row.lookup_pow_2_0) << "," - << field_to_string(row.lookup_pow_2_1) << "," << field_to_string(row.lookup_u8_0) << "," - << field_to_string(row.lookup_u8_1) << "," << field_to_string(row.lookup_u16_0) << "," - << field_to_string(row.lookup_u16_1) << "," << field_to_string(row.lookup_u16_2) << "," - << field_to_string(row.lookup_u16_3) << "," << field_to_string(row.lookup_u16_4) << "," - << field_to_string(row.lookup_u16_5) << "," << field_to_string(row.lookup_u16_6) << "," - << field_to_string(row.lookup_u16_7) << "," << field_to_string(row.lookup_u16_8) << "," - << field_to_string(row.lookup_u16_9) << "," << field_to_string(row.lookup_u16_10) << "," - << field_to_string(row.lookup_u16_11) << "," << field_to_string(row.lookup_u16_12) << "," - << field_to_string(row.lookup_u16_13) << "," << field_to_string(row.lookup_u16_14) << "," - << field_to_string(row.lookup_div_u16_0) << "," << field_to_string(row.lookup_div_u16_1) << "," - << field_to_string(row.lookup_div_u16_2) << "," << field_to_string(row.lookup_div_u16_3) << "," - << field_to_string(row.lookup_div_u16_4) << "," << field_to_string(row.lookup_div_u16_5) << "," - << field_to_string(row.lookup_div_u16_6) << "," << field_to_string(row.lookup_div_u16_7) << "," - << field_to_string(row.lookup_byte_lengths_counts) << "," + << field_to_string(row.main_clk) << "," << field_to_string(row.main_first) << "," + << field_to_string(row.alu_a_hi) << "," << field_to_string(row.alu_a_lo) << "," + << field_to_string(row.alu_alu_sel) << "," << field_to_string(row.alu_b_hi) << "," + << field_to_string(row.alu_b_lo) << "," << field_to_string(row.alu_borrow) << "," + << field_to_string(row.alu_cf) << "," << field_to_string(row.alu_clk) << "," + << field_to_string(row.alu_cmp_rng_ctr) << "," << field_to_string(row.alu_cmp_sel) << "," + << field_to_string(row.alu_div_rng_chk_selector) << "," << field_to_string(row.alu_div_u16_r0) << "," + << field_to_string(row.alu_div_u16_r1) << "," << field_to_string(row.alu_div_u16_r2) << "," + << field_to_string(row.alu_div_u16_r3) << "," << field_to_string(row.alu_div_u16_r4) << "," + << field_to_string(row.alu_div_u16_r5) << "," << field_to_string(row.alu_div_u16_r6) << "," + << field_to_string(row.alu_div_u16_r7) << "," << field_to_string(row.alu_divisor_hi) << "," + << field_to_string(row.alu_divisor_lo) << "," << field_to_string(row.alu_ff_tag) << "," + << field_to_string(row.alu_ia) << "," << field_to_string(row.alu_ib) << "," << field_to_string(row.alu_ic) + << "," << field_to_string(row.alu_in_tag) << "," << field_to_string(row.alu_op_add) << "," + << field_to_string(row.alu_op_cast) << "," << field_to_string(row.alu_op_cast_prev) << "," + << field_to_string(row.alu_op_div) << "," << field_to_string(row.alu_op_div_a_lt_b) << "," + << field_to_string(row.alu_op_div_std) << "," << field_to_string(row.alu_op_eq) << "," + << field_to_string(row.alu_op_eq_diff_inv) << "," << field_to_string(row.alu_op_lt) << "," + << field_to_string(row.alu_op_lte) << "," << field_to_string(row.alu_op_mul) << "," + << field_to_string(row.alu_op_not) << "," << field_to_string(row.alu_op_shl) << "," + << field_to_string(row.alu_op_shr) << "," << field_to_string(row.alu_op_sub) << "," + << field_to_string(row.alu_p_a_borrow) << "," << field_to_string(row.alu_p_b_borrow) << "," + << field_to_string(row.alu_p_sub_a_hi) << "," << field_to_string(row.alu_p_sub_a_lo) << "," + << field_to_string(row.alu_p_sub_b_hi) << "," << field_to_string(row.alu_p_sub_b_lo) << "," + << field_to_string(row.alu_partial_prod_hi) << "," << field_to_string(row.alu_partial_prod_lo) << "," + << field_to_string(row.alu_quotient_hi) << "," << field_to_string(row.alu_quotient_lo) << "," + << field_to_string(row.alu_remainder) << "," << field_to_string(row.alu_res_hi) << "," + << field_to_string(row.alu_res_lo) << "," << field_to_string(row.alu_rng_chk_lookup_selector) << "," + << field_to_string(row.alu_rng_chk_sel) << "," << field_to_string(row.alu_shift_lt_bit_len) << "," + << field_to_string(row.alu_shift_sel) << "," << field_to_string(row.alu_t_sub_s_bits) << "," + << field_to_string(row.alu_two_pow_s) << "," << field_to_string(row.alu_two_pow_t_sub_s) << "," + << field_to_string(row.alu_u128_tag) << "," << field_to_string(row.alu_u16_r0) << "," + << field_to_string(row.alu_u16_r1) << "," << field_to_string(row.alu_u16_r10) << "," + << field_to_string(row.alu_u16_r11) << "," << field_to_string(row.alu_u16_r12) << "," + << field_to_string(row.alu_u16_r13) << "," << field_to_string(row.alu_u16_r14) << "," + << field_to_string(row.alu_u16_r2) << "," << field_to_string(row.alu_u16_r3) << "," + << field_to_string(row.alu_u16_r4) << "," << field_to_string(row.alu_u16_r5) << "," + << field_to_string(row.alu_u16_r6) << "," << field_to_string(row.alu_u16_r7) << "," + << field_to_string(row.alu_u16_r8) << "," << field_to_string(row.alu_u16_r9) << "," + << field_to_string(row.alu_u16_tag) << "," << field_to_string(row.alu_u32_tag) << "," + << field_to_string(row.alu_u64_tag) << "," << field_to_string(row.alu_u8_r0) << "," + << field_to_string(row.alu_u8_r1) << "," << field_to_string(row.alu_u8_tag) << "," + << field_to_string(row.binary_acc_ia) << "," << field_to_string(row.binary_acc_ib) << "," + << field_to_string(row.binary_acc_ic) << "," << field_to_string(row.binary_bin_sel) << "," + << field_to_string(row.binary_clk) << "," << field_to_string(row.binary_ia_bytes) << "," + << field_to_string(row.binary_ib_bytes) << "," << field_to_string(row.binary_ic_bytes) << "," + << field_to_string(row.binary_in_tag) << "," << field_to_string(row.binary_mem_tag_ctr) << "," + << field_to_string(row.binary_mem_tag_ctr_inv) << "," << field_to_string(row.binary_op_id) << "," + << field_to_string(row.binary_start) << "," << field_to_string(row.byte_lookup_bin_sel) << "," + << field_to_string(row.byte_lookup_table_byte_lengths) << "," + << field_to_string(row.byte_lookup_table_in_tags) << "," << field_to_string(row.byte_lookup_table_input_a) + << "," << field_to_string(row.byte_lookup_table_input_b) << "," + << field_to_string(row.byte_lookup_table_op_id) << "," << field_to_string(row.byte_lookup_table_output) + << "," << field_to_string(row.conversion_clk) << "," << field_to_string(row.conversion_input) << "," + << field_to_string(row.conversion_num_limbs) << "," << field_to_string(row.conversion_radix) << "," + << field_to_string(row.conversion_to_radix_le_sel) << "," << field_to_string(row.gas_da_gas_fixed_table) + << "," << field_to_string(row.gas_gas_cost_sel) << "," << field_to_string(row.gas_l2_gas_fixed_table) << "," + << field_to_string(row.keccakf1600_clk) << "," << field_to_string(row.keccakf1600_input) << "," + << field_to_string(row.keccakf1600_keccakf1600_sel) << "," << field_to_string(row.keccakf1600_output) << "," + << field_to_string(row.kernel_emit_l2_to_l1_msg_write_offset) << "," + << field_to_string(row.kernel_emit_note_hash_write_offset) << "," + << field_to_string(row.kernel_emit_nullifier_write_offset) << "," + << field_to_string(row.kernel_emit_unencrypted_log_write_offset) << "," + << field_to_string(row.kernel_kernel_in_offset) << "," << field_to_string(row.kernel_kernel_inputs) << "," + << field_to_string(row.kernel_kernel_metadata_out) << "," << field_to_string(row.kernel_kernel_out_offset) + << "," << field_to_string(row.kernel_kernel_side_effect_out) << "," + << field_to_string(row.kernel_kernel_value_out) << "," + << field_to_string(row.kernel_l1_to_l2_msg_exists_write_offset) << "," + << field_to_string(row.kernel_note_hash_exist_write_offset) << "," + << field_to_string(row.kernel_nullifier_exists_write_offset) << "," + << field_to_string(row.kernel_nullifier_non_exists_write_offset) << "," + << field_to_string(row.kernel_q_public_input_kernel_add_to_table) << "," + << field_to_string(row.kernel_q_public_input_kernel_out_add_to_table) << "," + << field_to_string(row.kernel_side_effect_counter) << "," << field_to_string(row.kernel_sload_write_offset) + << "," << field_to_string(row.kernel_sstore_write_offset) << "," + << field_to_string(row.main_abs_da_rem_gas_hi) << "," << field_to_string(row.main_abs_da_rem_gas_lo) << "," + << field_to_string(row.main_abs_l2_rem_gas_hi) << "," << field_to_string(row.main_abs_l2_rem_gas_lo) << "," + << field_to_string(row.main_alu_in_tag) << "," << field_to_string(row.main_alu_sel) << "," + << field_to_string(row.main_bin_op_id) << "," << field_to_string(row.main_bin_sel) << "," + << field_to_string(row.main_call_ptr) << "," << field_to_string(row.main_da_gas_op) << "," + << field_to_string(row.main_da_gas_remaining) << "," << field_to_string(row.main_da_out_of_gas) << "," + << field_to_string(row.main_gas_cost_active) << "," << field_to_string(row.main_ia) << "," + << field_to_string(row.main_ib) << "," << field_to_string(row.main_ic) << "," << field_to_string(row.main_id) + << "," << field_to_string(row.main_id_zero) << "," << field_to_string(row.main_ind_a) << "," + << field_to_string(row.main_ind_b) << "," << field_to_string(row.main_ind_c) << "," + << field_to_string(row.main_ind_d) << "," << field_to_string(row.main_ind_op_a) << "," + << field_to_string(row.main_ind_op_b) << "," << field_to_string(row.main_ind_op_c) << "," + << field_to_string(row.main_ind_op_d) << "," << field_to_string(row.main_internal_return_ptr) << "," + << field_to_string(row.main_inv) << "," << field_to_string(row.main_l2_gas_op) << "," + << field_to_string(row.main_l2_gas_remaining) << "," << field_to_string(row.main_l2_out_of_gas) << "," + << field_to_string(row.main_last) << "," << field_to_string(row.main_mem_idx_a) << "," + << field_to_string(row.main_mem_idx_b) << "," << field_to_string(row.main_mem_idx_c) << "," + << field_to_string(row.main_mem_idx_d) << "," << field_to_string(row.main_mem_op_a) << "," + << field_to_string(row.main_mem_op_activate_gas) << "," << field_to_string(row.main_mem_op_b) << "," + << field_to_string(row.main_mem_op_c) << "," << field_to_string(row.main_mem_op_d) << "," + << field_to_string(row.main_op_err) << "," << field_to_string(row.main_opcode_val) << "," + << field_to_string(row.main_pc) << "," << field_to_string(row.main_q_kernel_lookup) << "," + << field_to_string(row.main_q_kernel_output_lookup) << "," << field_to_string(row.main_r_in_tag) << "," + << field_to_string(row.main_rwa) << "," << field_to_string(row.main_rwb) << "," + << field_to_string(row.main_rwc) << "," << field_to_string(row.main_rwd) << "," + << field_to_string(row.main_sel_cmov) << "," << field_to_string(row.main_sel_external_call) << "," + << field_to_string(row.main_sel_halt) << "," << field_to_string(row.main_sel_internal_call) << "," + << field_to_string(row.main_sel_internal_return) << "," << field_to_string(row.main_sel_jump) << "," + << field_to_string(row.main_sel_jumpi) << "," << field_to_string(row.main_sel_mov) << "," + << field_to_string(row.main_sel_mov_a) << "," << field_to_string(row.main_sel_mov_b) << "," + << field_to_string(row.main_sel_op_add) << "," << field_to_string(row.main_sel_op_address) << "," + << field_to_string(row.main_sel_op_and) << "," << field_to_string(row.main_sel_op_block_number) << "," + << field_to_string(row.main_sel_op_cast) << "," << field_to_string(row.main_sel_op_chain_id) << "," + << field_to_string(row.main_sel_op_coinbase) << "," << field_to_string(row.main_sel_op_dagasleft) << "," + << field_to_string(row.main_sel_op_div) << "," << field_to_string(row.main_sel_op_emit_l2_to_l1_msg) << "," + << field_to_string(row.main_sel_op_emit_note_hash) << "," << field_to_string(row.main_sel_op_emit_nullifier) + << "," << field_to_string(row.main_sel_op_emit_unencrypted_log) << "," << field_to_string(row.main_sel_op_eq) + << "," << field_to_string(row.main_sel_op_fdiv) << "," << field_to_string(row.main_sel_op_fee_per_da_gas) + << "," << field_to_string(row.main_sel_op_fee_per_l2_gas) << "," + << field_to_string(row.main_sel_op_get_contract_instance) << "," << field_to_string(row.main_sel_op_keccak) + << "," << field_to_string(row.main_sel_op_l1_to_l2_msg_exists) << "," + << field_to_string(row.main_sel_op_l2gasleft) << "," << field_to_string(row.main_sel_op_lt) << "," + << field_to_string(row.main_sel_op_lte) << "," << field_to_string(row.main_sel_op_mul) << "," + << field_to_string(row.main_sel_op_not) << "," << field_to_string(row.main_sel_op_note_hash_exists) << "," + << field_to_string(row.main_sel_op_nullifier_exists) << "," << field_to_string(row.main_sel_op_or) << "," + << field_to_string(row.main_sel_op_pedersen) << "," << field_to_string(row.main_sel_op_poseidon2) << "," + << field_to_string(row.main_sel_op_radix_le) << "," << field_to_string(row.main_sel_op_sender) << "," + << field_to_string(row.main_sel_op_sha256) << "," << field_to_string(row.main_sel_op_shl) << "," + << field_to_string(row.main_sel_op_shr) << "," << field_to_string(row.main_sel_op_sload) << "," + << field_to_string(row.main_sel_op_sstore) << "," << field_to_string(row.main_sel_op_storage_address) << "," + << field_to_string(row.main_sel_op_sub) << "," << field_to_string(row.main_sel_op_timestamp) << "," + << field_to_string(row.main_sel_op_transaction_fee) << "," << field_to_string(row.main_sel_op_version) << "," + << field_to_string(row.main_sel_op_xor) << "," << field_to_string(row.main_sel_rng_16) << "," + << field_to_string(row.main_sel_rng_8) << "," << field_to_string(row.main_space_id) << "," + << field_to_string(row.main_table_pow_2) << "," << field_to_string(row.main_tag_err) << "," + << field_to_string(row.main_w_in_tag) << "," << field_to_string(row.mem_addr) << "," + << field_to_string(row.mem_clk) << "," << field_to_string(row.mem_diff_hi) << "," + << field_to_string(row.mem_diff_lo) << "," << field_to_string(row.mem_diff_mid) << "," + << field_to_string(row.mem_glob_addr) << "," << field_to_string(row.mem_ind_op_a) << "," + << field_to_string(row.mem_ind_op_b) << "," << field_to_string(row.mem_ind_op_c) << "," + << field_to_string(row.mem_ind_op_d) << "," << field_to_string(row.mem_last) << "," + << field_to_string(row.mem_lastAccess) << "," << field_to_string(row.mem_mem_sel) << "," + << field_to_string(row.mem_one_min_inv) << "," << field_to_string(row.mem_op_a) << "," + << field_to_string(row.mem_op_b) << "," << field_to_string(row.mem_op_c) << "," + << field_to_string(row.mem_op_d) << "," << field_to_string(row.mem_r_in_tag) << "," + << field_to_string(row.mem_rng_chk_sel) << "," << field_to_string(row.mem_rw) << "," + << field_to_string(row.mem_sel_cmov) << "," << field_to_string(row.mem_sel_mov_a) << "," + << field_to_string(row.mem_sel_mov_b) << "," << field_to_string(row.mem_skip_check_tag) << "," + << field_to_string(row.mem_space_id) << "," << field_to_string(row.mem_tag) << "," + << field_to_string(row.mem_tag_err) << "," << field_to_string(row.mem_tsp) << "," + << field_to_string(row.mem_val) << "," << field_to_string(row.mem_w_in_tag) << "," + << field_to_string(row.pedersen_clk) << "," << field_to_string(row.pedersen_input) << "," + << field_to_string(row.pedersen_output) << "," << field_to_string(row.pedersen_pedersen_sel) << "," + << field_to_string(row.poseidon2_clk) << "," << field_to_string(row.poseidon2_input) << "," + << field_to_string(row.poseidon2_output) << "," << field_to_string(row.poseidon2_poseidon_perm_sel) << "," + << field_to_string(row.sha256_clk) << "," << field_to_string(row.sha256_input) << "," + << field_to_string(row.sha256_output) << "," << field_to_string(row.sha256_sha256_compression_sel) << "," + << field_to_string(row.sha256_state) << "," << field_to_string(row.perm_main_alu) << "," + << field_to_string(row.perm_main_bin) << "," << field_to_string(row.perm_main_conv) << "," + << field_to_string(row.perm_main_pos2_perm) << "," << field_to_string(row.perm_main_pedersen) << "," + << field_to_string(row.perm_main_mem_a) << "," << field_to_string(row.perm_main_mem_b) << "," + << field_to_string(row.perm_main_mem_c) << "," << field_to_string(row.perm_main_mem_d) << "," + << field_to_string(row.perm_main_mem_ind_a) << "," << field_to_string(row.perm_main_mem_ind_b) << "," + << field_to_string(row.perm_main_mem_ind_c) << "," << field_to_string(row.perm_main_mem_ind_d) << "," + << field_to_string(row.lookup_byte_lengths) << "," << field_to_string(row.lookup_byte_operations) << "," + << field_to_string(row.lookup_opcode_gas) << "," << field_to_string(row.range_check_l2_gas_hi) << "," + << field_to_string(row.range_check_l2_gas_lo) << "," << field_to_string(row.range_check_da_gas_hi) << "," + << field_to_string(row.range_check_da_gas_lo) << "," << field_to_string(row.kernel_output_lookup) << "," + << field_to_string(row.lookup_into_kernel) << "," << field_to_string(row.incl_main_tag_err) << "," + << field_to_string(row.incl_mem_tag_err) << "," << field_to_string(row.lookup_mem_rng_chk_lo) << "," + << field_to_string(row.lookup_mem_rng_chk_mid) << "," << field_to_string(row.lookup_mem_rng_chk_hi) << "," + << field_to_string(row.lookup_pow_2_0) << "," << field_to_string(row.lookup_pow_2_1) << "," + << field_to_string(row.lookup_u8_0) << "," << field_to_string(row.lookup_u8_1) << "," + << field_to_string(row.lookup_u16_0) << "," << field_to_string(row.lookup_u16_1) << "," + << field_to_string(row.lookup_u16_2) << "," << field_to_string(row.lookup_u16_3) << "," + << field_to_string(row.lookup_u16_4) << "," << field_to_string(row.lookup_u16_5) << "," + << field_to_string(row.lookup_u16_6) << "," << field_to_string(row.lookup_u16_7) << "," + << field_to_string(row.lookup_u16_8) << "," << field_to_string(row.lookup_u16_9) << "," + << field_to_string(row.lookup_u16_10) << "," << field_to_string(row.lookup_u16_11) << "," + << field_to_string(row.lookup_u16_12) << "," << field_to_string(row.lookup_u16_13) << "," + << field_to_string(row.lookup_u16_14) << "," << field_to_string(row.lookup_div_u16_0) << "," + << field_to_string(row.lookup_div_u16_1) << "," << field_to_string(row.lookup_div_u16_2) << "," + << field_to_string(row.lookup_div_u16_3) << "," << field_to_string(row.lookup_div_u16_4) << "," + << field_to_string(row.lookup_div_u16_5) << "," << field_to_string(row.lookup_div_u16_6) << "," + << field_to_string(row.lookup_div_u16_7) << "," << field_to_string(row.lookup_byte_lengths_counts) << "," << field_to_string(row.lookup_byte_operations_counts) << "," << field_to_string(row.lookup_opcode_gas_counts) << "," << field_to_string(row.range_check_l2_gas_hi_counts) << "," << field_to_string(row.range_check_l2_gas_lo_counts) << "," diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp index a3a8b784711..3cb0b1f7c38 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_circuit_builder.hpp @@ -16,18 +16,13 @@ #include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" #include "barretenberg/stdlib_circuit_builders/circuit_builder_base.hpp" -#include "barretenberg/relations/generated/avm/avm_alu.hpp" -#include "barretenberg/relations/generated/avm/avm_binary.hpp" -#include "barretenberg/relations/generated/avm/avm_conversion.hpp" -#include "barretenberg/relations/generated/avm/avm_keccakf1600.hpp" -#include "barretenberg/relations/generated/avm/avm_kernel.hpp" -#include "barretenberg/relations/generated/avm/avm_main.hpp" -#include "barretenberg/relations/generated/avm/avm_mem.hpp" -#include "barretenberg/relations/generated/avm/avm_pedersen.hpp" -#include "barretenberg/relations/generated/avm/avm_poseidon2.hpp" -#include "barretenberg/relations/generated/avm/avm_sha256.hpp" +#include "barretenberg/relations/generated/avm/alu.hpp" +#include "barretenberg/relations/generated/avm/binary.hpp" +#include "barretenberg/relations/generated/avm/conversion.hpp" #include "barretenberg/relations/generated/avm/incl_main_tag_err.hpp" #include "barretenberg/relations/generated/avm/incl_mem_tag_err.hpp" +#include "barretenberg/relations/generated/avm/keccakf1600.hpp" +#include "barretenberg/relations/generated/avm/kernel.hpp" #include "barretenberg/relations/generated/avm/kernel_output_lookup.hpp" #include "barretenberg/relations/generated/avm/lookup_byte_lengths.hpp" #include "barretenberg/relations/generated/avm/lookup_byte_operations.hpp" @@ -63,6 +58,9 @@ #include "barretenberg/relations/generated/avm/lookup_u16_9.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_0.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_1.hpp" +#include "barretenberg/relations/generated/avm/main.hpp" +#include "barretenberg/relations/generated/avm/mem.hpp" +#include "barretenberg/relations/generated/avm/pedersen.hpp" #include "barretenberg/relations/generated/avm/perm_main_alu.hpp" #include "barretenberg/relations/generated/avm/perm_main_bin.hpp" #include "barretenberg/relations/generated/avm/perm_main_conv.hpp" @@ -76,305 +74,307 @@ #include "barretenberg/relations/generated/avm/perm_main_mem_ind_d.hpp" #include "barretenberg/relations/generated/avm/perm_main_pedersen.hpp" #include "barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp" +#include "barretenberg/relations/generated/avm/poseidon2.hpp" #include "barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp" #include "barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp" #include "barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp" #include "barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp" +#include "barretenberg/relations/generated/avm/sha256.hpp" #include "barretenberg/vm/generated/avm_flavor.hpp" namespace bb { template struct AvmFullRow { - FF avm_main_clk{}; - FF avm_main_first{}; - FF avm_alu_a_hi{}; - FF avm_alu_a_lo{}; - FF avm_alu_alu_sel{}; - FF avm_alu_b_hi{}; - FF avm_alu_b_lo{}; - FF avm_alu_borrow{}; - FF avm_alu_cf{}; - FF avm_alu_clk{}; - FF avm_alu_cmp_rng_ctr{}; - FF avm_alu_cmp_sel{}; - FF avm_alu_div_rng_chk_selector{}; - FF avm_alu_div_u16_r0{}; - FF avm_alu_div_u16_r1{}; - FF avm_alu_div_u16_r2{}; - FF avm_alu_div_u16_r3{}; - FF avm_alu_div_u16_r4{}; - FF avm_alu_div_u16_r5{}; - FF avm_alu_div_u16_r6{}; - FF avm_alu_div_u16_r7{}; - FF avm_alu_divisor_hi{}; - FF avm_alu_divisor_lo{}; - FF avm_alu_ff_tag{}; - FF avm_alu_ia{}; - FF avm_alu_ib{}; - FF avm_alu_ic{}; - FF avm_alu_in_tag{}; - FF avm_alu_op_add{}; - FF avm_alu_op_cast{}; - FF avm_alu_op_cast_prev{}; - FF avm_alu_op_div{}; - FF avm_alu_op_div_a_lt_b{}; - FF avm_alu_op_div_std{}; - FF avm_alu_op_eq{}; - FF avm_alu_op_eq_diff_inv{}; - FF avm_alu_op_lt{}; - FF avm_alu_op_lte{}; - FF avm_alu_op_mul{}; - FF avm_alu_op_not{}; - FF avm_alu_op_shl{}; - FF avm_alu_op_shr{}; - FF avm_alu_op_sub{}; - FF avm_alu_p_a_borrow{}; - FF avm_alu_p_b_borrow{}; - FF avm_alu_p_sub_a_hi{}; - FF avm_alu_p_sub_a_lo{}; - FF avm_alu_p_sub_b_hi{}; - FF avm_alu_p_sub_b_lo{}; - FF avm_alu_partial_prod_hi{}; - FF avm_alu_partial_prod_lo{}; - FF avm_alu_quotient_hi{}; - FF avm_alu_quotient_lo{}; - FF avm_alu_remainder{}; - FF avm_alu_res_hi{}; - FF avm_alu_res_lo{}; - FF avm_alu_rng_chk_lookup_selector{}; - FF avm_alu_rng_chk_sel{}; - FF avm_alu_shift_lt_bit_len{}; - FF avm_alu_shift_sel{}; - FF avm_alu_t_sub_s_bits{}; - FF avm_alu_two_pow_s{}; - FF avm_alu_two_pow_t_sub_s{}; - FF avm_alu_u128_tag{}; - FF avm_alu_u16_r0{}; - FF avm_alu_u16_r1{}; - FF avm_alu_u16_r10{}; - FF avm_alu_u16_r11{}; - FF avm_alu_u16_r12{}; - FF avm_alu_u16_r13{}; - FF avm_alu_u16_r14{}; - FF avm_alu_u16_r2{}; - FF avm_alu_u16_r3{}; - FF avm_alu_u16_r4{}; - FF avm_alu_u16_r5{}; - FF avm_alu_u16_r6{}; - FF avm_alu_u16_r7{}; - FF avm_alu_u16_r8{}; - FF avm_alu_u16_r9{}; - FF avm_alu_u16_tag{}; - FF avm_alu_u32_tag{}; - FF avm_alu_u64_tag{}; - FF avm_alu_u8_r0{}; - FF avm_alu_u8_r1{}; - FF avm_alu_u8_tag{}; - FF avm_binary_acc_ia{}; - FF avm_binary_acc_ib{}; - FF avm_binary_acc_ic{}; - FF avm_binary_bin_sel{}; - FF avm_binary_clk{}; - FF avm_binary_ia_bytes{}; - FF avm_binary_ib_bytes{}; - FF avm_binary_ic_bytes{}; - FF avm_binary_in_tag{}; - FF avm_binary_mem_tag_ctr{}; - FF avm_binary_mem_tag_ctr_inv{}; - FF avm_binary_op_id{}; - FF avm_binary_start{}; - FF avm_byte_lookup_bin_sel{}; - FF avm_byte_lookup_table_byte_lengths{}; - FF avm_byte_lookup_table_in_tags{}; - FF avm_byte_lookup_table_input_a{}; - FF avm_byte_lookup_table_input_b{}; - FF avm_byte_lookup_table_op_id{}; - FF avm_byte_lookup_table_output{}; - FF avm_conversion_clk{}; - FF avm_conversion_input{}; - FF avm_conversion_num_limbs{}; - FF avm_conversion_radix{}; - FF avm_conversion_to_radix_le_sel{}; - FF avm_gas_da_gas_fixed_table{}; - FF avm_gas_gas_cost_sel{}; - FF avm_gas_l2_gas_fixed_table{}; - FF avm_keccakf1600_clk{}; - FF avm_keccakf1600_input{}; - FF avm_keccakf1600_keccakf1600_sel{}; - FF avm_keccakf1600_output{}; - FF avm_kernel_emit_l2_to_l1_msg_write_offset{}; - FF avm_kernel_emit_note_hash_write_offset{}; - FF avm_kernel_emit_nullifier_write_offset{}; - FF avm_kernel_emit_unencrypted_log_write_offset{}; - FF avm_kernel_kernel_in_offset{}; - FF avm_kernel_kernel_inputs{}; - FF avm_kernel_kernel_metadata_out{}; - FF avm_kernel_kernel_out_offset{}; - FF avm_kernel_kernel_side_effect_out{}; - FF avm_kernel_kernel_value_out{}; - FF avm_kernel_l1_to_l2_msg_exists_write_offset{}; - FF avm_kernel_note_hash_exist_write_offset{}; - FF avm_kernel_nullifier_exists_write_offset{}; - FF avm_kernel_nullifier_non_exists_write_offset{}; - FF avm_kernel_q_public_input_kernel_add_to_table{}; - FF avm_kernel_q_public_input_kernel_out_add_to_table{}; - FF avm_kernel_side_effect_counter{}; - FF avm_kernel_sload_write_offset{}; - FF avm_kernel_sstore_write_offset{}; - FF avm_main_abs_da_rem_gas_hi{}; - FF avm_main_abs_da_rem_gas_lo{}; - FF avm_main_abs_l2_rem_gas_hi{}; - FF avm_main_abs_l2_rem_gas_lo{}; - FF avm_main_alu_in_tag{}; - FF avm_main_alu_sel{}; - FF avm_main_bin_op_id{}; - FF avm_main_bin_sel{}; - FF avm_main_call_ptr{}; - FF avm_main_da_gas_op{}; - FF avm_main_da_gas_remaining{}; - FF avm_main_da_out_of_gas{}; - FF avm_main_gas_cost_active{}; - FF avm_main_ia{}; - FF avm_main_ib{}; - FF avm_main_ic{}; - FF avm_main_id{}; - FF avm_main_id_zero{}; - FF avm_main_ind_a{}; - FF avm_main_ind_b{}; - FF avm_main_ind_c{}; - FF avm_main_ind_d{}; - FF avm_main_ind_op_a{}; - FF avm_main_ind_op_b{}; - FF avm_main_ind_op_c{}; - FF avm_main_ind_op_d{}; - FF avm_main_internal_return_ptr{}; - FF avm_main_inv{}; - FF avm_main_l2_gas_op{}; - FF avm_main_l2_gas_remaining{}; - FF avm_main_l2_out_of_gas{}; - FF avm_main_last{}; - FF avm_main_mem_idx_a{}; - FF avm_main_mem_idx_b{}; - FF avm_main_mem_idx_c{}; - FF avm_main_mem_idx_d{}; - FF avm_main_mem_op_a{}; - FF avm_main_mem_op_activate_gas{}; - FF avm_main_mem_op_b{}; - FF avm_main_mem_op_c{}; - FF avm_main_mem_op_d{}; - FF avm_main_op_err{}; - FF avm_main_opcode_val{}; - FF avm_main_pc{}; - FF avm_main_q_kernel_lookup{}; - FF avm_main_q_kernel_output_lookup{}; - FF avm_main_r_in_tag{}; - FF avm_main_rwa{}; - FF avm_main_rwb{}; - FF avm_main_rwc{}; - FF avm_main_rwd{}; - FF avm_main_sel_cmov{}; - FF avm_main_sel_external_call{}; - FF avm_main_sel_halt{}; - FF avm_main_sel_internal_call{}; - FF avm_main_sel_internal_return{}; - FF avm_main_sel_jump{}; - FF avm_main_sel_jumpi{}; - FF avm_main_sel_mov{}; - FF avm_main_sel_mov_a{}; - FF avm_main_sel_mov_b{}; - FF avm_main_sel_op_add{}; - FF avm_main_sel_op_address{}; - FF avm_main_sel_op_and{}; - FF avm_main_sel_op_block_number{}; - FF avm_main_sel_op_cast{}; - FF avm_main_sel_op_chain_id{}; - FF avm_main_sel_op_coinbase{}; - FF avm_main_sel_op_dagasleft{}; - FF avm_main_sel_op_div{}; - FF avm_main_sel_op_emit_l2_to_l1_msg{}; - FF avm_main_sel_op_emit_note_hash{}; - FF avm_main_sel_op_emit_nullifier{}; - FF avm_main_sel_op_emit_unencrypted_log{}; - FF avm_main_sel_op_eq{}; - FF avm_main_sel_op_fdiv{}; - FF avm_main_sel_op_fee_per_da_gas{}; - FF avm_main_sel_op_fee_per_l2_gas{}; - FF avm_main_sel_op_get_contract_instance{}; - FF avm_main_sel_op_keccak{}; - FF avm_main_sel_op_l1_to_l2_msg_exists{}; - FF avm_main_sel_op_l2gasleft{}; - FF avm_main_sel_op_lt{}; - FF avm_main_sel_op_lte{}; - FF avm_main_sel_op_mul{}; - FF avm_main_sel_op_not{}; - FF avm_main_sel_op_note_hash_exists{}; - FF avm_main_sel_op_nullifier_exists{}; - FF avm_main_sel_op_or{}; - FF avm_main_sel_op_pedersen{}; - FF avm_main_sel_op_poseidon2{}; - FF avm_main_sel_op_radix_le{}; - FF avm_main_sel_op_sender{}; - FF avm_main_sel_op_sha256{}; - FF avm_main_sel_op_shl{}; - FF avm_main_sel_op_shr{}; - FF avm_main_sel_op_sload{}; - FF avm_main_sel_op_sstore{}; - FF avm_main_sel_op_storage_address{}; - FF avm_main_sel_op_sub{}; - FF avm_main_sel_op_timestamp{}; - FF avm_main_sel_op_transaction_fee{}; - FF avm_main_sel_op_version{}; - FF avm_main_sel_op_xor{}; - FF avm_main_sel_rng_16{}; - FF avm_main_sel_rng_8{}; - FF avm_main_space_id{}; - FF avm_main_table_pow_2{}; - FF avm_main_tag_err{}; - FF avm_main_w_in_tag{}; - FF avm_mem_addr{}; - FF avm_mem_clk{}; - FF avm_mem_diff_hi{}; - FF avm_mem_diff_lo{}; - FF avm_mem_diff_mid{}; - FF avm_mem_glob_addr{}; - FF avm_mem_ind_op_a{}; - FF avm_mem_ind_op_b{}; - FF avm_mem_ind_op_c{}; - FF avm_mem_ind_op_d{}; - FF avm_mem_last{}; - FF avm_mem_lastAccess{}; - FF avm_mem_mem_sel{}; - FF avm_mem_one_min_inv{}; - FF avm_mem_op_a{}; - FF avm_mem_op_b{}; - FF avm_mem_op_c{}; - FF avm_mem_op_d{}; - FF avm_mem_r_in_tag{}; - FF avm_mem_rng_chk_sel{}; - FF avm_mem_rw{}; - FF avm_mem_sel_cmov{}; - FF avm_mem_sel_mov_a{}; - FF avm_mem_sel_mov_b{}; - FF avm_mem_skip_check_tag{}; - FF avm_mem_space_id{}; - FF avm_mem_tag{}; - FF avm_mem_tag_err{}; - FF avm_mem_tsp{}; - FF avm_mem_val{}; - FF avm_mem_w_in_tag{}; - FF avm_pedersen_clk{}; - FF avm_pedersen_input{}; - FF avm_pedersen_output{}; - FF avm_pedersen_pedersen_sel{}; - FF avm_poseidon2_clk{}; - FF avm_poseidon2_input{}; - FF avm_poseidon2_output{}; - FF avm_poseidon2_poseidon_perm_sel{}; - FF avm_sha256_clk{}; - FF avm_sha256_input{}; - FF avm_sha256_output{}; - FF avm_sha256_sha256_compression_sel{}; - FF avm_sha256_state{}; + FF main_clk{}; + FF main_first{}; + FF alu_a_hi{}; + FF alu_a_lo{}; + FF alu_alu_sel{}; + FF alu_b_hi{}; + FF alu_b_lo{}; + FF alu_borrow{}; + FF alu_cf{}; + FF alu_clk{}; + FF alu_cmp_rng_ctr{}; + FF alu_cmp_sel{}; + FF alu_div_rng_chk_selector{}; + FF alu_div_u16_r0{}; + FF alu_div_u16_r1{}; + FF alu_div_u16_r2{}; + FF alu_div_u16_r3{}; + FF alu_div_u16_r4{}; + FF alu_div_u16_r5{}; + FF alu_div_u16_r6{}; + FF alu_div_u16_r7{}; + FF alu_divisor_hi{}; + FF alu_divisor_lo{}; + FF alu_ff_tag{}; + FF alu_ia{}; + FF alu_ib{}; + FF alu_ic{}; + FF alu_in_tag{}; + FF alu_op_add{}; + FF alu_op_cast{}; + FF alu_op_cast_prev{}; + FF alu_op_div{}; + FF alu_op_div_a_lt_b{}; + FF alu_op_div_std{}; + FF alu_op_eq{}; + FF alu_op_eq_diff_inv{}; + FF alu_op_lt{}; + FF alu_op_lte{}; + FF alu_op_mul{}; + FF alu_op_not{}; + FF alu_op_shl{}; + FF alu_op_shr{}; + FF alu_op_sub{}; + FF alu_p_a_borrow{}; + FF alu_p_b_borrow{}; + FF alu_p_sub_a_hi{}; + FF alu_p_sub_a_lo{}; + FF alu_p_sub_b_hi{}; + FF alu_p_sub_b_lo{}; + FF alu_partial_prod_hi{}; + FF alu_partial_prod_lo{}; + FF alu_quotient_hi{}; + FF alu_quotient_lo{}; + FF alu_remainder{}; + FF alu_res_hi{}; + FF alu_res_lo{}; + FF alu_rng_chk_lookup_selector{}; + FF alu_rng_chk_sel{}; + FF alu_shift_lt_bit_len{}; + FF alu_shift_sel{}; + FF alu_t_sub_s_bits{}; + FF alu_two_pow_s{}; + FF alu_two_pow_t_sub_s{}; + FF alu_u128_tag{}; + FF alu_u16_r0{}; + FF alu_u16_r1{}; + FF alu_u16_r10{}; + FF alu_u16_r11{}; + FF alu_u16_r12{}; + FF alu_u16_r13{}; + FF alu_u16_r14{}; + FF alu_u16_r2{}; + FF alu_u16_r3{}; + FF alu_u16_r4{}; + FF alu_u16_r5{}; + FF alu_u16_r6{}; + FF alu_u16_r7{}; + FF alu_u16_r8{}; + FF alu_u16_r9{}; + FF alu_u16_tag{}; + FF alu_u32_tag{}; + FF alu_u64_tag{}; + FF alu_u8_r0{}; + FF alu_u8_r1{}; + FF alu_u8_tag{}; + FF binary_acc_ia{}; + FF binary_acc_ib{}; + FF binary_acc_ic{}; + FF binary_bin_sel{}; + FF binary_clk{}; + FF binary_ia_bytes{}; + FF binary_ib_bytes{}; + FF binary_ic_bytes{}; + FF binary_in_tag{}; + FF binary_mem_tag_ctr{}; + FF binary_mem_tag_ctr_inv{}; + FF binary_op_id{}; + FF binary_start{}; + FF byte_lookup_bin_sel{}; + FF byte_lookup_table_byte_lengths{}; + FF byte_lookup_table_in_tags{}; + FF byte_lookup_table_input_a{}; + FF byte_lookup_table_input_b{}; + FF byte_lookup_table_op_id{}; + FF byte_lookup_table_output{}; + FF conversion_clk{}; + FF conversion_input{}; + FF conversion_num_limbs{}; + FF conversion_radix{}; + FF conversion_to_radix_le_sel{}; + FF gas_da_gas_fixed_table{}; + FF gas_gas_cost_sel{}; + FF gas_l2_gas_fixed_table{}; + FF keccakf1600_clk{}; + FF keccakf1600_input{}; + FF keccakf1600_keccakf1600_sel{}; + FF keccakf1600_output{}; + FF kernel_emit_l2_to_l1_msg_write_offset{}; + FF kernel_emit_note_hash_write_offset{}; + FF kernel_emit_nullifier_write_offset{}; + FF kernel_emit_unencrypted_log_write_offset{}; + FF kernel_kernel_in_offset{}; + FF kernel_kernel_inputs{}; + FF kernel_kernel_metadata_out{}; + FF kernel_kernel_out_offset{}; + FF kernel_kernel_side_effect_out{}; + FF kernel_kernel_value_out{}; + FF kernel_l1_to_l2_msg_exists_write_offset{}; + FF kernel_note_hash_exist_write_offset{}; + FF kernel_nullifier_exists_write_offset{}; + FF kernel_nullifier_non_exists_write_offset{}; + FF kernel_q_public_input_kernel_add_to_table{}; + FF kernel_q_public_input_kernel_out_add_to_table{}; + FF kernel_side_effect_counter{}; + FF kernel_sload_write_offset{}; + FF kernel_sstore_write_offset{}; + FF main_abs_da_rem_gas_hi{}; + FF main_abs_da_rem_gas_lo{}; + FF main_abs_l2_rem_gas_hi{}; + FF main_abs_l2_rem_gas_lo{}; + FF main_alu_in_tag{}; + FF main_alu_sel{}; + FF main_bin_op_id{}; + FF main_bin_sel{}; + FF main_call_ptr{}; + FF main_da_gas_op{}; + FF main_da_gas_remaining{}; + FF main_da_out_of_gas{}; + FF main_gas_cost_active{}; + FF main_ia{}; + FF main_ib{}; + FF main_ic{}; + FF main_id{}; + FF main_id_zero{}; + FF main_ind_a{}; + FF main_ind_b{}; + FF main_ind_c{}; + FF main_ind_d{}; + FF main_ind_op_a{}; + FF main_ind_op_b{}; + FF main_ind_op_c{}; + FF main_ind_op_d{}; + FF main_internal_return_ptr{}; + FF main_inv{}; + FF main_l2_gas_op{}; + FF main_l2_gas_remaining{}; + FF main_l2_out_of_gas{}; + FF main_last{}; + FF main_mem_idx_a{}; + FF main_mem_idx_b{}; + FF main_mem_idx_c{}; + FF main_mem_idx_d{}; + FF main_mem_op_a{}; + FF main_mem_op_activate_gas{}; + FF main_mem_op_b{}; + FF main_mem_op_c{}; + FF main_mem_op_d{}; + FF main_op_err{}; + FF main_opcode_val{}; + FF main_pc{}; + FF main_q_kernel_lookup{}; + FF main_q_kernel_output_lookup{}; + FF main_r_in_tag{}; + FF main_rwa{}; + FF main_rwb{}; + FF main_rwc{}; + FF main_rwd{}; + FF main_sel_cmov{}; + FF main_sel_external_call{}; + FF main_sel_halt{}; + FF main_sel_internal_call{}; + FF main_sel_internal_return{}; + FF main_sel_jump{}; + FF main_sel_jumpi{}; + FF main_sel_mov{}; + FF main_sel_mov_a{}; + FF main_sel_mov_b{}; + FF main_sel_op_add{}; + FF main_sel_op_address{}; + FF main_sel_op_and{}; + FF main_sel_op_block_number{}; + FF main_sel_op_cast{}; + FF main_sel_op_chain_id{}; + FF main_sel_op_coinbase{}; + FF main_sel_op_dagasleft{}; + FF main_sel_op_div{}; + FF main_sel_op_emit_l2_to_l1_msg{}; + FF main_sel_op_emit_note_hash{}; + FF main_sel_op_emit_nullifier{}; + FF main_sel_op_emit_unencrypted_log{}; + FF main_sel_op_eq{}; + FF main_sel_op_fdiv{}; + FF main_sel_op_fee_per_da_gas{}; + FF main_sel_op_fee_per_l2_gas{}; + FF main_sel_op_get_contract_instance{}; + FF main_sel_op_keccak{}; + FF main_sel_op_l1_to_l2_msg_exists{}; + FF main_sel_op_l2gasleft{}; + FF main_sel_op_lt{}; + FF main_sel_op_lte{}; + FF main_sel_op_mul{}; + FF main_sel_op_not{}; + FF main_sel_op_note_hash_exists{}; + FF main_sel_op_nullifier_exists{}; + FF main_sel_op_or{}; + FF main_sel_op_pedersen{}; + FF main_sel_op_poseidon2{}; + FF main_sel_op_radix_le{}; + FF main_sel_op_sender{}; + FF main_sel_op_sha256{}; + FF main_sel_op_shl{}; + FF main_sel_op_shr{}; + FF main_sel_op_sload{}; + FF main_sel_op_sstore{}; + FF main_sel_op_storage_address{}; + FF main_sel_op_sub{}; + FF main_sel_op_timestamp{}; + FF main_sel_op_transaction_fee{}; + FF main_sel_op_version{}; + FF main_sel_op_xor{}; + FF main_sel_rng_16{}; + FF main_sel_rng_8{}; + FF main_space_id{}; + FF main_table_pow_2{}; + FF main_tag_err{}; + FF main_w_in_tag{}; + FF mem_addr{}; + FF mem_clk{}; + FF mem_diff_hi{}; + FF mem_diff_lo{}; + FF mem_diff_mid{}; + FF mem_glob_addr{}; + FF mem_ind_op_a{}; + FF mem_ind_op_b{}; + FF mem_ind_op_c{}; + FF mem_ind_op_d{}; + FF mem_last{}; + FF mem_lastAccess{}; + FF mem_mem_sel{}; + FF mem_one_min_inv{}; + FF mem_op_a{}; + FF mem_op_b{}; + FF mem_op_c{}; + FF mem_op_d{}; + FF mem_r_in_tag{}; + FF mem_rng_chk_sel{}; + FF mem_rw{}; + FF mem_sel_cmov{}; + FF mem_sel_mov_a{}; + FF mem_sel_mov_b{}; + FF mem_skip_check_tag{}; + FF mem_space_id{}; + FF mem_tag{}; + FF mem_tag_err{}; + FF mem_tsp{}; + FF mem_val{}; + FF mem_w_in_tag{}; + FF pedersen_clk{}; + FF pedersen_input{}; + FF pedersen_output{}; + FF pedersen_pedersen_sel{}; + FF poseidon2_clk{}; + FF poseidon2_input{}; + FF poseidon2_output{}; + FF poseidon2_poseidon_perm_sel{}; + FF sha256_clk{}; + FF sha256_input{}; + FF sha256_output{}; + FF sha256_sha256_compression_sel{}; + FF sha256_state{}; FF perm_main_alu{}; FF perm_main_bin{}; FF perm_main_conv{}; @@ -470,71 +470,71 @@ template struct AvmFullRow { FF lookup_div_u16_5_counts{}; FF lookup_div_u16_6_counts{}; FF lookup_div_u16_7_counts{}; - FF avm_alu_a_hi_shift{}; - FF avm_alu_a_lo_shift{}; - FF avm_alu_alu_sel_shift{}; - FF avm_alu_b_hi_shift{}; - FF avm_alu_b_lo_shift{}; - FF avm_alu_cmp_rng_ctr_shift{}; - FF avm_alu_cmp_sel_shift{}; - FF avm_alu_div_rng_chk_selector_shift{}; - FF avm_alu_div_u16_r0_shift{}; - FF avm_alu_div_u16_r1_shift{}; - FF avm_alu_div_u16_r2_shift{}; - FF avm_alu_div_u16_r3_shift{}; - FF avm_alu_div_u16_r4_shift{}; - FF avm_alu_div_u16_r5_shift{}; - FF avm_alu_div_u16_r6_shift{}; - FF avm_alu_div_u16_r7_shift{}; - FF avm_alu_op_add_shift{}; - FF avm_alu_op_cast_prev_shift{}; - FF avm_alu_op_cast_shift{}; - FF avm_alu_op_div_shift{}; - FF avm_alu_op_mul_shift{}; - FF avm_alu_op_shl_shift{}; - FF avm_alu_op_shr_shift{}; - FF avm_alu_op_sub_shift{}; - FF avm_alu_p_sub_a_hi_shift{}; - FF avm_alu_p_sub_a_lo_shift{}; - FF avm_alu_p_sub_b_hi_shift{}; - FF avm_alu_p_sub_b_lo_shift{}; - FF avm_alu_rng_chk_lookup_selector_shift{}; - FF avm_alu_rng_chk_sel_shift{}; - FF avm_alu_u16_r0_shift{}; - FF avm_alu_u16_r1_shift{}; - FF avm_alu_u16_r2_shift{}; - FF avm_alu_u16_r3_shift{}; - FF avm_alu_u16_r4_shift{}; - FF avm_alu_u16_r5_shift{}; - FF avm_alu_u16_r6_shift{}; - FF avm_alu_u8_r0_shift{}; - FF avm_alu_u8_r1_shift{}; - FF avm_binary_acc_ia_shift{}; - FF avm_binary_acc_ib_shift{}; - FF avm_binary_acc_ic_shift{}; - FF avm_binary_mem_tag_ctr_shift{}; - FF avm_binary_op_id_shift{}; - FF avm_kernel_emit_l2_to_l1_msg_write_offset_shift{}; - FF avm_kernel_emit_note_hash_write_offset_shift{}; - FF avm_kernel_emit_nullifier_write_offset_shift{}; - FF avm_kernel_emit_unencrypted_log_write_offset_shift{}; - FF avm_kernel_l1_to_l2_msg_exists_write_offset_shift{}; - FF avm_kernel_note_hash_exist_write_offset_shift{}; - FF avm_kernel_nullifier_exists_write_offset_shift{}; - FF avm_kernel_nullifier_non_exists_write_offset_shift{}; - FF avm_kernel_side_effect_counter_shift{}; - FF avm_kernel_sload_write_offset_shift{}; - FF avm_kernel_sstore_write_offset_shift{}; - FF avm_main_da_gas_remaining_shift{}; - FF avm_main_internal_return_ptr_shift{}; - FF avm_main_l2_gas_remaining_shift{}; - FF avm_main_pc_shift{}; - FF avm_mem_glob_addr_shift{}; - FF avm_mem_mem_sel_shift{}; - FF avm_mem_rw_shift{}; - FF avm_mem_tag_shift{}; - FF avm_mem_tsp_shift{}; - FF avm_mem_val_shift{}; + FF alu_a_hi_shift{}; + FF alu_a_lo_shift{}; + FF alu_alu_sel_shift{}; + FF alu_b_hi_shift{}; + FF alu_b_lo_shift{}; + FF alu_cmp_rng_ctr_shift{}; + FF alu_cmp_sel_shift{}; + FF alu_div_rng_chk_selector_shift{}; + FF alu_div_u16_r0_shift{}; + FF alu_div_u16_r1_shift{}; + FF alu_div_u16_r2_shift{}; + FF alu_div_u16_r3_shift{}; + FF alu_div_u16_r4_shift{}; + FF alu_div_u16_r5_shift{}; + FF alu_div_u16_r6_shift{}; + FF alu_div_u16_r7_shift{}; + FF alu_op_add_shift{}; + FF alu_op_cast_prev_shift{}; + FF alu_op_cast_shift{}; + FF alu_op_div_shift{}; + FF alu_op_mul_shift{}; + FF alu_op_shl_shift{}; + FF alu_op_shr_shift{}; + FF alu_op_sub_shift{}; + FF alu_p_sub_a_hi_shift{}; + FF alu_p_sub_a_lo_shift{}; + FF alu_p_sub_b_hi_shift{}; + FF alu_p_sub_b_lo_shift{}; + FF alu_rng_chk_lookup_selector_shift{}; + FF alu_rng_chk_sel_shift{}; + FF alu_u16_r0_shift{}; + FF alu_u16_r1_shift{}; + FF alu_u16_r2_shift{}; + FF alu_u16_r3_shift{}; + FF alu_u16_r4_shift{}; + FF alu_u16_r5_shift{}; + FF alu_u16_r6_shift{}; + FF alu_u8_r0_shift{}; + FF alu_u8_r1_shift{}; + FF binary_acc_ia_shift{}; + FF binary_acc_ib_shift{}; + FF binary_acc_ic_shift{}; + FF binary_mem_tag_ctr_shift{}; + FF binary_op_id_shift{}; + FF kernel_emit_l2_to_l1_msg_write_offset_shift{}; + FF kernel_emit_note_hash_write_offset_shift{}; + FF kernel_emit_nullifier_write_offset_shift{}; + FF kernel_emit_unencrypted_log_write_offset_shift{}; + FF kernel_l1_to_l2_msg_exists_write_offset_shift{}; + FF kernel_note_hash_exist_write_offset_shift{}; + FF kernel_nullifier_exists_write_offset_shift{}; + FF kernel_nullifier_non_exists_write_offset_shift{}; + FF kernel_side_effect_counter_shift{}; + FF kernel_sload_write_offset_shift{}; + FF kernel_sstore_write_offset_shift{}; + FF main_da_gas_remaining_shift{}; + FF main_internal_return_ptr_shift{}; + FF main_l2_gas_remaining_shift{}; + FF main_pc_shift{}; + FF mem_glob_addr_shift{}; + FF mem_mem_sel_shift{}; + FF mem_rw_shift{}; + FF mem_tag_shift{}; + FF mem_tsp_shift{}; + FF mem_val_shift{}; [[maybe_unused]] static std::vector names(); }; @@ -568,300 +568,297 @@ class AvmCircuitBuilder { } for (size_t i = 0; i < rows.size(); i++) { - polys.avm_main_clk[i] = rows[i].avm_main_clk; - polys.avm_main_first[i] = rows[i].avm_main_first; - polys.avm_alu_a_hi[i] = rows[i].avm_alu_a_hi; - polys.avm_alu_a_lo[i] = rows[i].avm_alu_a_lo; - polys.avm_alu_alu_sel[i] = rows[i].avm_alu_alu_sel; - polys.avm_alu_b_hi[i] = rows[i].avm_alu_b_hi; - polys.avm_alu_b_lo[i] = rows[i].avm_alu_b_lo; - polys.avm_alu_borrow[i] = rows[i].avm_alu_borrow; - polys.avm_alu_cf[i] = rows[i].avm_alu_cf; - polys.avm_alu_clk[i] = rows[i].avm_alu_clk; - polys.avm_alu_cmp_rng_ctr[i] = rows[i].avm_alu_cmp_rng_ctr; - polys.avm_alu_cmp_sel[i] = rows[i].avm_alu_cmp_sel; - polys.avm_alu_div_rng_chk_selector[i] = rows[i].avm_alu_div_rng_chk_selector; - polys.avm_alu_div_u16_r0[i] = rows[i].avm_alu_div_u16_r0; - polys.avm_alu_div_u16_r1[i] = rows[i].avm_alu_div_u16_r1; - polys.avm_alu_div_u16_r2[i] = rows[i].avm_alu_div_u16_r2; - polys.avm_alu_div_u16_r3[i] = rows[i].avm_alu_div_u16_r3; - polys.avm_alu_div_u16_r4[i] = rows[i].avm_alu_div_u16_r4; - polys.avm_alu_div_u16_r5[i] = rows[i].avm_alu_div_u16_r5; - polys.avm_alu_div_u16_r6[i] = rows[i].avm_alu_div_u16_r6; - polys.avm_alu_div_u16_r7[i] = rows[i].avm_alu_div_u16_r7; - polys.avm_alu_divisor_hi[i] = rows[i].avm_alu_divisor_hi; - polys.avm_alu_divisor_lo[i] = rows[i].avm_alu_divisor_lo; - polys.avm_alu_ff_tag[i] = rows[i].avm_alu_ff_tag; - polys.avm_alu_ia[i] = rows[i].avm_alu_ia; - polys.avm_alu_ib[i] = rows[i].avm_alu_ib; - polys.avm_alu_ic[i] = rows[i].avm_alu_ic; - polys.avm_alu_in_tag[i] = rows[i].avm_alu_in_tag; - polys.avm_alu_op_add[i] = rows[i].avm_alu_op_add; - polys.avm_alu_op_cast[i] = rows[i].avm_alu_op_cast; - polys.avm_alu_op_cast_prev[i] = rows[i].avm_alu_op_cast_prev; - polys.avm_alu_op_div[i] = rows[i].avm_alu_op_div; - polys.avm_alu_op_div_a_lt_b[i] = rows[i].avm_alu_op_div_a_lt_b; - polys.avm_alu_op_div_std[i] = rows[i].avm_alu_op_div_std; - polys.avm_alu_op_eq[i] = rows[i].avm_alu_op_eq; - polys.avm_alu_op_eq_diff_inv[i] = rows[i].avm_alu_op_eq_diff_inv; - polys.avm_alu_op_lt[i] = rows[i].avm_alu_op_lt; - polys.avm_alu_op_lte[i] = rows[i].avm_alu_op_lte; - polys.avm_alu_op_mul[i] = rows[i].avm_alu_op_mul; - polys.avm_alu_op_not[i] = rows[i].avm_alu_op_not; - polys.avm_alu_op_shl[i] = rows[i].avm_alu_op_shl; - polys.avm_alu_op_shr[i] = rows[i].avm_alu_op_shr; - polys.avm_alu_op_sub[i] = rows[i].avm_alu_op_sub; - polys.avm_alu_p_a_borrow[i] = rows[i].avm_alu_p_a_borrow; - polys.avm_alu_p_b_borrow[i] = rows[i].avm_alu_p_b_borrow; - polys.avm_alu_p_sub_a_hi[i] = rows[i].avm_alu_p_sub_a_hi; - polys.avm_alu_p_sub_a_lo[i] = rows[i].avm_alu_p_sub_a_lo; - polys.avm_alu_p_sub_b_hi[i] = rows[i].avm_alu_p_sub_b_hi; - polys.avm_alu_p_sub_b_lo[i] = rows[i].avm_alu_p_sub_b_lo; - polys.avm_alu_partial_prod_hi[i] = rows[i].avm_alu_partial_prod_hi; - polys.avm_alu_partial_prod_lo[i] = rows[i].avm_alu_partial_prod_lo; - polys.avm_alu_quotient_hi[i] = rows[i].avm_alu_quotient_hi; - polys.avm_alu_quotient_lo[i] = rows[i].avm_alu_quotient_lo; - polys.avm_alu_remainder[i] = rows[i].avm_alu_remainder; - polys.avm_alu_res_hi[i] = rows[i].avm_alu_res_hi; - polys.avm_alu_res_lo[i] = rows[i].avm_alu_res_lo; - polys.avm_alu_rng_chk_lookup_selector[i] = rows[i].avm_alu_rng_chk_lookup_selector; - polys.avm_alu_rng_chk_sel[i] = rows[i].avm_alu_rng_chk_sel; - polys.avm_alu_shift_lt_bit_len[i] = rows[i].avm_alu_shift_lt_bit_len; - polys.avm_alu_shift_sel[i] = rows[i].avm_alu_shift_sel; - polys.avm_alu_t_sub_s_bits[i] = rows[i].avm_alu_t_sub_s_bits; - polys.avm_alu_two_pow_s[i] = rows[i].avm_alu_two_pow_s; - polys.avm_alu_two_pow_t_sub_s[i] = rows[i].avm_alu_two_pow_t_sub_s; - polys.avm_alu_u128_tag[i] = rows[i].avm_alu_u128_tag; - polys.avm_alu_u16_r0[i] = rows[i].avm_alu_u16_r0; - polys.avm_alu_u16_r1[i] = rows[i].avm_alu_u16_r1; - polys.avm_alu_u16_r10[i] = rows[i].avm_alu_u16_r10; - polys.avm_alu_u16_r11[i] = rows[i].avm_alu_u16_r11; - polys.avm_alu_u16_r12[i] = rows[i].avm_alu_u16_r12; - polys.avm_alu_u16_r13[i] = rows[i].avm_alu_u16_r13; - polys.avm_alu_u16_r14[i] = rows[i].avm_alu_u16_r14; - polys.avm_alu_u16_r2[i] = rows[i].avm_alu_u16_r2; - polys.avm_alu_u16_r3[i] = rows[i].avm_alu_u16_r3; - polys.avm_alu_u16_r4[i] = rows[i].avm_alu_u16_r4; - polys.avm_alu_u16_r5[i] = rows[i].avm_alu_u16_r5; - polys.avm_alu_u16_r6[i] = rows[i].avm_alu_u16_r6; - polys.avm_alu_u16_r7[i] = rows[i].avm_alu_u16_r7; - polys.avm_alu_u16_r8[i] = rows[i].avm_alu_u16_r8; - polys.avm_alu_u16_r9[i] = rows[i].avm_alu_u16_r9; - polys.avm_alu_u16_tag[i] = rows[i].avm_alu_u16_tag; - polys.avm_alu_u32_tag[i] = rows[i].avm_alu_u32_tag; - polys.avm_alu_u64_tag[i] = rows[i].avm_alu_u64_tag; - polys.avm_alu_u8_r0[i] = rows[i].avm_alu_u8_r0; - polys.avm_alu_u8_r1[i] = rows[i].avm_alu_u8_r1; - polys.avm_alu_u8_tag[i] = rows[i].avm_alu_u8_tag; - polys.avm_binary_acc_ia[i] = rows[i].avm_binary_acc_ia; - polys.avm_binary_acc_ib[i] = rows[i].avm_binary_acc_ib; - polys.avm_binary_acc_ic[i] = rows[i].avm_binary_acc_ic; - polys.avm_binary_bin_sel[i] = rows[i].avm_binary_bin_sel; - polys.avm_binary_clk[i] = rows[i].avm_binary_clk; - polys.avm_binary_ia_bytes[i] = rows[i].avm_binary_ia_bytes; - polys.avm_binary_ib_bytes[i] = rows[i].avm_binary_ib_bytes; - polys.avm_binary_ic_bytes[i] = rows[i].avm_binary_ic_bytes; - polys.avm_binary_in_tag[i] = rows[i].avm_binary_in_tag; - polys.avm_binary_mem_tag_ctr[i] = rows[i].avm_binary_mem_tag_ctr; - polys.avm_binary_mem_tag_ctr_inv[i] = rows[i].avm_binary_mem_tag_ctr_inv; - polys.avm_binary_op_id[i] = rows[i].avm_binary_op_id; - polys.avm_binary_start[i] = rows[i].avm_binary_start; - polys.avm_byte_lookup_bin_sel[i] = rows[i].avm_byte_lookup_bin_sel; - polys.avm_byte_lookup_table_byte_lengths[i] = rows[i].avm_byte_lookup_table_byte_lengths; - polys.avm_byte_lookup_table_in_tags[i] = rows[i].avm_byte_lookup_table_in_tags; - polys.avm_byte_lookup_table_input_a[i] = rows[i].avm_byte_lookup_table_input_a; - polys.avm_byte_lookup_table_input_b[i] = rows[i].avm_byte_lookup_table_input_b; - polys.avm_byte_lookup_table_op_id[i] = rows[i].avm_byte_lookup_table_op_id; - polys.avm_byte_lookup_table_output[i] = rows[i].avm_byte_lookup_table_output; - polys.avm_conversion_clk[i] = rows[i].avm_conversion_clk; - polys.avm_conversion_input[i] = rows[i].avm_conversion_input; - polys.avm_conversion_num_limbs[i] = rows[i].avm_conversion_num_limbs; - polys.avm_conversion_radix[i] = rows[i].avm_conversion_radix; - polys.avm_conversion_to_radix_le_sel[i] = rows[i].avm_conversion_to_radix_le_sel; - polys.avm_gas_da_gas_fixed_table[i] = rows[i].avm_gas_da_gas_fixed_table; - polys.avm_gas_gas_cost_sel[i] = rows[i].avm_gas_gas_cost_sel; - polys.avm_gas_l2_gas_fixed_table[i] = rows[i].avm_gas_l2_gas_fixed_table; - polys.avm_keccakf1600_clk[i] = rows[i].avm_keccakf1600_clk; - polys.avm_keccakf1600_input[i] = rows[i].avm_keccakf1600_input; - polys.avm_keccakf1600_keccakf1600_sel[i] = rows[i].avm_keccakf1600_keccakf1600_sel; - polys.avm_keccakf1600_output[i] = rows[i].avm_keccakf1600_output; - polys.avm_kernel_emit_l2_to_l1_msg_write_offset[i] = rows[i].avm_kernel_emit_l2_to_l1_msg_write_offset; - polys.avm_kernel_emit_note_hash_write_offset[i] = rows[i].avm_kernel_emit_note_hash_write_offset; - polys.avm_kernel_emit_nullifier_write_offset[i] = rows[i].avm_kernel_emit_nullifier_write_offset; - polys.avm_kernel_emit_unencrypted_log_write_offset[i] = - rows[i].avm_kernel_emit_unencrypted_log_write_offset; - polys.avm_kernel_kernel_in_offset[i] = rows[i].avm_kernel_kernel_in_offset; - polys.avm_kernel_kernel_inputs[i] = rows[i].avm_kernel_kernel_inputs; - polys.avm_kernel_kernel_metadata_out[i] = rows[i].avm_kernel_kernel_metadata_out; - polys.avm_kernel_kernel_out_offset[i] = rows[i].avm_kernel_kernel_out_offset; - polys.avm_kernel_kernel_side_effect_out[i] = rows[i].avm_kernel_kernel_side_effect_out; - polys.avm_kernel_kernel_value_out[i] = rows[i].avm_kernel_kernel_value_out; - polys.avm_kernel_l1_to_l2_msg_exists_write_offset[i] = rows[i].avm_kernel_l1_to_l2_msg_exists_write_offset; - polys.avm_kernel_note_hash_exist_write_offset[i] = rows[i].avm_kernel_note_hash_exist_write_offset; - polys.avm_kernel_nullifier_exists_write_offset[i] = rows[i].avm_kernel_nullifier_exists_write_offset; - polys.avm_kernel_nullifier_non_exists_write_offset[i] = - rows[i].avm_kernel_nullifier_non_exists_write_offset; - polys.avm_kernel_q_public_input_kernel_add_to_table[i] = - rows[i].avm_kernel_q_public_input_kernel_add_to_table; - polys.avm_kernel_q_public_input_kernel_out_add_to_table[i] = - rows[i].avm_kernel_q_public_input_kernel_out_add_to_table; - polys.avm_kernel_side_effect_counter[i] = rows[i].avm_kernel_side_effect_counter; - polys.avm_kernel_sload_write_offset[i] = rows[i].avm_kernel_sload_write_offset; - polys.avm_kernel_sstore_write_offset[i] = rows[i].avm_kernel_sstore_write_offset; - polys.avm_main_abs_da_rem_gas_hi[i] = rows[i].avm_main_abs_da_rem_gas_hi; - polys.avm_main_abs_da_rem_gas_lo[i] = rows[i].avm_main_abs_da_rem_gas_lo; - polys.avm_main_abs_l2_rem_gas_hi[i] = rows[i].avm_main_abs_l2_rem_gas_hi; - polys.avm_main_abs_l2_rem_gas_lo[i] = rows[i].avm_main_abs_l2_rem_gas_lo; - polys.avm_main_alu_in_tag[i] = rows[i].avm_main_alu_in_tag; - polys.avm_main_alu_sel[i] = rows[i].avm_main_alu_sel; - polys.avm_main_bin_op_id[i] = rows[i].avm_main_bin_op_id; - polys.avm_main_bin_sel[i] = rows[i].avm_main_bin_sel; - polys.avm_main_call_ptr[i] = rows[i].avm_main_call_ptr; - polys.avm_main_da_gas_op[i] = rows[i].avm_main_da_gas_op; - polys.avm_main_da_gas_remaining[i] = rows[i].avm_main_da_gas_remaining; - polys.avm_main_da_out_of_gas[i] = rows[i].avm_main_da_out_of_gas; - polys.avm_main_gas_cost_active[i] = rows[i].avm_main_gas_cost_active; - polys.avm_main_ia[i] = rows[i].avm_main_ia; - polys.avm_main_ib[i] = rows[i].avm_main_ib; - polys.avm_main_ic[i] = rows[i].avm_main_ic; - polys.avm_main_id[i] = rows[i].avm_main_id; - polys.avm_main_id_zero[i] = rows[i].avm_main_id_zero; - polys.avm_main_ind_a[i] = rows[i].avm_main_ind_a; - polys.avm_main_ind_b[i] = rows[i].avm_main_ind_b; - polys.avm_main_ind_c[i] = rows[i].avm_main_ind_c; - polys.avm_main_ind_d[i] = rows[i].avm_main_ind_d; - polys.avm_main_ind_op_a[i] = rows[i].avm_main_ind_op_a; - polys.avm_main_ind_op_b[i] = rows[i].avm_main_ind_op_b; - polys.avm_main_ind_op_c[i] = rows[i].avm_main_ind_op_c; - polys.avm_main_ind_op_d[i] = rows[i].avm_main_ind_op_d; - polys.avm_main_internal_return_ptr[i] = rows[i].avm_main_internal_return_ptr; - polys.avm_main_inv[i] = rows[i].avm_main_inv; - polys.avm_main_l2_gas_op[i] = rows[i].avm_main_l2_gas_op; - polys.avm_main_l2_gas_remaining[i] = rows[i].avm_main_l2_gas_remaining; - polys.avm_main_l2_out_of_gas[i] = rows[i].avm_main_l2_out_of_gas; - polys.avm_main_last[i] = rows[i].avm_main_last; - polys.avm_main_mem_idx_a[i] = rows[i].avm_main_mem_idx_a; - polys.avm_main_mem_idx_b[i] = rows[i].avm_main_mem_idx_b; - polys.avm_main_mem_idx_c[i] = rows[i].avm_main_mem_idx_c; - polys.avm_main_mem_idx_d[i] = rows[i].avm_main_mem_idx_d; - polys.avm_main_mem_op_a[i] = rows[i].avm_main_mem_op_a; - polys.avm_main_mem_op_activate_gas[i] = rows[i].avm_main_mem_op_activate_gas; - polys.avm_main_mem_op_b[i] = rows[i].avm_main_mem_op_b; - polys.avm_main_mem_op_c[i] = rows[i].avm_main_mem_op_c; - polys.avm_main_mem_op_d[i] = rows[i].avm_main_mem_op_d; - polys.avm_main_op_err[i] = rows[i].avm_main_op_err; - polys.avm_main_opcode_val[i] = rows[i].avm_main_opcode_val; - polys.avm_main_pc[i] = rows[i].avm_main_pc; - polys.avm_main_q_kernel_lookup[i] = rows[i].avm_main_q_kernel_lookup; - polys.avm_main_q_kernel_output_lookup[i] = rows[i].avm_main_q_kernel_output_lookup; - polys.avm_main_r_in_tag[i] = rows[i].avm_main_r_in_tag; - polys.avm_main_rwa[i] = rows[i].avm_main_rwa; - polys.avm_main_rwb[i] = rows[i].avm_main_rwb; - polys.avm_main_rwc[i] = rows[i].avm_main_rwc; - polys.avm_main_rwd[i] = rows[i].avm_main_rwd; - polys.avm_main_sel_cmov[i] = rows[i].avm_main_sel_cmov; - polys.avm_main_sel_external_call[i] = rows[i].avm_main_sel_external_call; - polys.avm_main_sel_halt[i] = rows[i].avm_main_sel_halt; - polys.avm_main_sel_internal_call[i] = rows[i].avm_main_sel_internal_call; - polys.avm_main_sel_internal_return[i] = rows[i].avm_main_sel_internal_return; - polys.avm_main_sel_jump[i] = rows[i].avm_main_sel_jump; - polys.avm_main_sel_jumpi[i] = rows[i].avm_main_sel_jumpi; - polys.avm_main_sel_mov[i] = rows[i].avm_main_sel_mov; - polys.avm_main_sel_mov_a[i] = rows[i].avm_main_sel_mov_a; - polys.avm_main_sel_mov_b[i] = rows[i].avm_main_sel_mov_b; - polys.avm_main_sel_op_add[i] = rows[i].avm_main_sel_op_add; - polys.avm_main_sel_op_address[i] = rows[i].avm_main_sel_op_address; - polys.avm_main_sel_op_and[i] = rows[i].avm_main_sel_op_and; - polys.avm_main_sel_op_block_number[i] = rows[i].avm_main_sel_op_block_number; - polys.avm_main_sel_op_cast[i] = rows[i].avm_main_sel_op_cast; - polys.avm_main_sel_op_chain_id[i] = rows[i].avm_main_sel_op_chain_id; - polys.avm_main_sel_op_coinbase[i] = rows[i].avm_main_sel_op_coinbase; - polys.avm_main_sel_op_dagasleft[i] = rows[i].avm_main_sel_op_dagasleft; - polys.avm_main_sel_op_div[i] = rows[i].avm_main_sel_op_div; - polys.avm_main_sel_op_emit_l2_to_l1_msg[i] = rows[i].avm_main_sel_op_emit_l2_to_l1_msg; - polys.avm_main_sel_op_emit_note_hash[i] = rows[i].avm_main_sel_op_emit_note_hash; - polys.avm_main_sel_op_emit_nullifier[i] = rows[i].avm_main_sel_op_emit_nullifier; - polys.avm_main_sel_op_emit_unencrypted_log[i] = rows[i].avm_main_sel_op_emit_unencrypted_log; - polys.avm_main_sel_op_eq[i] = rows[i].avm_main_sel_op_eq; - polys.avm_main_sel_op_fdiv[i] = rows[i].avm_main_sel_op_fdiv; - polys.avm_main_sel_op_fee_per_da_gas[i] = rows[i].avm_main_sel_op_fee_per_da_gas; - polys.avm_main_sel_op_fee_per_l2_gas[i] = rows[i].avm_main_sel_op_fee_per_l2_gas; - polys.avm_main_sel_op_get_contract_instance[i] = rows[i].avm_main_sel_op_get_contract_instance; - polys.avm_main_sel_op_keccak[i] = rows[i].avm_main_sel_op_keccak; - polys.avm_main_sel_op_l1_to_l2_msg_exists[i] = rows[i].avm_main_sel_op_l1_to_l2_msg_exists; - polys.avm_main_sel_op_l2gasleft[i] = rows[i].avm_main_sel_op_l2gasleft; - polys.avm_main_sel_op_lt[i] = rows[i].avm_main_sel_op_lt; - polys.avm_main_sel_op_lte[i] = rows[i].avm_main_sel_op_lte; - polys.avm_main_sel_op_mul[i] = rows[i].avm_main_sel_op_mul; - polys.avm_main_sel_op_not[i] = rows[i].avm_main_sel_op_not; - polys.avm_main_sel_op_note_hash_exists[i] = rows[i].avm_main_sel_op_note_hash_exists; - polys.avm_main_sel_op_nullifier_exists[i] = rows[i].avm_main_sel_op_nullifier_exists; - polys.avm_main_sel_op_or[i] = rows[i].avm_main_sel_op_or; - polys.avm_main_sel_op_pedersen[i] = rows[i].avm_main_sel_op_pedersen; - polys.avm_main_sel_op_poseidon2[i] = rows[i].avm_main_sel_op_poseidon2; - polys.avm_main_sel_op_radix_le[i] = rows[i].avm_main_sel_op_radix_le; - polys.avm_main_sel_op_sender[i] = rows[i].avm_main_sel_op_sender; - polys.avm_main_sel_op_sha256[i] = rows[i].avm_main_sel_op_sha256; - polys.avm_main_sel_op_shl[i] = rows[i].avm_main_sel_op_shl; - polys.avm_main_sel_op_shr[i] = rows[i].avm_main_sel_op_shr; - polys.avm_main_sel_op_sload[i] = rows[i].avm_main_sel_op_sload; - polys.avm_main_sel_op_sstore[i] = rows[i].avm_main_sel_op_sstore; - polys.avm_main_sel_op_storage_address[i] = rows[i].avm_main_sel_op_storage_address; - polys.avm_main_sel_op_sub[i] = rows[i].avm_main_sel_op_sub; - polys.avm_main_sel_op_timestamp[i] = rows[i].avm_main_sel_op_timestamp; - polys.avm_main_sel_op_transaction_fee[i] = rows[i].avm_main_sel_op_transaction_fee; - polys.avm_main_sel_op_version[i] = rows[i].avm_main_sel_op_version; - polys.avm_main_sel_op_xor[i] = rows[i].avm_main_sel_op_xor; - polys.avm_main_sel_rng_16[i] = rows[i].avm_main_sel_rng_16; - polys.avm_main_sel_rng_8[i] = rows[i].avm_main_sel_rng_8; - polys.avm_main_space_id[i] = rows[i].avm_main_space_id; - polys.avm_main_table_pow_2[i] = rows[i].avm_main_table_pow_2; - polys.avm_main_tag_err[i] = rows[i].avm_main_tag_err; - polys.avm_main_w_in_tag[i] = rows[i].avm_main_w_in_tag; - polys.avm_mem_addr[i] = rows[i].avm_mem_addr; - polys.avm_mem_clk[i] = rows[i].avm_mem_clk; - polys.avm_mem_diff_hi[i] = rows[i].avm_mem_diff_hi; - polys.avm_mem_diff_lo[i] = rows[i].avm_mem_diff_lo; - polys.avm_mem_diff_mid[i] = rows[i].avm_mem_diff_mid; - polys.avm_mem_glob_addr[i] = rows[i].avm_mem_glob_addr; - polys.avm_mem_ind_op_a[i] = rows[i].avm_mem_ind_op_a; - polys.avm_mem_ind_op_b[i] = rows[i].avm_mem_ind_op_b; - polys.avm_mem_ind_op_c[i] = rows[i].avm_mem_ind_op_c; - polys.avm_mem_ind_op_d[i] = rows[i].avm_mem_ind_op_d; - polys.avm_mem_last[i] = rows[i].avm_mem_last; - polys.avm_mem_lastAccess[i] = rows[i].avm_mem_lastAccess; - polys.avm_mem_mem_sel[i] = rows[i].avm_mem_mem_sel; - polys.avm_mem_one_min_inv[i] = rows[i].avm_mem_one_min_inv; - polys.avm_mem_op_a[i] = rows[i].avm_mem_op_a; - polys.avm_mem_op_b[i] = rows[i].avm_mem_op_b; - polys.avm_mem_op_c[i] = rows[i].avm_mem_op_c; - polys.avm_mem_op_d[i] = rows[i].avm_mem_op_d; - polys.avm_mem_r_in_tag[i] = rows[i].avm_mem_r_in_tag; - polys.avm_mem_rng_chk_sel[i] = rows[i].avm_mem_rng_chk_sel; - polys.avm_mem_rw[i] = rows[i].avm_mem_rw; - polys.avm_mem_sel_cmov[i] = rows[i].avm_mem_sel_cmov; - polys.avm_mem_sel_mov_a[i] = rows[i].avm_mem_sel_mov_a; - polys.avm_mem_sel_mov_b[i] = rows[i].avm_mem_sel_mov_b; - polys.avm_mem_skip_check_tag[i] = rows[i].avm_mem_skip_check_tag; - polys.avm_mem_space_id[i] = rows[i].avm_mem_space_id; - polys.avm_mem_tag[i] = rows[i].avm_mem_tag; - polys.avm_mem_tag_err[i] = rows[i].avm_mem_tag_err; - polys.avm_mem_tsp[i] = rows[i].avm_mem_tsp; - polys.avm_mem_val[i] = rows[i].avm_mem_val; - polys.avm_mem_w_in_tag[i] = rows[i].avm_mem_w_in_tag; - polys.avm_pedersen_clk[i] = rows[i].avm_pedersen_clk; - polys.avm_pedersen_input[i] = rows[i].avm_pedersen_input; - polys.avm_pedersen_output[i] = rows[i].avm_pedersen_output; - polys.avm_pedersen_pedersen_sel[i] = rows[i].avm_pedersen_pedersen_sel; - polys.avm_poseidon2_clk[i] = rows[i].avm_poseidon2_clk; - polys.avm_poseidon2_input[i] = rows[i].avm_poseidon2_input; - polys.avm_poseidon2_output[i] = rows[i].avm_poseidon2_output; - polys.avm_poseidon2_poseidon_perm_sel[i] = rows[i].avm_poseidon2_poseidon_perm_sel; - polys.avm_sha256_clk[i] = rows[i].avm_sha256_clk; - polys.avm_sha256_input[i] = rows[i].avm_sha256_input; - polys.avm_sha256_output[i] = rows[i].avm_sha256_output; - polys.avm_sha256_sha256_compression_sel[i] = rows[i].avm_sha256_sha256_compression_sel; - polys.avm_sha256_state[i] = rows[i].avm_sha256_state; + polys.main_clk[i] = rows[i].main_clk; + polys.main_first[i] = rows[i].main_first; + polys.alu_a_hi[i] = rows[i].alu_a_hi; + polys.alu_a_lo[i] = rows[i].alu_a_lo; + polys.alu_alu_sel[i] = rows[i].alu_alu_sel; + polys.alu_b_hi[i] = rows[i].alu_b_hi; + polys.alu_b_lo[i] = rows[i].alu_b_lo; + polys.alu_borrow[i] = rows[i].alu_borrow; + polys.alu_cf[i] = rows[i].alu_cf; + polys.alu_clk[i] = rows[i].alu_clk; + polys.alu_cmp_rng_ctr[i] = rows[i].alu_cmp_rng_ctr; + polys.alu_cmp_sel[i] = rows[i].alu_cmp_sel; + polys.alu_div_rng_chk_selector[i] = rows[i].alu_div_rng_chk_selector; + polys.alu_div_u16_r0[i] = rows[i].alu_div_u16_r0; + polys.alu_div_u16_r1[i] = rows[i].alu_div_u16_r1; + polys.alu_div_u16_r2[i] = rows[i].alu_div_u16_r2; + polys.alu_div_u16_r3[i] = rows[i].alu_div_u16_r3; + polys.alu_div_u16_r4[i] = rows[i].alu_div_u16_r4; + polys.alu_div_u16_r5[i] = rows[i].alu_div_u16_r5; + polys.alu_div_u16_r6[i] = rows[i].alu_div_u16_r6; + polys.alu_div_u16_r7[i] = rows[i].alu_div_u16_r7; + polys.alu_divisor_hi[i] = rows[i].alu_divisor_hi; + polys.alu_divisor_lo[i] = rows[i].alu_divisor_lo; + polys.alu_ff_tag[i] = rows[i].alu_ff_tag; + polys.alu_ia[i] = rows[i].alu_ia; + polys.alu_ib[i] = rows[i].alu_ib; + polys.alu_ic[i] = rows[i].alu_ic; + polys.alu_in_tag[i] = rows[i].alu_in_tag; + polys.alu_op_add[i] = rows[i].alu_op_add; + polys.alu_op_cast[i] = rows[i].alu_op_cast; + polys.alu_op_cast_prev[i] = rows[i].alu_op_cast_prev; + polys.alu_op_div[i] = rows[i].alu_op_div; + polys.alu_op_div_a_lt_b[i] = rows[i].alu_op_div_a_lt_b; + polys.alu_op_div_std[i] = rows[i].alu_op_div_std; + polys.alu_op_eq[i] = rows[i].alu_op_eq; + polys.alu_op_eq_diff_inv[i] = rows[i].alu_op_eq_diff_inv; + polys.alu_op_lt[i] = rows[i].alu_op_lt; + polys.alu_op_lte[i] = rows[i].alu_op_lte; + polys.alu_op_mul[i] = rows[i].alu_op_mul; + polys.alu_op_not[i] = rows[i].alu_op_not; + polys.alu_op_shl[i] = rows[i].alu_op_shl; + polys.alu_op_shr[i] = rows[i].alu_op_shr; + polys.alu_op_sub[i] = rows[i].alu_op_sub; + polys.alu_p_a_borrow[i] = rows[i].alu_p_a_borrow; + polys.alu_p_b_borrow[i] = rows[i].alu_p_b_borrow; + polys.alu_p_sub_a_hi[i] = rows[i].alu_p_sub_a_hi; + polys.alu_p_sub_a_lo[i] = rows[i].alu_p_sub_a_lo; + polys.alu_p_sub_b_hi[i] = rows[i].alu_p_sub_b_hi; + polys.alu_p_sub_b_lo[i] = rows[i].alu_p_sub_b_lo; + polys.alu_partial_prod_hi[i] = rows[i].alu_partial_prod_hi; + polys.alu_partial_prod_lo[i] = rows[i].alu_partial_prod_lo; + polys.alu_quotient_hi[i] = rows[i].alu_quotient_hi; + polys.alu_quotient_lo[i] = rows[i].alu_quotient_lo; + polys.alu_remainder[i] = rows[i].alu_remainder; + polys.alu_res_hi[i] = rows[i].alu_res_hi; + polys.alu_res_lo[i] = rows[i].alu_res_lo; + polys.alu_rng_chk_lookup_selector[i] = rows[i].alu_rng_chk_lookup_selector; + polys.alu_rng_chk_sel[i] = rows[i].alu_rng_chk_sel; + polys.alu_shift_lt_bit_len[i] = rows[i].alu_shift_lt_bit_len; + polys.alu_shift_sel[i] = rows[i].alu_shift_sel; + polys.alu_t_sub_s_bits[i] = rows[i].alu_t_sub_s_bits; + polys.alu_two_pow_s[i] = rows[i].alu_two_pow_s; + polys.alu_two_pow_t_sub_s[i] = rows[i].alu_two_pow_t_sub_s; + polys.alu_u128_tag[i] = rows[i].alu_u128_tag; + polys.alu_u16_r0[i] = rows[i].alu_u16_r0; + polys.alu_u16_r1[i] = rows[i].alu_u16_r1; + polys.alu_u16_r10[i] = rows[i].alu_u16_r10; + polys.alu_u16_r11[i] = rows[i].alu_u16_r11; + polys.alu_u16_r12[i] = rows[i].alu_u16_r12; + polys.alu_u16_r13[i] = rows[i].alu_u16_r13; + polys.alu_u16_r14[i] = rows[i].alu_u16_r14; + polys.alu_u16_r2[i] = rows[i].alu_u16_r2; + polys.alu_u16_r3[i] = rows[i].alu_u16_r3; + polys.alu_u16_r4[i] = rows[i].alu_u16_r4; + polys.alu_u16_r5[i] = rows[i].alu_u16_r5; + polys.alu_u16_r6[i] = rows[i].alu_u16_r6; + polys.alu_u16_r7[i] = rows[i].alu_u16_r7; + polys.alu_u16_r8[i] = rows[i].alu_u16_r8; + polys.alu_u16_r9[i] = rows[i].alu_u16_r9; + polys.alu_u16_tag[i] = rows[i].alu_u16_tag; + polys.alu_u32_tag[i] = rows[i].alu_u32_tag; + polys.alu_u64_tag[i] = rows[i].alu_u64_tag; + polys.alu_u8_r0[i] = rows[i].alu_u8_r0; + polys.alu_u8_r1[i] = rows[i].alu_u8_r1; + polys.alu_u8_tag[i] = rows[i].alu_u8_tag; + polys.binary_acc_ia[i] = rows[i].binary_acc_ia; + polys.binary_acc_ib[i] = rows[i].binary_acc_ib; + polys.binary_acc_ic[i] = rows[i].binary_acc_ic; + polys.binary_bin_sel[i] = rows[i].binary_bin_sel; + polys.binary_clk[i] = rows[i].binary_clk; + polys.binary_ia_bytes[i] = rows[i].binary_ia_bytes; + polys.binary_ib_bytes[i] = rows[i].binary_ib_bytes; + polys.binary_ic_bytes[i] = rows[i].binary_ic_bytes; + polys.binary_in_tag[i] = rows[i].binary_in_tag; + polys.binary_mem_tag_ctr[i] = rows[i].binary_mem_tag_ctr; + polys.binary_mem_tag_ctr_inv[i] = rows[i].binary_mem_tag_ctr_inv; + polys.binary_op_id[i] = rows[i].binary_op_id; + polys.binary_start[i] = rows[i].binary_start; + polys.byte_lookup_bin_sel[i] = rows[i].byte_lookup_bin_sel; + polys.byte_lookup_table_byte_lengths[i] = rows[i].byte_lookup_table_byte_lengths; + polys.byte_lookup_table_in_tags[i] = rows[i].byte_lookup_table_in_tags; + polys.byte_lookup_table_input_a[i] = rows[i].byte_lookup_table_input_a; + polys.byte_lookup_table_input_b[i] = rows[i].byte_lookup_table_input_b; + polys.byte_lookup_table_op_id[i] = rows[i].byte_lookup_table_op_id; + polys.byte_lookup_table_output[i] = rows[i].byte_lookup_table_output; + polys.conversion_clk[i] = rows[i].conversion_clk; + polys.conversion_input[i] = rows[i].conversion_input; + polys.conversion_num_limbs[i] = rows[i].conversion_num_limbs; + polys.conversion_radix[i] = rows[i].conversion_radix; + polys.conversion_to_radix_le_sel[i] = rows[i].conversion_to_radix_le_sel; + polys.gas_da_gas_fixed_table[i] = rows[i].gas_da_gas_fixed_table; + polys.gas_gas_cost_sel[i] = rows[i].gas_gas_cost_sel; + polys.gas_l2_gas_fixed_table[i] = rows[i].gas_l2_gas_fixed_table; + polys.keccakf1600_clk[i] = rows[i].keccakf1600_clk; + polys.keccakf1600_input[i] = rows[i].keccakf1600_input; + polys.keccakf1600_keccakf1600_sel[i] = rows[i].keccakf1600_keccakf1600_sel; + polys.keccakf1600_output[i] = rows[i].keccakf1600_output; + polys.kernel_emit_l2_to_l1_msg_write_offset[i] = rows[i].kernel_emit_l2_to_l1_msg_write_offset; + polys.kernel_emit_note_hash_write_offset[i] = rows[i].kernel_emit_note_hash_write_offset; + polys.kernel_emit_nullifier_write_offset[i] = rows[i].kernel_emit_nullifier_write_offset; + polys.kernel_emit_unencrypted_log_write_offset[i] = rows[i].kernel_emit_unencrypted_log_write_offset; + polys.kernel_kernel_in_offset[i] = rows[i].kernel_kernel_in_offset; + polys.kernel_kernel_inputs[i] = rows[i].kernel_kernel_inputs; + polys.kernel_kernel_metadata_out[i] = rows[i].kernel_kernel_metadata_out; + polys.kernel_kernel_out_offset[i] = rows[i].kernel_kernel_out_offset; + polys.kernel_kernel_side_effect_out[i] = rows[i].kernel_kernel_side_effect_out; + polys.kernel_kernel_value_out[i] = rows[i].kernel_kernel_value_out; + polys.kernel_l1_to_l2_msg_exists_write_offset[i] = rows[i].kernel_l1_to_l2_msg_exists_write_offset; + polys.kernel_note_hash_exist_write_offset[i] = rows[i].kernel_note_hash_exist_write_offset; + polys.kernel_nullifier_exists_write_offset[i] = rows[i].kernel_nullifier_exists_write_offset; + polys.kernel_nullifier_non_exists_write_offset[i] = rows[i].kernel_nullifier_non_exists_write_offset; + polys.kernel_q_public_input_kernel_add_to_table[i] = rows[i].kernel_q_public_input_kernel_add_to_table; + polys.kernel_q_public_input_kernel_out_add_to_table[i] = + rows[i].kernel_q_public_input_kernel_out_add_to_table; + polys.kernel_side_effect_counter[i] = rows[i].kernel_side_effect_counter; + polys.kernel_sload_write_offset[i] = rows[i].kernel_sload_write_offset; + polys.kernel_sstore_write_offset[i] = rows[i].kernel_sstore_write_offset; + polys.main_abs_da_rem_gas_hi[i] = rows[i].main_abs_da_rem_gas_hi; + polys.main_abs_da_rem_gas_lo[i] = rows[i].main_abs_da_rem_gas_lo; + polys.main_abs_l2_rem_gas_hi[i] = rows[i].main_abs_l2_rem_gas_hi; + polys.main_abs_l2_rem_gas_lo[i] = rows[i].main_abs_l2_rem_gas_lo; + polys.main_alu_in_tag[i] = rows[i].main_alu_in_tag; + polys.main_alu_sel[i] = rows[i].main_alu_sel; + polys.main_bin_op_id[i] = rows[i].main_bin_op_id; + polys.main_bin_sel[i] = rows[i].main_bin_sel; + polys.main_call_ptr[i] = rows[i].main_call_ptr; + polys.main_da_gas_op[i] = rows[i].main_da_gas_op; + polys.main_da_gas_remaining[i] = rows[i].main_da_gas_remaining; + polys.main_da_out_of_gas[i] = rows[i].main_da_out_of_gas; + polys.main_gas_cost_active[i] = rows[i].main_gas_cost_active; + polys.main_ia[i] = rows[i].main_ia; + polys.main_ib[i] = rows[i].main_ib; + polys.main_ic[i] = rows[i].main_ic; + polys.main_id[i] = rows[i].main_id; + polys.main_id_zero[i] = rows[i].main_id_zero; + polys.main_ind_a[i] = rows[i].main_ind_a; + polys.main_ind_b[i] = rows[i].main_ind_b; + polys.main_ind_c[i] = rows[i].main_ind_c; + polys.main_ind_d[i] = rows[i].main_ind_d; + polys.main_ind_op_a[i] = rows[i].main_ind_op_a; + polys.main_ind_op_b[i] = rows[i].main_ind_op_b; + polys.main_ind_op_c[i] = rows[i].main_ind_op_c; + polys.main_ind_op_d[i] = rows[i].main_ind_op_d; + polys.main_internal_return_ptr[i] = rows[i].main_internal_return_ptr; + polys.main_inv[i] = rows[i].main_inv; + polys.main_l2_gas_op[i] = rows[i].main_l2_gas_op; + polys.main_l2_gas_remaining[i] = rows[i].main_l2_gas_remaining; + polys.main_l2_out_of_gas[i] = rows[i].main_l2_out_of_gas; + polys.main_last[i] = rows[i].main_last; + polys.main_mem_idx_a[i] = rows[i].main_mem_idx_a; + polys.main_mem_idx_b[i] = rows[i].main_mem_idx_b; + polys.main_mem_idx_c[i] = rows[i].main_mem_idx_c; + polys.main_mem_idx_d[i] = rows[i].main_mem_idx_d; + polys.main_mem_op_a[i] = rows[i].main_mem_op_a; + polys.main_mem_op_activate_gas[i] = rows[i].main_mem_op_activate_gas; + polys.main_mem_op_b[i] = rows[i].main_mem_op_b; + polys.main_mem_op_c[i] = rows[i].main_mem_op_c; + polys.main_mem_op_d[i] = rows[i].main_mem_op_d; + polys.main_op_err[i] = rows[i].main_op_err; + polys.main_opcode_val[i] = rows[i].main_opcode_val; + polys.main_pc[i] = rows[i].main_pc; + polys.main_q_kernel_lookup[i] = rows[i].main_q_kernel_lookup; + polys.main_q_kernel_output_lookup[i] = rows[i].main_q_kernel_output_lookup; + polys.main_r_in_tag[i] = rows[i].main_r_in_tag; + polys.main_rwa[i] = rows[i].main_rwa; + polys.main_rwb[i] = rows[i].main_rwb; + polys.main_rwc[i] = rows[i].main_rwc; + polys.main_rwd[i] = rows[i].main_rwd; + polys.main_sel_cmov[i] = rows[i].main_sel_cmov; + polys.main_sel_external_call[i] = rows[i].main_sel_external_call; + polys.main_sel_halt[i] = rows[i].main_sel_halt; + polys.main_sel_internal_call[i] = rows[i].main_sel_internal_call; + polys.main_sel_internal_return[i] = rows[i].main_sel_internal_return; + polys.main_sel_jump[i] = rows[i].main_sel_jump; + polys.main_sel_jumpi[i] = rows[i].main_sel_jumpi; + polys.main_sel_mov[i] = rows[i].main_sel_mov; + polys.main_sel_mov_a[i] = rows[i].main_sel_mov_a; + polys.main_sel_mov_b[i] = rows[i].main_sel_mov_b; + polys.main_sel_op_add[i] = rows[i].main_sel_op_add; + polys.main_sel_op_address[i] = rows[i].main_sel_op_address; + polys.main_sel_op_and[i] = rows[i].main_sel_op_and; + polys.main_sel_op_block_number[i] = rows[i].main_sel_op_block_number; + polys.main_sel_op_cast[i] = rows[i].main_sel_op_cast; + polys.main_sel_op_chain_id[i] = rows[i].main_sel_op_chain_id; + polys.main_sel_op_coinbase[i] = rows[i].main_sel_op_coinbase; + polys.main_sel_op_dagasleft[i] = rows[i].main_sel_op_dagasleft; + polys.main_sel_op_div[i] = rows[i].main_sel_op_div; + polys.main_sel_op_emit_l2_to_l1_msg[i] = rows[i].main_sel_op_emit_l2_to_l1_msg; + polys.main_sel_op_emit_note_hash[i] = rows[i].main_sel_op_emit_note_hash; + polys.main_sel_op_emit_nullifier[i] = rows[i].main_sel_op_emit_nullifier; + polys.main_sel_op_emit_unencrypted_log[i] = rows[i].main_sel_op_emit_unencrypted_log; + polys.main_sel_op_eq[i] = rows[i].main_sel_op_eq; + polys.main_sel_op_fdiv[i] = rows[i].main_sel_op_fdiv; + polys.main_sel_op_fee_per_da_gas[i] = rows[i].main_sel_op_fee_per_da_gas; + polys.main_sel_op_fee_per_l2_gas[i] = rows[i].main_sel_op_fee_per_l2_gas; + polys.main_sel_op_get_contract_instance[i] = rows[i].main_sel_op_get_contract_instance; + polys.main_sel_op_keccak[i] = rows[i].main_sel_op_keccak; + polys.main_sel_op_l1_to_l2_msg_exists[i] = rows[i].main_sel_op_l1_to_l2_msg_exists; + polys.main_sel_op_l2gasleft[i] = rows[i].main_sel_op_l2gasleft; + polys.main_sel_op_lt[i] = rows[i].main_sel_op_lt; + polys.main_sel_op_lte[i] = rows[i].main_sel_op_lte; + polys.main_sel_op_mul[i] = rows[i].main_sel_op_mul; + polys.main_sel_op_not[i] = rows[i].main_sel_op_not; + polys.main_sel_op_note_hash_exists[i] = rows[i].main_sel_op_note_hash_exists; + polys.main_sel_op_nullifier_exists[i] = rows[i].main_sel_op_nullifier_exists; + polys.main_sel_op_or[i] = rows[i].main_sel_op_or; + polys.main_sel_op_pedersen[i] = rows[i].main_sel_op_pedersen; + polys.main_sel_op_poseidon2[i] = rows[i].main_sel_op_poseidon2; + polys.main_sel_op_radix_le[i] = rows[i].main_sel_op_radix_le; + polys.main_sel_op_sender[i] = rows[i].main_sel_op_sender; + polys.main_sel_op_sha256[i] = rows[i].main_sel_op_sha256; + polys.main_sel_op_shl[i] = rows[i].main_sel_op_shl; + polys.main_sel_op_shr[i] = rows[i].main_sel_op_shr; + polys.main_sel_op_sload[i] = rows[i].main_sel_op_sload; + polys.main_sel_op_sstore[i] = rows[i].main_sel_op_sstore; + polys.main_sel_op_storage_address[i] = rows[i].main_sel_op_storage_address; + polys.main_sel_op_sub[i] = rows[i].main_sel_op_sub; + polys.main_sel_op_timestamp[i] = rows[i].main_sel_op_timestamp; + polys.main_sel_op_transaction_fee[i] = rows[i].main_sel_op_transaction_fee; + polys.main_sel_op_version[i] = rows[i].main_sel_op_version; + polys.main_sel_op_xor[i] = rows[i].main_sel_op_xor; + polys.main_sel_rng_16[i] = rows[i].main_sel_rng_16; + polys.main_sel_rng_8[i] = rows[i].main_sel_rng_8; + polys.main_space_id[i] = rows[i].main_space_id; + polys.main_table_pow_2[i] = rows[i].main_table_pow_2; + polys.main_tag_err[i] = rows[i].main_tag_err; + polys.main_w_in_tag[i] = rows[i].main_w_in_tag; + polys.mem_addr[i] = rows[i].mem_addr; + polys.mem_clk[i] = rows[i].mem_clk; + polys.mem_diff_hi[i] = rows[i].mem_diff_hi; + polys.mem_diff_lo[i] = rows[i].mem_diff_lo; + polys.mem_diff_mid[i] = rows[i].mem_diff_mid; + polys.mem_glob_addr[i] = rows[i].mem_glob_addr; + polys.mem_ind_op_a[i] = rows[i].mem_ind_op_a; + polys.mem_ind_op_b[i] = rows[i].mem_ind_op_b; + polys.mem_ind_op_c[i] = rows[i].mem_ind_op_c; + polys.mem_ind_op_d[i] = rows[i].mem_ind_op_d; + polys.mem_last[i] = rows[i].mem_last; + polys.mem_lastAccess[i] = rows[i].mem_lastAccess; + polys.mem_mem_sel[i] = rows[i].mem_mem_sel; + polys.mem_one_min_inv[i] = rows[i].mem_one_min_inv; + polys.mem_op_a[i] = rows[i].mem_op_a; + polys.mem_op_b[i] = rows[i].mem_op_b; + polys.mem_op_c[i] = rows[i].mem_op_c; + polys.mem_op_d[i] = rows[i].mem_op_d; + polys.mem_r_in_tag[i] = rows[i].mem_r_in_tag; + polys.mem_rng_chk_sel[i] = rows[i].mem_rng_chk_sel; + polys.mem_rw[i] = rows[i].mem_rw; + polys.mem_sel_cmov[i] = rows[i].mem_sel_cmov; + polys.mem_sel_mov_a[i] = rows[i].mem_sel_mov_a; + polys.mem_sel_mov_b[i] = rows[i].mem_sel_mov_b; + polys.mem_skip_check_tag[i] = rows[i].mem_skip_check_tag; + polys.mem_space_id[i] = rows[i].mem_space_id; + polys.mem_tag[i] = rows[i].mem_tag; + polys.mem_tag_err[i] = rows[i].mem_tag_err; + polys.mem_tsp[i] = rows[i].mem_tsp; + polys.mem_val[i] = rows[i].mem_val; + polys.mem_w_in_tag[i] = rows[i].mem_w_in_tag; + polys.pedersen_clk[i] = rows[i].pedersen_clk; + polys.pedersen_input[i] = rows[i].pedersen_input; + polys.pedersen_output[i] = rows[i].pedersen_output; + polys.pedersen_pedersen_sel[i] = rows[i].pedersen_pedersen_sel; + polys.poseidon2_clk[i] = rows[i].poseidon2_clk; + polys.poseidon2_input[i] = rows[i].poseidon2_input; + polys.poseidon2_output[i] = rows[i].poseidon2_output; + polys.poseidon2_poseidon_perm_sel[i] = rows[i].poseidon2_poseidon_perm_sel; + polys.sha256_clk[i] = rows[i].sha256_clk; + polys.sha256_input[i] = rows[i].sha256_input; + polys.sha256_output[i] = rows[i].sha256_output; + polys.sha256_sha256_compression_sel[i] = rows[i].sha256_sha256_compression_sel; + polys.sha256_state[i] = rows[i].sha256_state; polys.lookup_byte_lengths_counts[i] = rows[i].lookup_byte_lengths_counts; polys.lookup_byte_operations_counts[i] = rows[i].lookup_byte_operations_counts; polys.lookup_opcode_gas_counts[i] = rows[i].lookup_opcode_gas_counts; @@ -905,79 +902,77 @@ class AvmCircuitBuilder { polys.lookup_div_u16_7_counts[i] = rows[i].lookup_div_u16_7_counts; } - polys.avm_alu_a_hi_shift = Polynomial(polys.avm_alu_a_hi.shifted()); - polys.avm_alu_a_lo_shift = Polynomial(polys.avm_alu_a_lo.shifted()); - polys.avm_alu_alu_sel_shift = Polynomial(polys.avm_alu_alu_sel.shifted()); - polys.avm_alu_b_hi_shift = Polynomial(polys.avm_alu_b_hi.shifted()); - polys.avm_alu_b_lo_shift = Polynomial(polys.avm_alu_b_lo.shifted()); - polys.avm_alu_cmp_rng_ctr_shift = Polynomial(polys.avm_alu_cmp_rng_ctr.shifted()); - polys.avm_alu_cmp_sel_shift = Polynomial(polys.avm_alu_cmp_sel.shifted()); - polys.avm_alu_div_rng_chk_selector_shift = Polynomial(polys.avm_alu_div_rng_chk_selector.shifted()); - polys.avm_alu_div_u16_r0_shift = Polynomial(polys.avm_alu_div_u16_r0.shifted()); - polys.avm_alu_div_u16_r1_shift = Polynomial(polys.avm_alu_div_u16_r1.shifted()); - polys.avm_alu_div_u16_r2_shift = Polynomial(polys.avm_alu_div_u16_r2.shifted()); - polys.avm_alu_div_u16_r3_shift = Polynomial(polys.avm_alu_div_u16_r3.shifted()); - polys.avm_alu_div_u16_r4_shift = Polynomial(polys.avm_alu_div_u16_r4.shifted()); - polys.avm_alu_div_u16_r5_shift = Polynomial(polys.avm_alu_div_u16_r5.shifted()); - polys.avm_alu_div_u16_r6_shift = Polynomial(polys.avm_alu_div_u16_r6.shifted()); - polys.avm_alu_div_u16_r7_shift = Polynomial(polys.avm_alu_div_u16_r7.shifted()); - polys.avm_alu_op_add_shift = Polynomial(polys.avm_alu_op_add.shifted()); - polys.avm_alu_op_cast_prev_shift = Polynomial(polys.avm_alu_op_cast_prev.shifted()); - polys.avm_alu_op_cast_shift = Polynomial(polys.avm_alu_op_cast.shifted()); - polys.avm_alu_op_div_shift = Polynomial(polys.avm_alu_op_div.shifted()); - polys.avm_alu_op_mul_shift = Polynomial(polys.avm_alu_op_mul.shifted()); - polys.avm_alu_op_shl_shift = Polynomial(polys.avm_alu_op_shl.shifted()); - polys.avm_alu_op_shr_shift = Polynomial(polys.avm_alu_op_shr.shifted()); - polys.avm_alu_op_sub_shift = Polynomial(polys.avm_alu_op_sub.shifted()); - polys.avm_alu_p_sub_a_hi_shift = Polynomial(polys.avm_alu_p_sub_a_hi.shifted()); - polys.avm_alu_p_sub_a_lo_shift = Polynomial(polys.avm_alu_p_sub_a_lo.shifted()); - polys.avm_alu_p_sub_b_hi_shift = Polynomial(polys.avm_alu_p_sub_b_hi.shifted()); - polys.avm_alu_p_sub_b_lo_shift = Polynomial(polys.avm_alu_p_sub_b_lo.shifted()); - polys.avm_alu_rng_chk_lookup_selector_shift = Polynomial(polys.avm_alu_rng_chk_lookup_selector.shifted()); - polys.avm_alu_rng_chk_sel_shift = Polynomial(polys.avm_alu_rng_chk_sel.shifted()); - polys.avm_alu_u16_r0_shift = Polynomial(polys.avm_alu_u16_r0.shifted()); - polys.avm_alu_u16_r1_shift = Polynomial(polys.avm_alu_u16_r1.shifted()); - polys.avm_alu_u16_r2_shift = Polynomial(polys.avm_alu_u16_r2.shifted()); - polys.avm_alu_u16_r3_shift = Polynomial(polys.avm_alu_u16_r3.shifted()); - polys.avm_alu_u16_r4_shift = Polynomial(polys.avm_alu_u16_r4.shifted()); - polys.avm_alu_u16_r5_shift = Polynomial(polys.avm_alu_u16_r5.shifted()); - polys.avm_alu_u16_r6_shift = Polynomial(polys.avm_alu_u16_r6.shifted()); - polys.avm_alu_u8_r0_shift = Polynomial(polys.avm_alu_u8_r0.shifted()); - polys.avm_alu_u8_r1_shift = Polynomial(polys.avm_alu_u8_r1.shifted()); - polys.avm_binary_acc_ia_shift = Polynomial(polys.avm_binary_acc_ia.shifted()); - polys.avm_binary_acc_ib_shift = Polynomial(polys.avm_binary_acc_ib.shifted()); - polys.avm_binary_acc_ic_shift = Polynomial(polys.avm_binary_acc_ic.shifted()); - polys.avm_binary_mem_tag_ctr_shift = Polynomial(polys.avm_binary_mem_tag_ctr.shifted()); - polys.avm_binary_op_id_shift = Polynomial(polys.avm_binary_op_id.shifted()); - polys.avm_kernel_emit_l2_to_l1_msg_write_offset_shift = - Polynomial(polys.avm_kernel_emit_l2_to_l1_msg_write_offset.shifted()); - polys.avm_kernel_emit_note_hash_write_offset_shift = - Polynomial(polys.avm_kernel_emit_note_hash_write_offset.shifted()); - polys.avm_kernel_emit_nullifier_write_offset_shift = - Polynomial(polys.avm_kernel_emit_nullifier_write_offset.shifted()); - polys.avm_kernel_emit_unencrypted_log_write_offset_shift = - Polynomial(polys.avm_kernel_emit_unencrypted_log_write_offset.shifted()); - polys.avm_kernel_l1_to_l2_msg_exists_write_offset_shift = - Polynomial(polys.avm_kernel_l1_to_l2_msg_exists_write_offset.shifted()); - polys.avm_kernel_note_hash_exist_write_offset_shift = - Polynomial(polys.avm_kernel_note_hash_exist_write_offset.shifted()); - polys.avm_kernel_nullifier_exists_write_offset_shift = - Polynomial(polys.avm_kernel_nullifier_exists_write_offset.shifted()); - polys.avm_kernel_nullifier_non_exists_write_offset_shift = - Polynomial(polys.avm_kernel_nullifier_non_exists_write_offset.shifted()); - polys.avm_kernel_side_effect_counter_shift = Polynomial(polys.avm_kernel_side_effect_counter.shifted()); - polys.avm_kernel_sload_write_offset_shift = Polynomial(polys.avm_kernel_sload_write_offset.shifted()); - polys.avm_kernel_sstore_write_offset_shift = Polynomial(polys.avm_kernel_sstore_write_offset.shifted()); - polys.avm_main_da_gas_remaining_shift = Polynomial(polys.avm_main_da_gas_remaining.shifted()); - polys.avm_main_internal_return_ptr_shift = Polynomial(polys.avm_main_internal_return_ptr.shifted()); - polys.avm_main_l2_gas_remaining_shift = Polynomial(polys.avm_main_l2_gas_remaining.shifted()); - polys.avm_main_pc_shift = Polynomial(polys.avm_main_pc.shifted()); - polys.avm_mem_glob_addr_shift = Polynomial(polys.avm_mem_glob_addr.shifted()); - polys.avm_mem_mem_sel_shift = Polynomial(polys.avm_mem_mem_sel.shifted()); - polys.avm_mem_rw_shift = Polynomial(polys.avm_mem_rw.shifted()); - polys.avm_mem_tag_shift = Polynomial(polys.avm_mem_tag.shifted()); - polys.avm_mem_tsp_shift = Polynomial(polys.avm_mem_tsp.shifted()); - polys.avm_mem_val_shift = Polynomial(polys.avm_mem_val.shifted()); + polys.alu_a_hi_shift = Polynomial(polys.alu_a_hi.shifted()); + polys.alu_a_lo_shift = Polynomial(polys.alu_a_lo.shifted()); + polys.alu_alu_sel_shift = Polynomial(polys.alu_alu_sel.shifted()); + polys.alu_b_hi_shift = Polynomial(polys.alu_b_hi.shifted()); + polys.alu_b_lo_shift = Polynomial(polys.alu_b_lo.shifted()); + polys.alu_cmp_rng_ctr_shift = Polynomial(polys.alu_cmp_rng_ctr.shifted()); + polys.alu_cmp_sel_shift = Polynomial(polys.alu_cmp_sel.shifted()); + polys.alu_div_rng_chk_selector_shift = Polynomial(polys.alu_div_rng_chk_selector.shifted()); + polys.alu_div_u16_r0_shift = Polynomial(polys.alu_div_u16_r0.shifted()); + polys.alu_div_u16_r1_shift = Polynomial(polys.alu_div_u16_r1.shifted()); + polys.alu_div_u16_r2_shift = Polynomial(polys.alu_div_u16_r2.shifted()); + polys.alu_div_u16_r3_shift = Polynomial(polys.alu_div_u16_r3.shifted()); + polys.alu_div_u16_r4_shift = Polynomial(polys.alu_div_u16_r4.shifted()); + polys.alu_div_u16_r5_shift = Polynomial(polys.alu_div_u16_r5.shifted()); + polys.alu_div_u16_r6_shift = Polynomial(polys.alu_div_u16_r6.shifted()); + polys.alu_div_u16_r7_shift = Polynomial(polys.alu_div_u16_r7.shifted()); + polys.alu_op_add_shift = Polynomial(polys.alu_op_add.shifted()); + polys.alu_op_cast_prev_shift = Polynomial(polys.alu_op_cast_prev.shifted()); + polys.alu_op_cast_shift = Polynomial(polys.alu_op_cast.shifted()); + polys.alu_op_div_shift = Polynomial(polys.alu_op_div.shifted()); + polys.alu_op_mul_shift = Polynomial(polys.alu_op_mul.shifted()); + polys.alu_op_shl_shift = Polynomial(polys.alu_op_shl.shifted()); + polys.alu_op_shr_shift = Polynomial(polys.alu_op_shr.shifted()); + polys.alu_op_sub_shift = Polynomial(polys.alu_op_sub.shifted()); + polys.alu_p_sub_a_hi_shift = Polynomial(polys.alu_p_sub_a_hi.shifted()); + polys.alu_p_sub_a_lo_shift = Polynomial(polys.alu_p_sub_a_lo.shifted()); + polys.alu_p_sub_b_hi_shift = Polynomial(polys.alu_p_sub_b_hi.shifted()); + polys.alu_p_sub_b_lo_shift = Polynomial(polys.alu_p_sub_b_lo.shifted()); + polys.alu_rng_chk_lookup_selector_shift = Polynomial(polys.alu_rng_chk_lookup_selector.shifted()); + polys.alu_rng_chk_sel_shift = Polynomial(polys.alu_rng_chk_sel.shifted()); + polys.alu_u16_r0_shift = Polynomial(polys.alu_u16_r0.shifted()); + polys.alu_u16_r1_shift = Polynomial(polys.alu_u16_r1.shifted()); + polys.alu_u16_r2_shift = Polynomial(polys.alu_u16_r2.shifted()); + polys.alu_u16_r3_shift = Polynomial(polys.alu_u16_r3.shifted()); + polys.alu_u16_r4_shift = Polynomial(polys.alu_u16_r4.shifted()); + polys.alu_u16_r5_shift = Polynomial(polys.alu_u16_r5.shifted()); + polys.alu_u16_r6_shift = Polynomial(polys.alu_u16_r6.shifted()); + polys.alu_u8_r0_shift = Polynomial(polys.alu_u8_r0.shifted()); + polys.alu_u8_r1_shift = Polynomial(polys.alu_u8_r1.shifted()); + polys.binary_acc_ia_shift = Polynomial(polys.binary_acc_ia.shifted()); + polys.binary_acc_ib_shift = Polynomial(polys.binary_acc_ib.shifted()); + polys.binary_acc_ic_shift = Polynomial(polys.binary_acc_ic.shifted()); + polys.binary_mem_tag_ctr_shift = Polynomial(polys.binary_mem_tag_ctr.shifted()); + polys.binary_op_id_shift = Polynomial(polys.binary_op_id.shifted()); + polys.kernel_emit_l2_to_l1_msg_write_offset_shift = + Polynomial(polys.kernel_emit_l2_to_l1_msg_write_offset.shifted()); + polys.kernel_emit_note_hash_write_offset_shift = Polynomial(polys.kernel_emit_note_hash_write_offset.shifted()); + polys.kernel_emit_nullifier_write_offset_shift = Polynomial(polys.kernel_emit_nullifier_write_offset.shifted()); + polys.kernel_emit_unencrypted_log_write_offset_shift = + Polynomial(polys.kernel_emit_unencrypted_log_write_offset.shifted()); + polys.kernel_l1_to_l2_msg_exists_write_offset_shift = + Polynomial(polys.kernel_l1_to_l2_msg_exists_write_offset.shifted()); + polys.kernel_note_hash_exist_write_offset_shift = + Polynomial(polys.kernel_note_hash_exist_write_offset.shifted()); + polys.kernel_nullifier_exists_write_offset_shift = + Polynomial(polys.kernel_nullifier_exists_write_offset.shifted()); + polys.kernel_nullifier_non_exists_write_offset_shift = + Polynomial(polys.kernel_nullifier_non_exists_write_offset.shifted()); + polys.kernel_side_effect_counter_shift = Polynomial(polys.kernel_side_effect_counter.shifted()); + polys.kernel_sload_write_offset_shift = Polynomial(polys.kernel_sload_write_offset.shifted()); + polys.kernel_sstore_write_offset_shift = Polynomial(polys.kernel_sstore_write_offset.shifted()); + polys.main_da_gas_remaining_shift = Polynomial(polys.main_da_gas_remaining.shifted()); + polys.main_internal_return_ptr_shift = Polynomial(polys.main_internal_return_ptr.shifted()); + polys.main_l2_gas_remaining_shift = Polynomial(polys.main_l2_gas_remaining.shifted()); + polys.main_pc_shift = Polynomial(polys.main_pc.shifted()); + polys.mem_glob_addr_shift = Polynomial(polys.mem_glob_addr.shifted()); + polys.mem_mem_sel_shift = Polynomial(polys.mem_mem_sel.shifted()); + polys.mem_rw_shift = Polynomial(polys.mem_rw.shifted()); + polys.mem_tag_shift = Polynomial(polys.mem_tag.shifted()); + polys.mem_tsp_shift = Polynomial(polys.mem_tsp.shifted()); + polys.mem_val_shift = Polynomial(polys.mem_val.shifted()); return polys; } @@ -1049,54 +1044,51 @@ class AvmCircuitBuilder { return true; }; - auto avm_alu = [=]() { - return evaluate_relation.template operator()>("avm_alu", - Avm_vm::get_relation_label_avm_alu); + auto alu = [=]() { + return evaluate_relation.template operator()>("alu", Avm_vm::get_relation_label_alu); }; - auto avm_binary = [=]() { - return evaluate_relation.template operator()>("avm_binary", - Avm_vm::get_relation_label_avm_binary); + auto binary = [=]() { + return evaluate_relation.template operator()>("binary", + Avm_vm::get_relation_label_binary); }; - auto avm_conversion = [=]() { - return evaluate_relation.template operator()>( - "avm_conversion", Avm_vm::get_relation_label_avm_conversion); + auto conversion = [=]() { + return evaluate_relation.template operator()>("conversion", + Avm_vm::get_relation_label_conversion); }; - auto avm_keccakf1600 = [=]() { - return evaluate_relation.template operator()>( - "avm_keccakf1600", Avm_vm::get_relation_label_avm_keccakf1600); + auto keccakf1600 = [=]() { + return evaluate_relation.template operator()>( + "keccakf1600", Avm_vm::get_relation_label_keccakf1600); }; - auto avm_kernel = [=]() { - return evaluate_relation.template operator()>("avm_kernel", - Avm_vm::get_relation_label_avm_kernel); + auto kernel = [=]() { + return evaluate_relation.template operator()>("kernel", + Avm_vm::get_relation_label_kernel); }; - auto avm_main = [=]() { - return evaluate_relation.template operator()>("avm_main", - Avm_vm::get_relation_label_avm_main); + auto main = [=]() { + return evaluate_relation.template operator()>("main", Avm_vm::get_relation_label_main); }; - auto avm_mem = [=]() { - return evaluate_relation.template operator()>("avm_mem", - Avm_vm::get_relation_label_avm_mem); + auto mem = [=]() { + return evaluate_relation.template operator()>("mem", Avm_vm::get_relation_label_mem); }; - auto avm_pedersen = [=]() { - return evaluate_relation.template operator()>( - "avm_pedersen", Avm_vm::get_relation_label_avm_pedersen); + auto pedersen = [=]() { + return evaluate_relation.template operator()>("pedersen", + Avm_vm::get_relation_label_pedersen); }; - auto avm_poseidon2 = [=]() { - return evaluate_relation.template operator()>( - "avm_poseidon2", Avm_vm::get_relation_label_avm_poseidon2); + auto poseidon2 = [=]() { + return evaluate_relation.template operator()>("poseidon2", + Avm_vm::get_relation_label_poseidon2); }; - auto avm_sha256 = [=]() { - return evaluate_relation.template operator()>("avm_sha256", - Avm_vm::get_relation_label_avm_sha256); + auto sha256 = [=]() { + return evaluate_relation.template operator()>("sha256", + Avm_vm::get_relation_label_sha256); }; auto perm_main_alu = [=]() { @@ -1329,25 +1321,25 @@ class AvmCircuitBuilder { // Evaluate check circuit closures as futures std::vector> relation_futures; - relation_futures.emplace_back(std::async(std::launch::async, avm_alu)); + relation_futures.emplace_back(std::async(std::launch::async, alu)); - relation_futures.emplace_back(std::async(std::launch::async, avm_binary)); + relation_futures.emplace_back(std::async(std::launch::async, binary)); - relation_futures.emplace_back(std::async(std::launch::async, avm_conversion)); + relation_futures.emplace_back(std::async(std::launch::async, conversion)); - relation_futures.emplace_back(std::async(std::launch::async, avm_keccakf1600)); + relation_futures.emplace_back(std::async(std::launch::async, keccakf1600)); - relation_futures.emplace_back(std::async(std::launch::async, avm_kernel)); + relation_futures.emplace_back(std::async(std::launch::async, kernel)); - relation_futures.emplace_back(std::async(std::launch::async, avm_main)); + relation_futures.emplace_back(std::async(std::launch::async, main)); - relation_futures.emplace_back(std::async(std::launch::async, avm_mem)); + relation_futures.emplace_back(std::async(std::launch::async, mem)); - relation_futures.emplace_back(std::async(std::launch::async, avm_pedersen)); + relation_futures.emplace_back(std::async(std::launch::async, pedersen)); - relation_futures.emplace_back(std::async(std::launch::async, avm_poseidon2)); + relation_futures.emplace_back(std::async(std::launch::async, poseidon2)); - relation_futures.emplace_back(std::async(std::launch::async, avm_sha256)); + relation_futures.emplace_back(std::async(std::launch::async, sha256)); relation_futures.emplace_back(std::async(std::launch::async, perm_main_alu)); @@ -1466,25 +1458,25 @@ class AvmCircuitBuilder { } #else - avm_alu(); + alu(); - avm_binary(); + binary(); - avm_conversion(); + conversion(); - avm_keccakf1600(); + keccakf1600(); - avm_kernel(); + kernel(); - avm_main(); + main(); - avm_mem(); + mem(); - avm_pedersen(); + pedersen(); - avm_poseidon2(); + poseidon2(); - avm_sha256(); + sha256(); perm_main_alu(); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp index 5d520d28dc3..4f0f8feadc8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp @@ -13,18 +13,13 @@ #include "barretenberg/flavor/flavor_macros.hpp" #include "barretenberg/polynomials/evaluation_domain.hpp" #include "barretenberg/polynomials/polynomial.hpp" -#include "barretenberg/relations/generated/avm/avm_alu.hpp" -#include "barretenberg/relations/generated/avm/avm_binary.hpp" -#include "barretenberg/relations/generated/avm/avm_conversion.hpp" -#include "barretenberg/relations/generated/avm/avm_keccakf1600.hpp" -#include "barretenberg/relations/generated/avm/avm_kernel.hpp" -#include "barretenberg/relations/generated/avm/avm_main.hpp" -#include "barretenberg/relations/generated/avm/avm_mem.hpp" -#include "barretenberg/relations/generated/avm/avm_pedersen.hpp" -#include "barretenberg/relations/generated/avm/avm_poseidon2.hpp" -#include "barretenberg/relations/generated/avm/avm_sha256.hpp" +#include "barretenberg/relations/generated/avm/alu.hpp" +#include "barretenberg/relations/generated/avm/binary.hpp" +#include "barretenberg/relations/generated/avm/conversion.hpp" #include "barretenberg/relations/generated/avm/incl_main_tag_err.hpp" #include "barretenberg/relations/generated/avm/incl_mem_tag_err.hpp" +#include "barretenberg/relations/generated/avm/keccakf1600.hpp" +#include "barretenberg/relations/generated/avm/kernel.hpp" #include "barretenberg/relations/generated/avm/kernel_output_lookup.hpp" #include "barretenberg/relations/generated/avm/lookup_byte_lengths.hpp" #include "barretenberg/relations/generated/avm/lookup_byte_operations.hpp" @@ -60,6 +55,9 @@ #include "barretenberg/relations/generated/avm/lookup_u16_9.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_0.hpp" #include "barretenberg/relations/generated/avm/lookup_u8_1.hpp" +#include "barretenberg/relations/generated/avm/main.hpp" +#include "barretenberg/relations/generated/avm/mem.hpp" +#include "barretenberg/relations/generated/avm/pedersen.hpp" #include "barretenberg/relations/generated/avm/perm_main_alu.hpp" #include "barretenberg/relations/generated/avm/perm_main_bin.hpp" #include "barretenberg/relations/generated/avm/perm_main_conv.hpp" @@ -73,10 +71,12 @@ #include "barretenberg/relations/generated/avm/perm_main_mem_ind_d.hpp" #include "barretenberg/relations/generated/avm/perm_main_pedersen.hpp" #include "barretenberg/relations/generated/avm/perm_main_pos2_perm.hpp" +#include "barretenberg/relations/generated/avm/poseidon2.hpp" #include "barretenberg/relations/generated/avm/range_check_da_gas_hi.hpp" #include "barretenberg/relations/generated/avm/range_check_da_gas_lo.hpp" #include "barretenberg/relations/generated/avm/range_check_l2_gas_hi.hpp" #include "barretenberg/relations/generated/avm/range_check_l2_gas_lo.hpp" +#include "barretenberg/relations/generated/avm/sha256.hpp" #include "barretenberg/transcript/transcript.hpp" namespace bb { @@ -159,16 +159,16 @@ class AvmFlavor { lookup_div_u16_6_relation, lookup_div_u16_7_relation>; - using Relations = std::tuple, - Avm_vm::avm_binary, - Avm_vm::avm_conversion, - Avm_vm::avm_keccakf1600, - Avm_vm::avm_kernel, - Avm_vm::avm_main, - Avm_vm::avm_mem, - Avm_vm::avm_pedersen, - Avm_vm::avm_poseidon2, - Avm_vm::avm_sha256, + using Relations = std::tuple, + Avm_vm::binary, + Avm_vm::conversion, + Avm_vm::keccakf1600, + Avm_vm::kernel, + Avm_vm::main, + Avm_vm::mem, + Avm_vm::pedersen, + Avm_vm::poseidon2, + Avm_vm::sha256, perm_main_alu_relation, perm_main_bin_relation, perm_main_conv_relation, @@ -245,9 +245,9 @@ class AvmFlavor { public: using DataType = DataType_; - DEFINE_FLAVOR_MEMBERS(DataType, avm_main_clk, avm_main_first) + DEFINE_FLAVOR_MEMBERS(DataType, main_clk, main_first) - RefVector get_selectors() { return { avm_main_clk, avm_main_first }; }; + RefVector get_selectors() { return { main_clk, main_first }; }; RefVector get_sigma_polynomials() { return {}; }; RefVector get_id_polynomials() { return {}; }; RefVector get_table_polynomials() { return {}; }; @@ -256,294 +256,294 @@ class AvmFlavor { template class WitnessEntities { public: DEFINE_FLAVOR_MEMBERS(DataType, - avm_alu_a_hi, - avm_alu_a_lo, - avm_alu_alu_sel, - avm_alu_b_hi, - avm_alu_b_lo, - avm_alu_borrow, - avm_alu_cf, - avm_alu_clk, - avm_alu_cmp_rng_ctr, - avm_alu_cmp_sel, - avm_alu_div_rng_chk_selector, - avm_alu_div_u16_r0, - avm_alu_div_u16_r1, - avm_alu_div_u16_r2, - avm_alu_div_u16_r3, - avm_alu_div_u16_r4, - avm_alu_div_u16_r5, - avm_alu_div_u16_r6, - avm_alu_div_u16_r7, - avm_alu_divisor_hi, - avm_alu_divisor_lo, - avm_alu_ff_tag, - avm_alu_ia, - avm_alu_ib, - avm_alu_ic, - avm_alu_in_tag, - avm_alu_op_add, - avm_alu_op_cast, - avm_alu_op_cast_prev, - avm_alu_op_div, - avm_alu_op_div_a_lt_b, - avm_alu_op_div_std, - avm_alu_op_eq, - avm_alu_op_eq_diff_inv, - avm_alu_op_lt, - avm_alu_op_lte, - avm_alu_op_mul, - avm_alu_op_not, - avm_alu_op_shl, - avm_alu_op_shr, - avm_alu_op_sub, - avm_alu_p_a_borrow, - avm_alu_p_b_borrow, - avm_alu_p_sub_a_hi, - avm_alu_p_sub_a_lo, - avm_alu_p_sub_b_hi, - avm_alu_p_sub_b_lo, - avm_alu_partial_prod_hi, - avm_alu_partial_prod_lo, - avm_alu_quotient_hi, - avm_alu_quotient_lo, - avm_alu_remainder, - avm_alu_res_hi, - avm_alu_res_lo, - avm_alu_rng_chk_lookup_selector, - avm_alu_rng_chk_sel, - avm_alu_shift_lt_bit_len, - avm_alu_shift_sel, - avm_alu_t_sub_s_bits, - avm_alu_two_pow_s, - avm_alu_two_pow_t_sub_s, - avm_alu_u128_tag, - avm_alu_u16_r0, - avm_alu_u16_r1, - avm_alu_u16_r10, - avm_alu_u16_r11, - avm_alu_u16_r12, - avm_alu_u16_r13, - avm_alu_u16_r14, - avm_alu_u16_r2, - avm_alu_u16_r3, - avm_alu_u16_r4, - avm_alu_u16_r5, - avm_alu_u16_r6, - avm_alu_u16_r7, - avm_alu_u16_r8, - avm_alu_u16_r9, - avm_alu_u16_tag, - avm_alu_u32_tag, - avm_alu_u64_tag, - avm_alu_u8_r0, - avm_alu_u8_r1, - avm_alu_u8_tag, - avm_binary_acc_ia, - avm_binary_acc_ib, - avm_binary_acc_ic, - avm_binary_bin_sel, - avm_binary_clk, - avm_binary_ia_bytes, - avm_binary_ib_bytes, - avm_binary_ic_bytes, - avm_binary_in_tag, - avm_binary_mem_tag_ctr, - avm_binary_mem_tag_ctr_inv, - avm_binary_op_id, - avm_binary_start, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_byte_lengths, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_output, - avm_conversion_clk, - avm_conversion_input, - avm_conversion_num_limbs, - avm_conversion_radix, - avm_conversion_to_radix_le_sel, - avm_gas_da_gas_fixed_table, - avm_gas_gas_cost_sel, - avm_gas_l2_gas_fixed_table, - avm_keccakf1600_clk, - avm_keccakf1600_input, - avm_keccakf1600_keccakf1600_sel, - avm_keccakf1600_output, - avm_kernel_emit_l2_to_l1_msg_write_offset, - avm_kernel_emit_note_hash_write_offset, - avm_kernel_emit_nullifier_write_offset, - avm_kernel_emit_unencrypted_log_write_offset, - avm_kernel_kernel_in_offset, - avm_kernel_kernel_inputs, - avm_kernel_kernel_metadata_out, - avm_kernel_kernel_out_offset, - avm_kernel_kernel_side_effect_out, - avm_kernel_kernel_value_out, - avm_kernel_l1_to_l2_msg_exists_write_offset, - avm_kernel_note_hash_exist_write_offset, - avm_kernel_nullifier_exists_write_offset, - avm_kernel_nullifier_non_exists_write_offset, - avm_kernel_q_public_input_kernel_add_to_table, - avm_kernel_q_public_input_kernel_out_add_to_table, - avm_kernel_side_effect_counter, - avm_kernel_sload_write_offset, - avm_kernel_sstore_write_offset, - avm_main_abs_da_rem_gas_hi, - avm_main_abs_da_rem_gas_lo, - avm_main_abs_l2_rem_gas_hi, - avm_main_abs_l2_rem_gas_lo, - avm_main_alu_in_tag, - avm_main_alu_sel, - avm_main_bin_op_id, - avm_main_bin_sel, - avm_main_call_ptr, - avm_main_da_gas_op, - avm_main_da_gas_remaining, - avm_main_da_out_of_gas, - avm_main_gas_cost_active, - avm_main_ia, - avm_main_ib, - avm_main_ic, - avm_main_id, - avm_main_id_zero, - avm_main_ind_a, - avm_main_ind_b, - avm_main_ind_c, - avm_main_ind_d, - avm_main_ind_op_a, - avm_main_ind_op_b, - avm_main_ind_op_c, - avm_main_ind_op_d, - avm_main_internal_return_ptr, - avm_main_inv, - avm_main_l2_gas_op, - avm_main_l2_gas_remaining, - avm_main_l2_out_of_gas, - avm_main_last, - avm_main_mem_idx_a, - avm_main_mem_idx_b, - avm_main_mem_idx_c, - avm_main_mem_idx_d, - avm_main_mem_op_a, - avm_main_mem_op_activate_gas, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_mem_op_d, - avm_main_op_err, - avm_main_opcode_val, - avm_main_pc, - avm_main_q_kernel_lookup, - avm_main_q_kernel_output_lookup, - avm_main_r_in_tag, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, - avm_main_rwd, - avm_main_sel_cmov, - avm_main_sel_external_call, - avm_main_sel_halt, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_jumpi, - avm_main_sel_mov, - avm_main_sel_mov_a, - avm_main_sel_mov_b, - avm_main_sel_op_add, - avm_main_sel_op_address, - avm_main_sel_op_and, - avm_main_sel_op_block_number, - avm_main_sel_op_cast, - avm_main_sel_op_chain_id, - avm_main_sel_op_coinbase, - avm_main_sel_op_dagasleft, - avm_main_sel_op_div, - avm_main_sel_op_emit_l2_to_l1_msg, - avm_main_sel_op_emit_note_hash, - avm_main_sel_op_emit_nullifier, - avm_main_sel_op_emit_unencrypted_log, - avm_main_sel_op_eq, - avm_main_sel_op_fdiv, - avm_main_sel_op_fee_per_da_gas, - avm_main_sel_op_fee_per_l2_gas, - avm_main_sel_op_get_contract_instance, - avm_main_sel_op_keccak, - avm_main_sel_op_l1_to_l2_msg_exists, - avm_main_sel_op_l2gasleft, - avm_main_sel_op_lt, - avm_main_sel_op_lte, - avm_main_sel_op_mul, - avm_main_sel_op_not, - avm_main_sel_op_note_hash_exists, - avm_main_sel_op_nullifier_exists, - avm_main_sel_op_or, - avm_main_sel_op_pedersen, - avm_main_sel_op_poseidon2, - avm_main_sel_op_radix_le, - avm_main_sel_op_sender, - avm_main_sel_op_sha256, - avm_main_sel_op_shl, - avm_main_sel_op_shr, - avm_main_sel_op_sload, - avm_main_sel_op_sstore, - avm_main_sel_op_storage_address, - avm_main_sel_op_sub, - avm_main_sel_op_timestamp, - avm_main_sel_op_transaction_fee, - avm_main_sel_op_version, - avm_main_sel_op_xor, - avm_main_sel_rng_16, - avm_main_sel_rng_8, - avm_main_space_id, - avm_main_table_pow_2, - avm_main_tag_err, - avm_main_w_in_tag, - avm_mem_addr, - avm_mem_clk, - avm_mem_diff_hi, - avm_mem_diff_lo, - avm_mem_diff_mid, - avm_mem_glob_addr, - avm_mem_ind_op_a, - avm_mem_ind_op_b, - avm_mem_ind_op_c, - avm_mem_ind_op_d, - avm_mem_last, - avm_mem_lastAccess, - avm_mem_mem_sel, - avm_mem_one_min_inv, - avm_mem_op_a, - avm_mem_op_b, - avm_mem_op_c, - avm_mem_op_d, - avm_mem_r_in_tag, - avm_mem_rng_chk_sel, - avm_mem_rw, - avm_mem_sel_cmov, - avm_mem_sel_mov_a, - avm_mem_sel_mov_b, - avm_mem_skip_check_tag, - avm_mem_space_id, - avm_mem_tag, - avm_mem_tag_err, - avm_mem_tsp, - avm_mem_val, - avm_mem_w_in_tag, - avm_pedersen_clk, - avm_pedersen_input, - avm_pedersen_output, - avm_pedersen_pedersen_sel, - avm_poseidon2_clk, - avm_poseidon2_input, - avm_poseidon2_output, - avm_poseidon2_poseidon_perm_sel, - avm_sha256_clk, - avm_sha256_input, - avm_sha256_output, - avm_sha256_sha256_compression_sel, - avm_sha256_state, + alu_a_hi, + alu_a_lo, + alu_alu_sel, + alu_b_hi, + alu_b_lo, + alu_borrow, + alu_cf, + alu_clk, + alu_cmp_rng_ctr, + alu_cmp_sel, + alu_div_rng_chk_selector, + alu_div_u16_r0, + alu_div_u16_r1, + alu_div_u16_r2, + alu_div_u16_r3, + alu_div_u16_r4, + alu_div_u16_r5, + alu_div_u16_r6, + alu_div_u16_r7, + alu_divisor_hi, + alu_divisor_lo, + alu_ff_tag, + alu_ia, + alu_ib, + alu_ic, + alu_in_tag, + alu_op_add, + alu_op_cast, + alu_op_cast_prev, + alu_op_div, + alu_op_div_a_lt_b, + alu_op_div_std, + alu_op_eq, + alu_op_eq_diff_inv, + alu_op_lt, + alu_op_lte, + alu_op_mul, + alu_op_not, + alu_op_shl, + alu_op_shr, + alu_op_sub, + alu_p_a_borrow, + alu_p_b_borrow, + alu_p_sub_a_hi, + alu_p_sub_a_lo, + alu_p_sub_b_hi, + alu_p_sub_b_lo, + alu_partial_prod_hi, + alu_partial_prod_lo, + alu_quotient_hi, + alu_quotient_lo, + alu_remainder, + alu_res_hi, + alu_res_lo, + alu_rng_chk_lookup_selector, + alu_rng_chk_sel, + alu_shift_lt_bit_len, + alu_shift_sel, + alu_t_sub_s_bits, + alu_two_pow_s, + alu_two_pow_t_sub_s, + alu_u128_tag, + alu_u16_r0, + alu_u16_r1, + alu_u16_r10, + alu_u16_r11, + alu_u16_r12, + alu_u16_r13, + alu_u16_r14, + alu_u16_r2, + alu_u16_r3, + alu_u16_r4, + alu_u16_r5, + alu_u16_r6, + alu_u16_r7, + alu_u16_r8, + alu_u16_r9, + alu_u16_tag, + alu_u32_tag, + alu_u64_tag, + alu_u8_r0, + alu_u8_r1, + alu_u8_tag, + binary_acc_ia, + binary_acc_ib, + binary_acc_ic, + binary_bin_sel, + binary_clk, + binary_ia_bytes, + binary_ib_bytes, + binary_ic_bytes, + binary_in_tag, + binary_mem_tag_ctr, + binary_mem_tag_ctr_inv, + binary_op_id, + binary_start, + byte_lookup_bin_sel, + byte_lookup_table_byte_lengths, + byte_lookup_table_in_tags, + byte_lookup_table_input_a, + byte_lookup_table_input_b, + byte_lookup_table_op_id, + byte_lookup_table_output, + conversion_clk, + conversion_input, + conversion_num_limbs, + conversion_radix, + conversion_to_radix_le_sel, + gas_da_gas_fixed_table, + gas_gas_cost_sel, + gas_l2_gas_fixed_table, + keccakf1600_clk, + keccakf1600_input, + keccakf1600_keccakf1600_sel, + keccakf1600_output, + kernel_emit_l2_to_l1_msg_write_offset, + kernel_emit_note_hash_write_offset, + kernel_emit_nullifier_write_offset, + kernel_emit_unencrypted_log_write_offset, + kernel_kernel_in_offset, + kernel_kernel_inputs, + kernel_kernel_metadata_out, + kernel_kernel_out_offset, + kernel_kernel_side_effect_out, + kernel_kernel_value_out, + kernel_l1_to_l2_msg_exists_write_offset, + kernel_note_hash_exist_write_offset, + kernel_nullifier_exists_write_offset, + kernel_nullifier_non_exists_write_offset, + kernel_q_public_input_kernel_add_to_table, + kernel_q_public_input_kernel_out_add_to_table, + kernel_side_effect_counter, + kernel_sload_write_offset, + kernel_sstore_write_offset, + main_abs_da_rem_gas_hi, + main_abs_da_rem_gas_lo, + main_abs_l2_rem_gas_hi, + main_abs_l2_rem_gas_lo, + main_alu_in_tag, + main_alu_sel, + main_bin_op_id, + main_bin_sel, + main_call_ptr, + main_da_gas_op, + main_da_gas_remaining, + main_da_out_of_gas, + main_gas_cost_active, + main_ia, + main_ib, + main_ic, + main_id, + main_id_zero, + main_ind_a, + main_ind_b, + main_ind_c, + main_ind_d, + main_ind_op_a, + main_ind_op_b, + main_ind_op_c, + main_ind_op_d, + main_internal_return_ptr, + main_inv, + main_l2_gas_op, + main_l2_gas_remaining, + main_l2_out_of_gas, + main_last, + main_mem_idx_a, + main_mem_idx_b, + main_mem_idx_c, + main_mem_idx_d, + main_mem_op_a, + main_mem_op_activate_gas, + main_mem_op_b, + main_mem_op_c, + main_mem_op_d, + main_op_err, + main_opcode_val, + main_pc, + main_q_kernel_lookup, + main_q_kernel_output_lookup, + main_r_in_tag, + main_rwa, + main_rwb, + main_rwc, + main_rwd, + main_sel_cmov, + main_sel_external_call, + main_sel_halt, + main_sel_internal_call, + main_sel_internal_return, + main_sel_jump, + main_sel_jumpi, + main_sel_mov, + main_sel_mov_a, + main_sel_mov_b, + main_sel_op_add, + main_sel_op_address, + main_sel_op_and, + main_sel_op_block_number, + main_sel_op_cast, + main_sel_op_chain_id, + main_sel_op_coinbase, + main_sel_op_dagasleft, + main_sel_op_div, + main_sel_op_emit_l2_to_l1_msg, + main_sel_op_emit_note_hash, + main_sel_op_emit_nullifier, + main_sel_op_emit_unencrypted_log, + main_sel_op_eq, + main_sel_op_fdiv, + main_sel_op_fee_per_da_gas, + main_sel_op_fee_per_l2_gas, + main_sel_op_get_contract_instance, + main_sel_op_keccak, + main_sel_op_l1_to_l2_msg_exists, + main_sel_op_l2gasleft, + main_sel_op_lt, + main_sel_op_lte, + main_sel_op_mul, + main_sel_op_not, + main_sel_op_note_hash_exists, + main_sel_op_nullifier_exists, + main_sel_op_or, + main_sel_op_pedersen, + main_sel_op_poseidon2, + main_sel_op_radix_le, + main_sel_op_sender, + main_sel_op_sha256, + main_sel_op_shl, + main_sel_op_shr, + main_sel_op_sload, + main_sel_op_sstore, + main_sel_op_storage_address, + main_sel_op_sub, + main_sel_op_timestamp, + main_sel_op_transaction_fee, + main_sel_op_version, + main_sel_op_xor, + main_sel_rng_16, + main_sel_rng_8, + main_space_id, + main_table_pow_2, + main_tag_err, + main_w_in_tag, + mem_addr, + mem_clk, + mem_diff_hi, + mem_diff_lo, + mem_diff_mid, + mem_glob_addr, + mem_ind_op_a, + mem_ind_op_b, + mem_ind_op_c, + mem_ind_op_d, + mem_last, + mem_lastAccess, + mem_mem_sel, + mem_one_min_inv, + mem_op_a, + mem_op_b, + mem_op_c, + mem_op_d, + mem_r_in_tag, + mem_rng_chk_sel, + mem_rw, + mem_sel_cmov, + mem_sel_mov_a, + mem_sel_mov_b, + mem_skip_check_tag, + mem_space_id, + mem_tag, + mem_tag_err, + mem_tsp, + mem_val, + mem_w_in_tag, + pedersen_clk, + pedersen_input, + pedersen_output, + pedersen_pedersen_sel, + poseidon2_clk, + poseidon2_input, + poseidon2_output, + poseidon2_poseidon_perm_sel, + sha256_clk, + sha256_input, + sha256_output, + sha256_sha256_compression_sel, + sha256_state, perm_main_alu, perm_main_bin, perm_main_conv, @@ -642,294 +642,294 @@ class AvmFlavor { RefVector get_wires() { - return { avm_alu_a_hi, - avm_alu_a_lo, - avm_alu_alu_sel, - avm_alu_b_hi, - avm_alu_b_lo, - avm_alu_borrow, - avm_alu_cf, - avm_alu_clk, - avm_alu_cmp_rng_ctr, - avm_alu_cmp_sel, - avm_alu_div_rng_chk_selector, - avm_alu_div_u16_r0, - avm_alu_div_u16_r1, - avm_alu_div_u16_r2, - avm_alu_div_u16_r3, - avm_alu_div_u16_r4, - avm_alu_div_u16_r5, - avm_alu_div_u16_r6, - avm_alu_div_u16_r7, - avm_alu_divisor_hi, - avm_alu_divisor_lo, - avm_alu_ff_tag, - avm_alu_ia, - avm_alu_ib, - avm_alu_ic, - avm_alu_in_tag, - avm_alu_op_add, - avm_alu_op_cast, - avm_alu_op_cast_prev, - avm_alu_op_div, - avm_alu_op_div_a_lt_b, - avm_alu_op_div_std, - avm_alu_op_eq, - avm_alu_op_eq_diff_inv, - avm_alu_op_lt, - avm_alu_op_lte, - avm_alu_op_mul, - avm_alu_op_not, - avm_alu_op_shl, - avm_alu_op_shr, - avm_alu_op_sub, - avm_alu_p_a_borrow, - avm_alu_p_b_borrow, - avm_alu_p_sub_a_hi, - avm_alu_p_sub_a_lo, - avm_alu_p_sub_b_hi, - avm_alu_p_sub_b_lo, - avm_alu_partial_prod_hi, - avm_alu_partial_prod_lo, - avm_alu_quotient_hi, - avm_alu_quotient_lo, - avm_alu_remainder, - avm_alu_res_hi, - avm_alu_res_lo, - avm_alu_rng_chk_lookup_selector, - avm_alu_rng_chk_sel, - avm_alu_shift_lt_bit_len, - avm_alu_shift_sel, - avm_alu_t_sub_s_bits, - avm_alu_two_pow_s, - avm_alu_two_pow_t_sub_s, - avm_alu_u128_tag, - avm_alu_u16_r0, - avm_alu_u16_r1, - avm_alu_u16_r10, - avm_alu_u16_r11, - avm_alu_u16_r12, - avm_alu_u16_r13, - avm_alu_u16_r14, - avm_alu_u16_r2, - avm_alu_u16_r3, - avm_alu_u16_r4, - avm_alu_u16_r5, - avm_alu_u16_r6, - avm_alu_u16_r7, - avm_alu_u16_r8, - avm_alu_u16_r9, - avm_alu_u16_tag, - avm_alu_u32_tag, - avm_alu_u64_tag, - avm_alu_u8_r0, - avm_alu_u8_r1, - avm_alu_u8_tag, - avm_binary_acc_ia, - avm_binary_acc_ib, - avm_binary_acc_ic, - avm_binary_bin_sel, - avm_binary_clk, - avm_binary_ia_bytes, - avm_binary_ib_bytes, - avm_binary_ic_bytes, - avm_binary_in_tag, - avm_binary_mem_tag_ctr, - avm_binary_mem_tag_ctr_inv, - avm_binary_op_id, - avm_binary_start, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_byte_lengths, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_output, - avm_conversion_clk, - avm_conversion_input, - avm_conversion_num_limbs, - avm_conversion_radix, - avm_conversion_to_radix_le_sel, - avm_gas_da_gas_fixed_table, - avm_gas_gas_cost_sel, - avm_gas_l2_gas_fixed_table, - avm_keccakf1600_clk, - avm_keccakf1600_input, - avm_keccakf1600_keccakf1600_sel, - avm_keccakf1600_output, - avm_kernel_emit_l2_to_l1_msg_write_offset, - avm_kernel_emit_note_hash_write_offset, - avm_kernel_emit_nullifier_write_offset, - avm_kernel_emit_unencrypted_log_write_offset, - avm_kernel_kernel_in_offset, - avm_kernel_kernel_inputs, - avm_kernel_kernel_metadata_out, - avm_kernel_kernel_out_offset, - avm_kernel_kernel_side_effect_out, - avm_kernel_kernel_value_out, - avm_kernel_l1_to_l2_msg_exists_write_offset, - avm_kernel_note_hash_exist_write_offset, - avm_kernel_nullifier_exists_write_offset, - avm_kernel_nullifier_non_exists_write_offset, - avm_kernel_q_public_input_kernel_add_to_table, - avm_kernel_q_public_input_kernel_out_add_to_table, - avm_kernel_side_effect_counter, - avm_kernel_sload_write_offset, - avm_kernel_sstore_write_offset, - avm_main_abs_da_rem_gas_hi, - avm_main_abs_da_rem_gas_lo, - avm_main_abs_l2_rem_gas_hi, - avm_main_abs_l2_rem_gas_lo, - avm_main_alu_in_tag, - avm_main_alu_sel, - avm_main_bin_op_id, - avm_main_bin_sel, - avm_main_call_ptr, - avm_main_da_gas_op, - avm_main_da_gas_remaining, - avm_main_da_out_of_gas, - avm_main_gas_cost_active, - avm_main_ia, - avm_main_ib, - avm_main_ic, - avm_main_id, - avm_main_id_zero, - avm_main_ind_a, - avm_main_ind_b, - avm_main_ind_c, - avm_main_ind_d, - avm_main_ind_op_a, - avm_main_ind_op_b, - avm_main_ind_op_c, - avm_main_ind_op_d, - avm_main_internal_return_ptr, - avm_main_inv, - avm_main_l2_gas_op, - avm_main_l2_gas_remaining, - avm_main_l2_out_of_gas, - avm_main_last, - avm_main_mem_idx_a, - avm_main_mem_idx_b, - avm_main_mem_idx_c, - avm_main_mem_idx_d, - avm_main_mem_op_a, - avm_main_mem_op_activate_gas, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_mem_op_d, - avm_main_op_err, - avm_main_opcode_val, - avm_main_pc, - avm_main_q_kernel_lookup, - avm_main_q_kernel_output_lookup, - avm_main_r_in_tag, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, - avm_main_rwd, - avm_main_sel_cmov, - avm_main_sel_external_call, - avm_main_sel_halt, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_jumpi, - avm_main_sel_mov, - avm_main_sel_mov_a, - avm_main_sel_mov_b, - avm_main_sel_op_add, - avm_main_sel_op_address, - avm_main_sel_op_and, - avm_main_sel_op_block_number, - avm_main_sel_op_cast, - avm_main_sel_op_chain_id, - avm_main_sel_op_coinbase, - avm_main_sel_op_dagasleft, - avm_main_sel_op_div, - avm_main_sel_op_emit_l2_to_l1_msg, - avm_main_sel_op_emit_note_hash, - avm_main_sel_op_emit_nullifier, - avm_main_sel_op_emit_unencrypted_log, - avm_main_sel_op_eq, - avm_main_sel_op_fdiv, - avm_main_sel_op_fee_per_da_gas, - avm_main_sel_op_fee_per_l2_gas, - avm_main_sel_op_get_contract_instance, - avm_main_sel_op_keccak, - avm_main_sel_op_l1_to_l2_msg_exists, - avm_main_sel_op_l2gasleft, - avm_main_sel_op_lt, - avm_main_sel_op_lte, - avm_main_sel_op_mul, - avm_main_sel_op_not, - avm_main_sel_op_note_hash_exists, - avm_main_sel_op_nullifier_exists, - avm_main_sel_op_or, - avm_main_sel_op_pedersen, - avm_main_sel_op_poseidon2, - avm_main_sel_op_radix_le, - avm_main_sel_op_sender, - avm_main_sel_op_sha256, - avm_main_sel_op_shl, - avm_main_sel_op_shr, - avm_main_sel_op_sload, - avm_main_sel_op_sstore, - avm_main_sel_op_storage_address, - avm_main_sel_op_sub, - avm_main_sel_op_timestamp, - avm_main_sel_op_transaction_fee, - avm_main_sel_op_version, - avm_main_sel_op_xor, - avm_main_sel_rng_16, - avm_main_sel_rng_8, - avm_main_space_id, - avm_main_table_pow_2, - avm_main_tag_err, - avm_main_w_in_tag, - avm_mem_addr, - avm_mem_clk, - avm_mem_diff_hi, - avm_mem_diff_lo, - avm_mem_diff_mid, - avm_mem_glob_addr, - avm_mem_ind_op_a, - avm_mem_ind_op_b, - avm_mem_ind_op_c, - avm_mem_ind_op_d, - avm_mem_last, - avm_mem_lastAccess, - avm_mem_mem_sel, - avm_mem_one_min_inv, - avm_mem_op_a, - avm_mem_op_b, - avm_mem_op_c, - avm_mem_op_d, - avm_mem_r_in_tag, - avm_mem_rng_chk_sel, - avm_mem_rw, - avm_mem_sel_cmov, - avm_mem_sel_mov_a, - avm_mem_sel_mov_b, - avm_mem_skip_check_tag, - avm_mem_space_id, - avm_mem_tag, - avm_mem_tag_err, - avm_mem_tsp, - avm_mem_val, - avm_mem_w_in_tag, - avm_pedersen_clk, - avm_pedersen_input, - avm_pedersen_output, - avm_pedersen_pedersen_sel, - avm_poseidon2_clk, - avm_poseidon2_input, - avm_poseidon2_output, - avm_poseidon2_poseidon_perm_sel, - avm_sha256_clk, - avm_sha256_input, - avm_sha256_output, - avm_sha256_sha256_compression_sel, - avm_sha256_state, + return { alu_a_hi, + alu_a_lo, + alu_alu_sel, + alu_b_hi, + alu_b_lo, + alu_borrow, + alu_cf, + alu_clk, + alu_cmp_rng_ctr, + alu_cmp_sel, + alu_div_rng_chk_selector, + alu_div_u16_r0, + alu_div_u16_r1, + alu_div_u16_r2, + alu_div_u16_r3, + alu_div_u16_r4, + alu_div_u16_r5, + alu_div_u16_r6, + alu_div_u16_r7, + alu_divisor_hi, + alu_divisor_lo, + alu_ff_tag, + alu_ia, + alu_ib, + alu_ic, + alu_in_tag, + alu_op_add, + alu_op_cast, + alu_op_cast_prev, + alu_op_div, + alu_op_div_a_lt_b, + alu_op_div_std, + alu_op_eq, + alu_op_eq_diff_inv, + alu_op_lt, + alu_op_lte, + alu_op_mul, + alu_op_not, + alu_op_shl, + alu_op_shr, + alu_op_sub, + alu_p_a_borrow, + alu_p_b_borrow, + alu_p_sub_a_hi, + alu_p_sub_a_lo, + alu_p_sub_b_hi, + alu_p_sub_b_lo, + alu_partial_prod_hi, + alu_partial_prod_lo, + alu_quotient_hi, + alu_quotient_lo, + alu_remainder, + alu_res_hi, + alu_res_lo, + alu_rng_chk_lookup_selector, + alu_rng_chk_sel, + alu_shift_lt_bit_len, + alu_shift_sel, + alu_t_sub_s_bits, + alu_two_pow_s, + alu_two_pow_t_sub_s, + alu_u128_tag, + alu_u16_r0, + alu_u16_r1, + alu_u16_r10, + alu_u16_r11, + alu_u16_r12, + alu_u16_r13, + alu_u16_r14, + alu_u16_r2, + alu_u16_r3, + alu_u16_r4, + alu_u16_r5, + alu_u16_r6, + alu_u16_r7, + alu_u16_r8, + alu_u16_r9, + alu_u16_tag, + alu_u32_tag, + alu_u64_tag, + alu_u8_r0, + alu_u8_r1, + alu_u8_tag, + binary_acc_ia, + binary_acc_ib, + binary_acc_ic, + binary_bin_sel, + binary_clk, + binary_ia_bytes, + binary_ib_bytes, + binary_ic_bytes, + binary_in_tag, + binary_mem_tag_ctr, + binary_mem_tag_ctr_inv, + binary_op_id, + binary_start, + byte_lookup_bin_sel, + byte_lookup_table_byte_lengths, + byte_lookup_table_in_tags, + byte_lookup_table_input_a, + byte_lookup_table_input_b, + byte_lookup_table_op_id, + byte_lookup_table_output, + conversion_clk, + conversion_input, + conversion_num_limbs, + conversion_radix, + conversion_to_radix_le_sel, + gas_da_gas_fixed_table, + gas_gas_cost_sel, + gas_l2_gas_fixed_table, + keccakf1600_clk, + keccakf1600_input, + keccakf1600_keccakf1600_sel, + keccakf1600_output, + kernel_emit_l2_to_l1_msg_write_offset, + kernel_emit_note_hash_write_offset, + kernel_emit_nullifier_write_offset, + kernel_emit_unencrypted_log_write_offset, + kernel_kernel_in_offset, + kernel_kernel_inputs, + kernel_kernel_metadata_out, + kernel_kernel_out_offset, + kernel_kernel_side_effect_out, + kernel_kernel_value_out, + kernel_l1_to_l2_msg_exists_write_offset, + kernel_note_hash_exist_write_offset, + kernel_nullifier_exists_write_offset, + kernel_nullifier_non_exists_write_offset, + kernel_q_public_input_kernel_add_to_table, + kernel_q_public_input_kernel_out_add_to_table, + kernel_side_effect_counter, + kernel_sload_write_offset, + kernel_sstore_write_offset, + main_abs_da_rem_gas_hi, + main_abs_da_rem_gas_lo, + main_abs_l2_rem_gas_hi, + main_abs_l2_rem_gas_lo, + main_alu_in_tag, + main_alu_sel, + main_bin_op_id, + main_bin_sel, + main_call_ptr, + main_da_gas_op, + main_da_gas_remaining, + main_da_out_of_gas, + main_gas_cost_active, + main_ia, + main_ib, + main_ic, + main_id, + main_id_zero, + main_ind_a, + main_ind_b, + main_ind_c, + main_ind_d, + main_ind_op_a, + main_ind_op_b, + main_ind_op_c, + main_ind_op_d, + main_internal_return_ptr, + main_inv, + main_l2_gas_op, + main_l2_gas_remaining, + main_l2_out_of_gas, + main_last, + main_mem_idx_a, + main_mem_idx_b, + main_mem_idx_c, + main_mem_idx_d, + main_mem_op_a, + main_mem_op_activate_gas, + main_mem_op_b, + main_mem_op_c, + main_mem_op_d, + main_op_err, + main_opcode_val, + main_pc, + main_q_kernel_lookup, + main_q_kernel_output_lookup, + main_r_in_tag, + main_rwa, + main_rwb, + main_rwc, + main_rwd, + main_sel_cmov, + main_sel_external_call, + main_sel_halt, + main_sel_internal_call, + main_sel_internal_return, + main_sel_jump, + main_sel_jumpi, + main_sel_mov, + main_sel_mov_a, + main_sel_mov_b, + main_sel_op_add, + main_sel_op_address, + main_sel_op_and, + main_sel_op_block_number, + main_sel_op_cast, + main_sel_op_chain_id, + main_sel_op_coinbase, + main_sel_op_dagasleft, + main_sel_op_div, + main_sel_op_emit_l2_to_l1_msg, + main_sel_op_emit_note_hash, + main_sel_op_emit_nullifier, + main_sel_op_emit_unencrypted_log, + main_sel_op_eq, + main_sel_op_fdiv, + main_sel_op_fee_per_da_gas, + main_sel_op_fee_per_l2_gas, + main_sel_op_get_contract_instance, + main_sel_op_keccak, + main_sel_op_l1_to_l2_msg_exists, + main_sel_op_l2gasleft, + main_sel_op_lt, + main_sel_op_lte, + main_sel_op_mul, + main_sel_op_not, + main_sel_op_note_hash_exists, + main_sel_op_nullifier_exists, + main_sel_op_or, + main_sel_op_pedersen, + main_sel_op_poseidon2, + main_sel_op_radix_le, + main_sel_op_sender, + main_sel_op_sha256, + main_sel_op_shl, + main_sel_op_shr, + main_sel_op_sload, + main_sel_op_sstore, + main_sel_op_storage_address, + main_sel_op_sub, + main_sel_op_timestamp, + main_sel_op_transaction_fee, + main_sel_op_version, + main_sel_op_xor, + main_sel_rng_16, + main_sel_rng_8, + main_space_id, + main_table_pow_2, + main_tag_err, + main_w_in_tag, + mem_addr, + mem_clk, + mem_diff_hi, + mem_diff_lo, + mem_diff_mid, + mem_glob_addr, + mem_ind_op_a, + mem_ind_op_b, + mem_ind_op_c, + mem_ind_op_d, + mem_last, + mem_lastAccess, + mem_mem_sel, + mem_one_min_inv, + mem_op_a, + mem_op_b, + mem_op_c, + mem_op_d, + mem_r_in_tag, + mem_rng_chk_sel, + mem_rw, + mem_sel_cmov, + mem_sel_mov_a, + mem_sel_mov_b, + mem_skip_check_tag, + mem_space_id, + mem_tag, + mem_tag_err, + mem_tsp, + mem_val, + mem_w_in_tag, + pedersen_clk, + pedersen_input, + pedersen_output, + pedersen_pedersen_sel, + poseidon2_clk, + poseidon2_input, + poseidon2_output, + poseidon2_poseidon_perm_sel, + sha256_clk, + sha256_input, + sha256_output, + sha256_sha256_compression_sel, + sha256_state, perm_main_alu, perm_main_bin, perm_main_conv, @@ -1031,296 +1031,296 @@ class AvmFlavor { template class AllEntities { public: DEFINE_FLAVOR_MEMBERS(DataType, - avm_main_clk, - avm_main_first, - avm_alu_a_hi, - avm_alu_a_lo, - avm_alu_alu_sel, - avm_alu_b_hi, - avm_alu_b_lo, - avm_alu_borrow, - avm_alu_cf, - avm_alu_clk, - avm_alu_cmp_rng_ctr, - avm_alu_cmp_sel, - avm_alu_div_rng_chk_selector, - avm_alu_div_u16_r0, - avm_alu_div_u16_r1, - avm_alu_div_u16_r2, - avm_alu_div_u16_r3, - avm_alu_div_u16_r4, - avm_alu_div_u16_r5, - avm_alu_div_u16_r6, - avm_alu_div_u16_r7, - avm_alu_divisor_hi, - avm_alu_divisor_lo, - avm_alu_ff_tag, - avm_alu_ia, - avm_alu_ib, - avm_alu_ic, - avm_alu_in_tag, - avm_alu_op_add, - avm_alu_op_cast, - avm_alu_op_cast_prev, - avm_alu_op_div, - avm_alu_op_div_a_lt_b, - avm_alu_op_div_std, - avm_alu_op_eq, - avm_alu_op_eq_diff_inv, - avm_alu_op_lt, - avm_alu_op_lte, - avm_alu_op_mul, - avm_alu_op_not, - avm_alu_op_shl, - avm_alu_op_shr, - avm_alu_op_sub, - avm_alu_p_a_borrow, - avm_alu_p_b_borrow, - avm_alu_p_sub_a_hi, - avm_alu_p_sub_a_lo, - avm_alu_p_sub_b_hi, - avm_alu_p_sub_b_lo, - avm_alu_partial_prod_hi, - avm_alu_partial_prod_lo, - avm_alu_quotient_hi, - avm_alu_quotient_lo, - avm_alu_remainder, - avm_alu_res_hi, - avm_alu_res_lo, - avm_alu_rng_chk_lookup_selector, - avm_alu_rng_chk_sel, - avm_alu_shift_lt_bit_len, - avm_alu_shift_sel, - avm_alu_t_sub_s_bits, - avm_alu_two_pow_s, - avm_alu_two_pow_t_sub_s, - avm_alu_u128_tag, - avm_alu_u16_r0, - avm_alu_u16_r1, - avm_alu_u16_r10, - avm_alu_u16_r11, - avm_alu_u16_r12, - avm_alu_u16_r13, - avm_alu_u16_r14, - avm_alu_u16_r2, - avm_alu_u16_r3, - avm_alu_u16_r4, - avm_alu_u16_r5, - avm_alu_u16_r6, - avm_alu_u16_r7, - avm_alu_u16_r8, - avm_alu_u16_r9, - avm_alu_u16_tag, - avm_alu_u32_tag, - avm_alu_u64_tag, - avm_alu_u8_r0, - avm_alu_u8_r1, - avm_alu_u8_tag, - avm_binary_acc_ia, - avm_binary_acc_ib, - avm_binary_acc_ic, - avm_binary_bin_sel, - avm_binary_clk, - avm_binary_ia_bytes, - avm_binary_ib_bytes, - avm_binary_ic_bytes, - avm_binary_in_tag, - avm_binary_mem_tag_ctr, - avm_binary_mem_tag_ctr_inv, - avm_binary_op_id, - avm_binary_start, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_byte_lengths, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_output, - avm_conversion_clk, - avm_conversion_input, - avm_conversion_num_limbs, - avm_conversion_radix, - avm_conversion_to_radix_le_sel, - avm_gas_da_gas_fixed_table, - avm_gas_gas_cost_sel, - avm_gas_l2_gas_fixed_table, - avm_keccakf1600_clk, - avm_keccakf1600_input, - avm_keccakf1600_keccakf1600_sel, - avm_keccakf1600_output, - avm_kernel_emit_l2_to_l1_msg_write_offset, - avm_kernel_emit_note_hash_write_offset, - avm_kernel_emit_nullifier_write_offset, - avm_kernel_emit_unencrypted_log_write_offset, - avm_kernel_kernel_in_offset, - avm_kernel_kernel_inputs, - avm_kernel_kernel_metadata_out, - avm_kernel_kernel_out_offset, - avm_kernel_kernel_side_effect_out, - avm_kernel_kernel_value_out, - avm_kernel_l1_to_l2_msg_exists_write_offset, - avm_kernel_note_hash_exist_write_offset, - avm_kernel_nullifier_exists_write_offset, - avm_kernel_nullifier_non_exists_write_offset, - avm_kernel_q_public_input_kernel_add_to_table, - avm_kernel_q_public_input_kernel_out_add_to_table, - avm_kernel_side_effect_counter, - avm_kernel_sload_write_offset, - avm_kernel_sstore_write_offset, - avm_main_abs_da_rem_gas_hi, - avm_main_abs_da_rem_gas_lo, - avm_main_abs_l2_rem_gas_hi, - avm_main_abs_l2_rem_gas_lo, - avm_main_alu_in_tag, - avm_main_alu_sel, - avm_main_bin_op_id, - avm_main_bin_sel, - avm_main_call_ptr, - avm_main_da_gas_op, - avm_main_da_gas_remaining, - avm_main_da_out_of_gas, - avm_main_gas_cost_active, - avm_main_ia, - avm_main_ib, - avm_main_ic, - avm_main_id, - avm_main_id_zero, - avm_main_ind_a, - avm_main_ind_b, - avm_main_ind_c, - avm_main_ind_d, - avm_main_ind_op_a, - avm_main_ind_op_b, - avm_main_ind_op_c, - avm_main_ind_op_d, - avm_main_internal_return_ptr, - avm_main_inv, - avm_main_l2_gas_op, - avm_main_l2_gas_remaining, - avm_main_l2_out_of_gas, - avm_main_last, - avm_main_mem_idx_a, - avm_main_mem_idx_b, - avm_main_mem_idx_c, - avm_main_mem_idx_d, - avm_main_mem_op_a, - avm_main_mem_op_activate_gas, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_mem_op_d, - avm_main_op_err, - avm_main_opcode_val, - avm_main_pc, - avm_main_q_kernel_lookup, - avm_main_q_kernel_output_lookup, - avm_main_r_in_tag, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, - avm_main_rwd, - avm_main_sel_cmov, - avm_main_sel_external_call, - avm_main_sel_halt, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_jumpi, - avm_main_sel_mov, - avm_main_sel_mov_a, - avm_main_sel_mov_b, - avm_main_sel_op_add, - avm_main_sel_op_address, - avm_main_sel_op_and, - avm_main_sel_op_block_number, - avm_main_sel_op_cast, - avm_main_sel_op_chain_id, - avm_main_sel_op_coinbase, - avm_main_sel_op_dagasleft, - avm_main_sel_op_div, - avm_main_sel_op_emit_l2_to_l1_msg, - avm_main_sel_op_emit_note_hash, - avm_main_sel_op_emit_nullifier, - avm_main_sel_op_emit_unencrypted_log, - avm_main_sel_op_eq, - avm_main_sel_op_fdiv, - avm_main_sel_op_fee_per_da_gas, - avm_main_sel_op_fee_per_l2_gas, - avm_main_sel_op_get_contract_instance, - avm_main_sel_op_keccak, - avm_main_sel_op_l1_to_l2_msg_exists, - avm_main_sel_op_l2gasleft, - avm_main_sel_op_lt, - avm_main_sel_op_lte, - avm_main_sel_op_mul, - avm_main_sel_op_not, - avm_main_sel_op_note_hash_exists, - avm_main_sel_op_nullifier_exists, - avm_main_sel_op_or, - avm_main_sel_op_pedersen, - avm_main_sel_op_poseidon2, - avm_main_sel_op_radix_le, - avm_main_sel_op_sender, - avm_main_sel_op_sha256, - avm_main_sel_op_shl, - avm_main_sel_op_shr, - avm_main_sel_op_sload, - avm_main_sel_op_sstore, - avm_main_sel_op_storage_address, - avm_main_sel_op_sub, - avm_main_sel_op_timestamp, - avm_main_sel_op_transaction_fee, - avm_main_sel_op_version, - avm_main_sel_op_xor, - avm_main_sel_rng_16, - avm_main_sel_rng_8, - avm_main_space_id, - avm_main_table_pow_2, - avm_main_tag_err, - avm_main_w_in_tag, - avm_mem_addr, - avm_mem_clk, - avm_mem_diff_hi, - avm_mem_diff_lo, - avm_mem_diff_mid, - avm_mem_glob_addr, - avm_mem_ind_op_a, - avm_mem_ind_op_b, - avm_mem_ind_op_c, - avm_mem_ind_op_d, - avm_mem_last, - avm_mem_lastAccess, - avm_mem_mem_sel, - avm_mem_one_min_inv, - avm_mem_op_a, - avm_mem_op_b, - avm_mem_op_c, - avm_mem_op_d, - avm_mem_r_in_tag, - avm_mem_rng_chk_sel, - avm_mem_rw, - avm_mem_sel_cmov, - avm_mem_sel_mov_a, - avm_mem_sel_mov_b, - avm_mem_skip_check_tag, - avm_mem_space_id, - avm_mem_tag, - avm_mem_tag_err, - avm_mem_tsp, - avm_mem_val, - avm_mem_w_in_tag, - avm_pedersen_clk, - avm_pedersen_input, - avm_pedersen_output, - avm_pedersen_pedersen_sel, - avm_poseidon2_clk, - avm_poseidon2_input, - avm_poseidon2_output, - avm_poseidon2_poseidon_perm_sel, - avm_sha256_clk, - avm_sha256_input, - avm_sha256_output, - avm_sha256_sha256_compression_sel, - avm_sha256_state, + main_clk, + main_first, + alu_a_hi, + alu_a_lo, + alu_alu_sel, + alu_b_hi, + alu_b_lo, + alu_borrow, + alu_cf, + alu_clk, + alu_cmp_rng_ctr, + alu_cmp_sel, + alu_div_rng_chk_selector, + alu_div_u16_r0, + alu_div_u16_r1, + alu_div_u16_r2, + alu_div_u16_r3, + alu_div_u16_r4, + alu_div_u16_r5, + alu_div_u16_r6, + alu_div_u16_r7, + alu_divisor_hi, + alu_divisor_lo, + alu_ff_tag, + alu_ia, + alu_ib, + alu_ic, + alu_in_tag, + alu_op_add, + alu_op_cast, + alu_op_cast_prev, + alu_op_div, + alu_op_div_a_lt_b, + alu_op_div_std, + alu_op_eq, + alu_op_eq_diff_inv, + alu_op_lt, + alu_op_lte, + alu_op_mul, + alu_op_not, + alu_op_shl, + alu_op_shr, + alu_op_sub, + alu_p_a_borrow, + alu_p_b_borrow, + alu_p_sub_a_hi, + alu_p_sub_a_lo, + alu_p_sub_b_hi, + alu_p_sub_b_lo, + alu_partial_prod_hi, + alu_partial_prod_lo, + alu_quotient_hi, + alu_quotient_lo, + alu_remainder, + alu_res_hi, + alu_res_lo, + alu_rng_chk_lookup_selector, + alu_rng_chk_sel, + alu_shift_lt_bit_len, + alu_shift_sel, + alu_t_sub_s_bits, + alu_two_pow_s, + alu_two_pow_t_sub_s, + alu_u128_tag, + alu_u16_r0, + alu_u16_r1, + alu_u16_r10, + alu_u16_r11, + alu_u16_r12, + alu_u16_r13, + alu_u16_r14, + alu_u16_r2, + alu_u16_r3, + alu_u16_r4, + alu_u16_r5, + alu_u16_r6, + alu_u16_r7, + alu_u16_r8, + alu_u16_r9, + alu_u16_tag, + alu_u32_tag, + alu_u64_tag, + alu_u8_r0, + alu_u8_r1, + alu_u8_tag, + binary_acc_ia, + binary_acc_ib, + binary_acc_ic, + binary_bin_sel, + binary_clk, + binary_ia_bytes, + binary_ib_bytes, + binary_ic_bytes, + binary_in_tag, + binary_mem_tag_ctr, + binary_mem_tag_ctr_inv, + binary_op_id, + binary_start, + byte_lookup_bin_sel, + byte_lookup_table_byte_lengths, + byte_lookup_table_in_tags, + byte_lookup_table_input_a, + byte_lookup_table_input_b, + byte_lookup_table_op_id, + byte_lookup_table_output, + conversion_clk, + conversion_input, + conversion_num_limbs, + conversion_radix, + conversion_to_radix_le_sel, + gas_da_gas_fixed_table, + gas_gas_cost_sel, + gas_l2_gas_fixed_table, + keccakf1600_clk, + keccakf1600_input, + keccakf1600_keccakf1600_sel, + keccakf1600_output, + kernel_emit_l2_to_l1_msg_write_offset, + kernel_emit_note_hash_write_offset, + kernel_emit_nullifier_write_offset, + kernel_emit_unencrypted_log_write_offset, + kernel_kernel_in_offset, + kernel_kernel_inputs, + kernel_kernel_metadata_out, + kernel_kernel_out_offset, + kernel_kernel_side_effect_out, + kernel_kernel_value_out, + kernel_l1_to_l2_msg_exists_write_offset, + kernel_note_hash_exist_write_offset, + kernel_nullifier_exists_write_offset, + kernel_nullifier_non_exists_write_offset, + kernel_q_public_input_kernel_add_to_table, + kernel_q_public_input_kernel_out_add_to_table, + kernel_side_effect_counter, + kernel_sload_write_offset, + kernel_sstore_write_offset, + main_abs_da_rem_gas_hi, + main_abs_da_rem_gas_lo, + main_abs_l2_rem_gas_hi, + main_abs_l2_rem_gas_lo, + main_alu_in_tag, + main_alu_sel, + main_bin_op_id, + main_bin_sel, + main_call_ptr, + main_da_gas_op, + main_da_gas_remaining, + main_da_out_of_gas, + main_gas_cost_active, + main_ia, + main_ib, + main_ic, + main_id, + main_id_zero, + main_ind_a, + main_ind_b, + main_ind_c, + main_ind_d, + main_ind_op_a, + main_ind_op_b, + main_ind_op_c, + main_ind_op_d, + main_internal_return_ptr, + main_inv, + main_l2_gas_op, + main_l2_gas_remaining, + main_l2_out_of_gas, + main_last, + main_mem_idx_a, + main_mem_idx_b, + main_mem_idx_c, + main_mem_idx_d, + main_mem_op_a, + main_mem_op_activate_gas, + main_mem_op_b, + main_mem_op_c, + main_mem_op_d, + main_op_err, + main_opcode_val, + main_pc, + main_q_kernel_lookup, + main_q_kernel_output_lookup, + main_r_in_tag, + main_rwa, + main_rwb, + main_rwc, + main_rwd, + main_sel_cmov, + main_sel_external_call, + main_sel_halt, + main_sel_internal_call, + main_sel_internal_return, + main_sel_jump, + main_sel_jumpi, + main_sel_mov, + main_sel_mov_a, + main_sel_mov_b, + main_sel_op_add, + main_sel_op_address, + main_sel_op_and, + main_sel_op_block_number, + main_sel_op_cast, + main_sel_op_chain_id, + main_sel_op_coinbase, + main_sel_op_dagasleft, + main_sel_op_div, + main_sel_op_emit_l2_to_l1_msg, + main_sel_op_emit_note_hash, + main_sel_op_emit_nullifier, + main_sel_op_emit_unencrypted_log, + main_sel_op_eq, + main_sel_op_fdiv, + main_sel_op_fee_per_da_gas, + main_sel_op_fee_per_l2_gas, + main_sel_op_get_contract_instance, + main_sel_op_keccak, + main_sel_op_l1_to_l2_msg_exists, + main_sel_op_l2gasleft, + main_sel_op_lt, + main_sel_op_lte, + main_sel_op_mul, + main_sel_op_not, + main_sel_op_note_hash_exists, + main_sel_op_nullifier_exists, + main_sel_op_or, + main_sel_op_pedersen, + main_sel_op_poseidon2, + main_sel_op_radix_le, + main_sel_op_sender, + main_sel_op_sha256, + main_sel_op_shl, + main_sel_op_shr, + main_sel_op_sload, + main_sel_op_sstore, + main_sel_op_storage_address, + main_sel_op_sub, + main_sel_op_timestamp, + main_sel_op_transaction_fee, + main_sel_op_version, + main_sel_op_xor, + main_sel_rng_16, + main_sel_rng_8, + main_space_id, + main_table_pow_2, + main_tag_err, + main_w_in_tag, + mem_addr, + mem_clk, + mem_diff_hi, + mem_diff_lo, + mem_diff_mid, + mem_glob_addr, + mem_ind_op_a, + mem_ind_op_b, + mem_ind_op_c, + mem_ind_op_d, + mem_last, + mem_lastAccess, + mem_mem_sel, + mem_one_min_inv, + mem_op_a, + mem_op_b, + mem_op_c, + mem_op_d, + mem_r_in_tag, + mem_rng_chk_sel, + mem_rw, + mem_sel_cmov, + mem_sel_mov_a, + mem_sel_mov_b, + mem_skip_check_tag, + mem_space_id, + mem_tag, + mem_tag_err, + mem_tsp, + mem_val, + mem_w_in_tag, + pedersen_clk, + pedersen_input, + pedersen_output, + pedersen_pedersen_sel, + poseidon2_clk, + poseidon2_input, + poseidon2_output, + poseidon2_poseidon_perm_sel, + sha256_clk, + sha256_input, + sha256_output, + sha256_sha256_compression_sel, + sha256_state, perm_main_alu, perm_main_bin, perm_main_conv, @@ -1416,364 +1416,364 @@ class AvmFlavor { lookup_div_u16_5_counts, lookup_div_u16_6_counts, lookup_div_u16_7_counts, - avm_alu_a_hi_shift, - avm_alu_a_lo_shift, - avm_alu_alu_sel_shift, - avm_alu_b_hi_shift, - avm_alu_b_lo_shift, - avm_alu_cmp_rng_ctr_shift, - avm_alu_cmp_sel_shift, - avm_alu_div_rng_chk_selector_shift, - avm_alu_div_u16_r0_shift, - avm_alu_div_u16_r1_shift, - avm_alu_div_u16_r2_shift, - avm_alu_div_u16_r3_shift, - avm_alu_div_u16_r4_shift, - avm_alu_div_u16_r5_shift, - avm_alu_div_u16_r6_shift, - avm_alu_div_u16_r7_shift, - avm_alu_op_add_shift, - avm_alu_op_cast_prev_shift, - avm_alu_op_cast_shift, - avm_alu_op_div_shift, - avm_alu_op_mul_shift, - avm_alu_op_shl_shift, - avm_alu_op_shr_shift, - avm_alu_op_sub_shift, - avm_alu_p_sub_a_hi_shift, - avm_alu_p_sub_a_lo_shift, - avm_alu_p_sub_b_hi_shift, - avm_alu_p_sub_b_lo_shift, - avm_alu_rng_chk_lookup_selector_shift, - avm_alu_rng_chk_sel_shift, - avm_alu_u16_r0_shift, - avm_alu_u16_r1_shift, - avm_alu_u16_r2_shift, - avm_alu_u16_r3_shift, - avm_alu_u16_r4_shift, - avm_alu_u16_r5_shift, - avm_alu_u16_r6_shift, - avm_alu_u8_r0_shift, - avm_alu_u8_r1_shift, - avm_binary_acc_ia_shift, - avm_binary_acc_ib_shift, - avm_binary_acc_ic_shift, - avm_binary_mem_tag_ctr_shift, - avm_binary_op_id_shift, - avm_kernel_emit_l2_to_l1_msg_write_offset_shift, - avm_kernel_emit_note_hash_write_offset_shift, - avm_kernel_emit_nullifier_write_offset_shift, - avm_kernel_emit_unencrypted_log_write_offset_shift, - avm_kernel_l1_to_l2_msg_exists_write_offset_shift, - avm_kernel_note_hash_exist_write_offset_shift, - avm_kernel_nullifier_exists_write_offset_shift, - avm_kernel_nullifier_non_exists_write_offset_shift, - avm_kernel_side_effect_counter_shift, - avm_kernel_sload_write_offset_shift, - avm_kernel_sstore_write_offset_shift, - avm_main_da_gas_remaining_shift, - avm_main_internal_return_ptr_shift, - avm_main_l2_gas_remaining_shift, - avm_main_pc_shift, - avm_mem_glob_addr_shift, - avm_mem_mem_sel_shift, - avm_mem_rw_shift, - avm_mem_tag_shift, - avm_mem_tsp_shift, - avm_mem_val_shift) + alu_a_hi_shift, + alu_a_lo_shift, + alu_alu_sel_shift, + alu_b_hi_shift, + alu_b_lo_shift, + alu_cmp_rng_ctr_shift, + alu_cmp_sel_shift, + alu_div_rng_chk_selector_shift, + alu_div_u16_r0_shift, + alu_div_u16_r1_shift, + alu_div_u16_r2_shift, + alu_div_u16_r3_shift, + alu_div_u16_r4_shift, + alu_div_u16_r5_shift, + alu_div_u16_r6_shift, + alu_div_u16_r7_shift, + alu_op_add_shift, + alu_op_cast_prev_shift, + alu_op_cast_shift, + alu_op_div_shift, + alu_op_mul_shift, + alu_op_shl_shift, + alu_op_shr_shift, + alu_op_sub_shift, + alu_p_sub_a_hi_shift, + alu_p_sub_a_lo_shift, + alu_p_sub_b_hi_shift, + alu_p_sub_b_lo_shift, + alu_rng_chk_lookup_selector_shift, + alu_rng_chk_sel_shift, + alu_u16_r0_shift, + alu_u16_r1_shift, + alu_u16_r2_shift, + alu_u16_r3_shift, + alu_u16_r4_shift, + alu_u16_r5_shift, + alu_u16_r6_shift, + alu_u8_r0_shift, + alu_u8_r1_shift, + binary_acc_ia_shift, + binary_acc_ib_shift, + binary_acc_ic_shift, + binary_mem_tag_ctr_shift, + binary_op_id_shift, + kernel_emit_l2_to_l1_msg_write_offset_shift, + kernel_emit_note_hash_write_offset_shift, + kernel_emit_nullifier_write_offset_shift, + kernel_emit_unencrypted_log_write_offset_shift, + kernel_l1_to_l2_msg_exists_write_offset_shift, + kernel_note_hash_exist_write_offset_shift, + kernel_nullifier_exists_write_offset_shift, + kernel_nullifier_non_exists_write_offset_shift, + kernel_side_effect_counter_shift, + kernel_sload_write_offset_shift, + kernel_sstore_write_offset_shift, + main_da_gas_remaining_shift, + main_internal_return_ptr_shift, + main_l2_gas_remaining_shift, + main_pc_shift, + mem_glob_addr_shift, + mem_mem_sel_shift, + mem_rw_shift, + mem_tag_shift, + mem_tsp_shift, + mem_val_shift) RefVector get_wires() { - return { avm_main_clk, - avm_main_first, - avm_alu_a_hi, - avm_alu_a_lo, - avm_alu_alu_sel, - avm_alu_b_hi, - avm_alu_b_lo, - avm_alu_borrow, - avm_alu_cf, - avm_alu_clk, - avm_alu_cmp_rng_ctr, - avm_alu_cmp_sel, - avm_alu_div_rng_chk_selector, - avm_alu_div_u16_r0, - avm_alu_div_u16_r1, - avm_alu_div_u16_r2, - avm_alu_div_u16_r3, - avm_alu_div_u16_r4, - avm_alu_div_u16_r5, - avm_alu_div_u16_r6, - avm_alu_div_u16_r7, - avm_alu_divisor_hi, - avm_alu_divisor_lo, - avm_alu_ff_tag, - avm_alu_ia, - avm_alu_ib, - avm_alu_ic, - avm_alu_in_tag, - avm_alu_op_add, - avm_alu_op_cast, - avm_alu_op_cast_prev, - avm_alu_op_div, - avm_alu_op_div_a_lt_b, - avm_alu_op_div_std, - avm_alu_op_eq, - avm_alu_op_eq_diff_inv, - avm_alu_op_lt, - avm_alu_op_lte, - avm_alu_op_mul, - avm_alu_op_not, - avm_alu_op_shl, - avm_alu_op_shr, - avm_alu_op_sub, - avm_alu_p_a_borrow, - avm_alu_p_b_borrow, - avm_alu_p_sub_a_hi, - avm_alu_p_sub_a_lo, - avm_alu_p_sub_b_hi, - avm_alu_p_sub_b_lo, - avm_alu_partial_prod_hi, - avm_alu_partial_prod_lo, - avm_alu_quotient_hi, - avm_alu_quotient_lo, - avm_alu_remainder, - avm_alu_res_hi, - avm_alu_res_lo, - avm_alu_rng_chk_lookup_selector, - avm_alu_rng_chk_sel, - avm_alu_shift_lt_bit_len, - avm_alu_shift_sel, - avm_alu_t_sub_s_bits, - avm_alu_two_pow_s, - avm_alu_two_pow_t_sub_s, - avm_alu_u128_tag, - avm_alu_u16_r0, - avm_alu_u16_r1, - avm_alu_u16_r10, - avm_alu_u16_r11, - avm_alu_u16_r12, - avm_alu_u16_r13, - avm_alu_u16_r14, - avm_alu_u16_r2, - avm_alu_u16_r3, - avm_alu_u16_r4, - avm_alu_u16_r5, - avm_alu_u16_r6, - avm_alu_u16_r7, - avm_alu_u16_r8, - avm_alu_u16_r9, - avm_alu_u16_tag, - avm_alu_u32_tag, - avm_alu_u64_tag, - avm_alu_u8_r0, - avm_alu_u8_r1, - avm_alu_u8_tag, - avm_binary_acc_ia, - avm_binary_acc_ib, - avm_binary_acc_ic, - avm_binary_bin_sel, - avm_binary_clk, - avm_binary_ia_bytes, - avm_binary_ib_bytes, - avm_binary_ic_bytes, - avm_binary_in_tag, - avm_binary_mem_tag_ctr, - avm_binary_mem_tag_ctr_inv, - avm_binary_op_id, - avm_binary_start, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_byte_lengths, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_output, - avm_conversion_clk, - avm_conversion_input, - avm_conversion_num_limbs, - avm_conversion_radix, - avm_conversion_to_radix_le_sel, - avm_gas_da_gas_fixed_table, - avm_gas_gas_cost_sel, - avm_gas_l2_gas_fixed_table, - avm_keccakf1600_clk, - avm_keccakf1600_input, - avm_keccakf1600_keccakf1600_sel, - avm_keccakf1600_output, - avm_kernel_emit_l2_to_l1_msg_write_offset, - avm_kernel_emit_note_hash_write_offset, - avm_kernel_emit_nullifier_write_offset, - avm_kernel_emit_unencrypted_log_write_offset, - avm_kernel_kernel_in_offset, - avm_kernel_kernel_inputs, - avm_kernel_kernel_metadata_out, - avm_kernel_kernel_out_offset, - avm_kernel_kernel_side_effect_out, - avm_kernel_kernel_value_out, - avm_kernel_l1_to_l2_msg_exists_write_offset, - avm_kernel_note_hash_exist_write_offset, - avm_kernel_nullifier_exists_write_offset, - avm_kernel_nullifier_non_exists_write_offset, - avm_kernel_q_public_input_kernel_add_to_table, - avm_kernel_q_public_input_kernel_out_add_to_table, - avm_kernel_side_effect_counter, - avm_kernel_sload_write_offset, - avm_kernel_sstore_write_offset, - avm_main_abs_da_rem_gas_hi, - avm_main_abs_da_rem_gas_lo, - avm_main_abs_l2_rem_gas_hi, - avm_main_abs_l2_rem_gas_lo, - avm_main_alu_in_tag, - avm_main_alu_sel, - avm_main_bin_op_id, - avm_main_bin_sel, - avm_main_call_ptr, - avm_main_da_gas_op, - avm_main_da_gas_remaining, - avm_main_da_out_of_gas, - avm_main_gas_cost_active, - avm_main_ia, - avm_main_ib, - avm_main_ic, - avm_main_id, - avm_main_id_zero, - avm_main_ind_a, - avm_main_ind_b, - avm_main_ind_c, - avm_main_ind_d, - avm_main_ind_op_a, - avm_main_ind_op_b, - avm_main_ind_op_c, - avm_main_ind_op_d, - avm_main_internal_return_ptr, - avm_main_inv, - avm_main_l2_gas_op, - avm_main_l2_gas_remaining, - avm_main_l2_out_of_gas, - avm_main_last, - avm_main_mem_idx_a, - avm_main_mem_idx_b, - avm_main_mem_idx_c, - avm_main_mem_idx_d, - avm_main_mem_op_a, - avm_main_mem_op_activate_gas, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_mem_op_d, - avm_main_op_err, - avm_main_opcode_val, - avm_main_pc, - avm_main_q_kernel_lookup, - avm_main_q_kernel_output_lookup, - avm_main_r_in_tag, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, - avm_main_rwd, - avm_main_sel_cmov, - avm_main_sel_external_call, - avm_main_sel_halt, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_jumpi, - avm_main_sel_mov, - avm_main_sel_mov_a, - avm_main_sel_mov_b, - avm_main_sel_op_add, - avm_main_sel_op_address, - avm_main_sel_op_and, - avm_main_sel_op_block_number, - avm_main_sel_op_cast, - avm_main_sel_op_chain_id, - avm_main_sel_op_coinbase, - avm_main_sel_op_dagasleft, - avm_main_sel_op_div, - avm_main_sel_op_emit_l2_to_l1_msg, - avm_main_sel_op_emit_note_hash, - avm_main_sel_op_emit_nullifier, - avm_main_sel_op_emit_unencrypted_log, - avm_main_sel_op_eq, - avm_main_sel_op_fdiv, - avm_main_sel_op_fee_per_da_gas, - avm_main_sel_op_fee_per_l2_gas, - avm_main_sel_op_get_contract_instance, - avm_main_sel_op_keccak, - avm_main_sel_op_l1_to_l2_msg_exists, - avm_main_sel_op_l2gasleft, - avm_main_sel_op_lt, - avm_main_sel_op_lte, - avm_main_sel_op_mul, - avm_main_sel_op_not, - avm_main_sel_op_note_hash_exists, - avm_main_sel_op_nullifier_exists, - avm_main_sel_op_or, - avm_main_sel_op_pedersen, - avm_main_sel_op_poseidon2, - avm_main_sel_op_radix_le, - avm_main_sel_op_sender, - avm_main_sel_op_sha256, - avm_main_sel_op_shl, - avm_main_sel_op_shr, - avm_main_sel_op_sload, - avm_main_sel_op_sstore, - avm_main_sel_op_storage_address, - avm_main_sel_op_sub, - avm_main_sel_op_timestamp, - avm_main_sel_op_transaction_fee, - avm_main_sel_op_version, - avm_main_sel_op_xor, - avm_main_sel_rng_16, - avm_main_sel_rng_8, - avm_main_space_id, - avm_main_table_pow_2, - avm_main_tag_err, - avm_main_w_in_tag, - avm_mem_addr, - avm_mem_clk, - avm_mem_diff_hi, - avm_mem_diff_lo, - avm_mem_diff_mid, - avm_mem_glob_addr, - avm_mem_ind_op_a, - avm_mem_ind_op_b, - avm_mem_ind_op_c, - avm_mem_ind_op_d, - avm_mem_last, - avm_mem_lastAccess, - avm_mem_mem_sel, - avm_mem_one_min_inv, - avm_mem_op_a, - avm_mem_op_b, - avm_mem_op_c, - avm_mem_op_d, - avm_mem_r_in_tag, - avm_mem_rng_chk_sel, - avm_mem_rw, - avm_mem_sel_cmov, - avm_mem_sel_mov_a, - avm_mem_sel_mov_b, - avm_mem_skip_check_tag, - avm_mem_space_id, - avm_mem_tag, - avm_mem_tag_err, - avm_mem_tsp, - avm_mem_val, - avm_mem_w_in_tag, - avm_pedersen_clk, - avm_pedersen_input, - avm_pedersen_output, - avm_pedersen_pedersen_sel, - avm_poseidon2_clk, - avm_poseidon2_input, - avm_poseidon2_output, - avm_poseidon2_poseidon_perm_sel, - avm_sha256_clk, - avm_sha256_input, - avm_sha256_output, - avm_sha256_sha256_compression_sel, - avm_sha256_state, + return { main_clk, + main_first, + alu_a_hi, + alu_a_lo, + alu_alu_sel, + alu_b_hi, + alu_b_lo, + alu_borrow, + alu_cf, + alu_clk, + alu_cmp_rng_ctr, + alu_cmp_sel, + alu_div_rng_chk_selector, + alu_div_u16_r0, + alu_div_u16_r1, + alu_div_u16_r2, + alu_div_u16_r3, + alu_div_u16_r4, + alu_div_u16_r5, + alu_div_u16_r6, + alu_div_u16_r7, + alu_divisor_hi, + alu_divisor_lo, + alu_ff_tag, + alu_ia, + alu_ib, + alu_ic, + alu_in_tag, + alu_op_add, + alu_op_cast, + alu_op_cast_prev, + alu_op_div, + alu_op_div_a_lt_b, + alu_op_div_std, + alu_op_eq, + alu_op_eq_diff_inv, + alu_op_lt, + alu_op_lte, + alu_op_mul, + alu_op_not, + alu_op_shl, + alu_op_shr, + alu_op_sub, + alu_p_a_borrow, + alu_p_b_borrow, + alu_p_sub_a_hi, + alu_p_sub_a_lo, + alu_p_sub_b_hi, + alu_p_sub_b_lo, + alu_partial_prod_hi, + alu_partial_prod_lo, + alu_quotient_hi, + alu_quotient_lo, + alu_remainder, + alu_res_hi, + alu_res_lo, + alu_rng_chk_lookup_selector, + alu_rng_chk_sel, + alu_shift_lt_bit_len, + alu_shift_sel, + alu_t_sub_s_bits, + alu_two_pow_s, + alu_two_pow_t_sub_s, + alu_u128_tag, + alu_u16_r0, + alu_u16_r1, + alu_u16_r10, + alu_u16_r11, + alu_u16_r12, + alu_u16_r13, + alu_u16_r14, + alu_u16_r2, + alu_u16_r3, + alu_u16_r4, + alu_u16_r5, + alu_u16_r6, + alu_u16_r7, + alu_u16_r8, + alu_u16_r9, + alu_u16_tag, + alu_u32_tag, + alu_u64_tag, + alu_u8_r0, + alu_u8_r1, + alu_u8_tag, + binary_acc_ia, + binary_acc_ib, + binary_acc_ic, + binary_bin_sel, + binary_clk, + binary_ia_bytes, + binary_ib_bytes, + binary_ic_bytes, + binary_in_tag, + binary_mem_tag_ctr, + binary_mem_tag_ctr_inv, + binary_op_id, + binary_start, + byte_lookup_bin_sel, + byte_lookup_table_byte_lengths, + byte_lookup_table_in_tags, + byte_lookup_table_input_a, + byte_lookup_table_input_b, + byte_lookup_table_op_id, + byte_lookup_table_output, + conversion_clk, + conversion_input, + conversion_num_limbs, + conversion_radix, + conversion_to_radix_le_sel, + gas_da_gas_fixed_table, + gas_gas_cost_sel, + gas_l2_gas_fixed_table, + keccakf1600_clk, + keccakf1600_input, + keccakf1600_keccakf1600_sel, + keccakf1600_output, + kernel_emit_l2_to_l1_msg_write_offset, + kernel_emit_note_hash_write_offset, + kernel_emit_nullifier_write_offset, + kernel_emit_unencrypted_log_write_offset, + kernel_kernel_in_offset, + kernel_kernel_inputs, + kernel_kernel_metadata_out, + kernel_kernel_out_offset, + kernel_kernel_side_effect_out, + kernel_kernel_value_out, + kernel_l1_to_l2_msg_exists_write_offset, + kernel_note_hash_exist_write_offset, + kernel_nullifier_exists_write_offset, + kernel_nullifier_non_exists_write_offset, + kernel_q_public_input_kernel_add_to_table, + kernel_q_public_input_kernel_out_add_to_table, + kernel_side_effect_counter, + kernel_sload_write_offset, + kernel_sstore_write_offset, + main_abs_da_rem_gas_hi, + main_abs_da_rem_gas_lo, + main_abs_l2_rem_gas_hi, + main_abs_l2_rem_gas_lo, + main_alu_in_tag, + main_alu_sel, + main_bin_op_id, + main_bin_sel, + main_call_ptr, + main_da_gas_op, + main_da_gas_remaining, + main_da_out_of_gas, + main_gas_cost_active, + main_ia, + main_ib, + main_ic, + main_id, + main_id_zero, + main_ind_a, + main_ind_b, + main_ind_c, + main_ind_d, + main_ind_op_a, + main_ind_op_b, + main_ind_op_c, + main_ind_op_d, + main_internal_return_ptr, + main_inv, + main_l2_gas_op, + main_l2_gas_remaining, + main_l2_out_of_gas, + main_last, + main_mem_idx_a, + main_mem_idx_b, + main_mem_idx_c, + main_mem_idx_d, + main_mem_op_a, + main_mem_op_activate_gas, + main_mem_op_b, + main_mem_op_c, + main_mem_op_d, + main_op_err, + main_opcode_val, + main_pc, + main_q_kernel_lookup, + main_q_kernel_output_lookup, + main_r_in_tag, + main_rwa, + main_rwb, + main_rwc, + main_rwd, + main_sel_cmov, + main_sel_external_call, + main_sel_halt, + main_sel_internal_call, + main_sel_internal_return, + main_sel_jump, + main_sel_jumpi, + main_sel_mov, + main_sel_mov_a, + main_sel_mov_b, + main_sel_op_add, + main_sel_op_address, + main_sel_op_and, + main_sel_op_block_number, + main_sel_op_cast, + main_sel_op_chain_id, + main_sel_op_coinbase, + main_sel_op_dagasleft, + main_sel_op_div, + main_sel_op_emit_l2_to_l1_msg, + main_sel_op_emit_note_hash, + main_sel_op_emit_nullifier, + main_sel_op_emit_unencrypted_log, + main_sel_op_eq, + main_sel_op_fdiv, + main_sel_op_fee_per_da_gas, + main_sel_op_fee_per_l2_gas, + main_sel_op_get_contract_instance, + main_sel_op_keccak, + main_sel_op_l1_to_l2_msg_exists, + main_sel_op_l2gasleft, + main_sel_op_lt, + main_sel_op_lte, + main_sel_op_mul, + main_sel_op_not, + main_sel_op_note_hash_exists, + main_sel_op_nullifier_exists, + main_sel_op_or, + main_sel_op_pedersen, + main_sel_op_poseidon2, + main_sel_op_radix_le, + main_sel_op_sender, + main_sel_op_sha256, + main_sel_op_shl, + main_sel_op_shr, + main_sel_op_sload, + main_sel_op_sstore, + main_sel_op_storage_address, + main_sel_op_sub, + main_sel_op_timestamp, + main_sel_op_transaction_fee, + main_sel_op_version, + main_sel_op_xor, + main_sel_rng_16, + main_sel_rng_8, + main_space_id, + main_table_pow_2, + main_tag_err, + main_w_in_tag, + mem_addr, + mem_clk, + mem_diff_hi, + mem_diff_lo, + mem_diff_mid, + mem_glob_addr, + mem_ind_op_a, + mem_ind_op_b, + mem_ind_op_c, + mem_ind_op_d, + mem_last, + mem_lastAccess, + mem_mem_sel, + mem_one_min_inv, + mem_op_a, + mem_op_b, + mem_op_c, + mem_op_d, + mem_r_in_tag, + mem_rng_chk_sel, + mem_rw, + mem_sel_cmov, + mem_sel_mov_a, + mem_sel_mov_b, + mem_skip_check_tag, + mem_space_id, + mem_tag, + mem_tag_err, + mem_tsp, + mem_val, + mem_w_in_tag, + pedersen_clk, + pedersen_input, + pedersen_output, + pedersen_pedersen_sel, + poseidon2_clk, + poseidon2_input, + poseidon2_output, + poseidon2_poseidon_perm_sel, + sha256_clk, + sha256_input, + sha256_output, + sha256_sha256_compression_sel, + sha256_state, perm_main_alu, perm_main_bin, perm_main_conv, @@ -1869,364 +1869,364 @@ class AvmFlavor { lookup_div_u16_5_counts, lookup_div_u16_6_counts, lookup_div_u16_7_counts, - avm_alu_a_hi_shift, - avm_alu_a_lo_shift, - avm_alu_alu_sel_shift, - avm_alu_b_hi_shift, - avm_alu_b_lo_shift, - avm_alu_cmp_rng_ctr_shift, - avm_alu_cmp_sel_shift, - avm_alu_div_rng_chk_selector_shift, - avm_alu_div_u16_r0_shift, - avm_alu_div_u16_r1_shift, - avm_alu_div_u16_r2_shift, - avm_alu_div_u16_r3_shift, - avm_alu_div_u16_r4_shift, - avm_alu_div_u16_r5_shift, - avm_alu_div_u16_r6_shift, - avm_alu_div_u16_r7_shift, - avm_alu_op_add_shift, - avm_alu_op_cast_prev_shift, - avm_alu_op_cast_shift, - avm_alu_op_div_shift, - avm_alu_op_mul_shift, - avm_alu_op_shl_shift, - avm_alu_op_shr_shift, - avm_alu_op_sub_shift, - avm_alu_p_sub_a_hi_shift, - avm_alu_p_sub_a_lo_shift, - avm_alu_p_sub_b_hi_shift, - avm_alu_p_sub_b_lo_shift, - avm_alu_rng_chk_lookup_selector_shift, - avm_alu_rng_chk_sel_shift, - avm_alu_u16_r0_shift, - avm_alu_u16_r1_shift, - avm_alu_u16_r2_shift, - avm_alu_u16_r3_shift, - avm_alu_u16_r4_shift, - avm_alu_u16_r5_shift, - avm_alu_u16_r6_shift, - avm_alu_u8_r0_shift, - avm_alu_u8_r1_shift, - avm_binary_acc_ia_shift, - avm_binary_acc_ib_shift, - avm_binary_acc_ic_shift, - avm_binary_mem_tag_ctr_shift, - avm_binary_op_id_shift, - avm_kernel_emit_l2_to_l1_msg_write_offset_shift, - avm_kernel_emit_note_hash_write_offset_shift, - avm_kernel_emit_nullifier_write_offset_shift, - avm_kernel_emit_unencrypted_log_write_offset_shift, - avm_kernel_l1_to_l2_msg_exists_write_offset_shift, - avm_kernel_note_hash_exist_write_offset_shift, - avm_kernel_nullifier_exists_write_offset_shift, - avm_kernel_nullifier_non_exists_write_offset_shift, - avm_kernel_side_effect_counter_shift, - avm_kernel_sload_write_offset_shift, - avm_kernel_sstore_write_offset_shift, - avm_main_da_gas_remaining_shift, - avm_main_internal_return_ptr_shift, - avm_main_l2_gas_remaining_shift, - avm_main_pc_shift, - avm_mem_glob_addr_shift, - avm_mem_mem_sel_shift, - avm_mem_rw_shift, - avm_mem_tag_shift, - avm_mem_tsp_shift, - avm_mem_val_shift }; + alu_a_hi_shift, + alu_a_lo_shift, + alu_alu_sel_shift, + alu_b_hi_shift, + alu_b_lo_shift, + alu_cmp_rng_ctr_shift, + alu_cmp_sel_shift, + alu_div_rng_chk_selector_shift, + alu_div_u16_r0_shift, + alu_div_u16_r1_shift, + alu_div_u16_r2_shift, + alu_div_u16_r3_shift, + alu_div_u16_r4_shift, + alu_div_u16_r5_shift, + alu_div_u16_r6_shift, + alu_div_u16_r7_shift, + alu_op_add_shift, + alu_op_cast_prev_shift, + alu_op_cast_shift, + alu_op_div_shift, + alu_op_mul_shift, + alu_op_shl_shift, + alu_op_shr_shift, + alu_op_sub_shift, + alu_p_sub_a_hi_shift, + alu_p_sub_a_lo_shift, + alu_p_sub_b_hi_shift, + alu_p_sub_b_lo_shift, + alu_rng_chk_lookup_selector_shift, + alu_rng_chk_sel_shift, + alu_u16_r0_shift, + alu_u16_r1_shift, + alu_u16_r2_shift, + alu_u16_r3_shift, + alu_u16_r4_shift, + alu_u16_r5_shift, + alu_u16_r6_shift, + alu_u8_r0_shift, + alu_u8_r1_shift, + binary_acc_ia_shift, + binary_acc_ib_shift, + binary_acc_ic_shift, + binary_mem_tag_ctr_shift, + binary_op_id_shift, + kernel_emit_l2_to_l1_msg_write_offset_shift, + kernel_emit_note_hash_write_offset_shift, + kernel_emit_nullifier_write_offset_shift, + kernel_emit_unencrypted_log_write_offset_shift, + kernel_l1_to_l2_msg_exists_write_offset_shift, + kernel_note_hash_exist_write_offset_shift, + kernel_nullifier_exists_write_offset_shift, + kernel_nullifier_non_exists_write_offset_shift, + kernel_side_effect_counter_shift, + kernel_sload_write_offset_shift, + kernel_sstore_write_offset_shift, + main_da_gas_remaining_shift, + main_internal_return_ptr_shift, + main_l2_gas_remaining_shift, + main_pc_shift, + mem_glob_addr_shift, + mem_mem_sel_shift, + mem_rw_shift, + mem_tag_shift, + mem_tsp_shift, + mem_val_shift }; }; RefVector get_unshifted() { - return { avm_main_clk, - avm_main_first, - avm_alu_a_hi, - avm_alu_a_lo, - avm_alu_alu_sel, - avm_alu_b_hi, - avm_alu_b_lo, - avm_alu_borrow, - avm_alu_cf, - avm_alu_clk, - avm_alu_cmp_rng_ctr, - avm_alu_cmp_sel, - avm_alu_div_rng_chk_selector, - avm_alu_div_u16_r0, - avm_alu_div_u16_r1, - avm_alu_div_u16_r2, - avm_alu_div_u16_r3, - avm_alu_div_u16_r4, - avm_alu_div_u16_r5, - avm_alu_div_u16_r6, - avm_alu_div_u16_r7, - avm_alu_divisor_hi, - avm_alu_divisor_lo, - avm_alu_ff_tag, - avm_alu_ia, - avm_alu_ib, - avm_alu_ic, - avm_alu_in_tag, - avm_alu_op_add, - avm_alu_op_cast, - avm_alu_op_cast_prev, - avm_alu_op_div, - avm_alu_op_div_a_lt_b, - avm_alu_op_div_std, - avm_alu_op_eq, - avm_alu_op_eq_diff_inv, - avm_alu_op_lt, - avm_alu_op_lte, - avm_alu_op_mul, - avm_alu_op_not, - avm_alu_op_shl, - avm_alu_op_shr, - avm_alu_op_sub, - avm_alu_p_a_borrow, - avm_alu_p_b_borrow, - avm_alu_p_sub_a_hi, - avm_alu_p_sub_a_lo, - avm_alu_p_sub_b_hi, - avm_alu_p_sub_b_lo, - avm_alu_partial_prod_hi, - avm_alu_partial_prod_lo, - avm_alu_quotient_hi, - avm_alu_quotient_lo, - avm_alu_remainder, - avm_alu_res_hi, - avm_alu_res_lo, - avm_alu_rng_chk_lookup_selector, - avm_alu_rng_chk_sel, - avm_alu_shift_lt_bit_len, - avm_alu_shift_sel, - avm_alu_t_sub_s_bits, - avm_alu_two_pow_s, - avm_alu_two_pow_t_sub_s, - avm_alu_u128_tag, - avm_alu_u16_r0, - avm_alu_u16_r1, - avm_alu_u16_r10, - avm_alu_u16_r11, - avm_alu_u16_r12, - avm_alu_u16_r13, - avm_alu_u16_r14, - avm_alu_u16_r2, - avm_alu_u16_r3, - avm_alu_u16_r4, - avm_alu_u16_r5, - avm_alu_u16_r6, - avm_alu_u16_r7, - avm_alu_u16_r8, - avm_alu_u16_r9, - avm_alu_u16_tag, - avm_alu_u32_tag, - avm_alu_u64_tag, - avm_alu_u8_r0, - avm_alu_u8_r1, - avm_alu_u8_tag, - avm_binary_acc_ia, - avm_binary_acc_ib, - avm_binary_acc_ic, - avm_binary_bin_sel, - avm_binary_clk, - avm_binary_ia_bytes, - avm_binary_ib_bytes, - avm_binary_ic_bytes, - avm_binary_in_tag, - avm_binary_mem_tag_ctr, - avm_binary_mem_tag_ctr_inv, - avm_binary_op_id, - avm_binary_start, - avm_byte_lookup_bin_sel, - avm_byte_lookup_table_byte_lengths, - avm_byte_lookup_table_in_tags, - avm_byte_lookup_table_input_a, - avm_byte_lookup_table_input_b, - avm_byte_lookup_table_op_id, - avm_byte_lookup_table_output, - avm_conversion_clk, - avm_conversion_input, - avm_conversion_num_limbs, - avm_conversion_radix, - avm_conversion_to_radix_le_sel, - avm_gas_da_gas_fixed_table, - avm_gas_gas_cost_sel, - avm_gas_l2_gas_fixed_table, - avm_keccakf1600_clk, - avm_keccakf1600_input, - avm_keccakf1600_keccakf1600_sel, - avm_keccakf1600_output, - avm_kernel_emit_l2_to_l1_msg_write_offset, - avm_kernel_emit_note_hash_write_offset, - avm_kernel_emit_nullifier_write_offset, - avm_kernel_emit_unencrypted_log_write_offset, - avm_kernel_kernel_in_offset, - avm_kernel_kernel_inputs, - avm_kernel_kernel_metadata_out, - avm_kernel_kernel_out_offset, - avm_kernel_kernel_side_effect_out, - avm_kernel_kernel_value_out, - avm_kernel_l1_to_l2_msg_exists_write_offset, - avm_kernel_note_hash_exist_write_offset, - avm_kernel_nullifier_exists_write_offset, - avm_kernel_nullifier_non_exists_write_offset, - avm_kernel_q_public_input_kernel_add_to_table, - avm_kernel_q_public_input_kernel_out_add_to_table, - avm_kernel_side_effect_counter, - avm_kernel_sload_write_offset, - avm_kernel_sstore_write_offset, - avm_main_abs_da_rem_gas_hi, - avm_main_abs_da_rem_gas_lo, - avm_main_abs_l2_rem_gas_hi, - avm_main_abs_l2_rem_gas_lo, - avm_main_alu_in_tag, - avm_main_alu_sel, - avm_main_bin_op_id, - avm_main_bin_sel, - avm_main_call_ptr, - avm_main_da_gas_op, - avm_main_da_gas_remaining, - avm_main_da_out_of_gas, - avm_main_gas_cost_active, - avm_main_ia, - avm_main_ib, - avm_main_ic, - avm_main_id, - avm_main_id_zero, - avm_main_ind_a, - avm_main_ind_b, - avm_main_ind_c, - avm_main_ind_d, - avm_main_ind_op_a, - avm_main_ind_op_b, - avm_main_ind_op_c, - avm_main_ind_op_d, - avm_main_internal_return_ptr, - avm_main_inv, - avm_main_l2_gas_op, - avm_main_l2_gas_remaining, - avm_main_l2_out_of_gas, - avm_main_last, - avm_main_mem_idx_a, - avm_main_mem_idx_b, - avm_main_mem_idx_c, - avm_main_mem_idx_d, - avm_main_mem_op_a, - avm_main_mem_op_activate_gas, - avm_main_mem_op_b, - avm_main_mem_op_c, - avm_main_mem_op_d, - avm_main_op_err, - avm_main_opcode_val, - avm_main_pc, - avm_main_q_kernel_lookup, - avm_main_q_kernel_output_lookup, - avm_main_r_in_tag, - avm_main_rwa, - avm_main_rwb, - avm_main_rwc, - avm_main_rwd, - avm_main_sel_cmov, - avm_main_sel_external_call, - avm_main_sel_halt, - avm_main_sel_internal_call, - avm_main_sel_internal_return, - avm_main_sel_jump, - avm_main_sel_jumpi, - avm_main_sel_mov, - avm_main_sel_mov_a, - avm_main_sel_mov_b, - avm_main_sel_op_add, - avm_main_sel_op_address, - avm_main_sel_op_and, - avm_main_sel_op_block_number, - avm_main_sel_op_cast, - avm_main_sel_op_chain_id, - avm_main_sel_op_coinbase, - avm_main_sel_op_dagasleft, - avm_main_sel_op_div, - avm_main_sel_op_emit_l2_to_l1_msg, - avm_main_sel_op_emit_note_hash, - avm_main_sel_op_emit_nullifier, - avm_main_sel_op_emit_unencrypted_log, - avm_main_sel_op_eq, - avm_main_sel_op_fdiv, - avm_main_sel_op_fee_per_da_gas, - avm_main_sel_op_fee_per_l2_gas, - avm_main_sel_op_get_contract_instance, - avm_main_sel_op_keccak, - avm_main_sel_op_l1_to_l2_msg_exists, - avm_main_sel_op_l2gasleft, - avm_main_sel_op_lt, - avm_main_sel_op_lte, - avm_main_sel_op_mul, - avm_main_sel_op_not, - avm_main_sel_op_note_hash_exists, - avm_main_sel_op_nullifier_exists, - avm_main_sel_op_or, - avm_main_sel_op_pedersen, - avm_main_sel_op_poseidon2, - avm_main_sel_op_radix_le, - avm_main_sel_op_sender, - avm_main_sel_op_sha256, - avm_main_sel_op_shl, - avm_main_sel_op_shr, - avm_main_sel_op_sload, - avm_main_sel_op_sstore, - avm_main_sel_op_storage_address, - avm_main_sel_op_sub, - avm_main_sel_op_timestamp, - avm_main_sel_op_transaction_fee, - avm_main_sel_op_version, - avm_main_sel_op_xor, - avm_main_sel_rng_16, - avm_main_sel_rng_8, - avm_main_space_id, - avm_main_table_pow_2, - avm_main_tag_err, - avm_main_w_in_tag, - avm_mem_addr, - avm_mem_clk, - avm_mem_diff_hi, - avm_mem_diff_lo, - avm_mem_diff_mid, - avm_mem_glob_addr, - avm_mem_ind_op_a, - avm_mem_ind_op_b, - avm_mem_ind_op_c, - avm_mem_ind_op_d, - avm_mem_last, - avm_mem_lastAccess, - avm_mem_mem_sel, - avm_mem_one_min_inv, - avm_mem_op_a, - avm_mem_op_b, - avm_mem_op_c, - avm_mem_op_d, - avm_mem_r_in_tag, - avm_mem_rng_chk_sel, - avm_mem_rw, - avm_mem_sel_cmov, - avm_mem_sel_mov_a, - avm_mem_sel_mov_b, - avm_mem_skip_check_tag, - avm_mem_space_id, - avm_mem_tag, - avm_mem_tag_err, - avm_mem_tsp, - avm_mem_val, - avm_mem_w_in_tag, - avm_pedersen_clk, - avm_pedersen_input, - avm_pedersen_output, - avm_pedersen_pedersen_sel, - avm_poseidon2_clk, - avm_poseidon2_input, - avm_poseidon2_output, - avm_poseidon2_poseidon_perm_sel, - avm_sha256_clk, - avm_sha256_input, - avm_sha256_output, - avm_sha256_sha256_compression_sel, - avm_sha256_state, + return { main_clk, + main_first, + alu_a_hi, + alu_a_lo, + alu_alu_sel, + alu_b_hi, + alu_b_lo, + alu_borrow, + alu_cf, + alu_clk, + alu_cmp_rng_ctr, + alu_cmp_sel, + alu_div_rng_chk_selector, + alu_div_u16_r0, + alu_div_u16_r1, + alu_div_u16_r2, + alu_div_u16_r3, + alu_div_u16_r4, + alu_div_u16_r5, + alu_div_u16_r6, + alu_div_u16_r7, + alu_divisor_hi, + alu_divisor_lo, + alu_ff_tag, + alu_ia, + alu_ib, + alu_ic, + alu_in_tag, + alu_op_add, + alu_op_cast, + alu_op_cast_prev, + alu_op_div, + alu_op_div_a_lt_b, + alu_op_div_std, + alu_op_eq, + alu_op_eq_diff_inv, + alu_op_lt, + alu_op_lte, + alu_op_mul, + alu_op_not, + alu_op_shl, + alu_op_shr, + alu_op_sub, + alu_p_a_borrow, + alu_p_b_borrow, + alu_p_sub_a_hi, + alu_p_sub_a_lo, + alu_p_sub_b_hi, + alu_p_sub_b_lo, + alu_partial_prod_hi, + alu_partial_prod_lo, + alu_quotient_hi, + alu_quotient_lo, + alu_remainder, + alu_res_hi, + alu_res_lo, + alu_rng_chk_lookup_selector, + alu_rng_chk_sel, + alu_shift_lt_bit_len, + alu_shift_sel, + alu_t_sub_s_bits, + alu_two_pow_s, + alu_two_pow_t_sub_s, + alu_u128_tag, + alu_u16_r0, + alu_u16_r1, + alu_u16_r10, + alu_u16_r11, + alu_u16_r12, + alu_u16_r13, + alu_u16_r14, + alu_u16_r2, + alu_u16_r3, + alu_u16_r4, + alu_u16_r5, + alu_u16_r6, + alu_u16_r7, + alu_u16_r8, + alu_u16_r9, + alu_u16_tag, + alu_u32_tag, + alu_u64_tag, + alu_u8_r0, + alu_u8_r1, + alu_u8_tag, + binary_acc_ia, + binary_acc_ib, + binary_acc_ic, + binary_bin_sel, + binary_clk, + binary_ia_bytes, + binary_ib_bytes, + binary_ic_bytes, + binary_in_tag, + binary_mem_tag_ctr, + binary_mem_tag_ctr_inv, + binary_op_id, + binary_start, + byte_lookup_bin_sel, + byte_lookup_table_byte_lengths, + byte_lookup_table_in_tags, + byte_lookup_table_input_a, + byte_lookup_table_input_b, + byte_lookup_table_op_id, + byte_lookup_table_output, + conversion_clk, + conversion_input, + conversion_num_limbs, + conversion_radix, + conversion_to_radix_le_sel, + gas_da_gas_fixed_table, + gas_gas_cost_sel, + gas_l2_gas_fixed_table, + keccakf1600_clk, + keccakf1600_input, + keccakf1600_keccakf1600_sel, + keccakf1600_output, + kernel_emit_l2_to_l1_msg_write_offset, + kernel_emit_note_hash_write_offset, + kernel_emit_nullifier_write_offset, + kernel_emit_unencrypted_log_write_offset, + kernel_kernel_in_offset, + kernel_kernel_inputs, + kernel_kernel_metadata_out, + kernel_kernel_out_offset, + kernel_kernel_side_effect_out, + kernel_kernel_value_out, + kernel_l1_to_l2_msg_exists_write_offset, + kernel_note_hash_exist_write_offset, + kernel_nullifier_exists_write_offset, + kernel_nullifier_non_exists_write_offset, + kernel_q_public_input_kernel_add_to_table, + kernel_q_public_input_kernel_out_add_to_table, + kernel_side_effect_counter, + kernel_sload_write_offset, + kernel_sstore_write_offset, + main_abs_da_rem_gas_hi, + main_abs_da_rem_gas_lo, + main_abs_l2_rem_gas_hi, + main_abs_l2_rem_gas_lo, + main_alu_in_tag, + main_alu_sel, + main_bin_op_id, + main_bin_sel, + main_call_ptr, + main_da_gas_op, + main_da_gas_remaining, + main_da_out_of_gas, + main_gas_cost_active, + main_ia, + main_ib, + main_ic, + main_id, + main_id_zero, + main_ind_a, + main_ind_b, + main_ind_c, + main_ind_d, + main_ind_op_a, + main_ind_op_b, + main_ind_op_c, + main_ind_op_d, + main_internal_return_ptr, + main_inv, + main_l2_gas_op, + main_l2_gas_remaining, + main_l2_out_of_gas, + main_last, + main_mem_idx_a, + main_mem_idx_b, + main_mem_idx_c, + main_mem_idx_d, + main_mem_op_a, + main_mem_op_activate_gas, + main_mem_op_b, + main_mem_op_c, + main_mem_op_d, + main_op_err, + main_opcode_val, + main_pc, + main_q_kernel_lookup, + main_q_kernel_output_lookup, + main_r_in_tag, + main_rwa, + main_rwb, + main_rwc, + main_rwd, + main_sel_cmov, + main_sel_external_call, + main_sel_halt, + main_sel_internal_call, + main_sel_internal_return, + main_sel_jump, + main_sel_jumpi, + main_sel_mov, + main_sel_mov_a, + main_sel_mov_b, + main_sel_op_add, + main_sel_op_address, + main_sel_op_and, + main_sel_op_block_number, + main_sel_op_cast, + main_sel_op_chain_id, + main_sel_op_coinbase, + main_sel_op_dagasleft, + main_sel_op_div, + main_sel_op_emit_l2_to_l1_msg, + main_sel_op_emit_note_hash, + main_sel_op_emit_nullifier, + main_sel_op_emit_unencrypted_log, + main_sel_op_eq, + main_sel_op_fdiv, + main_sel_op_fee_per_da_gas, + main_sel_op_fee_per_l2_gas, + main_sel_op_get_contract_instance, + main_sel_op_keccak, + main_sel_op_l1_to_l2_msg_exists, + main_sel_op_l2gasleft, + main_sel_op_lt, + main_sel_op_lte, + main_sel_op_mul, + main_sel_op_not, + main_sel_op_note_hash_exists, + main_sel_op_nullifier_exists, + main_sel_op_or, + main_sel_op_pedersen, + main_sel_op_poseidon2, + main_sel_op_radix_le, + main_sel_op_sender, + main_sel_op_sha256, + main_sel_op_shl, + main_sel_op_shr, + main_sel_op_sload, + main_sel_op_sstore, + main_sel_op_storage_address, + main_sel_op_sub, + main_sel_op_timestamp, + main_sel_op_transaction_fee, + main_sel_op_version, + main_sel_op_xor, + main_sel_rng_16, + main_sel_rng_8, + main_space_id, + main_table_pow_2, + main_tag_err, + main_w_in_tag, + mem_addr, + mem_clk, + mem_diff_hi, + mem_diff_lo, + mem_diff_mid, + mem_glob_addr, + mem_ind_op_a, + mem_ind_op_b, + mem_ind_op_c, + mem_ind_op_d, + mem_last, + mem_lastAccess, + mem_mem_sel, + mem_one_min_inv, + mem_op_a, + mem_op_b, + mem_op_c, + mem_op_d, + mem_r_in_tag, + mem_rng_chk_sel, + mem_rw, + mem_sel_cmov, + mem_sel_mov_a, + mem_sel_mov_b, + mem_skip_check_tag, + mem_space_id, + mem_tag, + mem_tag_err, + mem_tsp, + mem_val, + mem_w_in_tag, + pedersen_clk, + pedersen_input, + pedersen_output, + pedersen_pedersen_sel, + poseidon2_clk, + poseidon2_input, + poseidon2_output, + poseidon2_poseidon_perm_sel, + sha256_clk, + sha256_input, + sha256_output, + sha256_sha256_compression_sel, + sha256_state, perm_main_alu, perm_main_bin, perm_main_conv, @@ -2325,139 +2325,139 @@ class AvmFlavor { }; RefVector get_to_be_shifted() { - return { avm_alu_a_hi, - avm_alu_a_lo, - avm_alu_alu_sel, - avm_alu_b_hi, - avm_alu_b_lo, - avm_alu_cmp_rng_ctr, - avm_alu_cmp_sel, - avm_alu_div_rng_chk_selector, - avm_alu_div_u16_r0, - avm_alu_div_u16_r1, - avm_alu_div_u16_r2, - avm_alu_div_u16_r3, - avm_alu_div_u16_r4, - avm_alu_div_u16_r5, - avm_alu_div_u16_r6, - avm_alu_div_u16_r7, - avm_alu_op_add, - avm_alu_op_cast_prev, - avm_alu_op_cast, - avm_alu_op_div, - avm_alu_op_mul, - avm_alu_op_shl, - avm_alu_op_shr, - avm_alu_op_sub, - avm_alu_p_sub_a_hi, - avm_alu_p_sub_a_lo, - avm_alu_p_sub_b_hi, - avm_alu_p_sub_b_lo, - avm_alu_rng_chk_lookup_selector, - avm_alu_rng_chk_sel, - avm_alu_u16_r0, - avm_alu_u16_r1, - avm_alu_u16_r2, - avm_alu_u16_r3, - avm_alu_u16_r4, - avm_alu_u16_r5, - avm_alu_u16_r6, - avm_alu_u8_r0, - avm_alu_u8_r1, - avm_binary_acc_ia, - avm_binary_acc_ib, - avm_binary_acc_ic, - avm_binary_mem_tag_ctr, - avm_binary_op_id, - avm_kernel_emit_l2_to_l1_msg_write_offset, - avm_kernel_emit_note_hash_write_offset, - avm_kernel_emit_nullifier_write_offset, - avm_kernel_emit_unencrypted_log_write_offset, - avm_kernel_l1_to_l2_msg_exists_write_offset, - avm_kernel_note_hash_exist_write_offset, - avm_kernel_nullifier_exists_write_offset, - avm_kernel_nullifier_non_exists_write_offset, - avm_kernel_side_effect_counter, - avm_kernel_sload_write_offset, - avm_kernel_sstore_write_offset, - avm_main_da_gas_remaining, - avm_main_internal_return_ptr, - avm_main_l2_gas_remaining, - avm_main_pc, - avm_mem_glob_addr, - avm_mem_mem_sel, - avm_mem_rw, - avm_mem_tag, - avm_mem_tsp, - avm_mem_val }; + return { alu_a_hi, + alu_a_lo, + alu_alu_sel, + alu_b_hi, + alu_b_lo, + alu_cmp_rng_ctr, + alu_cmp_sel, + alu_div_rng_chk_selector, + alu_div_u16_r0, + alu_div_u16_r1, + alu_div_u16_r2, + alu_div_u16_r3, + alu_div_u16_r4, + alu_div_u16_r5, + alu_div_u16_r6, + alu_div_u16_r7, + alu_op_add, + alu_op_cast_prev, + alu_op_cast, + alu_op_div, + alu_op_mul, + alu_op_shl, + alu_op_shr, + alu_op_sub, + alu_p_sub_a_hi, + alu_p_sub_a_lo, + alu_p_sub_b_hi, + alu_p_sub_b_lo, + alu_rng_chk_lookup_selector, + alu_rng_chk_sel, + alu_u16_r0, + alu_u16_r1, + alu_u16_r2, + alu_u16_r3, + alu_u16_r4, + alu_u16_r5, + alu_u16_r6, + alu_u8_r0, + alu_u8_r1, + binary_acc_ia, + binary_acc_ib, + binary_acc_ic, + binary_mem_tag_ctr, + binary_op_id, + kernel_emit_l2_to_l1_msg_write_offset, + kernel_emit_note_hash_write_offset, + kernel_emit_nullifier_write_offset, + kernel_emit_unencrypted_log_write_offset, + kernel_l1_to_l2_msg_exists_write_offset, + kernel_note_hash_exist_write_offset, + kernel_nullifier_exists_write_offset, + kernel_nullifier_non_exists_write_offset, + kernel_side_effect_counter, + kernel_sload_write_offset, + kernel_sstore_write_offset, + main_da_gas_remaining, + main_internal_return_ptr, + main_l2_gas_remaining, + main_pc, + mem_glob_addr, + mem_mem_sel, + mem_rw, + mem_tag, + mem_tsp, + mem_val }; }; RefVector get_shifted() { - return { avm_alu_a_hi_shift, - avm_alu_a_lo_shift, - avm_alu_alu_sel_shift, - avm_alu_b_hi_shift, - avm_alu_b_lo_shift, - avm_alu_cmp_rng_ctr_shift, - avm_alu_cmp_sel_shift, - avm_alu_div_rng_chk_selector_shift, - avm_alu_div_u16_r0_shift, - avm_alu_div_u16_r1_shift, - avm_alu_div_u16_r2_shift, - avm_alu_div_u16_r3_shift, - avm_alu_div_u16_r4_shift, - avm_alu_div_u16_r5_shift, - avm_alu_div_u16_r6_shift, - avm_alu_div_u16_r7_shift, - avm_alu_op_add_shift, - avm_alu_op_cast_prev_shift, - avm_alu_op_cast_shift, - avm_alu_op_div_shift, - avm_alu_op_mul_shift, - avm_alu_op_shl_shift, - avm_alu_op_shr_shift, - avm_alu_op_sub_shift, - avm_alu_p_sub_a_hi_shift, - avm_alu_p_sub_a_lo_shift, - avm_alu_p_sub_b_hi_shift, - avm_alu_p_sub_b_lo_shift, - avm_alu_rng_chk_lookup_selector_shift, - avm_alu_rng_chk_sel_shift, - avm_alu_u16_r0_shift, - avm_alu_u16_r1_shift, - avm_alu_u16_r2_shift, - avm_alu_u16_r3_shift, - avm_alu_u16_r4_shift, - avm_alu_u16_r5_shift, - avm_alu_u16_r6_shift, - avm_alu_u8_r0_shift, - avm_alu_u8_r1_shift, - avm_binary_acc_ia_shift, - avm_binary_acc_ib_shift, - avm_binary_acc_ic_shift, - avm_binary_mem_tag_ctr_shift, - avm_binary_op_id_shift, - avm_kernel_emit_l2_to_l1_msg_write_offset_shift, - avm_kernel_emit_note_hash_write_offset_shift, - avm_kernel_emit_nullifier_write_offset_shift, - avm_kernel_emit_unencrypted_log_write_offset_shift, - avm_kernel_l1_to_l2_msg_exists_write_offset_shift, - avm_kernel_note_hash_exist_write_offset_shift, - avm_kernel_nullifier_exists_write_offset_shift, - avm_kernel_nullifier_non_exists_write_offset_shift, - avm_kernel_side_effect_counter_shift, - avm_kernel_sload_write_offset_shift, - avm_kernel_sstore_write_offset_shift, - avm_main_da_gas_remaining_shift, - avm_main_internal_return_ptr_shift, - avm_main_l2_gas_remaining_shift, - avm_main_pc_shift, - avm_mem_glob_addr_shift, - avm_mem_mem_sel_shift, - avm_mem_rw_shift, - avm_mem_tag_shift, - avm_mem_tsp_shift, - avm_mem_val_shift }; + return { alu_a_hi_shift, + alu_a_lo_shift, + alu_alu_sel_shift, + alu_b_hi_shift, + alu_b_lo_shift, + alu_cmp_rng_ctr_shift, + alu_cmp_sel_shift, + alu_div_rng_chk_selector_shift, + alu_div_u16_r0_shift, + alu_div_u16_r1_shift, + alu_div_u16_r2_shift, + alu_div_u16_r3_shift, + alu_div_u16_r4_shift, + alu_div_u16_r5_shift, + alu_div_u16_r6_shift, + alu_div_u16_r7_shift, + alu_op_add_shift, + alu_op_cast_prev_shift, + alu_op_cast_shift, + alu_op_div_shift, + alu_op_mul_shift, + alu_op_shl_shift, + alu_op_shr_shift, + alu_op_sub_shift, + alu_p_sub_a_hi_shift, + alu_p_sub_a_lo_shift, + alu_p_sub_b_hi_shift, + alu_p_sub_b_lo_shift, + alu_rng_chk_lookup_selector_shift, + alu_rng_chk_sel_shift, + alu_u16_r0_shift, + alu_u16_r1_shift, + alu_u16_r2_shift, + alu_u16_r3_shift, + alu_u16_r4_shift, + alu_u16_r5_shift, + alu_u16_r6_shift, + alu_u8_r0_shift, + alu_u8_r1_shift, + binary_acc_ia_shift, + binary_acc_ib_shift, + binary_acc_ic_shift, + binary_mem_tag_ctr_shift, + binary_op_id_shift, + kernel_emit_l2_to_l1_msg_write_offset_shift, + kernel_emit_note_hash_write_offset_shift, + kernel_emit_nullifier_write_offset_shift, + kernel_emit_unencrypted_log_write_offset_shift, + kernel_l1_to_l2_msg_exists_write_offset_shift, + kernel_note_hash_exist_write_offset_shift, + kernel_nullifier_exists_write_offset_shift, + kernel_nullifier_non_exists_write_offset_shift, + kernel_side_effect_counter_shift, + kernel_sload_write_offset_shift, + kernel_sstore_write_offset_shift, + main_da_gas_remaining_shift, + main_internal_return_ptr_shift, + main_l2_gas_remaining_shift, + main_pc_shift, + mem_glob_addr_shift, + mem_mem_sel_shift, + mem_rw_shift, + mem_tag_shift, + mem_tsp_shift, + mem_val_shift }; }; }; @@ -2471,71 +2471,71 @@ class AvmFlavor { RefVector get_to_be_shifted() { - return { avm_alu_a_hi, - avm_alu_a_lo, - avm_alu_alu_sel, - avm_alu_b_hi, - avm_alu_b_lo, - avm_alu_cmp_rng_ctr, - avm_alu_cmp_sel, - avm_alu_div_rng_chk_selector, - avm_alu_div_u16_r0, - avm_alu_div_u16_r1, - avm_alu_div_u16_r2, - avm_alu_div_u16_r3, - avm_alu_div_u16_r4, - avm_alu_div_u16_r5, - avm_alu_div_u16_r6, - avm_alu_div_u16_r7, - avm_alu_op_add, - avm_alu_op_cast_prev, - avm_alu_op_cast, - avm_alu_op_div, - avm_alu_op_mul, - avm_alu_op_shl, - avm_alu_op_shr, - avm_alu_op_sub, - avm_alu_p_sub_a_hi, - avm_alu_p_sub_a_lo, - avm_alu_p_sub_b_hi, - avm_alu_p_sub_b_lo, - avm_alu_rng_chk_lookup_selector, - avm_alu_rng_chk_sel, - avm_alu_u16_r0, - avm_alu_u16_r1, - avm_alu_u16_r2, - avm_alu_u16_r3, - avm_alu_u16_r4, - avm_alu_u16_r5, - avm_alu_u16_r6, - avm_alu_u8_r0, - avm_alu_u8_r1, - avm_binary_acc_ia, - avm_binary_acc_ib, - avm_binary_acc_ic, - avm_binary_mem_tag_ctr, - avm_binary_op_id, - avm_kernel_emit_l2_to_l1_msg_write_offset, - avm_kernel_emit_note_hash_write_offset, - avm_kernel_emit_nullifier_write_offset, - avm_kernel_emit_unencrypted_log_write_offset, - avm_kernel_l1_to_l2_msg_exists_write_offset, - avm_kernel_note_hash_exist_write_offset, - avm_kernel_nullifier_exists_write_offset, - avm_kernel_nullifier_non_exists_write_offset, - avm_kernel_side_effect_counter, - avm_kernel_sload_write_offset, - avm_kernel_sstore_write_offset, - avm_main_da_gas_remaining, - avm_main_internal_return_ptr, - avm_main_l2_gas_remaining, - avm_main_pc, - avm_mem_glob_addr, - avm_mem_mem_sel, - avm_mem_rw, - avm_mem_tag, - avm_mem_tsp, - avm_mem_val }; + return { alu_a_hi, + alu_a_lo, + alu_alu_sel, + alu_b_hi, + alu_b_lo, + alu_cmp_rng_ctr, + alu_cmp_sel, + alu_div_rng_chk_selector, + alu_div_u16_r0, + alu_div_u16_r1, + alu_div_u16_r2, + alu_div_u16_r3, + alu_div_u16_r4, + alu_div_u16_r5, + alu_div_u16_r6, + alu_div_u16_r7, + alu_op_add, + alu_op_cast_prev, + alu_op_cast, + alu_op_div, + alu_op_mul, + alu_op_shl, + alu_op_shr, + alu_op_sub, + alu_p_sub_a_hi, + alu_p_sub_a_lo, + alu_p_sub_b_hi, + alu_p_sub_b_lo, + alu_rng_chk_lookup_selector, + alu_rng_chk_sel, + alu_u16_r0, + alu_u16_r1, + alu_u16_r2, + alu_u16_r3, + alu_u16_r4, + alu_u16_r5, + alu_u16_r6, + alu_u8_r0, + alu_u8_r1, + binary_acc_ia, + binary_acc_ib, + binary_acc_ic, + binary_mem_tag_ctr, + binary_op_id, + kernel_emit_l2_to_l1_msg_write_offset, + kernel_emit_note_hash_write_offset, + kernel_emit_nullifier_write_offset, + kernel_emit_unencrypted_log_write_offset, + kernel_l1_to_l2_msg_exists_write_offset, + kernel_note_hash_exist_write_offset, + kernel_nullifier_exists_write_offset, + kernel_nullifier_non_exists_write_offset, + kernel_side_effect_counter, + kernel_sload_write_offset, + kernel_sstore_write_offset, + main_da_gas_remaining, + main_internal_return_ptr, + main_l2_gas_remaining, + main_pc, + mem_glob_addr, + mem_mem_sel, + mem_rw, + mem_tag, + mem_tsp, + mem_val }; }; void compute_logderivative_inverses(const RelationParameters& relation_parameters) @@ -2686,7 +2686,7 @@ class AvmFlavor { } } - [[nodiscard]] size_t get_polynomial_size() const { return avm_alu_a_hi.size(); } + [[nodiscard]] size_t get_polynomial_size() const { return alu_a_hi.size(); } /** * @brief Returns the evaluations of all prover polynomials at one point on the boolean hypercube, which * represents one row in the execution trace. @@ -2746,297 +2746,296 @@ class AvmFlavor { CommitmentLabels() : AllEntities() { - Base::avm_main_clk = "AVM_MAIN_CLK"; - Base::avm_main_first = "AVM_MAIN_FIRST"; - Base::avm_alu_a_hi = "AVM_ALU_A_HI"; - Base::avm_alu_a_lo = "AVM_ALU_A_LO"; - Base::avm_alu_alu_sel = "AVM_ALU_ALU_SEL"; - Base::avm_alu_b_hi = "AVM_ALU_B_HI"; - Base::avm_alu_b_lo = "AVM_ALU_B_LO"; - Base::avm_alu_borrow = "AVM_ALU_BORROW"; - Base::avm_alu_cf = "AVM_ALU_CF"; - Base::avm_alu_clk = "AVM_ALU_CLK"; - Base::avm_alu_cmp_rng_ctr = "AVM_ALU_CMP_RNG_CTR"; - Base::avm_alu_cmp_sel = "AVM_ALU_CMP_SEL"; - Base::avm_alu_div_rng_chk_selector = "AVM_ALU_DIV_RNG_CHK_SELECTOR"; - Base::avm_alu_div_u16_r0 = "AVM_ALU_DIV_U16_R0"; - Base::avm_alu_div_u16_r1 = "AVM_ALU_DIV_U16_R1"; - Base::avm_alu_div_u16_r2 = "AVM_ALU_DIV_U16_R2"; - Base::avm_alu_div_u16_r3 = "AVM_ALU_DIV_U16_R3"; - Base::avm_alu_div_u16_r4 = "AVM_ALU_DIV_U16_R4"; - Base::avm_alu_div_u16_r5 = "AVM_ALU_DIV_U16_R5"; - Base::avm_alu_div_u16_r6 = "AVM_ALU_DIV_U16_R6"; - Base::avm_alu_div_u16_r7 = "AVM_ALU_DIV_U16_R7"; - Base::avm_alu_divisor_hi = "AVM_ALU_DIVISOR_HI"; - Base::avm_alu_divisor_lo = "AVM_ALU_DIVISOR_LO"; - Base::avm_alu_ff_tag = "AVM_ALU_FF_TAG"; - Base::avm_alu_ia = "AVM_ALU_IA"; - Base::avm_alu_ib = "AVM_ALU_IB"; - Base::avm_alu_ic = "AVM_ALU_IC"; - Base::avm_alu_in_tag = "AVM_ALU_IN_TAG"; - Base::avm_alu_op_add = "AVM_ALU_OP_ADD"; - Base::avm_alu_op_cast = "AVM_ALU_OP_CAST"; - Base::avm_alu_op_cast_prev = "AVM_ALU_OP_CAST_PREV"; - Base::avm_alu_op_div = "AVM_ALU_OP_DIV"; - Base::avm_alu_op_div_a_lt_b = "AVM_ALU_OP_DIV_A_LT_B"; - Base::avm_alu_op_div_std = "AVM_ALU_OP_DIV_STD"; - Base::avm_alu_op_eq = "AVM_ALU_OP_EQ"; - Base::avm_alu_op_eq_diff_inv = "AVM_ALU_OP_EQ_DIFF_INV"; - Base::avm_alu_op_lt = "AVM_ALU_OP_LT"; - Base::avm_alu_op_lte = "AVM_ALU_OP_LTE"; - Base::avm_alu_op_mul = "AVM_ALU_OP_MUL"; - Base::avm_alu_op_not = "AVM_ALU_OP_NOT"; - Base::avm_alu_op_shl = "AVM_ALU_OP_SHL"; - Base::avm_alu_op_shr = "AVM_ALU_OP_SHR"; - Base::avm_alu_op_sub = "AVM_ALU_OP_SUB"; - Base::avm_alu_p_a_borrow = "AVM_ALU_P_A_BORROW"; - Base::avm_alu_p_b_borrow = "AVM_ALU_P_B_BORROW"; - Base::avm_alu_p_sub_a_hi = "AVM_ALU_P_SUB_A_HI"; - Base::avm_alu_p_sub_a_lo = "AVM_ALU_P_SUB_A_LO"; - Base::avm_alu_p_sub_b_hi = "AVM_ALU_P_SUB_B_HI"; - Base::avm_alu_p_sub_b_lo = "AVM_ALU_P_SUB_B_LO"; - Base::avm_alu_partial_prod_hi = "AVM_ALU_PARTIAL_PROD_HI"; - Base::avm_alu_partial_prod_lo = "AVM_ALU_PARTIAL_PROD_LO"; - Base::avm_alu_quotient_hi = "AVM_ALU_QUOTIENT_HI"; - Base::avm_alu_quotient_lo = "AVM_ALU_QUOTIENT_LO"; - Base::avm_alu_remainder = "AVM_ALU_REMAINDER"; - Base::avm_alu_res_hi = "AVM_ALU_RES_HI"; - Base::avm_alu_res_lo = "AVM_ALU_RES_LO"; - Base::avm_alu_rng_chk_lookup_selector = "AVM_ALU_RNG_CHK_LOOKUP_SELECTOR"; - Base::avm_alu_rng_chk_sel = "AVM_ALU_RNG_CHK_SEL"; - Base::avm_alu_shift_lt_bit_len = "AVM_ALU_SHIFT_LT_BIT_LEN"; - Base::avm_alu_shift_sel = "AVM_ALU_SHIFT_SEL"; - Base::avm_alu_t_sub_s_bits = "AVM_ALU_T_SUB_S_BITS"; - Base::avm_alu_two_pow_s = "AVM_ALU_TWO_POW_S"; - Base::avm_alu_two_pow_t_sub_s = "AVM_ALU_TWO_POW_T_SUB_S"; - Base::avm_alu_u128_tag = "AVM_ALU_U128_TAG"; - Base::avm_alu_u16_r0 = "AVM_ALU_U16_R0"; - Base::avm_alu_u16_r1 = "AVM_ALU_U16_R1"; - Base::avm_alu_u16_r10 = "AVM_ALU_U16_R10"; - Base::avm_alu_u16_r11 = "AVM_ALU_U16_R11"; - Base::avm_alu_u16_r12 = "AVM_ALU_U16_R12"; - Base::avm_alu_u16_r13 = "AVM_ALU_U16_R13"; - Base::avm_alu_u16_r14 = "AVM_ALU_U16_R14"; - Base::avm_alu_u16_r2 = "AVM_ALU_U16_R2"; - Base::avm_alu_u16_r3 = "AVM_ALU_U16_R3"; - Base::avm_alu_u16_r4 = "AVM_ALU_U16_R4"; - Base::avm_alu_u16_r5 = "AVM_ALU_U16_R5"; - Base::avm_alu_u16_r6 = "AVM_ALU_U16_R6"; - Base::avm_alu_u16_r7 = "AVM_ALU_U16_R7"; - Base::avm_alu_u16_r8 = "AVM_ALU_U16_R8"; - Base::avm_alu_u16_r9 = "AVM_ALU_U16_R9"; - Base::avm_alu_u16_tag = "AVM_ALU_U16_TAG"; - Base::avm_alu_u32_tag = "AVM_ALU_U32_TAG"; - Base::avm_alu_u64_tag = "AVM_ALU_U64_TAG"; - Base::avm_alu_u8_r0 = "AVM_ALU_U8_R0"; - Base::avm_alu_u8_r1 = "AVM_ALU_U8_R1"; - Base::avm_alu_u8_tag = "AVM_ALU_U8_TAG"; - Base::avm_binary_acc_ia = "AVM_BINARY_ACC_IA"; - Base::avm_binary_acc_ib = "AVM_BINARY_ACC_IB"; - Base::avm_binary_acc_ic = "AVM_BINARY_ACC_IC"; - Base::avm_binary_bin_sel = "AVM_BINARY_BIN_SEL"; - Base::avm_binary_clk = "AVM_BINARY_CLK"; - Base::avm_binary_ia_bytes = "AVM_BINARY_IA_BYTES"; - Base::avm_binary_ib_bytes = "AVM_BINARY_IB_BYTES"; - Base::avm_binary_ic_bytes = "AVM_BINARY_IC_BYTES"; - Base::avm_binary_in_tag = "AVM_BINARY_IN_TAG"; - Base::avm_binary_mem_tag_ctr = "AVM_BINARY_MEM_TAG_CTR"; - Base::avm_binary_mem_tag_ctr_inv = "AVM_BINARY_MEM_TAG_CTR_INV"; - Base::avm_binary_op_id = "AVM_BINARY_OP_ID"; - Base::avm_binary_start = "AVM_BINARY_START"; - Base::avm_byte_lookup_bin_sel = "AVM_BYTE_LOOKUP_BIN_SEL"; - Base::avm_byte_lookup_table_byte_lengths = "AVM_BYTE_LOOKUP_TABLE_BYTE_LENGTHS"; - Base::avm_byte_lookup_table_in_tags = "AVM_BYTE_LOOKUP_TABLE_IN_TAGS"; - Base::avm_byte_lookup_table_input_a = "AVM_BYTE_LOOKUP_TABLE_INPUT_A"; - Base::avm_byte_lookup_table_input_b = "AVM_BYTE_LOOKUP_TABLE_INPUT_B"; - Base::avm_byte_lookup_table_op_id = "AVM_BYTE_LOOKUP_TABLE_OP_ID"; - Base::avm_byte_lookup_table_output = "AVM_BYTE_LOOKUP_TABLE_OUTPUT"; - Base::avm_conversion_clk = "AVM_CONVERSION_CLK"; - Base::avm_conversion_input = "AVM_CONVERSION_INPUT"; - Base::avm_conversion_num_limbs = "AVM_CONVERSION_NUM_LIMBS"; - Base::avm_conversion_radix = "AVM_CONVERSION_RADIX"; - Base::avm_conversion_to_radix_le_sel = "AVM_CONVERSION_TO_RADIX_LE_SEL"; - Base::avm_gas_da_gas_fixed_table = "AVM_GAS_DA_GAS_FIXED_TABLE"; - Base::avm_gas_gas_cost_sel = "AVM_GAS_GAS_COST_SEL"; - Base::avm_gas_l2_gas_fixed_table = "AVM_GAS_L2_GAS_FIXED_TABLE"; - Base::avm_keccakf1600_clk = "AVM_KECCAKF1600_CLK"; - Base::avm_keccakf1600_input = "AVM_KECCAKF1600_INPUT"; - Base::avm_keccakf1600_keccakf1600_sel = "AVM_KECCAKF1600_KECCAKF1600_SEL"; - Base::avm_keccakf1600_output = "AVM_KECCAKF1600_OUTPUT"; - Base::avm_kernel_emit_l2_to_l1_msg_write_offset = "AVM_KERNEL_EMIT_L2_TO_L1_MSG_WRITE_OFFSET"; - Base::avm_kernel_emit_note_hash_write_offset = "AVM_KERNEL_EMIT_NOTE_HASH_WRITE_OFFSET"; - Base::avm_kernel_emit_nullifier_write_offset = "AVM_KERNEL_EMIT_NULLIFIER_WRITE_OFFSET"; - Base::avm_kernel_emit_unencrypted_log_write_offset = "AVM_KERNEL_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET"; - Base::avm_kernel_kernel_in_offset = "AVM_KERNEL_KERNEL_IN_OFFSET"; - Base::avm_kernel_kernel_inputs = "AVM_KERNEL_KERNEL_INPUTS"; - Base::avm_kernel_kernel_metadata_out = "AVM_KERNEL_KERNEL_METADATA_OUT"; - Base::avm_kernel_kernel_out_offset = "AVM_KERNEL_KERNEL_OUT_OFFSET"; - Base::avm_kernel_kernel_side_effect_out = "AVM_KERNEL_KERNEL_SIDE_EFFECT_OUT"; - Base::avm_kernel_kernel_value_out = "AVM_KERNEL_KERNEL_VALUE_OUT"; - Base::avm_kernel_l1_to_l2_msg_exists_write_offset = "AVM_KERNEL_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET"; - Base::avm_kernel_note_hash_exist_write_offset = "AVM_KERNEL_NOTE_HASH_EXIST_WRITE_OFFSET"; - Base::avm_kernel_nullifier_exists_write_offset = "AVM_KERNEL_NULLIFIER_EXISTS_WRITE_OFFSET"; - Base::avm_kernel_nullifier_non_exists_write_offset = "AVM_KERNEL_NULLIFIER_NON_EXISTS_WRITE_OFFSET"; - Base::avm_kernel_q_public_input_kernel_add_to_table = "AVM_KERNEL_Q_PUBLIC_INPUT_KERNEL_ADD_TO_TABLE"; - Base::avm_kernel_q_public_input_kernel_out_add_to_table = - "AVM_KERNEL_Q_PUBLIC_INPUT_KERNEL_OUT_ADD_TO_TABLE"; - Base::avm_kernel_side_effect_counter = "AVM_KERNEL_SIDE_EFFECT_COUNTER"; - Base::avm_kernel_sload_write_offset = "AVM_KERNEL_SLOAD_WRITE_OFFSET"; - Base::avm_kernel_sstore_write_offset = "AVM_KERNEL_SSTORE_WRITE_OFFSET"; - Base::avm_main_abs_da_rem_gas_hi = "AVM_MAIN_ABS_DA_REM_GAS_HI"; - Base::avm_main_abs_da_rem_gas_lo = "AVM_MAIN_ABS_DA_REM_GAS_LO"; - Base::avm_main_abs_l2_rem_gas_hi = "AVM_MAIN_ABS_L2_REM_GAS_HI"; - Base::avm_main_abs_l2_rem_gas_lo = "AVM_MAIN_ABS_L2_REM_GAS_LO"; - Base::avm_main_alu_in_tag = "AVM_MAIN_ALU_IN_TAG"; - Base::avm_main_alu_sel = "AVM_MAIN_ALU_SEL"; - Base::avm_main_bin_op_id = "AVM_MAIN_BIN_OP_ID"; - Base::avm_main_bin_sel = "AVM_MAIN_BIN_SEL"; - Base::avm_main_call_ptr = "AVM_MAIN_CALL_PTR"; - Base::avm_main_da_gas_op = "AVM_MAIN_DA_GAS_OP"; - Base::avm_main_da_gas_remaining = "AVM_MAIN_DA_GAS_REMAINING"; - Base::avm_main_da_out_of_gas = "AVM_MAIN_DA_OUT_OF_GAS"; - Base::avm_main_gas_cost_active = "AVM_MAIN_GAS_COST_ACTIVE"; - Base::avm_main_ia = "AVM_MAIN_IA"; - Base::avm_main_ib = "AVM_MAIN_IB"; - Base::avm_main_ic = "AVM_MAIN_IC"; - Base::avm_main_id = "AVM_MAIN_ID"; - Base::avm_main_id_zero = "AVM_MAIN_ID_ZERO"; - Base::avm_main_ind_a = "AVM_MAIN_IND_A"; - Base::avm_main_ind_b = "AVM_MAIN_IND_B"; - Base::avm_main_ind_c = "AVM_MAIN_IND_C"; - Base::avm_main_ind_d = "AVM_MAIN_IND_D"; - Base::avm_main_ind_op_a = "AVM_MAIN_IND_OP_A"; - Base::avm_main_ind_op_b = "AVM_MAIN_IND_OP_B"; - Base::avm_main_ind_op_c = "AVM_MAIN_IND_OP_C"; - Base::avm_main_ind_op_d = "AVM_MAIN_IND_OP_D"; - Base::avm_main_internal_return_ptr = "AVM_MAIN_INTERNAL_RETURN_PTR"; - Base::avm_main_inv = "AVM_MAIN_INV"; - Base::avm_main_l2_gas_op = "AVM_MAIN_L2_GAS_OP"; - Base::avm_main_l2_gas_remaining = "AVM_MAIN_L2_GAS_REMAINING"; - Base::avm_main_l2_out_of_gas = "AVM_MAIN_L2_OUT_OF_GAS"; - Base::avm_main_last = "AVM_MAIN_LAST"; - Base::avm_main_mem_idx_a = "AVM_MAIN_MEM_IDX_A"; - Base::avm_main_mem_idx_b = "AVM_MAIN_MEM_IDX_B"; - Base::avm_main_mem_idx_c = "AVM_MAIN_MEM_IDX_C"; - Base::avm_main_mem_idx_d = "AVM_MAIN_MEM_IDX_D"; - Base::avm_main_mem_op_a = "AVM_MAIN_MEM_OP_A"; - Base::avm_main_mem_op_activate_gas = "AVM_MAIN_MEM_OP_ACTIVATE_GAS"; - Base::avm_main_mem_op_b = "AVM_MAIN_MEM_OP_B"; - Base::avm_main_mem_op_c = "AVM_MAIN_MEM_OP_C"; - Base::avm_main_mem_op_d = "AVM_MAIN_MEM_OP_D"; - Base::avm_main_op_err = "AVM_MAIN_OP_ERR"; - Base::avm_main_opcode_val = "AVM_MAIN_OPCODE_VAL"; - Base::avm_main_pc = "AVM_MAIN_PC"; - Base::avm_main_q_kernel_lookup = "AVM_MAIN_Q_KERNEL_LOOKUP"; - Base::avm_main_q_kernel_output_lookup = "AVM_MAIN_Q_KERNEL_OUTPUT_LOOKUP"; - Base::avm_main_r_in_tag = "AVM_MAIN_R_IN_TAG"; - Base::avm_main_rwa = "AVM_MAIN_RWA"; - Base::avm_main_rwb = "AVM_MAIN_RWB"; - Base::avm_main_rwc = "AVM_MAIN_RWC"; - Base::avm_main_rwd = "AVM_MAIN_RWD"; - Base::avm_main_sel_cmov = "AVM_MAIN_SEL_CMOV"; - Base::avm_main_sel_external_call = "AVM_MAIN_SEL_EXTERNAL_CALL"; - Base::avm_main_sel_halt = "AVM_MAIN_SEL_HALT"; - Base::avm_main_sel_internal_call = "AVM_MAIN_SEL_INTERNAL_CALL"; - Base::avm_main_sel_internal_return = "AVM_MAIN_SEL_INTERNAL_RETURN"; - Base::avm_main_sel_jump = "AVM_MAIN_SEL_JUMP"; - Base::avm_main_sel_jumpi = "AVM_MAIN_SEL_JUMPI"; - Base::avm_main_sel_mov = "AVM_MAIN_SEL_MOV"; - Base::avm_main_sel_mov_a = "AVM_MAIN_SEL_MOV_A"; - Base::avm_main_sel_mov_b = "AVM_MAIN_SEL_MOV_B"; - Base::avm_main_sel_op_add = "AVM_MAIN_SEL_OP_ADD"; - Base::avm_main_sel_op_address = "AVM_MAIN_SEL_OP_ADDRESS"; - Base::avm_main_sel_op_and = "AVM_MAIN_SEL_OP_AND"; - Base::avm_main_sel_op_block_number = "AVM_MAIN_SEL_OP_BLOCK_NUMBER"; - Base::avm_main_sel_op_cast = "AVM_MAIN_SEL_OP_CAST"; - Base::avm_main_sel_op_chain_id = "AVM_MAIN_SEL_OP_CHAIN_ID"; - Base::avm_main_sel_op_coinbase = "AVM_MAIN_SEL_OP_COINBASE"; - Base::avm_main_sel_op_dagasleft = "AVM_MAIN_SEL_OP_DAGASLEFT"; - Base::avm_main_sel_op_div = "AVM_MAIN_SEL_OP_DIV"; - Base::avm_main_sel_op_emit_l2_to_l1_msg = "AVM_MAIN_SEL_OP_EMIT_L2_TO_L1_MSG"; - Base::avm_main_sel_op_emit_note_hash = "AVM_MAIN_SEL_OP_EMIT_NOTE_HASH"; - Base::avm_main_sel_op_emit_nullifier = "AVM_MAIN_SEL_OP_EMIT_NULLIFIER"; - Base::avm_main_sel_op_emit_unencrypted_log = "AVM_MAIN_SEL_OP_EMIT_UNENCRYPTED_LOG"; - Base::avm_main_sel_op_eq = "AVM_MAIN_SEL_OP_EQ"; - Base::avm_main_sel_op_fdiv = "AVM_MAIN_SEL_OP_FDIV"; - Base::avm_main_sel_op_fee_per_da_gas = "AVM_MAIN_SEL_OP_FEE_PER_DA_GAS"; - Base::avm_main_sel_op_fee_per_l2_gas = "AVM_MAIN_SEL_OP_FEE_PER_L2_GAS"; - Base::avm_main_sel_op_get_contract_instance = "AVM_MAIN_SEL_OP_GET_CONTRACT_INSTANCE"; - Base::avm_main_sel_op_keccak = "AVM_MAIN_SEL_OP_KECCAK"; - Base::avm_main_sel_op_l1_to_l2_msg_exists = "AVM_MAIN_SEL_OP_L1_TO_L2_MSG_EXISTS"; - Base::avm_main_sel_op_l2gasleft = "AVM_MAIN_SEL_OP_L2GASLEFT"; - Base::avm_main_sel_op_lt = "AVM_MAIN_SEL_OP_LT"; - Base::avm_main_sel_op_lte = "AVM_MAIN_SEL_OP_LTE"; - Base::avm_main_sel_op_mul = "AVM_MAIN_SEL_OP_MUL"; - Base::avm_main_sel_op_not = "AVM_MAIN_SEL_OP_NOT"; - Base::avm_main_sel_op_note_hash_exists = "AVM_MAIN_SEL_OP_NOTE_HASH_EXISTS"; - Base::avm_main_sel_op_nullifier_exists = "AVM_MAIN_SEL_OP_NULLIFIER_EXISTS"; - Base::avm_main_sel_op_or = "AVM_MAIN_SEL_OP_OR"; - Base::avm_main_sel_op_pedersen = "AVM_MAIN_SEL_OP_PEDERSEN"; - Base::avm_main_sel_op_poseidon2 = "AVM_MAIN_SEL_OP_POSEIDON2"; - Base::avm_main_sel_op_radix_le = "AVM_MAIN_SEL_OP_RADIX_LE"; - Base::avm_main_sel_op_sender = "AVM_MAIN_SEL_OP_SENDER"; - Base::avm_main_sel_op_sha256 = "AVM_MAIN_SEL_OP_SHA256"; - Base::avm_main_sel_op_shl = "AVM_MAIN_SEL_OP_SHL"; - Base::avm_main_sel_op_shr = "AVM_MAIN_SEL_OP_SHR"; - Base::avm_main_sel_op_sload = "AVM_MAIN_SEL_OP_SLOAD"; - Base::avm_main_sel_op_sstore = "AVM_MAIN_SEL_OP_SSTORE"; - Base::avm_main_sel_op_storage_address = "AVM_MAIN_SEL_OP_STORAGE_ADDRESS"; - Base::avm_main_sel_op_sub = "AVM_MAIN_SEL_OP_SUB"; - Base::avm_main_sel_op_timestamp = "AVM_MAIN_SEL_OP_TIMESTAMP"; - Base::avm_main_sel_op_transaction_fee = "AVM_MAIN_SEL_OP_TRANSACTION_FEE"; - Base::avm_main_sel_op_version = "AVM_MAIN_SEL_OP_VERSION"; - Base::avm_main_sel_op_xor = "AVM_MAIN_SEL_OP_XOR"; - Base::avm_main_sel_rng_16 = "AVM_MAIN_SEL_RNG_16"; - Base::avm_main_sel_rng_8 = "AVM_MAIN_SEL_RNG_8"; - Base::avm_main_space_id = "AVM_MAIN_SPACE_ID"; - Base::avm_main_table_pow_2 = "AVM_MAIN_TABLE_POW_2"; - Base::avm_main_tag_err = "AVM_MAIN_TAG_ERR"; - Base::avm_main_w_in_tag = "AVM_MAIN_W_IN_TAG"; - Base::avm_mem_addr = "AVM_MEM_ADDR"; - Base::avm_mem_clk = "AVM_MEM_CLK"; - Base::avm_mem_diff_hi = "AVM_MEM_DIFF_HI"; - Base::avm_mem_diff_lo = "AVM_MEM_DIFF_LO"; - Base::avm_mem_diff_mid = "AVM_MEM_DIFF_MID"; - Base::avm_mem_glob_addr = "AVM_MEM_GLOB_ADDR"; - Base::avm_mem_ind_op_a = "AVM_MEM_IND_OP_A"; - Base::avm_mem_ind_op_b = "AVM_MEM_IND_OP_B"; - Base::avm_mem_ind_op_c = "AVM_MEM_IND_OP_C"; - Base::avm_mem_ind_op_d = "AVM_MEM_IND_OP_D"; - Base::avm_mem_last = "AVM_MEM_LAST"; - Base::avm_mem_lastAccess = "AVM_MEM_LASTACCESS"; - Base::avm_mem_mem_sel = "AVM_MEM_MEM_SEL"; - Base::avm_mem_one_min_inv = "AVM_MEM_ONE_MIN_INV"; - Base::avm_mem_op_a = "AVM_MEM_OP_A"; - Base::avm_mem_op_b = "AVM_MEM_OP_B"; - Base::avm_mem_op_c = "AVM_MEM_OP_C"; - Base::avm_mem_op_d = "AVM_MEM_OP_D"; - Base::avm_mem_r_in_tag = "AVM_MEM_R_IN_TAG"; - Base::avm_mem_rng_chk_sel = "AVM_MEM_RNG_CHK_SEL"; - Base::avm_mem_rw = "AVM_MEM_RW"; - Base::avm_mem_sel_cmov = "AVM_MEM_SEL_CMOV"; - Base::avm_mem_sel_mov_a = "AVM_MEM_SEL_MOV_A"; - Base::avm_mem_sel_mov_b = "AVM_MEM_SEL_MOV_B"; - Base::avm_mem_skip_check_tag = "AVM_MEM_SKIP_CHECK_TAG"; - Base::avm_mem_space_id = "AVM_MEM_SPACE_ID"; - Base::avm_mem_tag = "AVM_MEM_TAG"; - Base::avm_mem_tag_err = "AVM_MEM_TAG_ERR"; - Base::avm_mem_tsp = "AVM_MEM_TSP"; - Base::avm_mem_val = "AVM_MEM_VAL"; - Base::avm_mem_w_in_tag = "AVM_MEM_W_IN_TAG"; - Base::avm_pedersen_clk = "AVM_PEDERSEN_CLK"; - Base::avm_pedersen_input = "AVM_PEDERSEN_INPUT"; - Base::avm_pedersen_output = "AVM_PEDERSEN_OUTPUT"; - Base::avm_pedersen_pedersen_sel = "AVM_PEDERSEN_PEDERSEN_SEL"; - Base::avm_poseidon2_clk = "AVM_POSEIDON2_CLK"; - Base::avm_poseidon2_input = "AVM_POSEIDON2_INPUT"; - Base::avm_poseidon2_output = "AVM_POSEIDON2_OUTPUT"; - Base::avm_poseidon2_poseidon_perm_sel = "AVM_POSEIDON2_POSEIDON_PERM_SEL"; - Base::avm_sha256_clk = "AVM_SHA256_CLK"; - Base::avm_sha256_input = "AVM_SHA256_INPUT"; - Base::avm_sha256_output = "AVM_SHA256_OUTPUT"; - Base::avm_sha256_sha256_compression_sel = "AVM_SHA256_SHA256_COMPRESSION_SEL"; - Base::avm_sha256_state = "AVM_SHA256_STATE"; + Base::main_clk = "MAIN_CLK"; + Base::main_first = "MAIN_FIRST"; + Base::alu_a_hi = "ALU_A_HI"; + Base::alu_a_lo = "ALU_A_LO"; + Base::alu_alu_sel = "ALU_ALU_SEL"; + Base::alu_b_hi = "ALU_B_HI"; + Base::alu_b_lo = "ALU_B_LO"; + Base::alu_borrow = "ALU_BORROW"; + Base::alu_cf = "ALU_CF"; + Base::alu_clk = "ALU_CLK"; + Base::alu_cmp_rng_ctr = "ALU_CMP_RNG_CTR"; + Base::alu_cmp_sel = "ALU_CMP_SEL"; + Base::alu_div_rng_chk_selector = "ALU_DIV_RNG_CHK_SELECTOR"; + Base::alu_div_u16_r0 = "ALU_DIV_U16_R0"; + Base::alu_div_u16_r1 = "ALU_DIV_U16_R1"; + Base::alu_div_u16_r2 = "ALU_DIV_U16_R2"; + Base::alu_div_u16_r3 = "ALU_DIV_U16_R3"; + Base::alu_div_u16_r4 = "ALU_DIV_U16_R4"; + Base::alu_div_u16_r5 = "ALU_DIV_U16_R5"; + Base::alu_div_u16_r6 = "ALU_DIV_U16_R6"; + Base::alu_div_u16_r7 = "ALU_DIV_U16_R7"; + Base::alu_divisor_hi = "ALU_DIVISOR_HI"; + Base::alu_divisor_lo = "ALU_DIVISOR_LO"; + Base::alu_ff_tag = "ALU_FF_TAG"; + Base::alu_ia = "ALU_IA"; + Base::alu_ib = "ALU_IB"; + Base::alu_ic = "ALU_IC"; + Base::alu_in_tag = "ALU_IN_TAG"; + Base::alu_op_add = "ALU_OP_ADD"; + Base::alu_op_cast = "ALU_OP_CAST"; + Base::alu_op_cast_prev = "ALU_OP_CAST_PREV"; + Base::alu_op_div = "ALU_OP_DIV"; + Base::alu_op_div_a_lt_b = "ALU_OP_DIV_A_LT_B"; + Base::alu_op_div_std = "ALU_OP_DIV_STD"; + Base::alu_op_eq = "ALU_OP_EQ"; + Base::alu_op_eq_diff_inv = "ALU_OP_EQ_DIFF_INV"; + Base::alu_op_lt = "ALU_OP_LT"; + Base::alu_op_lte = "ALU_OP_LTE"; + Base::alu_op_mul = "ALU_OP_MUL"; + Base::alu_op_not = "ALU_OP_NOT"; + Base::alu_op_shl = "ALU_OP_SHL"; + Base::alu_op_shr = "ALU_OP_SHR"; + Base::alu_op_sub = "ALU_OP_SUB"; + Base::alu_p_a_borrow = "ALU_P_A_BORROW"; + Base::alu_p_b_borrow = "ALU_P_B_BORROW"; + Base::alu_p_sub_a_hi = "ALU_P_SUB_A_HI"; + Base::alu_p_sub_a_lo = "ALU_P_SUB_A_LO"; + Base::alu_p_sub_b_hi = "ALU_P_SUB_B_HI"; + Base::alu_p_sub_b_lo = "ALU_P_SUB_B_LO"; + Base::alu_partial_prod_hi = "ALU_PARTIAL_PROD_HI"; + Base::alu_partial_prod_lo = "ALU_PARTIAL_PROD_LO"; + Base::alu_quotient_hi = "ALU_QUOTIENT_HI"; + Base::alu_quotient_lo = "ALU_QUOTIENT_LO"; + Base::alu_remainder = "ALU_REMAINDER"; + Base::alu_res_hi = "ALU_RES_HI"; + Base::alu_res_lo = "ALU_RES_LO"; + Base::alu_rng_chk_lookup_selector = "ALU_RNG_CHK_LOOKUP_SELECTOR"; + Base::alu_rng_chk_sel = "ALU_RNG_CHK_SEL"; + Base::alu_shift_lt_bit_len = "ALU_SHIFT_LT_BIT_LEN"; + Base::alu_shift_sel = "ALU_SHIFT_SEL"; + Base::alu_t_sub_s_bits = "ALU_T_SUB_S_BITS"; + Base::alu_two_pow_s = "ALU_TWO_POW_S"; + Base::alu_two_pow_t_sub_s = "ALU_TWO_POW_T_SUB_S"; + Base::alu_u128_tag = "ALU_U128_TAG"; + Base::alu_u16_r0 = "ALU_U16_R0"; + Base::alu_u16_r1 = "ALU_U16_R1"; + Base::alu_u16_r10 = "ALU_U16_R10"; + Base::alu_u16_r11 = "ALU_U16_R11"; + Base::alu_u16_r12 = "ALU_U16_R12"; + Base::alu_u16_r13 = "ALU_U16_R13"; + Base::alu_u16_r14 = "ALU_U16_R14"; + Base::alu_u16_r2 = "ALU_U16_R2"; + Base::alu_u16_r3 = "ALU_U16_R3"; + Base::alu_u16_r4 = "ALU_U16_R4"; + Base::alu_u16_r5 = "ALU_U16_R5"; + Base::alu_u16_r6 = "ALU_U16_R6"; + Base::alu_u16_r7 = "ALU_U16_R7"; + Base::alu_u16_r8 = "ALU_U16_R8"; + Base::alu_u16_r9 = "ALU_U16_R9"; + Base::alu_u16_tag = "ALU_U16_TAG"; + Base::alu_u32_tag = "ALU_U32_TAG"; + Base::alu_u64_tag = "ALU_U64_TAG"; + Base::alu_u8_r0 = "ALU_U8_R0"; + Base::alu_u8_r1 = "ALU_U8_R1"; + Base::alu_u8_tag = "ALU_U8_TAG"; + Base::binary_acc_ia = "BINARY_ACC_IA"; + Base::binary_acc_ib = "BINARY_ACC_IB"; + Base::binary_acc_ic = "BINARY_ACC_IC"; + Base::binary_bin_sel = "BINARY_BIN_SEL"; + Base::binary_clk = "BINARY_CLK"; + Base::binary_ia_bytes = "BINARY_IA_BYTES"; + Base::binary_ib_bytes = "BINARY_IB_BYTES"; + Base::binary_ic_bytes = "BINARY_IC_BYTES"; + Base::binary_in_tag = "BINARY_IN_TAG"; + Base::binary_mem_tag_ctr = "BINARY_MEM_TAG_CTR"; + Base::binary_mem_tag_ctr_inv = "BINARY_MEM_TAG_CTR_INV"; + Base::binary_op_id = "BINARY_OP_ID"; + Base::binary_start = "BINARY_START"; + Base::byte_lookup_bin_sel = "BYTE_LOOKUP_BIN_SEL"; + Base::byte_lookup_table_byte_lengths = "BYTE_LOOKUP_TABLE_BYTE_LENGTHS"; + Base::byte_lookup_table_in_tags = "BYTE_LOOKUP_TABLE_IN_TAGS"; + Base::byte_lookup_table_input_a = "BYTE_LOOKUP_TABLE_INPUT_A"; + Base::byte_lookup_table_input_b = "BYTE_LOOKUP_TABLE_INPUT_B"; + Base::byte_lookup_table_op_id = "BYTE_LOOKUP_TABLE_OP_ID"; + Base::byte_lookup_table_output = "BYTE_LOOKUP_TABLE_OUTPUT"; + Base::conversion_clk = "CONVERSION_CLK"; + Base::conversion_input = "CONVERSION_INPUT"; + Base::conversion_num_limbs = "CONVERSION_NUM_LIMBS"; + Base::conversion_radix = "CONVERSION_RADIX"; + Base::conversion_to_radix_le_sel = "CONVERSION_TO_RADIX_LE_SEL"; + Base::gas_da_gas_fixed_table = "GAS_DA_GAS_FIXED_TABLE"; + Base::gas_gas_cost_sel = "GAS_GAS_COST_SEL"; + Base::gas_l2_gas_fixed_table = "GAS_L2_GAS_FIXED_TABLE"; + Base::keccakf1600_clk = "KECCAKF1600_CLK"; + Base::keccakf1600_input = "KECCAKF1600_INPUT"; + Base::keccakf1600_keccakf1600_sel = "KECCAKF1600_KECCAKF1600_SEL"; + Base::keccakf1600_output = "KECCAKF1600_OUTPUT"; + Base::kernel_emit_l2_to_l1_msg_write_offset = "KERNEL_EMIT_L2_TO_L1_MSG_WRITE_OFFSET"; + Base::kernel_emit_note_hash_write_offset = "KERNEL_EMIT_NOTE_HASH_WRITE_OFFSET"; + Base::kernel_emit_nullifier_write_offset = "KERNEL_EMIT_NULLIFIER_WRITE_OFFSET"; + Base::kernel_emit_unencrypted_log_write_offset = "KERNEL_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET"; + Base::kernel_kernel_in_offset = "KERNEL_KERNEL_IN_OFFSET"; + Base::kernel_kernel_inputs = "KERNEL_KERNEL_INPUTS"; + Base::kernel_kernel_metadata_out = "KERNEL_KERNEL_METADATA_OUT"; + Base::kernel_kernel_out_offset = "KERNEL_KERNEL_OUT_OFFSET"; + Base::kernel_kernel_side_effect_out = "KERNEL_KERNEL_SIDE_EFFECT_OUT"; + Base::kernel_kernel_value_out = "KERNEL_KERNEL_VALUE_OUT"; + Base::kernel_l1_to_l2_msg_exists_write_offset = "KERNEL_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET"; + Base::kernel_note_hash_exist_write_offset = "KERNEL_NOTE_HASH_EXIST_WRITE_OFFSET"; + Base::kernel_nullifier_exists_write_offset = "KERNEL_NULLIFIER_EXISTS_WRITE_OFFSET"; + Base::kernel_nullifier_non_exists_write_offset = "KERNEL_NULLIFIER_NON_EXISTS_WRITE_OFFSET"; + Base::kernel_q_public_input_kernel_add_to_table = "KERNEL_Q_PUBLIC_INPUT_KERNEL_ADD_TO_TABLE"; + Base::kernel_q_public_input_kernel_out_add_to_table = "KERNEL_Q_PUBLIC_INPUT_KERNEL_OUT_ADD_TO_TABLE"; + Base::kernel_side_effect_counter = "KERNEL_SIDE_EFFECT_COUNTER"; + Base::kernel_sload_write_offset = "KERNEL_SLOAD_WRITE_OFFSET"; + Base::kernel_sstore_write_offset = "KERNEL_SSTORE_WRITE_OFFSET"; + Base::main_abs_da_rem_gas_hi = "MAIN_ABS_DA_REM_GAS_HI"; + Base::main_abs_da_rem_gas_lo = "MAIN_ABS_DA_REM_GAS_LO"; + Base::main_abs_l2_rem_gas_hi = "MAIN_ABS_L2_REM_GAS_HI"; + Base::main_abs_l2_rem_gas_lo = "MAIN_ABS_L2_REM_GAS_LO"; + Base::main_alu_in_tag = "MAIN_ALU_IN_TAG"; + Base::main_alu_sel = "MAIN_ALU_SEL"; + Base::main_bin_op_id = "MAIN_BIN_OP_ID"; + Base::main_bin_sel = "MAIN_BIN_SEL"; + Base::main_call_ptr = "MAIN_CALL_PTR"; + Base::main_da_gas_op = "MAIN_DA_GAS_OP"; + Base::main_da_gas_remaining = "MAIN_DA_GAS_REMAINING"; + Base::main_da_out_of_gas = "MAIN_DA_OUT_OF_GAS"; + Base::main_gas_cost_active = "MAIN_GAS_COST_ACTIVE"; + Base::main_ia = "MAIN_IA"; + Base::main_ib = "MAIN_IB"; + Base::main_ic = "MAIN_IC"; + Base::main_id = "MAIN_ID"; + Base::main_id_zero = "MAIN_ID_ZERO"; + Base::main_ind_a = "MAIN_IND_A"; + Base::main_ind_b = "MAIN_IND_B"; + Base::main_ind_c = "MAIN_IND_C"; + Base::main_ind_d = "MAIN_IND_D"; + Base::main_ind_op_a = "MAIN_IND_OP_A"; + Base::main_ind_op_b = "MAIN_IND_OP_B"; + Base::main_ind_op_c = "MAIN_IND_OP_C"; + Base::main_ind_op_d = "MAIN_IND_OP_D"; + Base::main_internal_return_ptr = "MAIN_INTERNAL_RETURN_PTR"; + Base::main_inv = "MAIN_INV"; + Base::main_l2_gas_op = "MAIN_L2_GAS_OP"; + Base::main_l2_gas_remaining = "MAIN_L2_GAS_REMAINING"; + Base::main_l2_out_of_gas = "MAIN_L2_OUT_OF_GAS"; + Base::main_last = "MAIN_LAST"; + Base::main_mem_idx_a = "MAIN_MEM_IDX_A"; + Base::main_mem_idx_b = "MAIN_MEM_IDX_B"; + Base::main_mem_idx_c = "MAIN_MEM_IDX_C"; + Base::main_mem_idx_d = "MAIN_MEM_IDX_D"; + Base::main_mem_op_a = "MAIN_MEM_OP_A"; + Base::main_mem_op_activate_gas = "MAIN_MEM_OP_ACTIVATE_GAS"; + Base::main_mem_op_b = "MAIN_MEM_OP_B"; + Base::main_mem_op_c = "MAIN_MEM_OP_C"; + Base::main_mem_op_d = "MAIN_MEM_OP_D"; + Base::main_op_err = "MAIN_OP_ERR"; + Base::main_opcode_val = "MAIN_OPCODE_VAL"; + Base::main_pc = "MAIN_PC"; + Base::main_q_kernel_lookup = "MAIN_Q_KERNEL_LOOKUP"; + Base::main_q_kernel_output_lookup = "MAIN_Q_KERNEL_OUTPUT_LOOKUP"; + Base::main_r_in_tag = "MAIN_R_IN_TAG"; + Base::main_rwa = "MAIN_RWA"; + Base::main_rwb = "MAIN_RWB"; + Base::main_rwc = "MAIN_RWC"; + Base::main_rwd = "MAIN_RWD"; + Base::main_sel_cmov = "MAIN_SEL_CMOV"; + Base::main_sel_external_call = "MAIN_SEL_EXTERNAL_CALL"; + Base::main_sel_halt = "MAIN_SEL_HALT"; + Base::main_sel_internal_call = "MAIN_SEL_INTERNAL_CALL"; + Base::main_sel_internal_return = "MAIN_SEL_INTERNAL_RETURN"; + Base::main_sel_jump = "MAIN_SEL_JUMP"; + Base::main_sel_jumpi = "MAIN_SEL_JUMPI"; + Base::main_sel_mov = "MAIN_SEL_MOV"; + Base::main_sel_mov_a = "MAIN_SEL_MOV_A"; + Base::main_sel_mov_b = "MAIN_SEL_MOV_B"; + Base::main_sel_op_add = "MAIN_SEL_OP_ADD"; + Base::main_sel_op_address = "MAIN_SEL_OP_ADDRESS"; + Base::main_sel_op_and = "MAIN_SEL_OP_AND"; + Base::main_sel_op_block_number = "MAIN_SEL_OP_BLOCK_NUMBER"; + Base::main_sel_op_cast = "MAIN_SEL_OP_CAST"; + Base::main_sel_op_chain_id = "MAIN_SEL_OP_CHAIN_ID"; + Base::main_sel_op_coinbase = "MAIN_SEL_OP_COINBASE"; + Base::main_sel_op_dagasleft = "MAIN_SEL_OP_DAGASLEFT"; + Base::main_sel_op_div = "MAIN_SEL_OP_DIV"; + Base::main_sel_op_emit_l2_to_l1_msg = "MAIN_SEL_OP_EMIT_L2_TO_L1_MSG"; + Base::main_sel_op_emit_note_hash = "MAIN_SEL_OP_EMIT_NOTE_HASH"; + Base::main_sel_op_emit_nullifier = "MAIN_SEL_OP_EMIT_NULLIFIER"; + Base::main_sel_op_emit_unencrypted_log = "MAIN_SEL_OP_EMIT_UNENCRYPTED_LOG"; + Base::main_sel_op_eq = "MAIN_SEL_OP_EQ"; + Base::main_sel_op_fdiv = "MAIN_SEL_OP_FDIV"; + Base::main_sel_op_fee_per_da_gas = "MAIN_SEL_OP_FEE_PER_DA_GAS"; + Base::main_sel_op_fee_per_l2_gas = "MAIN_SEL_OP_FEE_PER_L2_GAS"; + Base::main_sel_op_get_contract_instance = "MAIN_SEL_OP_GET_CONTRACT_INSTANCE"; + Base::main_sel_op_keccak = "MAIN_SEL_OP_KECCAK"; + Base::main_sel_op_l1_to_l2_msg_exists = "MAIN_SEL_OP_L1_TO_L2_MSG_EXISTS"; + Base::main_sel_op_l2gasleft = "MAIN_SEL_OP_L2GASLEFT"; + Base::main_sel_op_lt = "MAIN_SEL_OP_LT"; + Base::main_sel_op_lte = "MAIN_SEL_OP_LTE"; + Base::main_sel_op_mul = "MAIN_SEL_OP_MUL"; + Base::main_sel_op_not = "MAIN_SEL_OP_NOT"; + Base::main_sel_op_note_hash_exists = "MAIN_SEL_OP_NOTE_HASH_EXISTS"; + Base::main_sel_op_nullifier_exists = "MAIN_SEL_OP_NULLIFIER_EXISTS"; + Base::main_sel_op_or = "MAIN_SEL_OP_OR"; + Base::main_sel_op_pedersen = "MAIN_SEL_OP_PEDERSEN"; + Base::main_sel_op_poseidon2 = "MAIN_SEL_OP_POSEIDON2"; + Base::main_sel_op_radix_le = "MAIN_SEL_OP_RADIX_LE"; + Base::main_sel_op_sender = "MAIN_SEL_OP_SENDER"; + Base::main_sel_op_sha256 = "MAIN_SEL_OP_SHA256"; + Base::main_sel_op_shl = "MAIN_SEL_OP_SHL"; + Base::main_sel_op_shr = "MAIN_SEL_OP_SHR"; + Base::main_sel_op_sload = "MAIN_SEL_OP_SLOAD"; + Base::main_sel_op_sstore = "MAIN_SEL_OP_SSTORE"; + Base::main_sel_op_storage_address = "MAIN_SEL_OP_STORAGE_ADDRESS"; + Base::main_sel_op_sub = "MAIN_SEL_OP_SUB"; + Base::main_sel_op_timestamp = "MAIN_SEL_OP_TIMESTAMP"; + Base::main_sel_op_transaction_fee = "MAIN_SEL_OP_TRANSACTION_FEE"; + Base::main_sel_op_version = "MAIN_SEL_OP_VERSION"; + Base::main_sel_op_xor = "MAIN_SEL_OP_XOR"; + Base::main_sel_rng_16 = "MAIN_SEL_RNG_16"; + Base::main_sel_rng_8 = "MAIN_SEL_RNG_8"; + Base::main_space_id = "MAIN_SPACE_ID"; + Base::main_table_pow_2 = "MAIN_TABLE_POW_2"; + Base::main_tag_err = "MAIN_TAG_ERR"; + Base::main_w_in_tag = "MAIN_W_IN_TAG"; + Base::mem_addr = "MEM_ADDR"; + Base::mem_clk = "MEM_CLK"; + Base::mem_diff_hi = "MEM_DIFF_HI"; + Base::mem_diff_lo = "MEM_DIFF_LO"; + Base::mem_diff_mid = "MEM_DIFF_MID"; + Base::mem_glob_addr = "MEM_GLOB_ADDR"; + Base::mem_ind_op_a = "MEM_IND_OP_A"; + Base::mem_ind_op_b = "MEM_IND_OP_B"; + Base::mem_ind_op_c = "MEM_IND_OP_C"; + Base::mem_ind_op_d = "MEM_IND_OP_D"; + Base::mem_last = "MEM_LAST"; + Base::mem_lastAccess = "MEM_LASTACCESS"; + Base::mem_mem_sel = "MEM_MEM_SEL"; + Base::mem_one_min_inv = "MEM_ONE_MIN_INV"; + Base::mem_op_a = "MEM_OP_A"; + Base::mem_op_b = "MEM_OP_B"; + Base::mem_op_c = "MEM_OP_C"; + Base::mem_op_d = "MEM_OP_D"; + Base::mem_r_in_tag = "MEM_R_IN_TAG"; + Base::mem_rng_chk_sel = "MEM_RNG_CHK_SEL"; + Base::mem_rw = "MEM_RW"; + Base::mem_sel_cmov = "MEM_SEL_CMOV"; + Base::mem_sel_mov_a = "MEM_SEL_MOV_A"; + Base::mem_sel_mov_b = "MEM_SEL_MOV_B"; + Base::mem_skip_check_tag = "MEM_SKIP_CHECK_TAG"; + Base::mem_space_id = "MEM_SPACE_ID"; + Base::mem_tag = "MEM_TAG"; + Base::mem_tag_err = "MEM_TAG_ERR"; + Base::mem_tsp = "MEM_TSP"; + Base::mem_val = "MEM_VAL"; + Base::mem_w_in_tag = "MEM_W_IN_TAG"; + Base::pedersen_clk = "PEDERSEN_CLK"; + Base::pedersen_input = "PEDERSEN_INPUT"; + Base::pedersen_output = "PEDERSEN_OUTPUT"; + Base::pedersen_pedersen_sel = "PEDERSEN_PEDERSEN_SEL"; + Base::poseidon2_clk = "POSEIDON2_CLK"; + Base::poseidon2_input = "POSEIDON2_INPUT"; + Base::poseidon2_output = "POSEIDON2_OUTPUT"; + Base::poseidon2_poseidon_perm_sel = "POSEIDON2_POSEIDON_PERM_SEL"; + Base::sha256_clk = "SHA256_CLK"; + Base::sha256_input = "SHA256_INPUT"; + Base::sha256_output = "SHA256_OUTPUT"; + Base::sha256_sha256_compression_sel = "SHA256_SHA256_COMPRESSION_SEL"; + Base::sha256_state = "SHA256_STATE"; Base::perm_main_alu = "PERM_MAIN_ALU"; Base::perm_main_bin = "PERM_MAIN_BIN"; Base::perm_main_conv = "PERM_MAIN_CONV"; @@ -3142,8 +3141,8 @@ class AvmFlavor { public: VerifierCommitments(const std::shared_ptr& verification_key) { - avm_main_clk = verification_key->avm_main_clk; - avm_main_first = verification_key->avm_main_first; + main_clk = verification_key->main_clk; + main_first = verification_key->main_first; } }; @@ -3151,294 +3150,294 @@ class AvmFlavor { public: uint32_t circuit_size; - Commitment avm_alu_a_hi; - Commitment avm_alu_a_lo; - Commitment avm_alu_alu_sel; - Commitment avm_alu_b_hi; - Commitment avm_alu_b_lo; - Commitment avm_alu_borrow; - Commitment avm_alu_cf; - Commitment avm_alu_clk; - Commitment avm_alu_cmp_rng_ctr; - Commitment avm_alu_cmp_sel; - Commitment avm_alu_div_rng_chk_selector; - Commitment avm_alu_div_u16_r0; - Commitment avm_alu_div_u16_r1; - Commitment avm_alu_div_u16_r2; - Commitment avm_alu_div_u16_r3; - Commitment avm_alu_div_u16_r4; - Commitment avm_alu_div_u16_r5; - Commitment avm_alu_div_u16_r6; - Commitment avm_alu_div_u16_r7; - Commitment avm_alu_divisor_hi; - Commitment avm_alu_divisor_lo; - Commitment avm_alu_ff_tag; - Commitment avm_alu_ia; - Commitment avm_alu_ib; - Commitment avm_alu_ic; - Commitment avm_alu_in_tag; - Commitment avm_alu_op_add; - Commitment avm_alu_op_cast; - Commitment avm_alu_op_cast_prev; - Commitment avm_alu_op_div; - Commitment avm_alu_op_div_a_lt_b; - Commitment avm_alu_op_div_std; - Commitment avm_alu_op_eq; - Commitment avm_alu_op_eq_diff_inv; - Commitment avm_alu_op_lt; - Commitment avm_alu_op_lte; - Commitment avm_alu_op_mul; - Commitment avm_alu_op_not; - Commitment avm_alu_op_shl; - Commitment avm_alu_op_shr; - Commitment avm_alu_op_sub; - Commitment avm_alu_p_a_borrow; - Commitment avm_alu_p_b_borrow; - Commitment avm_alu_p_sub_a_hi; - Commitment avm_alu_p_sub_a_lo; - Commitment avm_alu_p_sub_b_hi; - Commitment avm_alu_p_sub_b_lo; - Commitment avm_alu_partial_prod_hi; - Commitment avm_alu_partial_prod_lo; - Commitment avm_alu_quotient_hi; - Commitment avm_alu_quotient_lo; - Commitment avm_alu_remainder; - Commitment avm_alu_res_hi; - Commitment avm_alu_res_lo; - Commitment avm_alu_rng_chk_lookup_selector; - Commitment avm_alu_rng_chk_sel; - Commitment avm_alu_shift_lt_bit_len; - Commitment avm_alu_shift_sel; - Commitment avm_alu_t_sub_s_bits; - Commitment avm_alu_two_pow_s; - Commitment avm_alu_two_pow_t_sub_s; - Commitment avm_alu_u128_tag; - Commitment avm_alu_u16_r0; - Commitment avm_alu_u16_r1; - Commitment avm_alu_u16_r10; - Commitment avm_alu_u16_r11; - Commitment avm_alu_u16_r12; - Commitment avm_alu_u16_r13; - Commitment avm_alu_u16_r14; - Commitment avm_alu_u16_r2; - Commitment avm_alu_u16_r3; - Commitment avm_alu_u16_r4; - Commitment avm_alu_u16_r5; - Commitment avm_alu_u16_r6; - Commitment avm_alu_u16_r7; - Commitment avm_alu_u16_r8; - Commitment avm_alu_u16_r9; - Commitment avm_alu_u16_tag; - Commitment avm_alu_u32_tag; - Commitment avm_alu_u64_tag; - Commitment avm_alu_u8_r0; - Commitment avm_alu_u8_r1; - Commitment avm_alu_u8_tag; - Commitment avm_binary_acc_ia; - Commitment avm_binary_acc_ib; - Commitment avm_binary_acc_ic; - Commitment avm_binary_bin_sel; - Commitment avm_binary_clk; - Commitment avm_binary_ia_bytes; - Commitment avm_binary_ib_bytes; - Commitment avm_binary_ic_bytes; - Commitment avm_binary_in_tag; - Commitment avm_binary_mem_tag_ctr; - Commitment avm_binary_mem_tag_ctr_inv; - Commitment avm_binary_op_id; - Commitment avm_binary_start; - Commitment avm_byte_lookup_bin_sel; - Commitment avm_byte_lookup_table_byte_lengths; - Commitment avm_byte_lookup_table_in_tags; - Commitment avm_byte_lookup_table_input_a; - Commitment avm_byte_lookup_table_input_b; - Commitment avm_byte_lookup_table_op_id; - Commitment avm_byte_lookup_table_output; - Commitment avm_conversion_clk; - Commitment avm_conversion_input; - Commitment avm_conversion_num_limbs; - Commitment avm_conversion_radix; - Commitment avm_conversion_to_radix_le_sel; - Commitment avm_gas_da_gas_fixed_table; - Commitment avm_gas_gas_cost_sel; - Commitment avm_gas_l2_gas_fixed_table; - Commitment avm_keccakf1600_clk; - Commitment avm_keccakf1600_input; - Commitment avm_keccakf1600_keccakf1600_sel; - Commitment avm_keccakf1600_output; - Commitment avm_kernel_emit_l2_to_l1_msg_write_offset; - Commitment avm_kernel_emit_note_hash_write_offset; - Commitment avm_kernel_emit_nullifier_write_offset; - Commitment avm_kernel_emit_unencrypted_log_write_offset; - Commitment avm_kernel_kernel_in_offset; - Commitment avm_kernel_kernel_inputs; - Commitment avm_kernel_kernel_metadata_out; - Commitment avm_kernel_kernel_out_offset; - Commitment avm_kernel_kernel_side_effect_out; - Commitment avm_kernel_kernel_value_out; - Commitment avm_kernel_l1_to_l2_msg_exists_write_offset; - Commitment avm_kernel_note_hash_exist_write_offset; - Commitment avm_kernel_nullifier_exists_write_offset; - Commitment avm_kernel_nullifier_non_exists_write_offset; - Commitment avm_kernel_q_public_input_kernel_add_to_table; - Commitment avm_kernel_q_public_input_kernel_out_add_to_table; - Commitment avm_kernel_side_effect_counter; - Commitment avm_kernel_sload_write_offset; - Commitment avm_kernel_sstore_write_offset; - Commitment avm_main_abs_da_rem_gas_hi; - Commitment avm_main_abs_da_rem_gas_lo; - Commitment avm_main_abs_l2_rem_gas_hi; - Commitment avm_main_abs_l2_rem_gas_lo; - Commitment avm_main_alu_in_tag; - Commitment avm_main_alu_sel; - Commitment avm_main_bin_op_id; - Commitment avm_main_bin_sel; - Commitment avm_main_call_ptr; - Commitment avm_main_da_gas_op; - Commitment avm_main_da_gas_remaining; - Commitment avm_main_da_out_of_gas; - Commitment avm_main_gas_cost_active; - Commitment avm_main_ia; - Commitment avm_main_ib; - Commitment avm_main_ic; - Commitment avm_main_id; - Commitment avm_main_id_zero; - Commitment avm_main_ind_a; - Commitment avm_main_ind_b; - Commitment avm_main_ind_c; - Commitment avm_main_ind_d; - Commitment avm_main_ind_op_a; - Commitment avm_main_ind_op_b; - Commitment avm_main_ind_op_c; - Commitment avm_main_ind_op_d; - Commitment avm_main_internal_return_ptr; - Commitment avm_main_inv; - Commitment avm_main_l2_gas_op; - Commitment avm_main_l2_gas_remaining; - Commitment avm_main_l2_out_of_gas; - Commitment avm_main_last; - Commitment avm_main_mem_idx_a; - Commitment avm_main_mem_idx_b; - Commitment avm_main_mem_idx_c; - Commitment avm_main_mem_idx_d; - Commitment avm_main_mem_op_a; - Commitment avm_main_mem_op_activate_gas; - Commitment avm_main_mem_op_b; - Commitment avm_main_mem_op_c; - Commitment avm_main_mem_op_d; - Commitment avm_main_op_err; - Commitment avm_main_opcode_val; - Commitment avm_main_pc; - Commitment avm_main_q_kernel_lookup; - Commitment avm_main_q_kernel_output_lookup; - Commitment avm_main_r_in_tag; - Commitment avm_main_rwa; - Commitment avm_main_rwb; - Commitment avm_main_rwc; - Commitment avm_main_rwd; - Commitment avm_main_sel_cmov; - Commitment avm_main_sel_external_call; - Commitment avm_main_sel_halt; - Commitment avm_main_sel_internal_call; - Commitment avm_main_sel_internal_return; - Commitment avm_main_sel_jump; - Commitment avm_main_sel_jumpi; - Commitment avm_main_sel_mov; - Commitment avm_main_sel_mov_a; - Commitment avm_main_sel_mov_b; - Commitment avm_main_sel_op_add; - Commitment avm_main_sel_op_address; - Commitment avm_main_sel_op_and; - Commitment avm_main_sel_op_block_number; - Commitment avm_main_sel_op_cast; - Commitment avm_main_sel_op_chain_id; - Commitment avm_main_sel_op_coinbase; - Commitment avm_main_sel_op_dagasleft; - Commitment avm_main_sel_op_div; - Commitment avm_main_sel_op_emit_l2_to_l1_msg; - Commitment avm_main_sel_op_emit_note_hash; - Commitment avm_main_sel_op_emit_nullifier; - Commitment avm_main_sel_op_emit_unencrypted_log; - Commitment avm_main_sel_op_eq; - Commitment avm_main_sel_op_fdiv; - Commitment avm_main_sel_op_fee_per_da_gas; - Commitment avm_main_sel_op_fee_per_l2_gas; - Commitment avm_main_sel_op_get_contract_instance; - Commitment avm_main_sel_op_keccak; - Commitment avm_main_sel_op_l1_to_l2_msg_exists; - Commitment avm_main_sel_op_l2gasleft; - Commitment avm_main_sel_op_lt; - Commitment avm_main_sel_op_lte; - Commitment avm_main_sel_op_mul; - Commitment avm_main_sel_op_not; - Commitment avm_main_sel_op_note_hash_exists; - Commitment avm_main_sel_op_nullifier_exists; - Commitment avm_main_sel_op_or; - Commitment avm_main_sel_op_pedersen; - Commitment avm_main_sel_op_poseidon2; - Commitment avm_main_sel_op_radix_le; - Commitment avm_main_sel_op_sender; - Commitment avm_main_sel_op_sha256; - Commitment avm_main_sel_op_shl; - Commitment avm_main_sel_op_shr; - Commitment avm_main_sel_op_sload; - Commitment avm_main_sel_op_sstore; - Commitment avm_main_sel_op_storage_address; - Commitment avm_main_sel_op_sub; - Commitment avm_main_sel_op_timestamp; - Commitment avm_main_sel_op_transaction_fee; - Commitment avm_main_sel_op_version; - Commitment avm_main_sel_op_xor; - Commitment avm_main_sel_rng_16; - Commitment avm_main_sel_rng_8; - Commitment avm_main_space_id; - Commitment avm_main_table_pow_2; - Commitment avm_main_tag_err; - Commitment avm_main_w_in_tag; - Commitment avm_mem_addr; - Commitment avm_mem_clk; - Commitment avm_mem_diff_hi; - Commitment avm_mem_diff_lo; - Commitment avm_mem_diff_mid; - Commitment avm_mem_glob_addr; - Commitment avm_mem_ind_op_a; - Commitment avm_mem_ind_op_b; - Commitment avm_mem_ind_op_c; - Commitment avm_mem_ind_op_d; - Commitment avm_mem_last; - Commitment avm_mem_lastAccess; - Commitment avm_mem_mem_sel; - Commitment avm_mem_one_min_inv; - Commitment avm_mem_op_a; - Commitment avm_mem_op_b; - Commitment avm_mem_op_c; - Commitment avm_mem_op_d; - Commitment avm_mem_r_in_tag; - Commitment avm_mem_rng_chk_sel; - Commitment avm_mem_rw; - Commitment avm_mem_sel_cmov; - Commitment avm_mem_sel_mov_a; - Commitment avm_mem_sel_mov_b; - Commitment avm_mem_skip_check_tag; - Commitment avm_mem_space_id; - Commitment avm_mem_tag; - Commitment avm_mem_tag_err; - Commitment avm_mem_tsp; - Commitment avm_mem_val; - Commitment avm_mem_w_in_tag; - Commitment avm_pedersen_clk; - Commitment avm_pedersen_input; - Commitment avm_pedersen_output; - Commitment avm_pedersen_pedersen_sel; - Commitment avm_poseidon2_clk; - Commitment avm_poseidon2_input; - Commitment avm_poseidon2_output; - Commitment avm_poseidon2_poseidon_perm_sel; - Commitment avm_sha256_clk; - Commitment avm_sha256_input; - Commitment avm_sha256_output; - Commitment avm_sha256_sha256_compression_sel; - Commitment avm_sha256_state; + Commitment alu_a_hi; + Commitment alu_a_lo; + Commitment alu_alu_sel; + Commitment alu_b_hi; + Commitment alu_b_lo; + Commitment alu_borrow; + Commitment alu_cf; + Commitment alu_clk; + Commitment alu_cmp_rng_ctr; + Commitment alu_cmp_sel; + Commitment alu_div_rng_chk_selector; + Commitment alu_div_u16_r0; + Commitment alu_div_u16_r1; + Commitment alu_div_u16_r2; + Commitment alu_div_u16_r3; + Commitment alu_div_u16_r4; + Commitment alu_div_u16_r5; + Commitment alu_div_u16_r6; + Commitment alu_div_u16_r7; + Commitment alu_divisor_hi; + Commitment alu_divisor_lo; + Commitment alu_ff_tag; + Commitment alu_ia; + Commitment alu_ib; + Commitment alu_ic; + Commitment alu_in_tag; + Commitment alu_op_add; + Commitment alu_op_cast; + Commitment alu_op_cast_prev; + Commitment alu_op_div; + Commitment alu_op_div_a_lt_b; + Commitment alu_op_div_std; + Commitment alu_op_eq; + Commitment alu_op_eq_diff_inv; + Commitment alu_op_lt; + Commitment alu_op_lte; + Commitment alu_op_mul; + Commitment alu_op_not; + Commitment alu_op_shl; + Commitment alu_op_shr; + Commitment alu_op_sub; + Commitment alu_p_a_borrow; + Commitment alu_p_b_borrow; + Commitment alu_p_sub_a_hi; + Commitment alu_p_sub_a_lo; + Commitment alu_p_sub_b_hi; + Commitment alu_p_sub_b_lo; + Commitment alu_partial_prod_hi; + Commitment alu_partial_prod_lo; + Commitment alu_quotient_hi; + Commitment alu_quotient_lo; + Commitment alu_remainder; + Commitment alu_res_hi; + Commitment alu_res_lo; + Commitment alu_rng_chk_lookup_selector; + Commitment alu_rng_chk_sel; + Commitment alu_shift_lt_bit_len; + Commitment alu_shift_sel; + Commitment alu_t_sub_s_bits; + Commitment alu_two_pow_s; + Commitment alu_two_pow_t_sub_s; + Commitment alu_u128_tag; + Commitment alu_u16_r0; + Commitment alu_u16_r1; + Commitment alu_u16_r10; + Commitment alu_u16_r11; + Commitment alu_u16_r12; + Commitment alu_u16_r13; + Commitment alu_u16_r14; + Commitment alu_u16_r2; + Commitment alu_u16_r3; + Commitment alu_u16_r4; + Commitment alu_u16_r5; + Commitment alu_u16_r6; + Commitment alu_u16_r7; + Commitment alu_u16_r8; + Commitment alu_u16_r9; + Commitment alu_u16_tag; + Commitment alu_u32_tag; + Commitment alu_u64_tag; + Commitment alu_u8_r0; + Commitment alu_u8_r1; + Commitment alu_u8_tag; + Commitment binary_acc_ia; + Commitment binary_acc_ib; + Commitment binary_acc_ic; + Commitment binary_bin_sel; + Commitment binary_clk; + Commitment binary_ia_bytes; + Commitment binary_ib_bytes; + Commitment binary_ic_bytes; + Commitment binary_in_tag; + Commitment binary_mem_tag_ctr; + Commitment binary_mem_tag_ctr_inv; + Commitment binary_op_id; + Commitment binary_start; + Commitment byte_lookup_bin_sel; + Commitment byte_lookup_table_byte_lengths; + Commitment byte_lookup_table_in_tags; + Commitment byte_lookup_table_input_a; + Commitment byte_lookup_table_input_b; + Commitment byte_lookup_table_op_id; + Commitment byte_lookup_table_output; + Commitment conversion_clk; + Commitment conversion_input; + Commitment conversion_num_limbs; + Commitment conversion_radix; + Commitment conversion_to_radix_le_sel; + Commitment gas_da_gas_fixed_table; + Commitment gas_gas_cost_sel; + Commitment gas_l2_gas_fixed_table; + Commitment keccakf1600_clk; + Commitment keccakf1600_input; + Commitment keccakf1600_keccakf1600_sel; + Commitment keccakf1600_output; + Commitment kernel_emit_l2_to_l1_msg_write_offset; + Commitment kernel_emit_note_hash_write_offset; + Commitment kernel_emit_nullifier_write_offset; + Commitment kernel_emit_unencrypted_log_write_offset; + Commitment kernel_kernel_in_offset; + Commitment kernel_kernel_inputs; + Commitment kernel_kernel_metadata_out; + Commitment kernel_kernel_out_offset; + Commitment kernel_kernel_side_effect_out; + Commitment kernel_kernel_value_out; + Commitment kernel_l1_to_l2_msg_exists_write_offset; + Commitment kernel_note_hash_exist_write_offset; + Commitment kernel_nullifier_exists_write_offset; + Commitment kernel_nullifier_non_exists_write_offset; + Commitment kernel_q_public_input_kernel_add_to_table; + Commitment kernel_q_public_input_kernel_out_add_to_table; + Commitment kernel_side_effect_counter; + Commitment kernel_sload_write_offset; + Commitment kernel_sstore_write_offset; + Commitment main_abs_da_rem_gas_hi; + Commitment main_abs_da_rem_gas_lo; + Commitment main_abs_l2_rem_gas_hi; + Commitment main_abs_l2_rem_gas_lo; + Commitment main_alu_in_tag; + Commitment main_alu_sel; + Commitment main_bin_op_id; + Commitment main_bin_sel; + Commitment main_call_ptr; + Commitment main_da_gas_op; + Commitment main_da_gas_remaining; + Commitment main_da_out_of_gas; + Commitment main_gas_cost_active; + Commitment main_ia; + Commitment main_ib; + Commitment main_ic; + Commitment main_id; + Commitment main_id_zero; + Commitment main_ind_a; + Commitment main_ind_b; + Commitment main_ind_c; + Commitment main_ind_d; + Commitment main_ind_op_a; + Commitment main_ind_op_b; + Commitment main_ind_op_c; + Commitment main_ind_op_d; + Commitment main_internal_return_ptr; + Commitment main_inv; + Commitment main_l2_gas_op; + Commitment main_l2_gas_remaining; + Commitment main_l2_out_of_gas; + Commitment main_last; + Commitment main_mem_idx_a; + Commitment main_mem_idx_b; + Commitment main_mem_idx_c; + Commitment main_mem_idx_d; + Commitment main_mem_op_a; + Commitment main_mem_op_activate_gas; + Commitment main_mem_op_b; + Commitment main_mem_op_c; + Commitment main_mem_op_d; + Commitment main_op_err; + Commitment main_opcode_val; + Commitment main_pc; + Commitment main_q_kernel_lookup; + Commitment main_q_kernel_output_lookup; + Commitment main_r_in_tag; + Commitment main_rwa; + Commitment main_rwb; + Commitment main_rwc; + Commitment main_rwd; + Commitment main_sel_cmov; + Commitment main_sel_external_call; + Commitment main_sel_halt; + Commitment main_sel_internal_call; + Commitment main_sel_internal_return; + Commitment main_sel_jump; + Commitment main_sel_jumpi; + Commitment main_sel_mov; + Commitment main_sel_mov_a; + Commitment main_sel_mov_b; + Commitment main_sel_op_add; + Commitment main_sel_op_address; + Commitment main_sel_op_and; + Commitment main_sel_op_block_number; + Commitment main_sel_op_cast; + Commitment main_sel_op_chain_id; + Commitment main_sel_op_coinbase; + Commitment main_sel_op_dagasleft; + Commitment main_sel_op_div; + Commitment main_sel_op_emit_l2_to_l1_msg; + Commitment main_sel_op_emit_note_hash; + Commitment main_sel_op_emit_nullifier; + Commitment main_sel_op_emit_unencrypted_log; + Commitment main_sel_op_eq; + Commitment main_sel_op_fdiv; + Commitment main_sel_op_fee_per_da_gas; + Commitment main_sel_op_fee_per_l2_gas; + Commitment main_sel_op_get_contract_instance; + Commitment main_sel_op_keccak; + Commitment main_sel_op_l1_to_l2_msg_exists; + Commitment main_sel_op_l2gasleft; + Commitment main_sel_op_lt; + Commitment main_sel_op_lte; + Commitment main_sel_op_mul; + Commitment main_sel_op_not; + Commitment main_sel_op_note_hash_exists; + Commitment main_sel_op_nullifier_exists; + Commitment main_sel_op_or; + Commitment main_sel_op_pedersen; + Commitment main_sel_op_poseidon2; + Commitment main_sel_op_radix_le; + Commitment main_sel_op_sender; + Commitment main_sel_op_sha256; + Commitment main_sel_op_shl; + Commitment main_sel_op_shr; + Commitment main_sel_op_sload; + Commitment main_sel_op_sstore; + Commitment main_sel_op_storage_address; + Commitment main_sel_op_sub; + Commitment main_sel_op_timestamp; + Commitment main_sel_op_transaction_fee; + Commitment main_sel_op_version; + Commitment main_sel_op_xor; + Commitment main_sel_rng_16; + Commitment main_sel_rng_8; + Commitment main_space_id; + Commitment main_table_pow_2; + Commitment main_tag_err; + Commitment main_w_in_tag; + Commitment mem_addr; + Commitment mem_clk; + Commitment mem_diff_hi; + Commitment mem_diff_lo; + Commitment mem_diff_mid; + Commitment mem_glob_addr; + Commitment mem_ind_op_a; + Commitment mem_ind_op_b; + Commitment mem_ind_op_c; + Commitment mem_ind_op_d; + Commitment mem_last; + Commitment mem_lastAccess; + Commitment mem_mem_sel; + Commitment mem_one_min_inv; + Commitment mem_op_a; + Commitment mem_op_b; + Commitment mem_op_c; + Commitment mem_op_d; + Commitment mem_r_in_tag; + Commitment mem_rng_chk_sel; + Commitment mem_rw; + Commitment mem_sel_cmov; + Commitment mem_sel_mov_a; + Commitment mem_sel_mov_b; + Commitment mem_skip_check_tag; + Commitment mem_space_id; + Commitment mem_tag; + Commitment mem_tag_err; + Commitment mem_tsp; + Commitment mem_val; + Commitment mem_w_in_tag; + Commitment pedersen_clk; + Commitment pedersen_input; + Commitment pedersen_output; + Commitment pedersen_pedersen_sel; + Commitment poseidon2_clk; + Commitment poseidon2_input; + Commitment poseidon2_output; + Commitment poseidon2_poseidon_perm_sel; + Commitment sha256_clk; + Commitment sha256_input; + Commitment sha256_output; + Commitment sha256_sha256_compression_sel; + Commitment sha256_state; Commitment perm_main_alu; Commitment perm_main_bin; Commitment perm_main_conv; @@ -3553,313 +3552,306 @@ class AvmFlavor { circuit_size = deserialize_from_buffer(proof_data, num_frs_read); size_t log_n = numeric::get_msb(circuit_size); - avm_alu_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_alu_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_cmp_rng_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_cmp_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_rng_chk_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_div_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_divisor_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_divisor_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_cast_prev = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_div_a_lt_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_div_std = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_p_a_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_p_b_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_p_sub_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_p_sub_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_p_sub_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_p_sub_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_partial_prod_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_partial_prod_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_quotient_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_quotient_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_remainder = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_res_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_res_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_rng_chk_lookup_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_rng_chk_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_shift_lt_bit_len = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_shift_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_t_sub_s_bits = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_two_pow_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_two_pow_t_sub_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_r9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_byte_lengths = + alu_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_alu_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_cf = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_cmp_rng_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_cmp_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_rng_chk_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_div_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_divisor_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_divisor_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ff_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_cast_prev = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div_a_lt_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_div_std = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_eq_diff_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_a_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_b_borrow = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_a_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_a_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_b_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_p_sub_b_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_partial_prod_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_partial_prod_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_quotient_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_quotient_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_remainder = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_res_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_res_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_rng_chk_lookup_selector = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_rng_chk_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_shift_lt_bit_len = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_shift_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_t_sub_s_bits = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_two_pow_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_two_pow_t_sub_s = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u128_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r10 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r11 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r12 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r13 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r14 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r3 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r4 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r5 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r6 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r7 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_r9 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u16_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u32_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u64_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_r0 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_r1 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + alu_u8_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_acc_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ia_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ib_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_ic_bytes = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_mem_tag_ctr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_mem_tag_ctr_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + binary_start = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_byte_lengths = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_num_limbs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_radix = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + conversion_to_radix_le_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_da_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_gas_cost_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + gas_l2_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_keccakf1600_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + keccakf1600_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_emit_l2_to_l1_msg_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_in_tags = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_input_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_input_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_byte_lookup_table_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_conversion_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_conversion_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_conversion_num_limbs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_conversion_radix = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_conversion_to_radix_le_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_gas_da_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_gas_gas_cost_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_gas_l2_gas_fixed_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_keccakf1600_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_keccakf1600_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_keccakf1600_keccakf1600_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_keccakf1600_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_emit_l2_to_l1_msg_write_offset = + kernel_emit_note_hash_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_emit_note_hash_write_offset = + kernel_emit_nullifier_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_emit_nullifier_write_offset = + kernel_emit_unencrypted_log_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_emit_unencrypted_log_write_offset = + kernel_kernel_in_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_inputs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_metadata_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_out_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_side_effect_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_kernel_value_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_l1_to_l2_msg_exists_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_kernel_in_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_kernel_inputs = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_kernel_metadata_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_kernel_out_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_kernel_side_effect_out = + kernel_note_hash_exist_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_kernel_value_out = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_l1_to_l2_msg_exists_write_offset = + kernel_nullifier_exists_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_note_hash_exist_write_offset = + kernel_nullifier_non_exists_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_nullifier_exists_write_offset = + kernel_q_public_input_kernel_add_to_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_nullifier_non_exists_write_offset = + kernel_q_public_input_kernel_out_add_to_table = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_q_public_input_kernel_add_to_table = + kernel_side_effect_counter = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_sload_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + kernel_sstore_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_da_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_da_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_l2_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_abs_l2_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_alu_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_call_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_gas_op = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_da_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_gas_cost_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_id_zero = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_ind_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_gas_op = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_l2_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_idx_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_idx_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_idx_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_idx_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_op_activate_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_opcode_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_q_kernel_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_q_kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_external_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_jumpi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mov_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_mov_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_block_number = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_chain_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_coinbase = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_dagasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_l2_to_l1_msg = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_note_hash = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_nullifier = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_emit_unencrypted_log = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_q_public_input_kernel_out_add_to_table = + main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fdiv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fee_per_da_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_fee_per_l2_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_get_contract_instance = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_side_effect_counter = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_sload_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_kernel_sstore_write_offset = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_abs_da_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_abs_da_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_abs_l2_rem_gas_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_abs_l2_rem_gas_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_alu_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_alu_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_bin_op_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_bin_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_call_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_da_gas_op = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_da_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_da_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_gas_cost_active = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ia = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ib = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ic = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_id_zero = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_ind_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_internal_return_ptr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_l2_gas_op = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_l2_gas_remaining = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_l2_out_of_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_idx_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_idx_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_idx_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_idx_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_activate_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_op_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_opcode_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_pc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_q_kernel_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_q_kernel_output_lookup = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_rwa = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_rwb = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_rwc = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_rwd = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_external_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_halt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_internal_call = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_internal_return = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_jump = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_jumpi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_mov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_mov_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_mov_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_add = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_and = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_block_number = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_cast = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_chain_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_coinbase = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_dagasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_div = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_emit_l2_to_l1_msg = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_emit_note_hash = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_emit_nullifier = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_emit_unencrypted_log = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_eq = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_fdiv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_fee_per_da_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_fee_per_l2_gas = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_get_contract_instance = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_keccak = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_l1_to_l2_msg_exists = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_l2gasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_note_hash_exists = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_nullifier_exists = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_poseidon2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_sender = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_sha256 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_sload = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_sstore = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_storage_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_timestamp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_transaction_fee = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_version = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_table_pow_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_diff_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_diff_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_diff_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_glob_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_ind_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_ind_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_ind_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_ind_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_mem_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_rng_chk_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_sel_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_sel_mov_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_sel_mov_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_skip_check_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_tsp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_mem_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_pedersen_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_pedersen_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_pedersen_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_pedersen_pedersen_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_poseidon2_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_poseidon2_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_poseidon2_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_poseidon2_poseidon_perm_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_sha256_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_sha256_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_sha256_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_sha256_sha256_compression_sel = - deserialize_from_buffer(Transcript::proof_data, num_frs_read); - avm_sha256_state = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_keccak = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_l1_to_l2_msg_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_l2gasleft = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_lt = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_lte = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_mul = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_not = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_note_hash_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_nullifier_exists = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_or = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_pedersen = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_poseidon2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_radix_le = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sender = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sha256 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_shl = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_shr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sload = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sstore = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_storage_address = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_sub = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_timestamp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_transaction_fee = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_version = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_op_xor = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_rng_16 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_sel_rng_8 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_table_pow_2 = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + main_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_hi = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_lo = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_diff_mid = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_glob_addr = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_ind_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_ind_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_ind_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_ind_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_last = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_lastAccess = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_mem_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_one_min_inv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_op_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_op_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_op_c = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_op_d = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_r_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_rng_chk_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_rw = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_cmov = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mov_a = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_sel_mov_b = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_skip_check_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_space_id = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tag_err = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_tsp = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_val = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + mem_w_in_tag = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + pedersen_pedersen_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + poseidon2_poseidon_perm_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_clk = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_input = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_output = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_sha256_compression_sel = deserialize_from_buffer(Transcript::proof_data, num_frs_read); + sha256_state = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_alu = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_bin = deserialize_from_buffer(Transcript::proof_data, num_frs_read); perm_main_conv = deserialize_from_buffer(Transcript::proof_data, num_frs_read); @@ -3978,294 +3970,294 @@ class AvmFlavor { serialize_to_buffer(circuit_size, Transcript::proof_data); - serialize_to_buffer(avm_alu_a_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_a_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_alu_sel, Transcript::proof_data); - serialize_to_buffer(avm_alu_b_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_b_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_borrow, Transcript::proof_data); - serialize_to_buffer(avm_alu_cf, Transcript::proof_data); - serialize_to_buffer(avm_alu_clk, Transcript::proof_data); - serialize_to_buffer(avm_alu_cmp_rng_ctr, Transcript::proof_data); - serialize_to_buffer(avm_alu_cmp_sel, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_rng_chk_selector, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r0, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r1, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r2, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r3, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r4, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r5, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r6, Transcript::proof_data); - serialize_to_buffer(avm_alu_div_u16_r7, Transcript::proof_data); - serialize_to_buffer(avm_alu_divisor_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_divisor_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_ff_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_ia, Transcript::proof_data); - serialize_to_buffer(avm_alu_ib, Transcript::proof_data); - serialize_to_buffer(avm_alu_ic, Transcript::proof_data); - serialize_to_buffer(avm_alu_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_add, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_cast, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_cast_prev, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_div, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_div_a_lt_b, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_div_std, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_eq, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_eq_diff_inv, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_lt, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_lte, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_mul, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_not, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_shl, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_shr, Transcript::proof_data); - serialize_to_buffer(avm_alu_op_sub, Transcript::proof_data); - serialize_to_buffer(avm_alu_p_a_borrow, Transcript::proof_data); - serialize_to_buffer(avm_alu_p_b_borrow, Transcript::proof_data); - serialize_to_buffer(avm_alu_p_sub_a_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_p_sub_a_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_p_sub_b_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_p_sub_b_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_partial_prod_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_partial_prod_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_quotient_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_quotient_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_remainder, Transcript::proof_data); - serialize_to_buffer(avm_alu_res_hi, Transcript::proof_data); - serialize_to_buffer(avm_alu_res_lo, Transcript::proof_data); - serialize_to_buffer(avm_alu_rng_chk_lookup_selector, Transcript::proof_data); - serialize_to_buffer(avm_alu_rng_chk_sel, Transcript::proof_data); - serialize_to_buffer(avm_alu_shift_lt_bit_len, Transcript::proof_data); - serialize_to_buffer(avm_alu_shift_sel, Transcript::proof_data); - serialize_to_buffer(avm_alu_t_sub_s_bits, Transcript::proof_data); - serialize_to_buffer(avm_alu_two_pow_s, Transcript::proof_data); - serialize_to_buffer(avm_alu_two_pow_t_sub_s, Transcript::proof_data); - serialize_to_buffer(avm_alu_u128_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r0, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r1, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r10, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r11, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r12, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r13, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r14, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r2, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r3, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r4, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r5, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r6, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r7, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r8, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_r9, Transcript::proof_data); - serialize_to_buffer(avm_alu_u16_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_u32_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_u64_tag, Transcript::proof_data); - serialize_to_buffer(avm_alu_u8_r0, Transcript::proof_data); - serialize_to_buffer(avm_alu_u8_r1, Transcript::proof_data); - serialize_to_buffer(avm_alu_u8_tag, Transcript::proof_data); - serialize_to_buffer(avm_binary_acc_ia, Transcript::proof_data); - serialize_to_buffer(avm_binary_acc_ib, Transcript::proof_data); - serialize_to_buffer(avm_binary_acc_ic, Transcript::proof_data); - serialize_to_buffer(avm_binary_bin_sel, Transcript::proof_data); - serialize_to_buffer(avm_binary_clk, Transcript::proof_data); - serialize_to_buffer(avm_binary_ia_bytes, Transcript::proof_data); - serialize_to_buffer(avm_binary_ib_bytes, Transcript::proof_data); - serialize_to_buffer(avm_binary_ic_bytes, Transcript::proof_data); - serialize_to_buffer(avm_binary_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_binary_mem_tag_ctr, Transcript::proof_data); - serialize_to_buffer(avm_binary_mem_tag_ctr_inv, Transcript::proof_data); - serialize_to_buffer(avm_binary_op_id, Transcript::proof_data); - serialize_to_buffer(avm_binary_start, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_bin_sel, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_byte_lengths, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_in_tags, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_input_a, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_input_b, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_op_id, Transcript::proof_data); - serialize_to_buffer(avm_byte_lookup_table_output, Transcript::proof_data); - serialize_to_buffer(avm_conversion_clk, Transcript::proof_data); - serialize_to_buffer(avm_conversion_input, Transcript::proof_data); - serialize_to_buffer(avm_conversion_num_limbs, Transcript::proof_data); - serialize_to_buffer(avm_conversion_radix, Transcript::proof_data); - serialize_to_buffer(avm_conversion_to_radix_le_sel, Transcript::proof_data); - serialize_to_buffer(avm_gas_da_gas_fixed_table, Transcript::proof_data); - serialize_to_buffer(avm_gas_gas_cost_sel, Transcript::proof_data); - serialize_to_buffer(avm_gas_l2_gas_fixed_table, Transcript::proof_data); - serialize_to_buffer(avm_keccakf1600_clk, Transcript::proof_data); - serialize_to_buffer(avm_keccakf1600_input, Transcript::proof_data); - serialize_to_buffer(avm_keccakf1600_keccakf1600_sel, Transcript::proof_data); - serialize_to_buffer(avm_keccakf1600_output, Transcript::proof_data); - serialize_to_buffer(avm_kernel_emit_l2_to_l1_msg_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_emit_note_hash_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_emit_nullifier_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_emit_unencrypted_log_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_kernel_in_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_kernel_inputs, Transcript::proof_data); - serialize_to_buffer(avm_kernel_kernel_metadata_out, Transcript::proof_data); - serialize_to_buffer(avm_kernel_kernel_out_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_kernel_side_effect_out, Transcript::proof_data); - serialize_to_buffer(avm_kernel_kernel_value_out, Transcript::proof_data); - serialize_to_buffer(avm_kernel_l1_to_l2_msg_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_note_hash_exist_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_nullifier_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_nullifier_non_exists_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_q_public_input_kernel_add_to_table, Transcript::proof_data); - serialize_to_buffer(avm_kernel_q_public_input_kernel_out_add_to_table, Transcript::proof_data); - serialize_to_buffer(avm_kernel_side_effect_counter, Transcript::proof_data); - serialize_to_buffer(avm_kernel_sload_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_kernel_sstore_write_offset, Transcript::proof_data); - serialize_to_buffer(avm_main_abs_da_rem_gas_hi, Transcript::proof_data); - serialize_to_buffer(avm_main_abs_da_rem_gas_lo, Transcript::proof_data); - serialize_to_buffer(avm_main_abs_l2_rem_gas_hi, Transcript::proof_data); - serialize_to_buffer(avm_main_abs_l2_rem_gas_lo, Transcript::proof_data); - serialize_to_buffer(avm_main_alu_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_main_alu_sel, Transcript::proof_data); - serialize_to_buffer(avm_main_bin_op_id, Transcript::proof_data); - serialize_to_buffer(avm_main_bin_sel, Transcript::proof_data); - serialize_to_buffer(avm_main_call_ptr, Transcript::proof_data); - serialize_to_buffer(avm_main_da_gas_op, Transcript::proof_data); - serialize_to_buffer(avm_main_da_gas_remaining, Transcript::proof_data); - serialize_to_buffer(avm_main_da_out_of_gas, Transcript::proof_data); - serialize_to_buffer(avm_main_gas_cost_active, Transcript::proof_data); - serialize_to_buffer(avm_main_ia, Transcript::proof_data); - serialize_to_buffer(avm_main_ib, Transcript::proof_data); - serialize_to_buffer(avm_main_ic, Transcript::proof_data); - serialize_to_buffer(avm_main_id, Transcript::proof_data); - serialize_to_buffer(avm_main_id_zero, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_a, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_b, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_c, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_d, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_op_a, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_op_b, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_op_c, Transcript::proof_data); - serialize_to_buffer(avm_main_ind_op_d, Transcript::proof_data); - serialize_to_buffer(avm_main_internal_return_ptr, Transcript::proof_data); - serialize_to_buffer(avm_main_inv, Transcript::proof_data); - serialize_to_buffer(avm_main_l2_gas_op, Transcript::proof_data); - serialize_to_buffer(avm_main_l2_gas_remaining, Transcript::proof_data); - serialize_to_buffer(avm_main_l2_out_of_gas, Transcript::proof_data); - serialize_to_buffer(avm_main_last, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_idx_a, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_idx_b, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_idx_c, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_idx_d, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_a, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_activate_gas, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_b, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_c, Transcript::proof_data); - serialize_to_buffer(avm_main_mem_op_d, Transcript::proof_data); - serialize_to_buffer(avm_main_op_err, Transcript::proof_data); - serialize_to_buffer(avm_main_opcode_val, Transcript::proof_data); - serialize_to_buffer(avm_main_pc, Transcript::proof_data); - serialize_to_buffer(avm_main_q_kernel_lookup, Transcript::proof_data); - serialize_to_buffer(avm_main_q_kernel_output_lookup, Transcript::proof_data); - serialize_to_buffer(avm_main_r_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_main_rwa, Transcript::proof_data); - serialize_to_buffer(avm_main_rwb, Transcript::proof_data); - serialize_to_buffer(avm_main_rwc, Transcript::proof_data); - serialize_to_buffer(avm_main_rwd, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_cmov, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_external_call, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_halt, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_internal_call, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_internal_return, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_jump, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_jumpi, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_mov, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_mov_a, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_mov_b, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_add, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_address, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_and, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_block_number, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_cast, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_chain_id, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_coinbase, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_dagasleft, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_div, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_emit_l2_to_l1_msg, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_emit_note_hash, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_emit_nullifier, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_emit_unencrypted_log, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_eq, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_fdiv, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_fee_per_da_gas, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_fee_per_l2_gas, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_get_contract_instance, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_keccak, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_l1_to_l2_msg_exists, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_l2gasleft, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_lt, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_lte, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_mul, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_not, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_note_hash_exists, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_nullifier_exists, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_or, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_pedersen, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_poseidon2, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_radix_le, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_sender, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_sha256, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_shl, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_shr, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_sload, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_sstore, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_storage_address, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_sub, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_timestamp, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_transaction_fee, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_version, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_op_xor, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_rng_16, Transcript::proof_data); - serialize_to_buffer(avm_main_sel_rng_8, Transcript::proof_data); - serialize_to_buffer(avm_main_space_id, Transcript::proof_data); - serialize_to_buffer(avm_main_table_pow_2, Transcript::proof_data); - serialize_to_buffer(avm_main_tag_err, Transcript::proof_data); - serialize_to_buffer(avm_main_w_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_mem_addr, Transcript::proof_data); - serialize_to_buffer(avm_mem_clk, Transcript::proof_data); - serialize_to_buffer(avm_mem_diff_hi, Transcript::proof_data); - serialize_to_buffer(avm_mem_diff_lo, Transcript::proof_data); - serialize_to_buffer(avm_mem_diff_mid, Transcript::proof_data); - serialize_to_buffer(avm_mem_glob_addr, Transcript::proof_data); - serialize_to_buffer(avm_mem_ind_op_a, Transcript::proof_data); - serialize_to_buffer(avm_mem_ind_op_b, Transcript::proof_data); - serialize_to_buffer(avm_mem_ind_op_c, Transcript::proof_data); - serialize_to_buffer(avm_mem_ind_op_d, Transcript::proof_data); - serialize_to_buffer(avm_mem_last, Transcript::proof_data); - serialize_to_buffer(avm_mem_lastAccess, Transcript::proof_data); - serialize_to_buffer(avm_mem_mem_sel, Transcript::proof_data); - serialize_to_buffer(avm_mem_one_min_inv, Transcript::proof_data); - serialize_to_buffer(avm_mem_op_a, Transcript::proof_data); - serialize_to_buffer(avm_mem_op_b, Transcript::proof_data); - serialize_to_buffer(avm_mem_op_c, Transcript::proof_data); - serialize_to_buffer(avm_mem_op_d, Transcript::proof_data); - serialize_to_buffer(avm_mem_r_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_mem_rng_chk_sel, Transcript::proof_data); - serialize_to_buffer(avm_mem_rw, Transcript::proof_data); - serialize_to_buffer(avm_mem_sel_cmov, Transcript::proof_data); - serialize_to_buffer(avm_mem_sel_mov_a, Transcript::proof_data); - serialize_to_buffer(avm_mem_sel_mov_b, Transcript::proof_data); - serialize_to_buffer(avm_mem_skip_check_tag, Transcript::proof_data); - serialize_to_buffer(avm_mem_space_id, Transcript::proof_data); - serialize_to_buffer(avm_mem_tag, Transcript::proof_data); - serialize_to_buffer(avm_mem_tag_err, Transcript::proof_data); - serialize_to_buffer(avm_mem_tsp, Transcript::proof_data); - serialize_to_buffer(avm_mem_val, Transcript::proof_data); - serialize_to_buffer(avm_mem_w_in_tag, Transcript::proof_data); - serialize_to_buffer(avm_pedersen_clk, Transcript::proof_data); - serialize_to_buffer(avm_pedersen_input, Transcript::proof_data); - serialize_to_buffer(avm_pedersen_output, Transcript::proof_data); - serialize_to_buffer(avm_pedersen_pedersen_sel, Transcript::proof_data); - serialize_to_buffer(avm_poseidon2_clk, Transcript::proof_data); - serialize_to_buffer(avm_poseidon2_input, Transcript::proof_data); - serialize_to_buffer(avm_poseidon2_output, Transcript::proof_data); - serialize_to_buffer(avm_poseidon2_poseidon_perm_sel, Transcript::proof_data); - serialize_to_buffer(avm_sha256_clk, Transcript::proof_data); - serialize_to_buffer(avm_sha256_input, Transcript::proof_data); - serialize_to_buffer(avm_sha256_output, Transcript::proof_data); - serialize_to_buffer(avm_sha256_sha256_compression_sel, Transcript::proof_data); - serialize_to_buffer(avm_sha256_state, Transcript::proof_data); + serialize_to_buffer(alu_a_hi, Transcript::proof_data); + serialize_to_buffer(alu_a_lo, Transcript::proof_data); + serialize_to_buffer(alu_alu_sel, Transcript::proof_data); + serialize_to_buffer(alu_b_hi, Transcript::proof_data); + serialize_to_buffer(alu_b_lo, Transcript::proof_data); + serialize_to_buffer(alu_borrow, Transcript::proof_data); + serialize_to_buffer(alu_cf, Transcript::proof_data); + serialize_to_buffer(alu_clk, Transcript::proof_data); + serialize_to_buffer(alu_cmp_rng_ctr, Transcript::proof_data); + serialize_to_buffer(alu_cmp_sel, Transcript::proof_data); + serialize_to_buffer(alu_div_rng_chk_selector, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r0, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r1, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r2, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r3, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r4, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r5, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r6, Transcript::proof_data); + serialize_to_buffer(alu_div_u16_r7, Transcript::proof_data); + serialize_to_buffer(alu_divisor_hi, Transcript::proof_data); + serialize_to_buffer(alu_divisor_lo, Transcript::proof_data); + serialize_to_buffer(alu_ff_tag, Transcript::proof_data); + serialize_to_buffer(alu_ia, Transcript::proof_data); + serialize_to_buffer(alu_ib, Transcript::proof_data); + serialize_to_buffer(alu_ic, Transcript::proof_data); + serialize_to_buffer(alu_in_tag, Transcript::proof_data); + serialize_to_buffer(alu_op_add, Transcript::proof_data); + serialize_to_buffer(alu_op_cast, Transcript::proof_data); + serialize_to_buffer(alu_op_cast_prev, Transcript::proof_data); + serialize_to_buffer(alu_op_div, Transcript::proof_data); + serialize_to_buffer(alu_op_div_a_lt_b, Transcript::proof_data); + serialize_to_buffer(alu_op_div_std, Transcript::proof_data); + serialize_to_buffer(alu_op_eq, Transcript::proof_data); + serialize_to_buffer(alu_op_eq_diff_inv, Transcript::proof_data); + serialize_to_buffer(alu_op_lt, Transcript::proof_data); + serialize_to_buffer(alu_op_lte, Transcript::proof_data); + serialize_to_buffer(alu_op_mul, Transcript::proof_data); + serialize_to_buffer(alu_op_not, Transcript::proof_data); + serialize_to_buffer(alu_op_shl, Transcript::proof_data); + serialize_to_buffer(alu_op_shr, Transcript::proof_data); + serialize_to_buffer(alu_op_sub, Transcript::proof_data); + serialize_to_buffer(alu_p_a_borrow, Transcript::proof_data); + serialize_to_buffer(alu_p_b_borrow, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_a_hi, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_a_lo, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_b_hi, Transcript::proof_data); + serialize_to_buffer(alu_p_sub_b_lo, Transcript::proof_data); + serialize_to_buffer(alu_partial_prod_hi, Transcript::proof_data); + serialize_to_buffer(alu_partial_prod_lo, Transcript::proof_data); + serialize_to_buffer(alu_quotient_hi, Transcript::proof_data); + serialize_to_buffer(alu_quotient_lo, Transcript::proof_data); + serialize_to_buffer(alu_remainder, Transcript::proof_data); + serialize_to_buffer(alu_res_hi, Transcript::proof_data); + serialize_to_buffer(alu_res_lo, Transcript::proof_data); + serialize_to_buffer(alu_rng_chk_lookup_selector, Transcript::proof_data); + serialize_to_buffer(alu_rng_chk_sel, Transcript::proof_data); + serialize_to_buffer(alu_shift_lt_bit_len, Transcript::proof_data); + serialize_to_buffer(alu_shift_sel, Transcript::proof_data); + serialize_to_buffer(alu_t_sub_s_bits, Transcript::proof_data); + serialize_to_buffer(alu_two_pow_s, Transcript::proof_data); + serialize_to_buffer(alu_two_pow_t_sub_s, Transcript::proof_data); + serialize_to_buffer(alu_u128_tag, Transcript::proof_data); + serialize_to_buffer(alu_u16_r0, Transcript::proof_data); + serialize_to_buffer(alu_u16_r1, Transcript::proof_data); + serialize_to_buffer(alu_u16_r10, Transcript::proof_data); + serialize_to_buffer(alu_u16_r11, Transcript::proof_data); + serialize_to_buffer(alu_u16_r12, Transcript::proof_data); + serialize_to_buffer(alu_u16_r13, Transcript::proof_data); + serialize_to_buffer(alu_u16_r14, Transcript::proof_data); + serialize_to_buffer(alu_u16_r2, Transcript::proof_data); + serialize_to_buffer(alu_u16_r3, Transcript::proof_data); + serialize_to_buffer(alu_u16_r4, Transcript::proof_data); + serialize_to_buffer(alu_u16_r5, Transcript::proof_data); + serialize_to_buffer(alu_u16_r6, Transcript::proof_data); + serialize_to_buffer(alu_u16_r7, Transcript::proof_data); + serialize_to_buffer(alu_u16_r8, Transcript::proof_data); + serialize_to_buffer(alu_u16_r9, Transcript::proof_data); + serialize_to_buffer(alu_u16_tag, Transcript::proof_data); + serialize_to_buffer(alu_u32_tag, Transcript::proof_data); + serialize_to_buffer(alu_u64_tag, Transcript::proof_data); + serialize_to_buffer(alu_u8_r0, Transcript::proof_data); + serialize_to_buffer(alu_u8_r1, Transcript::proof_data); + serialize_to_buffer(alu_u8_tag, Transcript::proof_data); + serialize_to_buffer(binary_acc_ia, Transcript::proof_data); + serialize_to_buffer(binary_acc_ib, Transcript::proof_data); + serialize_to_buffer(binary_acc_ic, Transcript::proof_data); + serialize_to_buffer(binary_bin_sel, Transcript::proof_data); + serialize_to_buffer(binary_clk, Transcript::proof_data); + serialize_to_buffer(binary_ia_bytes, Transcript::proof_data); + serialize_to_buffer(binary_ib_bytes, Transcript::proof_data); + serialize_to_buffer(binary_ic_bytes, Transcript::proof_data); + serialize_to_buffer(binary_in_tag, Transcript::proof_data); + serialize_to_buffer(binary_mem_tag_ctr, Transcript::proof_data); + serialize_to_buffer(binary_mem_tag_ctr_inv, Transcript::proof_data); + serialize_to_buffer(binary_op_id, Transcript::proof_data); + serialize_to_buffer(binary_start, Transcript::proof_data); + serialize_to_buffer(byte_lookup_bin_sel, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_byte_lengths, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_in_tags, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_input_a, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_input_b, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_op_id, Transcript::proof_data); + serialize_to_buffer(byte_lookup_table_output, Transcript::proof_data); + serialize_to_buffer(conversion_clk, Transcript::proof_data); + serialize_to_buffer(conversion_input, Transcript::proof_data); + serialize_to_buffer(conversion_num_limbs, Transcript::proof_data); + serialize_to_buffer(conversion_radix, Transcript::proof_data); + serialize_to_buffer(conversion_to_radix_le_sel, Transcript::proof_data); + serialize_to_buffer(gas_da_gas_fixed_table, Transcript::proof_data); + serialize_to_buffer(gas_gas_cost_sel, Transcript::proof_data); + serialize_to_buffer(gas_l2_gas_fixed_table, Transcript::proof_data); + serialize_to_buffer(keccakf1600_clk, Transcript::proof_data); + serialize_to_buffer(keccakf1600_input, Transcript::proof_data); + serialize_to_buffer(keccakf1600_keccakf1600_sel, Transcript::proof_data); + serialize_to_buffer(keccakf1600_output, Transcript::proof_data); + serialize_to_buffer(kernel_emit_l2_to_l1_msg_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_note_hash_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_nullifier_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_emit_unencrypted_log_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_in_offset, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_inputs, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_metadata_out, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_out_offset, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_side_effect_out, Transcript::proof_data); + serialize_to_buffer(kernel_kernel_value_out, Transcript::proof_data); + serialize_to_buffer(kernel_l1_to_l2_msg_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_note_hash_exist_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_nullifier_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_nullifier_non_exists_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_q_public_input_kernel_add_to_table, Transcript::proof_data); + serialize_to_buffer(kernel_q_public_input_kernel_out_add_to_table, Transcript::proof_data); + serialize_to_buffer(kernel_side_effect_counter, Transcript::proof_data); + serialize_to_buffer(kernel_sload_write_offset, Transcript::proof_data); + serialize_to_buffer(kernel_sstore_write_offset, Transcript::proof_data); + serialize_to_buffer(main_abs_da_rem_gas_hi, Transcript::proof_data); + serialize_to_buffer(main_abs_da_rem_gas_lo, Transcript::proof_data); + serialize_to_buffer(main_abs_l2_rem_gas_hi, Transcript::proof_data); + serialize_to_buffer(main_abs_l2_rem_gas_lo, Transcript::proof_data); + serialize_to_buffer(main_alu_in_tag, Transcript::proof_data); + serialize_to_buffer(main_alu_sel, Transcript::proof_data); + serialize_to_buffer(main_bin_op_id, Transcript::proof_data); + serialize_to_buffer(main_bin_sel, Transcript::proof_data); + serialize_to_buffer(main_call_ptr, Transcript::proof_data); + serialize_to_buffer(main_da_gas_op, Transcript::proof_data); + serialize_to_buffer(main_da_gas_remaining, Transcript::proof_data); + serialize_to_buffer(main_da_out_of_gas, Transcript::proof_data); + serialize_to_buffer(main_gas_cost_active, Transcript::proof_data); + serialize_to_buffer(main_ia, Transcript::proof_data); + serialize_to_buffer(main_ib, Transcript::proof_data); + serialize_to_buffer(main_ic, Transcript::proof_data); + serialize_to_buffer(main_id, Transcript::proof_data); + serialize_to_buffer(main_id_zero, Transcript::proof_data); + serialize_to_buffer(main_ind_a, Transcript::proof_data); + serialize_to_buffer(main_ind_b, Transcript::proof_data); + serialize_to_buffer(main_ind_c, Transcript::proof_data); + serialize_to_buffer(main_ind_d, Transcript::proof_data); + serialize_to_buffer(main_ind_op_a, Transcript::proof_data); + serialize_to_buffer(main_ind_op_b, Transcript::proof_data); + serialize_to_buffer(main_ind_op_c, Transcript::proof_data); + serialize_to_buffer(main_ind_op_d, Transcript::proof_data); + serialize_to_buffer(main_internal_return_ptr, Transcript::proof_data); + serialize_to_buffer(main_inv, Transcript::proof_data); + serialize_to_buffer(main_l2_gas_op, Transcript::proof_data); + serialize_to_buffer(main_l2_gas_remaining, Transcript::proof_data); + serialize_to_buffer(main_l2_out_of_gas, Transcript::proof_data); + serialize_to_buffer(main_last, Transcript::proof_data); + serialize_to_buffer(main_mem_idx_a, Transcript::proof_data); + serialize_to_buffer(main_mem_idx_b, Transcript::proof_data); + serialize_to_buffer(main_mem_idx_c, Transcript::proof_data); + serialize_to_buffer(main_mem_idx_d, Transcript::proof_data); + serialize_to_buffer(main_mem_op_a, Transcript::proof_data); + serialize_to_buffer(main_mem_op_activate_gas, Transcript::proof_data); + serialize_to_buffer(main_mem_op_b, Transcript::proof_data); + serialize_to_buffer(main_mem_op_c, Transcript::proof_data); + serialize_to_buffer(main_mem_op_d, Transcript::proof_data); + serialize_to_buffer(main_op_err, Transcript::proof_data); + serialize_to_buffer(main_opcode_val, Transcript::proof_data); + serialize_to_buffer(main_pc, Transcript::proof_data); + serialize_to_buffer(main_q_kernel_lookup, Transcript::proof_data); + serialize_to_buffer(main_q_kernel_output_lookup, Transcript::proof_data); + serialize_to_buffer(main_r_in_tag, Transcript::proof_data); + serialize_to_buffer(main_rwa, Transcript::proof_data); + serialize_to_buffer(main_rwb, Transcript::proof_data); + serialize_to_buffer(main_rwc, Transcript::proof_data); + serialize_to_buffer(main_rwd, Transcript::proof_data); + serialize_to_buffer(main_sel_cmov, Transcript::proof_data); + serialize_to_buffer(main_sel_external_call, Transcript::proof_data); + serialize_to_buffer(main_sel_halt, Transcript::proof_data); + serialize_to_buffer(main_sel_internal_call, Transcript::proof_data); + serialize_to_buffer(main_sel_internal_return, Transcript::proof_data); + serialize_to_buffer(main_sel_jump, Transcript::proof_data); + serialize_to_buffer(main_sel_jumpi, Transcript::proof_data); + serialize_to_buffer(main_sel_mov, Transcript::proof_data); + serialize_to_buffer(main_sel_mov_a, Transcript::proof_data); + serialize_to_buffer(main_sel_mov_b, Transcript::proof_data); + serialize_to_buffer(main_sel_op_add, Transcript::proof_data); + serialize_to_buffer(main_sel_op_address, Transcript::proof_data); + serialize_to_buffer(main_sel_op_and, Transcript::proof_data); + serialize_to_buffer(main_sel_op_block_number, Transcript::proof_data); + serialize_to_buffer(main_sel_op_cast, Transcript::proof_data); + serialize_to_buffer(main_sel_op_chain_id, Transcript::proof_data); + serialize_to_buffer(main_sel_op_coinbase, Transcript::proof_data); + serialize_to_buffer(main_sel_op_dagasleft, Transcript::proof_data); + serialize_to_buffer(main_sel_op_div, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_l2_to_l1_msg, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_note_hash, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_nullifier, Transcript::proof_data); + serialize_to_buffer(main_sel_op_emit_unencrypted_log, Transcript::proof_data); + serialize_to_buffer(main_sel_op_eq, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fdiv, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fee_per_da_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_op_fee_per_l2_gas, Transcript::proof_data); + serialize_to_buffer(main_sel_op_get_contract_instance, Transcript::proof_data); + serialize_to_buffer(main_sel_op_keccak, Transcript::proof_data); + serialize_to_buffer(main_sel_op_l1_to_l2_msg_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_l2gasleft, Transcript::proof_data); + serialize_to_buffer(main_sel_op_lt, Transcript::proof_data); + serialize_to_buffer(main_sel_op_lte, Transcript::proof_data); + serialize_to_buffer(main_sel_op_mul, Transcript::proof_data); + serialize_to_buffer(main_sel_op_not, Transcript::proof_data); + serialize_to_buffer(main_sel_op_note_hash_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_nullifier_exists, Transcript::proof_data); + serialize_to_buffer(main_sel_op_or, Transcript::proof_data); + serialize_to_buffer(main_sel_op_pedersen, Transcript::proof_data); + serialize_to_buffer(main_sel_op_poseidon2, Transcript::proof_data); + serialize_to_buffer(main_sel_op_radix_le, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sender, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sha256, Transcript::proof_data); + serialize_to_buffer(main_sel_op_shl, Transcript::proof_data); + serialize_to_buffer(main_sel_op_shr, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sload, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sstore, Transcript::proof_data); + serialize_to_buffer(main_sel_op_storage_address, Transcript::proof_data); + serialize_to_buffer(main_sel_op_sub, Transcript::proof_data); + serialize_to_buffer(main_sel_op_timestamp, Transcript::proof_data); + serialize_to_buffer(main_sel_op_transaction_fee, Transcript::proof_data); + serialize_to_buffer(main_sel_op_version, Transcript::proof_data); + serialize_to_buffer(main_sel_op_xor, Transcript::proof_data); + serialize_to_buffer(main_sel_rng_16, Transcript::proof_data); + serialize_to_buffer(main_sel_rng_8, Transcript::proof_data); + serialize_to_buffer(main_space_id, Transcript::proof_data); + serialize_to_buffer(main_table_pow_2, Transcript::proof_data); + serialize_to_buffer(main_tag_err, Transcript::proof_data); + serialize_to_buffer(main_w_in_tag, Transcript::proof_data); + serialize_to_buffer(mem_addr, Transcript::proof_data); + serialize_to_buffer(mem_clk, Transcript::proof_data); + serialize_to_buffer(mem_diff_hi, Transcript::proof_data); + serialize_to_buffer(mem_diff_lo, Transcript::proof_data); + serialize_to_buffer(mem_diff_mid, Transcript::proof_data); + serialize_to_buffer(mem_glob_addr, Transcript::proof_data); + serialize_to_buffer(mem_ind_op_a, Transcript::proof_data); + serialize_to_buffer(mem_ind_op_b, Transcript::proof_data); + serialize_to_buffer(mem_ind_op_c, Transcript::proof_data); + serialize_to_buffer(mem_ind_op_d, Transcript::proof_data); + serialize_to_buffer(mem_last, Transcript::proof_data); + serialize_to_buffer(mem_lastAccess, Transcript::proof_data); + serialize_to_buffer(mem_mem_sel, Transcript::proof_data); + serialize_to_buffer(mem_one_min_inv, Transcript::proof_data); + serialize_to_buffer(mem_op_a, Transcript::proof_data); + serialize_to_buffer(mem_op_b, Transcript::proof_data); + serialize_to_buffer(mem_op_c, Transcript::proof_data); + serialize_to_buffer(mem_op_d, Transcript::proof_data); + serialize_to_buffer(mem_r_in_tag, Transcript::proof_data); + serialize_to_buffer(mem_rng_chk_sel, Transcript::proof_data); + serialize_to_buffer(mem_rw, Transcript::proof_data); + serialize_to_buffer(mem_sel_cmov, Transcript::proof_data); + serialize_to_buffer(mem_sel_mov_a, Transcript::proof_data); + serialize_to_buffer(mem_sel_mov_b, Transcript::proof_data); + serialize_to_buffer(mem_skip_check_tag, Transcript::proof_data); + serialize_to_buffer(mem_space_id, Transcript::proof_data); + serialize_to_buffer(mem_tag, Transcript::proof_data); + serialize_to_buffer(mem_tag_err, Transcript::proof_data); + serialize_to_buffer(mem_tsp, Transcript::proof_data); + serialize_to_buffer(mem_val, Transcript::proof_data); + serialize_to_buffer(mem_w_in_tag, Transcript::proof_data); + serialize_to_buffer(pedersen_clk, Transcript::proof_data); + serialize_to_buffer(pedersen_input, Transcript::proof_data); + serialize_to_buffer(pedersen_output, Transcript::proof_data); + serialize_to_buffer(pedersen_pedersen_sel, Transcript::proof_data); + serialize_to_buffer(poseidon2_clk, Transcript::proof_data); + serialize_to_buffer(poseidon2_input, Transcript::proof_data); + serialize_to_buffer(poseidon2_output, Transcript::proof_data); + serialize_to_buffer(poseidon2_poseidon_perm_sel, Transcript::proof_data); + serialize_to_buffer(sha256_clk, Transcript::proof_data); + serialize_to_buffer(sha256_input, Transcript::proof_data); + serialize_to_buffer(sha256_output, Transcript::proof_data); + serialize_to_buffer(sha256_sha256_compression_sel, Transcript::proof_data); + serialize_to_buffer(sha256_state, Transcript::proof_data); serialize_to_buffer(perm_main_alu, Transcript::proof_data); serialize_to_buffer(perm_main_bin, Transcript::proof_data); serialize_to_buffer(perm_main_conv, Transcript::proof_data); diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp index 57ee78efa8c..e8b38b05911 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_prover.cpp @@ -59,313 +59,306 @@ void AvmProver::execute_wire_commitments_round() // Commit to all polynomials (apart from logderivative inverse polynomials, which are committed to in the later // logderivative phase) - witness_commitments.avm_alu_a_hi = commitment_key->commit(key->avm_alu_a_hi); - witness_commitments.avm_alu_a_lo = commitment_key->commit(key->avm_alu_a_lo); - witness_commitments.avm_alu_alu_sel = commitment_key->commit(key->avm_alu_alu_sel); - witness_commitments.avm_alu_b_hi = commitment_key->commit(key->avm_alu_b_hi); - witness_commitments.avm_alu_b_lo = commitment_key->commit(key->avm_alu_b_lo); - witness_commitments.avm_alu_borrow = commitment_key->commit(key->avm_alu_borrow); - witness_commitments.avm_alu_cf = commitment_key->commit(key->avm_alu_cf); - witness_commitments.avm_alu_clk = commitment_key->commit(key->avm_alu_clk); - witness_commitments.avm_alu_cmp_rng_ctr = commitment_key->commit(key->avm_alu_cmp_rng_ctr); - witness_commitments.avm_alu_cmp_sel = commitment_key->commit(key->avm_alu_cmp_sel); - witness_commitments.avm_alu_div_rng_chk_selector = commitment_key->commit(key->avm_alu_div_rng_chk_selector); - witness_commitments.avm_alu_div_u16_r0 = commitment_key->commit(key->avm_alu_div_u16_r0); - witness_commitments.avm_alu_div_u16_r1 = commitment_key->commit(key->avm_alu_div_u16_r1); - witness_commitments.avm_alu_div_u16_r2 = commitment_key->commit(key->avm_alu_div_u16_r2); - witness_commitments.avm_alu_div_u16_r3 = commitment_key->commit(key->avm_alu_div_u16_r3); - witness_commitments.avm_alu_div_u16_r4 = commitment_key->commit(key->avm_alu_div_u16_r4); - witness_commitments.avm_alu_div_u16_r5 = commitment_key->commit(key->avm_alu_div_u16_r5); - witness_commitments.avm_alu_div_u16_r6 = commitment_key->commit(key->avm_alu_div_u16_r6); - witness_commitments.avm_alu_div_u16_r7 = commitment_key->commit(key->avm_alu_div_u16_r7); - witness_commitments.avm_alu_divisor_hi = commitment_key->commit(key->avm_alu_divisor_hi); - witness_commitments.avm_alu_divisor_lo = commitment_key->commit(key->avm_alu_divisor_lo); - witness_commitments.avm_alu_ff_tag = commitment_key->commit(key->avm_alu_ff_tag); - witness_commitments.avm_alu_ia = commitment_key->commit(key->avm_alu_ia); - witness_commitments.avm_alu_ib = commitment_key->commit(key->avm_alu_ib); - witness_commitments.avm_alu_ic = commitment_key->commit(key->avm_alu_ic); - witness_commitments.avm_alu_in_tag = commitment_key->commit(key->avm_alu_in_tag); - witness_commitments.avm_alu_op_add = commitment_key->commit(key->avm_alu_op_add); - witness_commitments.avm_alu_op_cast = commitment_key->commit(key->avm_alu_op_cast); - witness_commitments.avm_alu_op_cast_prev = commitment_key->commit(key->avm_alu_op_cast_prev); - witness_commitments.avm_alu_op_div = commitment_key->commit(key->avm_alu_op_div); - witness_commitments.avm_alu_op_div_a_lt_b = commitment_key->commit(key->avm_alu_op_div_a_lt_b); - witness_commitments.avm_alu_op_div_std = commitment_key->commit(key->avm_alu_op_div_std); - witness_commitments.avm_alu_op_eq = commitment_key->commit(key->avm_alu_op_eq); - witness_commitments.avm_alu_op_eq_diff_inv = commitment_key->commit(key->avm_alu_op_eq_diff_inv); - witness_commitments.avm_alu_op_lt = commitment_key->commit(key->avm_alu_op_lt); - witness_commitments.avm_alu_op_lte = commitment_key->commit(key->avm_alu_op_lte); - witness_commitments.avm_alu_op_mul = commitment_key->commit(key->avm_alu_op_mul); - witness_commitments.avm_alu_op_not = commitment_key->commit(key->avm_alu_op_not); - witness_commitments.avm_alu_op_shl = commitment_key->commit(key->avm_alu_op_shl); - witness_commitments.avm_alu_op_shr = commitment_key->commit(key->avm_alu_op_shr); - witness_commitments.avm_alu_op_sub = commitment_key->commit(key->avm_alu_op_sub); - witness_commitments.avm_alu_p_a_borrow = commitment_key->commit(key->avm_alu_p_a_borrow); - witness_commitments.avm_alu_p_b_borrow = commitment_key->commit(key->avm_alu_p_b_borrow); - witness_commitments.avm_alu_p_sub_a_hi = commitment_key->commit(key->avm_alu_p_sub_a_hi); - witness_commitments.avm_alu_p_sub_a_lo = commitment_key->commit(key->avm_alu_p_sub_a_lo); - witness_commitments.avm_alu_p_sub_b_hi = commitment_key->commit(key->avm_alu_p_sub_b_hi); - witness_commitments.avm_alu_p_sub_b_lo = commitment_key->commit(key->avm_alu_p_sub_b_lo); - witness_commitments.avm_alu_partial_prod_hi = commitment_key->commit(key->avm_alu_partial_prod_hi); - witness_commitments.avm_alu_partial_prod_lo = commitment_key->commit(key->avm_alu_partial_prod_lo); - witness_commitments.avm_alu_quotient_hi = commitment_key->commit(key->avm_alu_quotient_hi); - witness_commitments.avm_alu_quotient_lo = commitment_key->commit(key->avm_alu_quotient_lo); - witness_commitments.avm_alu_remainder = commitment_key->commit(key->avm_alu_remainder); - witness_commitments.avm_alu_res_hi = commitment_key->commit(key->avm_alu_res_hi); - witness_commitments.avm_alu_res_lo = commitment_key->commit(key->avm_alu_res_lo); - witness_commitments.avm_alu_rng_chk_lookup_selector = commitment_key->commit(key->avm_alu_rng_chk_lookup_selector); - witness_commitments.avm_alu_rng_chk_sel = commitment_key->commit(key->avm_alu_rng_chk_sel); - witness_commitments.avm_alu_shift_lt_bit_len = commitment_key->commit(key->avm_alu_shift_lt_bit_len); - witness_commitments.avm_alu_shift_sel = commitment_key->commit(key->avm_alu_shift_sel); - witness_commitments.avm_alu_t_sub_s_bits = commitment_key->commit(key->avm_alu_t_sub_s_bits); - witness_commitments.avm_alu_two_pow_s = commitment_key->commit(key->avm_alu_two_pow_s); - witness_commitments.avm_alu_two_pow_t_sub_s = commitment_key->commit(key->avm_alu_two_pow_t_sub_s); - witness_commitments.avm_alu_u128_tag = commitment_key->commit(key->avm_alu_u128_tag); - witness_commitments.avm_alu_u16_r0 = commitment_key->commit(key->avm_alu_u16_r0); - witness_commitments.avm_alu_u16_r1 = commitment_key->commit(key->avm_alu_u16_r1); - witness_commitments.avm_alu_u16_r10 = commitment_key->commit(key->avm_alu_u16_r10); - witness_commitments.avm_alu_u16_r11 = commitment_key->commit(key->avm_alu_u16_r11); - witness_commitments.avm_alu_u16_r12 = commitment_key->commit(key->avm_alu_u16_r12); - witness_commitments.avm_alu_u16_r13 = commitment_key->commit(key->avm_alu_u16_r13); - witness_commitments.avm_alu_u16_r14 = commitment_key->commit(key->avm_alu_u16_r14); - witness_commitments.avm_alu_u16_r2 = commitment_key->commit(key->avm_alu_u16_r2); - witness_commitments.avm_alu_u16_r3 = commitment_key->commit(key->avm_alu_u16_r3); - witness_commitments.avm_alu_u16_r4 = commitment_key->commit(key->avm_alu_u16_r4); - witness_commitments.avm_alu_u16_r5 = commitment_key->commit(key->avm_alu_u16_r5); - witness_commitments.avm_alu_u16_r6 = commitment_key->commit(key->avm_alu_u16_r6); - witness_commitments.avm_alu_u16_r7 = commitment_key->commit(key->avm_alu_u16_r7); - witness_commitments.avm_alu_u16_r8 = commitment_key->commit(key->avm_alu_u16_r8); - witness_commitments.avm_alu_u16_r9 = commitment_key->commit(key->avm_alu_u16_r9); - witness_commitments.avm_alu_u16_tag = commitment_key->commit(key->avm_alu_u16_tag); - witness_commitments.avm_alu_u32_tag = commitment_key->commit(key->avm_alu_u32_tag); - witness_commitments.avm_alu_u64_tag = commitment_key->commit(key->avm_alu_u64_tag); - witness_commitments.avm_alu_u8_r0 = commitment_key->commit(key->avm_alu_u8_r0); - witness_commitments.avm_alu_u8_r1 = commitment_key->commit(key->avm_alu_u8_r1); - witness_commitments.avm_alu_u8_tag = commitment_key->commit(key->avm_alu_u8_tag); - witness_commitments.avm_binary_acc_ia = commitment_key->commit(key->avm_binary_acc_ia); - witness_commitments.avm_binary_acc_ib = commitment_key->commit(key->avm_binary_acc_ib); - witness_commitments.avm_binary_acc_ic = commitment_key->commit(key->avm_binary_acc_ic); - witness_commitments.avm_binary_bin_sel = commitment_key->commit(key->avm_binary_bin_sel); - witness_commitments.avm_binary_clk = commitment_key->commit(key->avm_binary_clk); - witness_commitments.avm_binary_ia_bytes = commitment_key->commit(key->avm_binary_ia_bytes); - witness_commitments.avm_binary_ib_bytes = commitment_key->commit(key->avm_binary_ib_bytes); - witness_commitments.avm_binary_ic_bytes = commitment_key->commit(key->avm_binary_ic_bytes); - witness_commitments.avm_binary_in_tag = commitment_key->commit(key->avm_binary_in_tag); - witness_commitments.avm_binary_mem_tag_ctr = commitment_key->commit(key->avm_binary_mem_tag_ctr); - witness_commitments.avm_binary_mem_tag_ctr_inv = commitment_key->commit(key->avm_binary_mem_tag_ctr_inv); - witness_commitments.avm_binary_op_id = commitment_key->commit(key->avm_binary_op_id); - witness_commitments.avm_binary_start = commitment_key->commit(key->avm_binary_start); - witness_commitments.avm_byte_lookup_bin_sel = commitment_key->commit(key->avm_byte_lookup_bin_sel); - witness_commitments.avm_byte_lookup_table_byte_lengths = - commitment_key->commit(key->avm_byte_lookup_table_byte_lengths); - witness_commitments.avm_byte_lookup_table_in_tags = commitment_key->commit(key->avm_byte_lookup_table_in_tags); - witness_commitments.avm_byte_lookup_table_input_a = commitment_key->commit(key->avm_byte_lookup_table_input_a); - witness_commitments.avm_byte_lookup_table_input_b = commitment_key->commit(key->avm_byte_lookup_table_input_b); - witness_commitments.avm_byte_lookup_table_op_id = commitment_key->commit(key->avm_byte_lookup_table_op_id); - witness_commitments.avm_byte_lookup_table_output = commitment_key->commit(key->avm_byte_lookup_table_output); - witness_commitments.avm_conversion_clk = commitment_key->commit(key->avm_conversion_clk); - witness_commitments.avm_conversion_input = commitment_key->commit(key->avm_conversion_input); - witness_commitments.avm_conversion_num_limbs = commitment_key->commit(key->avm_conversion_num_limbs); - witness_commitments.avm_conversion_radix = commitment_key->commit(key->avm_conversion_radix); - witness_commitments.avm_conversion_to_radix_le_sel = commitment_key->commit(key->avm_conversion_to_radix_le_sel); - witness_commitments.avm_gas_da_gas_fixed_table = commitment_key->commit(key->avm_gas_da_gas_fixed_table); - witness_commitments.avm_gas_gas_cost_sel = commitment_key->commit(key->avm_gas_gas_cost_sel); - witness_commitments.avm_gas_l2_gas_fixed_table = commitment_key->commit(key->avm_gas_l2_gas_fixed_table); - witness_commitments.avm_keccakf1600_clk = commitment_key->commit(key->avm_keccakf1600_clk); - witness_commitments.avm_keccakf1600_input = commitment_key->commit(key->avm_keccakf1600_input); - witness_commitments.avm_keccakf1600_keccakf1600_sel = commitment_key->commit(key->avm_keccakf1600_keccakf1600_sel); - witness_commitments.avm_keccakf1600_output = commitment_key->commit(key->avm_keccakf1600_output); - witness_commitments.avm_kernel_emit_l2_to_l1_msg_write_offset = - commitment_key->commit(key->avm_kernel_emit_l2_to_l1_msg_write_offset); - witness_commitments.avm_kernel_emit_note_hash_write_offset = - commitment_key->commit(key->avm_kernel_emit_note_hash_write_offset); - witness_commitments.avm_kernel_emit_nullifier_write_offset = - commitment_key->commit(key->avm_kernel_emit_nullifier_write_offset); - witness_commitments.avm_kernel_emit_unencrypted_log_write_offset = - commitment_key->commit(key->avm_kernel_emit_unencrypted_log_write_offset); - witness_commitments.avm_kernel_kernel_in_offset = commitment_key->commit(key->avm_kernel_kernel_in_offset); - witness_commitments.avm_kernel_kernel_inputs = commitment_key->commit(key->avm_kernel_kernel_inputs); - witness_commitments.avm_kernel_kernel_metadata_out = commitment_key->commit(key->avm_kernel_kernel_metadata_out); - witness_commitments.avm_kernel_kernel_out_offset = commitment_key->commit(key->avm_kernel_kernel_out_offset); - witness_commitments.avm_kernel_kernel_side_effect_out = - commitment_key->commit(key->avm_kernel_kernel_side_effect_out); - witness_commitments.avm_kernel_kernel_value_out = commitment_key->commit(key->avm_kernel_kernel_value_out); - witness_commitments.avm_kernel_l1_to_l2_msg_exists_write_offset = - commitment_key->commit(key->avm_kernel_l1_to_l2_msg_exists_write_offset); - witness_commitments.avm_kernel_note_hash_exist_write_offset = - commitment_key->commit(key->avm_kernel_note_hash_exist_write_offset); - witness_commitments.avm_kernel_nullifier_exists_write_offset = - commitment_key->commit(key->avm_kernel_nullifier_exists_write_offset); - witness_commitments.avm_kernel_nullifier_non_exists_write_offset = - commitment_key->commit(key->avm_kernel_nullifier_non_exists_write_offset); - witness_commitments.avm_kernel_q_public_input_kernel_add_to_table = - commitment_key->commit(key->avm_kernel_q_public_input_kernel_add_to_table); - witness_commitments.avm_kernel_q_public_input_kernel_out_add_to_table = - commitment_key->commit(key->avm_kernel_q_public_input_kernel_out_add_to_table); - witness_commitments.avm_kernel_side_effect_counter = commitment_key->commit(key->avm_kernel_side_effect_counter); - witness_commitments.avm_kernel_sload_write_offset = commitment_key->commit(key->avm_kernel_sload_write_offset); - witness_commitments.avm_kernel_sstore_write_offset = commitment_key->commit(key->avm_kernel_sstore_write_offset); - witness_commitments.avm_main_abs_da_rem_gas_hi = commitment_key->commit(key->avm_main_abs_da_rem_gas_hi); - witness_commitments.avm_main_abs_da_rem_gas_lo = commitment_key->commit(key->avm_main_abs_da_rem_gas_lo); - witness_commitments.avm_main_abs_l2_rem_gas_hi = commitment_key->commit(key->avm_main_abs_l2_rem_gas_hi); - witness_commitments.avm_main_abs_l2_rem_gas_lo = commitment_key->commit(key->avm_main_abs_l2_rem_gas_lo); - witness_commitments.avm_main_alu_in_tag = commitment_key->commit(key->avm_main_alu_in_tag); - witness_commitments.avm_main_alu_sel = commitment_key->commit(key->avm_main_alu_sel); - witness_commitments.avm_main_bin_op_id = commitment_key->commit(key->avm_main_bin_op_id); - witness_commitments.avm_main_bin_sel = commitment_key->commit(key->avm_main_bin_sel); - witness_commitments.avm_main_call_ptr = commitment_key->commit(key->avm_main_call_ptr); - witness_commitments.avm_main_da_gas_op = commitment_key->commit(key->avm_main_da_gas_op); - witness_commitments.avm_main_da_gas_remaining = commitment_key->commit(key->avm_main_da_gas_remaining); - witness_commitments.avm_main_da_out_of_gas = commitment_key->commit(key->avm_main_da_out_of_gas); - witness_commitments.avm_main_gas_cost_active = commitment_key->commit(key->avm_main_gas_cost_active); - witness_commitments.avm_main_ia = commitment_key->commit(key->avm_main_ia); - witness_commitments.avm_main_ib = commitment_key->commit(key->avm_main_ib); - witness_commitments.avm_main_ic = commitment_key->commit(key->avm_main_ic); - witness_commitments.avm_main_id = commitment_key->commit(key->avm_main_id); - witness_commitments.avm_main_id_zero = commitment_key->commit(key->avm_main_id_zero); - witness_commitments.avm_main_ind_a = commitment_key->commit(key->avm_main_ind_a); - witness_commitments.avm_main_ind_b = commitment_key->commit(key->avm_main_ind_b); - witness_commitments.avm_main_ind_c = commitment_key->commit(key->avm_main_ind_c); - witness_commitments.avm_main_ind_d = commitment_key->commit(key->avm_main_ind_d); - witness_commitments.avm_main_ind_op_a = commitment_key->commit(key->avm_main_ind_op_a); - witness_commitments.avm_main_ind_op_b = commitment_key->commit(key->avm_main_ind_op_b); - witness_commitments.avm_main_ind_op_c = commitment_key->commit(key->avm_main_ind_op_c); - witness_commitments.avm_main_ind_op_d = commitment_key->commit(key->avm_main_ind_op_d); - witness_commitments.avm_main_internal_return_ptr = commitment_key->commit(key->avm_main_internal_return_ptr); - witness_commitments.avm_main_inv = commitment_key->commit(key->avm_main_inv); - witness_commitments.avm_main_l2_gas_op = commitment_key->commit(key->avm_main_l2_gas_op); - witness_commitments.avm_main_l2_gas_remaining = commitment_key->commit(key->avm_main_l2_gas_remaining); - witness_commitments.avm_main_l2_out_of_gas = commitment_key->commit(key->avm_main_l2_out_of_gas); - witness_commitments.avm_main_last = commitment_key->commit(key->avm_main_last); - witness_commitments.avm_main_mem_idx_a = commitment_key->commit(key->avm_main_mem_idx_a); - witness_commitments.avm_main_mem_idx_b = commitment_key->commit(key->avm_main_mem_idx_b); - witness_commitments.avm_main_mem_idx_c = commitment_key->commit(key->avm_main_mem_idx_c); - witness_commitments.avm_main_mem_idx_d = commitment_key->commit(key->avm_main_mem_idx_d); - witness_commitments.avm_main_mem_op_a = commitment_key->commit(key->avm_main_mem_op_a); - witness_commitments.avm_main_mem_op_activate_gas = commitment_key->commit(key->avm_main_mem_op_activate_gas); - witness_commitments.avm_main_mem_op_b = commitment_key->commit(key->avm_main_mem_op_b); - witness_commitments.avm_main_mem_op_c = commitment_key->commit(key->avm_main_mem_op_c); - witness_commitments.avm_main_mem_op_d = commitment_key->commit(key->avm_main_mem_op_d); - witness_commitments.avm_main_op_err = commitment_key->commit(key->avm_main_op_err); - witness_commitments.avm_main_opcode_val = commitment_key->commit(key->avm_main_opcode_val); - witness_commitments.avm_main_pc = commitment_key->commit(key->avm_main_pc); - witness_commitments.avm_main_q_kernel_lookup = commitment_key->commit(key->avm_main_q_kernel_lookup); - witness_commitments.avm_main_q_kernel_output_lookup = commitment_key->commit(key->avm_main_q_kernel_output_lookup); - witness_commitments.avm_main_r_in_tag = commitment_key->commit(key->avm_main_r_in_tag); - witness_commitments.avm_main_rwa = commitment_key->commit(key->avm_main_rwa); - witness_commitments.avm_main_rwb = commitment_key->commit(key->avm_main_rwb); - witness_commitments.avm_main_rwc = commitment_key->commit(key->avm_main_rwc); - witness_commitments.avm_main_rwd = commitment_key->commit(key->avm_main_rwd); - witness_commitments.avm_main_sel_cmov = commitment_key->commit(key->avm_main_sel_cmov); - witness_commitments.avm_main_sel_external_call = commitment_key->commit(key->avm_main_sel_external_call); - witness_commitments.avm_main_sel_halt = commitment_key->commit(key->avm_main_sel_halt); - witness_commitments.avm_main_sel_internal_call = commitment_key->commit(key->avm_main_sel_internal_call); - witness_commitments.avm_main_sel_internal_return = commitment_key->commit(key->avm_main_sel_internal_return); - witness_commitments.avm_main_sel_jump = commitment_key->commit(key->avm_main_sel_jump); - witness_commitments.avm_main_sel_jumpi = commitment_key->commit(key->avm_main_sel_jumpi); - witness_commitments.avm_main_sel_mov = commitment_key->commit(key->avm_main_sel_mov); - witness_commitments.avm_main_sel_mov_a = commitment_key->commit(key->avm_main_sel_mov_a); - witness_commitments.avm_main_sel_mov_b = commitment_key->commit(key->avm_main_sel_mov_b); - witness_commitments.avm_main_sel_op_add = commitment_key->commit(key->avm_main_sel_op_add); - witness_commitments.avm_main_sel_op_address = commitment_key->commit(key->avm_main_sel_op_address); - witness_commitments.avm_main_sel_op_and = commitment_key->commit(key->avm_main_sel_op_and); - witness_commitments.avm_main_sel_op_block_number = commitment_key->commit(key->avm_main_sel_op_block_number); - witness_commitments.avm_main_sel_op_cast = commitment_key->commit(key->avm_main_sel_op_cast); - witness_commitments.avm_main_sel_op_chain_id = commitment_key->commit(key->avm_main_sel_op_chain_id); - witness_commitments.avm_main_sel_op_coinbase = commitment_key->commit(key->avm_main_sel_op_coinbase); - witness_commitments.avm_main_sel_op_dagasleft = commitment_key->commit(key->avm_main_sel_op_dagasleft); - witness_commitments.avm_main_sel_op_div = commitment_key->commit(key->avm_main_sel_op_div); - witness_commitments.avm_main_sel_op_emit_l2_to_l1_msg = - commitment_key->commit(key->avm_main_sel_op_emit_l2_to_l1_msg); - witness_commitments.avm_main_sel_op_emit_note_hash = commitment_key->commit(key->avm_main_sel_op_emit_note_hash); - witness_commitments.avm_main_sel_op_emit_nullifier = commitment_key->commit(key->avm_main_sel_op_emit_nullifier); - witness_commitments.avm_main_sel_op_emit_unencrypted_log = - commitment_key->commit(key->avm_main_sel_op_emit_unencrypted_log); - witness_commitments.avm_main_sel_op_eq = commitment_key->commit(key->avm_main_sel_op_eq); - witness_commitments.avm_main_sel_op_fdiv = commitment_key->commit(key->avm_main_sel_op_fdiv); - witness_commitments.avm_main_sel_op_fee_per_da_gas = commitment_key->commit(key->avm_main_sel_op_fee_per_da_gas); - witness_commitments.avm_main_sel_op_fee_per_l2_gas = commitment_key->commit(key->avm_main_sel_op_fee_per_l2_gas); - witness_commitments.avm_main_sel_op_get_contract_instance = - commitment_key->commit(key->avm_main_sel_op_get_contract_instance); - witness_commitments.avm_main_sel_op_keccak = commitment_key->commit(key->avm_main_sel_op_keccak); - witness_commitments.avm_main_sel_op_l1_to_l2_msg_exists = - commitment_key->commit(key->avm_main_sel_op_l1_to_l2_msg_exists); - witness_commitments.avm_main_sel_op_l2gasleft = commitment_key->commit(key->avm_main_sel_op_l2gasleft); - witness_commitments.avm_main_sel_op_lt = commitment_key->commit(key->avm_main_sel_op_lt); - witness_commitments.avm_main_sel_op_lte = commitment_key->commit(key->avm_main_sel_op_lte); - witness_commitments.avm_main_sel_op_mul = commitment_key->commit(key->avm_main_sel_op_mul); - witness_commitments.avm_main_sel_op_not = commitment_key->commit(key->avm_main_sel_op_not); - witness_commitments.avm_main_sel_op_note_hash_exists = - commitment_key->commit(key->avm_main_sel_op_note_hash_exists); - witness_commitments.avm_main_sel_op_nullifier_exists = - commitment_key->commit(key->avm_main_sel_op_nullifier_exists); - witness_commitments.avm_main_sel_op_or = commitment_key->commit(key->avm_main_sel_op_or); - witness_commitments.avm_main_sel_op_pedersen = commitment_key->commit(key->avm_main_sel_op_pedersen); - witness_commitments.avm_main_sel_op_poseidon2 = commitment_key->commit(key->avm_main_sel_op_poseidon2); - witness_commitments.avm_main_sel_op_radix_le = commitment_key->commit(key->avm_main_sel_op_radix_le); - witness_commitments.avm_main_sel_op_sender = commitment_key->commit(key->avm_main_sel_op_sender); - witness_commitments.avm_main_sel_op_sha256 = commitment_key->commit(key->avm_main_sel_op_sha256); - witness_commitments.avm_main_sel_op_shl = commitment_key->commit(key->avm_main_sel_op_shl); - witness_commitments.avm_main_sel_op_shr = commitment_key->commit(key->avm_main_sel_op_shr); - witness_commitments.avm_main_sel_op_sload = commitment_key->commit(key->avm_main_sel_op_sload); - witness_commitments.avm_main_sel_op_sstore = commitment_key->commit(key->avm_main_sel_op_sstore); - witness_commitments.avm_main_sel_op_storage_address = commitment_key->commit(key->avm_main_sel_op_storage_address); - witness_commitments.avm_main_sel_op_sub = commitment_key->commit(key->avm_main_sel_op_sub); - witness_commitments.avm_main_sel_op_timestamp = commitment_key->commit(key->avm_main_sel_op_timestamp); - witness_commitments.avm_main_sel_op_transaction_fee = commitment_key->commit(key->avm_main_sel_op_transaction_fee); - witness_commitments.avm_main_sel_op_version = commitment_key->commit(key->avm_main_sel_op_version); - witness_commitments.avm_main_sel_op_xor = commitment_key->commit(key->avm_main_sel_op_xor); - witness_commitments.avm_main_sel_rng_16 = commitment_key->commit(key->avm_main_sel_rng_16); - witness_commitments.avm_main_sel_rng_8 = commitment_key->commit(key->avm_main_sel_rng_8); - witness_commitments.avm_main_space_id = commitment_key->commit(key->avm_main_space_id); - witness_commitments.avm_main_table_pow_2 = commitment_key->commit(key->avm_main_table_pow_2); - witness_commitments.avm_main_tag_err = commitment_key->commit(key->avm_main_tag_err); - witness_commitments.avm_main_w_in_tag = commitment_key->commit(key->avm_main_w_in_tag); - witness_commitments.avm_mem_addr = commitment_key->commit(key->avm_mem_addr); - witness_commitments.avm_mem_clk = commitment_key->commit(key->avm_mem_clk); - witness_commitments.avm_mem_diff_hi = commitment_key->commit(key->avm_mem_diff_hi); - witness_commitments.avm_mem_diff_lo = commitment_key->commit(key->avm_mem_diff_lo); - witness_commitments.avm_mem_diff_mid = commitment_key->commit(key->avm_mem_diff_mid); - witness_commitments.avm_mem_glob_addr = commitment_key->commit(key->avm_mem_glob_addr); - witness_commitments.avm_mem_ind_op_a = commitment_key->commit(key->avm_mem_ind_op_a); - witness_commitments.avm_mem_ind_op_b = commitment_key->commit(key->avm_mem_ind_op_b); - witness_commitments.avm_mem_ind_op_c = commitment_key->commit(key->avm_mem_ind_op_c); - witness_commitments.avm_mem_ind_op_d = commitment_key->commit(key->avm_mem_ind_op_d); - witness_commitments.avm_mem_last = commitment_key->commit(key->avm_mem_last); - witness_commitments.avm_mem_lastAccess = commitment_key->commit(key->avm_mem_lastAccess); - witness_commitments.avm_mem_mem_sel = commitment_key->commit(key->avm_mem_mem_sel); - witness_commitments.avm_mem_one_min_inv = commitment_key->commit(key->avm_mem_one_min_inv); - witness_commitments.avm_mem_op_a = commitment_key->commit(key->avm_mem_op_a); - witness_commitments.avm_mem_op_b = commitment_key->commit(key->avm_mem_op_b); - witness_commitments.avm_mem_op_c = commitment_key->commit(key->avm_mem_op_c); - witness_commitments.avm_mem_op_d = commitment_key->commit(key->avm_mem_op_d); - witness_commitments.avm_mem_r_in_tag = commitment_key->commit(key->avm_mem_r_in_tag); - witness_commitments.avm_mem_rng_chk_sel = commitment_key->commit(key->avm_mem_rng_chk_sel); - witness_commitments.avm_mem_rw = commitment_key->commit(key->avm_mem_rw); - witness_commitments.avm_mem_sel_cmov = commitment_key->commit(key->avm_mem_sel_cmov); - witness_commitments.avm_mem_sel_mov_a = commitment_key->commit(key->avm_mem_sel_mov_a); - witness_commitments.avm_mem_sel_mov_b = commitment_key->commit(key->avm_mem_sel_mov_b); - witness_commitments.avm_mem_skip_check_tag = commitment_key->commit(key->avm_mem_skip_check_tag); - witness_commitments.avm_mem_space_id = commitment_key->commit(key->avm_mem_space_id); - witness_commitments.avm_mem_tag = commitment_key->commit(key->avm_mem_tag); - witness_commitments.avm_mem_tag_err = commitment_key->commit(key->avm_mem_tag_err); - witness_commitments.avm_mem_tsp = commitment_key->commit(key->avm_mem_tsp); - witness_commitments.avm_mem_val = commitment_key->commit(key->avm_mem_val); - witness_commitments.avm_mem_w_in_tag = commitment_key->commit(key->avm_mem_w_in_tag); - witness_commitments.avm_pedersen_clk = commitment_key->commit(key->avm_pedersen_clk); - witness_commitments.avm_pedersen_input = commitment_key->commit(key->avm_pedersen_input); - witness_commitments.avm_pedersen_output = commitment_key->commit(key->avm_pedersen_output); - witness_commitments.avm_pedersen_pedersen_sel = commitment_key->commit(key->avm_pedersen_pedersen_sel); - witness_commitments.avm_poseidon2_clk = commitment_key->commit(key->avm_poseidon2_clk); - witness_commitments.avm_poseidon2_input = commitment_key->commit(key->avm_poseidon2_input); - witness_commitments.avm_poseidon2_output = commitment_key->commit(key->avm_poseidon2_output); - witness_commitments.avm_poseidon2_poseidon_perm_sel = commitment_key->commit(key->avm_poseidon2_poseidon_perm_sel); - witness_commitments.avm_sha256_clk = commitment_key->commit(key->avm_sha256_clk); - witness_commitments.avm_sha256_input = commitment_key->commit(key->avm_sha256_input); - witness_commitments.avm_sha256_output = commitment_key->commit(key->avm_sha256_output); - witness_commitments.avm_sha256_sha256_compression_sel = - commitment_key->commit(key->avm_sha256_sha256_compression_sel); - witness_commitments.avm_sha256_state = commitment_key->commit(key->avm_sha256_state); + witness_commitments.alu_a_hi = commitment_key->commit(key->alu_a_hi); + witness_commitments.alu_a_lo = commitment_key->commit(key->alu_a_lo); + witness_commitments.alu_alu_sel = commitment_key->commit(key->alu_alu_sel); + witness_commitments.alu_b_hi = commitment_key->commit(key->alu_b_hi); + witness_commitments.alu_b_lo = commitment_key->commit(key->alu_b_lo); + witness_commitments.alu_borrow = commitment_key->commit(key->alu_borrow); + witness_commitments.alu_cf = commitment_key->commit(key->alu_cf); + witness_commitments.alu_clk = commitment_key->commit(key->alu_clk); + witness_commitments.alu_cmp_rng_ctr = commitment_key->commit(key->alu_cmp_rng_ctr); + witness_commitments.alu_cmp_sel = commitment_key->commit(key->alu_cmp_sel); + witness_commitments.alu_div_rng_chk_selector = commitment_key->commit(key->alu_div_rng_chk_selector); + witness_commitments.alu_div_u16_r0 = commitment_key->commit(key->alu_div_u16_r0); + witness_commitments.alu_div_u16_r1 = commitment_key->commit(key->alu_div_u16_r1); + witness_commitments.alu_div_u16_r2 = commitment_key->commit(key->alu_div_u16_r2); + witness_commitments.alu_div_u16_r3 = commitment_key->commit(key->alu_div_u16_r3); + witness_commitments.alu_div_u16_r4 = commitment_key->commit(key->alu_div_u16_r4); + witness_commitments.alu_div_u16_r5 = commitment_key->commit(key->alu_div_u16_r5); + witness_commitments.alu_div_u16_r6 = commitment_key->commit(key->alu_div_u16_r6); + witness_commitments.alu_div_u16_r7 = commitment_key->commit(key->alu_div_u16_r7); + witness_commitments.alu_divisor_hi = commitment_key->commit(key->alu_divisor_hi); + witness_commitments.alu_divisor_lo = commitment_key->commit(key->alu_divisor_lo); + witness_commitments.alu_ff_tag = commitment_key->commit(key->alu_ff_tag); + witness_commitments.alu_ia = commitment_key->commit(key->alu_ia); + witness_commitments.alu_ib = commitment_key->commit(key->alu_ib); + witness_commitments.alu_ic = commitment_key->commit(key->alu_ic); + witness_commitments.alu_in_tag = commitment_key->commit(key->alu_in_tag); + witness_commitments.alu_op_add = commitment_key->commit(key->alu_op_add); + witness_commitments.alu_op_cast = commitment_key->commit(key->alu_op_cast); + witness_commitments.alu_op_cast_prev = commitment_key->commit(key->alu_op_cast_prev); + witness_commitments.alu_op_div = commitment_key->commit(key->alu_op_div); + witness_commitments.alu_op_div_a_lt_b = commitment_key->commit(key->alu_op_div_a_lt_b); + witness_commitments.alu_op_div_std = commitment_key->commit(key->alu_op_div_std); + witness_commitments.alu_op_eq = commitment_key->commit(key->alu_op_eq); + witness_commitments.alu_op_eq_diff_inv = commitment_key->commit(key->alu_op_eq_diff_inv); + witness_commitments.alu_op_lt = commitment_key->commit(key->alu_op_lt); + witness_commitments.alu_op_lte = commitment_key->commit(key->alu_op_lte); + witness_commitments.alu_op_mul = commitment_key->commit(key->alu_op_mul); + witness_commitments.alu_op_not = commitment_key->commit(key->alu_op_not); + witness_commitments.alu_op_shl = commitment_key->commit(key->alu_op_shl); + witness_commitments.alu_op_shr = commitment_key->commit(key->alu_op_shr); + witness_commitments.alu_op_sub = commitment_key->commit(key->alu_op_sub); + witness_commitments.alu_p_a_borrow = commitment_key->commit(key->alu_p_a_borrow); + witness_commitments.alu_p_b_borrow = commitment_key->commit(key->alu_p_b_borrow); + witness_commitments.alu_p_sub_a_hi = commitment_key->commit(key->alu_p_sub_a_hi); + witness_commitments.alu_p_sub_a_lo = commitment_key->commit(key->alu_p_sub_a_lo); + witness_commitments.alu_p_sub_b_hi = commitment_key->commit(key->alu_p_sub_b_hi); + witness_commitments.alu_p_sub_b_lo = commitment_key->commit(key->alu_p_sub_b_lo); + witness_commitments.alu_partial_prod_hi = commitment_key->commit(key->alu_partial_prod_hi); + witness_commitments.alu_partial_prod_lo = commitment_key->commit(key->alu_partial_prod_lo); + witness_commitments.alu_quotient_hi = commitment_key->commit(key->alu_quotient_hi); + witness_commitments.alu_quotient_lo = commitment_key->commit(key->alu_quotient_lo); + witness_commitments.alu_remainder = commitment_key->commit(key->alu_remainder); + witness_commitments.alu_res_hi = commitment_key->commit(key->alu_res_hi); + witness_commitments.alu_res_lo = commitment_key->commit(key->alu_res_lo); + witness_commitments.alu_rng_chk_lookup_selector = commitment_key->commit(key->alu_rng_chk_lookup_selector); + witness_commitments.alu_rng_chk_sel = commitment_key->commit(key->alu_rng_chk_sel); + witness_commitments.alu_shift_lt_bit_len = commitment_key->commit(key->alu_shift_lt_bit_len); + witness_commitments.alu_shift_sel = commitment_key->commit(key->alu_shift_sel); + witness_commitments.alu_t_sub_s_bits = commitment_key->commit(key->alu_t_sub_s_bits); + witness_commitments.alu_two_pow_s = commitment_key->commit(key->alu_two_pow_s); + witness_commitments.alu_two_pow_t_sub_s = commitment_key->commit(key->alu_two_pow_t_sub_s); + witness_commitments.alu_u128_tag = commitment_key->commit(key->alu_u128_tag); + witness_commitments.alu_u16_r0 = commitment_key->commit(key->alu_u16_r0); + witness_commitments.alu_u16_r1 = commitment_key->commit(key->alu_u16_r1); + witness_commitments.alu_u16_r10 = commitment_key->commit(key->alu_u16_r10); + witness_commitments.alu_u16_r11 = commitment_key->commit(key->alu_u16_r11); + witness_commitments.alu_u16_r12 = commitment_key->commit(key->alu_u16_r12); + witness_commitments.alu_u16_r13 = commitment_key->commit(key->alu_u16_r13); + witness_commitments.alu_u16_r14 = commitment_key->commit(key->alu_u16_r14); + witness_commitments.alu_u16_r2 = commitment_key->commit(key->alu_u16_r2); + witness_commitments.alu_u16_r3 = commitment_key->commit(key->alu_u16_r3); + witness_commitments.alu_u16_r4 = commitment_key->commit(key->alu_u16_r4); + witness_commitments.alu_u16_r5 = commitment_key->commit(key->alu_u16_r5); + witness_commitments.alu_u16_r6 = commitment_key->commit(key->alu_u16_r6); + witness_commitments.alu_u16_r7 = commitment_key->commit(key->alu_u16_r7); + witness_commitments.alu_u16_r8 = commitment_key->commit(key->alu_u16_r8); + witness_commitments.alu_u16_r9 = commitment_key->commit(key->alu_u16_r9); + witness_commitments.alu_u16_tag = commitment_key->commit(key->alu_u16_tag); + witness_commitments.alu_u32_tag = commitment_key->commit(key->alu_u32_tag); + witness_commitments.alu_u64_tag = commitment_key->commit(key->alu_u64_tag); + witness_commitments.alu_u8_r0 = commitment_key->commit(key->alu_u8_r0); + witness_commitments.alu_u8_r1 = commitment_key->commit(key->alu_u8_r1); + witness_commitments.alu_u8_tag = commitment_key->commit(key->alu_u8_tag); + witness_commitments.binary_acc_ia = commitment_key->commit(key->binary_acc_ia); + witness_commitments.binary_acc_ib = commitment_key->commit(key->binary_acc_ib); + witness_commitments.binary_acc_ic = commitment_key->commit(key->binary_acc_ic); + witness_commitments.binary_bin_sel = commitment_key->commit(key->binary_bin_sel); + witness_commitments.binary_clk = commitment_key->commit(key->binary_clk); + witness_commitments.binary_ia_bytes = commitment_key->commit(key->binary_ia_bytes); + witness_commitments.binary_ib_bytes = commitment_key->commit(key->binary_ib_bytes); + witness_commitments.binary_ic_bytes = commitment_key->commit(key->binary_ic_bytes); + witness_commitments.binary_in_tag = commitment_key->commit(key->binary_in_tag); + witness_commitments.binary_mem_tag_ctr = commitment_key->commit(key->binary_mem_tag_ctr); + witness_commitments.binary_mem_tag_ctr_inv = commitment_key->commit(key->binary_mem_tag_ctr_inv); + witness_commitments.binary_op_id = commitment_key->commit(key->binary_op_id); + witness_commitments.binary_start = commitment_key->commit(key->binary_start); + witness_commitments.byte_lookup_bin_sel = commitment_key->commit(key->byte_lookup_bin_sel); + witness_commitments.byte_lookup_table_byte_lengths = commitment_key->commit(key->byte_lookup_table_byte_lengths); + witness_commitments.byte_lookup_table_in_tags = commitment_key->commit(key->byte_lookup_table_in_tags); + witness_commitments.byte_lookup_table_input_a = commitment_key->commit(key->byte_lookup_table_input_a); + witness_commitments.byte_lookup_table_input_b = commitment_key->commit(key->byte_lookup_table_input_b); + witness_commitments.byte_lookup_table_op_id = commitment_key->commit(key->byte_lookup_table_op_id); + witness_commitments.byte_lookup_table_output = commitment_key->commit(key->byte_lookup_table_output); + witness_commitments.conversion_clk = commitment_key->commit(key->conversion_clk); + witness_commitments.conversion_input = commitment_key->commit(key->conversion_input); + witness_commitments.conversion_num_limbs = commitment_key->commit(key->conversion_num_limbs); + witness_commitments.conversion_radix = commitment_key->commit(key->conversion_radix); + witness_commitments.conversion_to_radix_le_sel = commitment_key->commit(key->conversion_to_radix_le_sel); + witness_commitments.gas_da_gas_fixed_table = commitment_key->commit(key->gas_da_gas_fixed_table); + witness_commitments.gas_gas_cost_sel = commitment_key->commit(key->gas_gas_cost_sel); + witness_commitments.gas_l2_gas_fixed_table = commitment_key->commit(key->gas_l2_gas_fixed_table); + witness_commitments.keccakf1600_clk = commitment_key->commit(key->keccakf1600_clk); + witness_commitments.keccakf1600_input = commitment_key->commit(key->keccakf1600_input); + witness_commitments.keccakf1600_keccakf1600_sel = commitment_key->commit(key->keccakf1600_keccakf1600_sel); + witness_commitments.keccakf1600_output = commitment_key->commit(key->keccakf1600_output); + witness_commitments.kernel_emit_l2_to_l1_msg_write_offset = + commitment_key->commit(key->kernel_emit_l2_to_l1_msg_write_offset); + witness_commitments.kernel_emit_note_hash_write_offset = + commitment_key->commit(key->kernel_emit_note_hash_write_offset); + witness_commitments.kernel_emit_nullifier_write_offset = + commitment_key->commit(key->kernel_emit_nullifier_write_offset); + witness_commitments.kernel_emit_unencrypted_log_write_offset = + commitment_key->commit(key->kernel_emit_unencrypted_log_write_offset); + witness_commitments.kernel_kernel_in_offset = commitment_key->commit(key->kernel_kernel_in_offset); + witness_commitments.kernel_kernel_inputs = commitment_key->commit(key->kernel_kernel_inputs); + witness_commitments.kernel_kernel_metadata_out = commitment_key->commit(key->kernel_kernel_metadata_out); + witness_commitments.kernel_kernel_out_offset = commitment_key->commit(key->kernel_kernel_out_offset); + witness_commitments.kernel_kernel_side_effect_out = commitment_key->commit(key->kernel_kernel_side_effect_out); + witness_commitments.kernel_kernel_value_out = commitment_key->commit(key->kernel_kernel_value_out); + witness_commitments.kernel_l1_to_l2_msg_exists_write_offset = + commitment_key->commit(key->kernel_l1_to_l2_msg_exists_write_offset); + witness_commitments.kernel_note_hash_exist_write_offset = + commitment_key->commit(key->kernel_note_hash_exist_write_offset); + witness_commitments.kernel_nullifier_exists_write_offset = + commitment_key->commit(key->kernel_nullifier_exists_write_offset); + witness_commitments.kernel_nullifier_non_exists_write_offset = + commitment_key->commit(key->kernel_nullifier_non_exists_write_offset); + witness_commitments.kernel_q_public_input_kernel_add_to_table = + commitment_key->commit(key->kernel_q_public_input_kernel_add_to_table); + witness_commitments.kernel_q_public_input_kernel_out_add_to_table = + commitment_key->commit(key->kernel_q_public_input_kernel_out_add_to_table); + witness_commitments.kernel_side_effect_counter = commitment_key->commit(key->kernel_side_effect_counter); + witness_commitments.kernel_sload_write_offset = commitment_key->commit(key->kernel_sload_write_offset); + witness_commitments.kernel_sstore_write_offset = commitment_key->commit(key->kernel_sstore_write_offset); + witness_commitments.main_abs_da_rem_gas_hi = commitment_key->commit(key->main_abs_da_rem_gas_hi); + witness_commitments.main_abs_da_rem_gas_lo = commitment_key->commit(key->main_abs_da_rem_gas_lo); + witness_commitments.main_abs_l2_rem_gas_hi = commitment_key->commit(key->main_abs_l2_rem_gas_hi); + witness_commitments.main_abs_l2_rem_gas_lo = commitment_key->commit(key->main_abs_l2_rem_gas_lo); + witness_commitments.main_alu_in_tag = commitment_key->commit(key->main_alu_in_tag); + witness_commitments.main_alu_sel = commitment_key->commit(key->main_alu_sel); + witness_commitments.main_bin_op_id = commitment_key->commit(key->main_bin_op_id); + witness_commitments.main_bin_sel = commitment_key->commit(key->main_bin_sel); + witness_commitments.main_call_ptr = commitment_key->commit(key->main_call_ptr); + witness_commitments.main_da_gas_op = commitment_key->commit(key->main_da_gas_op); + witness_commitments.main_da_gas_remaining = commitment_key->commit(key->main_da_gas_remaining); + witness_commitments.main_da_out_of_gas = commitment_key->commit(key->main_da_out_of_gas); + witness_commitments.main_gas_cost_active = commitment_key->commit(key->main_gas_cost_active); + witness_commitments.main_ia = commitment_key->commit(key->main_ia); + witness_commitments.main_ib = commitment_key->commit(key->main_ib); + witness_commitments.main_ic = commitment_key->commit(key->main_ic); + witness_commitments.main_id = commitment_key->commit(key->main_id); + witness_commitments.main_id_zero = commitment_key->commit(key->main_id_zero); + witness_commitments.main_ind_a = commitment_key->commit(key->main_ind_a); + witness_commitments.main_ind_b = commitment_key->commit(key->main_ind_b); + witness_commitments.main_ind_c = commitment_key->commit(key->main_ind_c); + witness_commitments.main_ind_d = commitment_key->commit(key->main_ind_d); + witness_commitments.main_ind_op_a = commitment_key->commit(key->main_ind_op_a); + witness_commitments.main_ind_op_b = commitment_key->commit(key->main_ind_op_b); + witness_commitments.main_ind_op_c = commitment_key->commit(key->main_ind_op_c); + witness_commitments.main_ind_op_d = commitment_key->commit(key->main_ind_op_d); + witness_commitments.main_internal_return_ptr = commitment_key->commit(key->main_internal_return_ptr); + witness_commitments.main_inv = commitment_key->commit(key->main_inv); + witness_commitments.main_l2_gas_op = commitment_key->commit(key->main_l2_gas_op); + witness_commitments.main_l2_gas_remaining = commitment_key->commit(key->main_l2_gas_remaining); + witness_commitments.main_l2_out_of_gas = commitment_key->commit(key->main_l2_out_of_gas); + witness_commitments.main_last = commitment_key->commit(key->main_last); + witness_commitments.main_mem_idx_a = commitment_key->commit(key->main_mem_idx_a); + witness_commitments.main_mem_idx_b = commitment_key->commit(key->main_mem_idx_b); + witness_commitments.main_mem_idx_c = commitment_key->commit(key->main_mem_idx_c); + witness_commitments.main_mem_idx_d = commitment_key->commit(key->main_mem_idx_d); + witness_commitments.main_mem_op_a = commitment_key->commit(key->main_mem_op_a); + witness_commitments.main_mem_op_activate_gas = commitment_key->commit(key->main_mem_op_activate_gas); + witness_commitments.main_mem_op_b = commitment_key->commit(key->main_mem_op_b); + witness_commitments.main_mem_op_c = commitment_key->commit(key->main_mem_op_c); + witness_commitments.main_mem_op_d = commitment_key->commit(key->main_mem_op_d); + witness_commitments.main_op_err = commitment_key->commit(key->main_op_err); + witness_commitments.main_opcode_val = commitment_key->commit(key->main_opcode_val); + witness_commitments.main_pc = commitment_key->commit(key->main_pc); + witness_commitments.main_q_kernel_lookup = commitment_key->commit(key->main_q_kernel_lookup); + witness_commitments.main_q_kernel_output_lookup = commitment_key->commit(key->main_q_kernel_output_lookup); + witness_commitments.main_r_in_tag = commitment_key->commit(key->main_r_in_tag); + witness_commitments.main_rwa = commitment_key->commit(key->main_rwa); + witness_commitments.main_rwb = commitment_key->commit(key->main_rwb); + witness_commitments.main_rwc = commitment_key->commit(key->main_rwc); + witness_commitments.main_rwd = commitment_key->commit(key->main_rwd); + witness_commitments.main_sel_cmov = commitment_key->commit(key->main_sel_cmov); + witness_commitments.main_sel_external_call = commitment_key->commit(key->main_sel_external_call); + witness_commitments.main_sel_halt = commitment_key->commit(key->main_sel_halt); + witness_commitments.main_sel_internal_call = commitment_key->commit(key->main_sel_internal_call); + witness_commitments.main_sel_internal_return = commitment_key->commit(key->main_sel_internal_return); + witness_commitments.main_sel_jump = commitment_key->commit(key->main_sel_jump); + witness_commitments.main_sel_jumpi = commitment_key->commit(key->main_sel_jumpi); + witness_commitments.main_sel_mov = commitment_key->commit(key->main_sel_mov); + witness_commitments.main_sel_mov_a = commitment_key->commit(key->main_sel_mov_a); + witness_commitments.main_sel_mov_b = commitment_key->commit(key->main_sel_mov_b); + witness_commitments.main_sel_op_add = commitment_key->commit(key->main_sel_op_add); + witness_commitments.main_sel_op_address = commitment_key->commit(key->main_sel_op_address); + witness_commitments.main_sel_op_and = commitment_key->commit(key->main_sel_op_and); + witness_commitments.main_sel_op_block_number = commitment_key->commit(key->main_sel_op_block_number); + witness_commitments.main_sel_op_cast = commitment_key->commit(key->main_sel_op_cast); + witness_commitments.main_sel_op_chain_id = commitment_key->commit(key->main_sel_op_chain_id); + witness_commitments.main_sel_op_coinbase = commitment_key->commit(key->main_sel_op_coinbase); + witness_commitments.main_sel_op_dagasleft = commitment_key->commit(key->main_sel_op_dagasleft); + witness_commitments.main_sel_op_div = commitment_key->commit(key->main_sel_op_div); + witness_commitments.main_sel_op_emit_l2_to_l1_msg = commitment_key->commit(key->main_sel_op_emit_l2_to_l1_msg); + witness_commitments.main_sel_op_emit_note_hash = commitment_key->commit(key->main_sel_op_emit_note_hash); + witness_commitments.main_sel_op_emit_nullifier = commitment_key->commit(key->main_sel_op_emit_nullifier); + witness_commitments.main_sel_op_emit_unencrypted_log = + commitment_key->commit(key->main_sel_op_emit_unencrypted_log); + witness_commitments.main_sel_op_eq = commitment_key->commit(key->main_sel_op_eq); + witness_commitments.main_sel_op_fdiv = commitment_key->commit(key->main_sel_op_fdiv); + witness_commitments.main_sel_op_fee_per_da_gas = commitment_key->commit(key->main_sel_op_fee_per_da_gas); + witness_commitments.main_sel_op_fee_per_l2_gas = commitment_key->commit(key->main_sel_op_fee_per_l2_gas); + witness_commitments.main_sel_op_get_contract_instance = + commitment_key->commit(key->main_sel_op_get_contract_instance); + witness_commitments.main_sel_op_keccak = commitment_key->commit(key->main_sel_op_keccak); + witness_commitments.main_sel_op_l1_to_l2_msg_exists = commitment_key->commit(key->main_sel_op_l1_to_l2_msg_exists); + witness_commitments.main_sel_op_l2gasleft = commitment_key->commit(key->main_sel_op_l2gasleft); + witness_commitments.main_sel_op_lt = commitment_key->commit(key->main_sel_op_lt); + witness_commitments.main_sel_op_lte = commitment_key->commit(key->main_sel_op_lte); + witness_commitments.main_sel_op_mul = commitment_key->commit(key->main_sel_op_mul); + witness_commitments.main_sel_op_not = commitment_key->commit(key->main_sel_op_not); + witness_commitments.main_sel_op_note_hash_exists = commitment_key->commit(key->main_sel_op_note_hash_exists); + witness_commitments.main_sel_op_nullifier_exists = commitment_key->commit(key->main_sel_op_nullifier_exists); + witness_commitments.main_sel_op_or = commitment_key->commit(key->main_sel_op_or); + witness_commitments.main_sel_op_pedersen = commitment_key->commit(key->main_sel_op_pedersen); + witness_commitments.main_sel_op_poseidon2 = commitment_key->commit(key->main_sel_op_poseidon2); + witness_commitments.main_sel_op_radix_le = commitment_key->commit(key->main_sel_op_radix_le); + witness_commitments.main_sel_op_sender = commitment_key->commit(key->main_sel_op_sender); + witness_commitments.main_sel_op_sha256 = commitment_key->commit(key->main_sel_op_sha256); + witness_commitments.main_sel_op_shl = commitment_key->commit(key->main_sel_op_shl); + witness_commitments.main_sel_op_shr = commitment_key->commit(key->main_sel_op_shr); + witness_commitments.main_sel_op_sload = commitment_key->commit(key->main_sel_op_sload); + witness_commitments.main_sel_op_sstore = commitment_key->commit(key->main_sel_op_sstore); + witness_commitments.main_sel_op_storage_address = commitment_key->commit(key->main_sel_op_storage_address); + witness_commitments.main_sel_op_sub = commitment_key->commit(key->main_sel_op_sub); + witness_commitments.main_sel_op_timestamp = commitment_key->commit(key->main_sel_op_timestamp); + witness_commitments.main_sel_op_transaction_fee = commitment_key->commit(key->main_sel_op_transaction_fee); + witness_commitments.main_sel_op_version = commitment_key->commit(key->main_sel_op_version); + witness_commitments.main_sel_op_xor = commitment_key->commit(key->main_sel_op_xor); + witness_commitments.main_sel_rng_16 = commitment_key->commit(key->main_sel_rng_16); + witness_commitments.main_sel_rng_8 = commitment_key->commit(key->main_sel_rng_8); + witness_commitments.main_space_id = commitment_key->commit(key->main_space_id); + witness_commitments.main_table_pow_2 = commitment_key->commit(key->main_table_pow_2); + witness_commitments.main_tag_err = commitment_key->commit(key->main_tag_err); + witness_commitments.main_w_in_tag = commitment_key->commit(key->main_w_in_tag); + witness_commitments.mem_addr = commitment_key->commit(key->mem_addr); + witness_commitments.mem_clk = commitment_key->commit(key->mem_clk); + witness_commitments.mem_diff_hi = commitment_key->commit(key->mem_diff_hi); + witness_commitments.mem_diff_lo = commitment_key->commit(key->mem_diff_lo); + witness_commitments.mem_diff_mid = commitment_key->commit(key->mem_diff_mid); + witness_commitments.mem_glob_addr = commitment_key->commit(key->mem_glob_addr); + witness_commitments.mem_ind_op_a = commitment_key->commit(key->mem_ind_op_a); + witness_commitments.mem_ind_op_b = commitment_key->commit(key->mem_ind_op_b); + witness_commitments.mem_ind_op_c = commitment_key->commit(key->mem_ind_op_c); + witness_commitments.mem_ind_op_d = commitment_key->commit(key->mem_ind_op_d); + witness_commitments.mem_last = commitment_key->commit(key->mem_last); + witness_commitments.mem_lastAccess = commitment_key->commit(key->mem_lastAccess); + witness_commitments.mem_mem_sel = commitment_key->commit(key->mem_mem_sel); + witness_commitments.mem_one_min_inv = commitment_key->commit(key->mem_one_min_inv); + witness_commitments.mem_op_a = commitment_key->commit(key->mem_op_a); + witness_commitments.mem_op_b = commitment_key->commit(key->mem_op_b); + witness_commitments.mem_op_c = commitment_key->commit(key->mem_op_c); + witness_commitments.mem_op_d = commitment_key->commit(key->mem_op_d); + witness_commitments.mem_r_in_tag = commitment_key->commit(key->mem_r_in_tag); + witness_commitments.mem_rng_chk_sel = commitment_key->commit(key->mem_rng_chk_sel); + witness_commitments.mem_rw = commitment_key->commit(key->mem_rw); + witness_commitments.mem_sel_cmov = commitment_key->commit(key->mem_sel_cmov); + witness_commitments.mem_sel_mov_a = commitment_key->commit(key->mem_sel_mov_a); + witness_commitments.mem_sel_mov_b = commitment_key->commit(key->mem_sel_mov_b); + witness_commitments.mem_skip_check_tag = commitment_key->commit(key->mem_skip_check_tag); + witness_commitments.mem_space_id = commitment_key->commit(key->mem_space_id); + witness_commitments.mem_tag = commitment_key->commit(key->mem_tag); + witness_commitments.mem_tag_err = commitment_key->commit(key->mem_tag_err); + witness_commitments.mem_tsp = commitment_key->commit(key->mem_tsp); + witness_commitments.mem_val = commitment_key->commit(key->mem_val); + witness_commitments.mem_w_in_tag = commitment_key->commit(key->mem_w_in_tag); + witness_commitments.pedersen_clk = commitment_key->commit(key->pedersen_clk); + witness_commitments.pedersen_input = commitment_key->commit(key->pedersen_input); + witness_commitments.pedersen_output = commitment_key->commit(key->pedersen_output); + witness_commitments.pedersen_pedersen_sel = commitment_key->commit(key->pedersen_pedersen_sel); + witness_commitments.poseidon2_clk = commitment_key->commit(key->poseidon2_clk); + witness_commitments.poseidon2_input = commitment_key->commit(key->poseidon2_input); + witness_commitments.poseidon2_output = commitment_key->commit(key->poseidon2_output); + witness_commitments.poseidon2_poseidon_perm_sel = commitment_key->commit(key->poseidon2_poseidon_perm_sel); + witness_commitments.sha256_clk = commitment_key->commit(key->sha256_clk); + witness_commitments.sha256_input = commitment_key->commit(key->sha256_input); + witness_commitments.sha256_output = commitment_key->commit(key->sha256_output); + witness_commitments.sha256_sha256_compression_sel = commitment_key->commit(key->sha256_sha256_compression_sel); + witness_commitments.sha256_state = commitment_key->commit(key->sha256_state); witness_commitments.lookup_byte_lengths_counts = commitment_key->commit(key->lookup_byte_lengths_counts); witness_commitments.lookup_byte_operations_counts = commitment_key->commit(key->lookup_byte_operations_counts); witness_commitments.lookup_opcode_gas_counts = commitment_key->commit(key->lookup_opcode_gas_counts); @@ -409,372 +402,341 @@ void AvmProver::execute_wire_commitments_round() witness_commitments.lookup_div_u16_7_counts = commitment_key->commit(key->lookup_div_u16_7_counts); // Send all commitments to the verifier - transcript->send_to_verifier(commitment_labels.avm_alu_a_hi, witness_commitments.avm_alu_a_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_a_lo, witness_commitments.avm_alu_a_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_alu_sel, witness_commitments.avm_alu_alu_sel); - transcript->send_to_verifier(commitment_labels.avm_alu_b_hi, witness_commitments.avm_alu_b_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_b_lo, witness_commitments.avm_alu_b_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_borrow, witness_commitments.avm_alu_borrow); - transcript->send_to_verifier(commitment_labels.avm_alu_cf, witness_commitments.avm_alu_cf); - transcript->send_to_verifier(commitment_labels.avm_alu_clk, witness_commitments.avm_alu_clk); - transcript->send_to_verifier(commitment_labels.avm_alu_cmp_rng_ctr, witness_commitments.avm_alu_cmp_rng_ctr); - transcript->send_to_verifier(commitment_labels.avm_alu_cmp_sel, witness_commitments.avm_alu_cmp_sel); - transcript->send_to_verifier(commitment_labels.avm_alu_div_rng_chk_selector, - witness_commitments.avm_alu_div_rng_chk_selector); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r0, witness_commitments.avm_alu_div_u16_r0); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r1, witness_commitments.avm_alu_div_u16_r1); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r2, witness_commitments.avm_alu_div_u16_r2); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r3, witness_commitments.avm_alu_div_u16_r3); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r4, witness_commitments.avm_alu_div_u16_r4); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r5, witness_commitments.avm_alu_div_u16_r5); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r6, witness_commitments.avm_alu_div_u16_r6); - transcript->send_to_verifier(commitment_labels.avm_alu_div_u16_r7, witness_commitments.avm_alu_div_u16_r7); - transcript->send_to_verifier(commitment_labels.avm_alu_divisor_hi, witness_commitments.avm_alu_divisor_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_divisor_lo, witness_commitments.avm_alu_divisor_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_ff_tag, witness_commitments.avm_alu_ff_tag); - transcript->send_to_verifier(commitment_labels.avm_alu_ia, witness_commitments.avm_alu_ia); - transcript->send_to_verifier(commitment_labels.avm_alu_ib, witness_commitments.avm_alu_ib); - transcript->send_to_verifier(commitment_labels.avm_alu_ic, witness_commitments.avm_alu_ic); - transcript->send_to_verifier(commitment_labels.avm_alu_in_tag, witness_commitments.avm_alu_in_tag); - transcript->send_to_verifier(commitment_labels.avm_alu_op_add, witness_commitments.avm_alu_op_add); - transcript->send_to_verifier(commitment_labels.avm_alu_op_cast, witness_commitments.avm_alu_op_cast); - transcript->send_to_verifier(commitment_labels.avm_alu_op_cast_prev, witness_commitments.avm_alu_op_cast_prev); - transcript->send_to_verifier(commitment_labels.avm_alu_op_div, witness_commitments.avm_alu_op_div); - transcript->send_to_verifier(commitment_labels.avm_alu_op_div_a_lt_b, witness_commitments.avm_alu_op_div_a_lt_b); - transcript->send_to_verifier(commitment_labels.avm_alu_op_div_std, witness_commitments.avm_alu_op_div_std); - transcript->send_to_verifier(commitment_labels.avm_alu_op_eq, witness_commitments.avm_alu_op_eq); - transcript->send_to_verifier(commitment_labels.avm_alu_op_eq_diff_inv, witness_commitments.avm_alu_op_eq_diff_inv); - transcript->send_to_verifier(commitment_labels.avm_alu_op_lt, witness_commitments.avm_alu_op_lt); - transcript->send_to_verifier(commitment_labels.avm_alu_op_lte, witness_commitments.avm_alu_op_lte); - transcript->send_to_verifier(commitment_labels.avm_alu_op_mul, witness_commitments.avm_alu_op_mul); - transcript->send_to_verifier(commitment_labels.avm_alu_op_not, witness_commitments.avm_alu_op_not); - transcript->send_to_verifier(commitment_labels.avm_alu_op_shl, witness_commitments.avm_alu_op_shl); - transcript->send_to_verifier(commitment_labels.avm_alu_op_shr, witness_commitments.avm_alu_op_shr); - transcript->send_to_verifier(commitment_labels.avm_alu_op_sub, witness_commitments.avm_alu_op_sub); - transcript->send_to_verifier(commitment_labels.avm_alu_p_a_borrow, witness_commitments.avm_alu_p_a_borrow); - transcript->send_to_verifier(commitment_labels.avm_alu_p_b_borrow, witness_commitments.avm_alu_p_b_borrow); - transcript->send_to_verifier(commitment_labels.avm_alu_p_sub_a_hi, witness_commitments.avm_alu_p_sub_a_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_p_sub_a_lo, witness_commitments.avm_alu_p_sub_a_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_p_sub_b_hi, witness_commitments.avm_alu_p_sub_b_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_p_sub_b_lo, witness_commitments.avm_alu_p_sub_b_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_partial_prod_hi, - witness_commitments.avm_alu_partial_prod_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_partial_prod_lo, - witness_commitments.avm_alu_partial_prod_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_quotient_hi, witness_commitments.avm_alu_quotient_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_quotient_lo, witness_commitments.avm_alu_quotient_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_remainder, witness_commitments.avm_alu_remainder); - transcript->send_to_verifier(commitment_labels.avm_alu_res_hi, witness_commitments.avm_alu_res_hi); - transcript->send_to_verifier(commitment_labels.avm_alu_res_lo, witness_commitments.avm_alu_res_lo); - transcript->send_to_verifier(commitment_labels.avm_alu_rng_chk_lookup_selector, - witness_commitments.avm_alu_rng_chk_lookup_selector); - transcript->send_to_verifier(commitment_labels.avm_alu_rng_chk_sel, witness_commitments.avm_alu_rng_chk_sel); - transcript->send_to_verifier(commitment_labels.avm_alu_shift_lt_bit_len, - witness_commitments.avm_alu_shift_lt_bit_len); - transcript->send_to_verifier(commitment_labels.avm_alu_shift_sel, witness_commitments.avm_alu_shift_sel); - transcript->send_to_verifier(commitment_labels.avm_alu_t_sub_s_bits, witness_commitments.avm_alu_t_sub_s_bits); - transcript->send_to_verifier(commitment_labels.avm_alu_two_pow_s, witness_commitments.avm_alu_two_pow_s); - transcript->send_to_verifier(commitment_labels.avm_alu_two_pow_t_sub_s, - witness_commitments.avm_alu_two_pow_t_sub_s); - transcript->send_to_verifier(commitment_labels.avm_alu_u128_tag, witness_commitments.avm_alu_u128_tag); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r0, witness_commitments.avm_alu_u16_r0); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r1, witness_commitments.avm_alu_u16_r1); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r10, witness_commitments.avm_alu_u16_r10); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r11, witness_commitments.avm_alu_u16_r11); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r12, witness_commitments.avm_alu_u16_r12); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r13, witness_commitments.avm_alu_u16_r13); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r14, witness_commitments.avm_alu_u16_r14); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r2, witness_commitments.avm_alu_u16_r2); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r3, witness_commitments.avm_alu_u16_r3); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r4, witness_commitments.avm_alu_u16_r4); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r5, witness_commitments.avm_alu_u16_r5); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r6, witness_commitments.avm_alu_u16_r6); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r7, witness_commitments.avm_alu_u16_r7); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r8, witness_commitments.avm_alu_u16_r8); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_r9, witness_commitments.avm_alu_u16_r9); - transcript->send_to_verifier(commitment_labels.avm_alu_u16_tag, witness_commitments.avm_alu_u16_tag); - transcript->send_to_verifier(commitment_labels.avm_alu_u32_tag, witness_commitments.avm_alu_u32_tag); - transcript->send_to_verifier(commitment_labels.avm_alu_u64_tag, witness_commitments.avm_alu_u64_tag); - transcript->send_to_verifier(commitment_labels.avm_alu_u8_r0, witness_commitments.avm_alu_u8_r0); - transcript->send_to_verifier(commitment_labels.avm_alu_u8_r1, witness_commitments.avm_alu_u8_r1); - transcript->send_to_verifier(commitment_labels.avm_alu_u8_tag, witness_commitments.avm_alu_u8_tag); - transcript->send_to_verifier(commitment_labels.avm_binary_acc_ia, witness_commitments.avm_binary_acc_ia); - transcript->send_to_verifier(commitment_labels.avm_binary_acc_ib, witness_commitments.avm_binary_acc_ib); - transcript->send_to_verifier(commitment_labels.avm_binary_acc_ic, witness_commitments.avm_binary_acc_ic); - transcript->send_to_verifier(commitment_labels.avm_binary_bin_sel, witness_commitments.avm_binary_bin_sel); - transcript->send_to_verifier(commitment_labels.avm_binary_clk, witness_commitments.avm_binary_clk); - transcript->send_to_verifier(commitment_labels.avm_binary_ia_bytes, witness_commitments.avm_binary_ia_bytes); - transcript->send_to_verifier(commitment_labels.avm_binary_ib_bytes, witness_commitments.avm_binary_ib_bytes); - transcript->send_to_verifier(commitment_labels.avm_binary_ic_bytes, witness_commitments.avm_binary_ic_bytes); - transcript->send_to_verifier(commitment_labels.avm_binary_in_tag, witness_commitments.avm_binary_in_tag); - transcript->send_to_verifier(commitment_labels.avm_binary_mem_tag_ctr, witness_commitments.avm_binary_mem_tag_ctr); - transcript->send_to_verifier(commitment_labels.avm_binary_mem_tag_ctr_inv, - witness_commitments.avm_binary_mem_tag_ctr_inv); - transcript->send_to_verifier(commitment_labels.avm_binary_op_id, witness_commitments.avm_binary_op_id); - transcript->send_to_verifier(commitment_labels.avm_binary_start, witness_commitments.avm_binary_start); - transcript->send_to_verifier(commitment_labels.avm_byte_lookup_bin_sel, - witness_commitments.avm_byte_lookup_bin_sel); - transcript->send_to_verifier(commitment_labels.avm_byte_lookup_table_byte_lengths, - witness_commitments.avm_byte_lookup_table_byte_lengths); - transcript->send_to_verifier(commitment_labels.avm_byte_lookup_table_in_tags, - witness_commitments.avm_byte_lookup_table_in_tags); - transcript->send_to_verifier(commitment_labels.avm_byte_lookup_table_input_a, - witness_commitments.avm_byte_lookup_table_input_a); - transcript->send_to_verifier(commitment_labels.avm_byte_lookup_table_input_b, - witness_commitments.avm_byte_lookup_table_input_b); - transcript->send_to_verifier(commitment_labels.avm_byte_lookup_table_op_id, - witness_commitments.avm_byte_lookup_table_op_id); - transcript->send_to_verifier(commitment_labels.avm_byte_lookup_table_output, - witness_commitments.avm_byte_lookup_table_output); - transcript->send_to_verifier(commitment_labels.avm_conversion_clk, witness_commitments.avm_conversion_clk); - transcript->send_to_verifier(commitment_labels.avm_conversion_input, witness_commitments.avm_conversion_input); - transcript->send_to_verifier(commitment_labels.avm_conversion_num_limbs, - witness_commitments.avm_conversion_num_limbs); - transcript->send_to_verifier(commitment_labels.avm_conversion_radix, witness_commitments.avm_conversion_radix); - transcript->send_to_verifier(commitment_labels.avm_conversion_to_radix_le_sel, - witness_commitments.avm_conversion_to_radix_le_sel); - transcript->send_to_verifier(commitment_labels.avm_gas_da_gas_fixed_table, - witness_commitments.avm_gas_da_gas_fixed_table); - transcript->send_to_verifier(commitment_labels.avm_gas_gas_cost_sel, witness_commitments.avm_gas_gas_cost_sel); - transcript->send_to_verifier(commitment_labels.avm_gas_l2_gas_fixed_table, - witness_commitments.avm_gas_l2_gas_fixed_table); - transcript->send_to_verifier(commitment_labels.avm_keccakf1600_clk, witness_commitments.avm_keccakf1600_clk); - transcript->send_to_verifier(commitment_labels.avm_keccakf1600_input, witness_commitments.avm_keccakf1600_input); - transcript->send_to_verifier(commitment_labels.avm_keccakf1600_keccakf1600_sel, - witness_commitments.avm_keccakf1600_keccakf1600_sel); - transcript->send_to_verifier(commitment_labels.avm_keccakf1600_output, witness_commitments.avm_keccakf1600_output); - transcript->send_to_verifier(commitment_labels.avm_kernel_emit_l2_to_l1_msg_write_offset, - witness_commitments.avm_kernel_emit_l2_to_l1_msg_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_emit_note_hash_write_offset, - witness_commitments.avm_kernel_emit_note_hash_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_emit_nullifier_write_offset, - witness_commitments.avm_kernel_emit_nullifier_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_emit_unencrypted_log_write_offset, - witness_commitments.avm_kernel_emit_unencrypted_log_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_kernel_in_offset, - witness_commitments.avm_kernel_kernel_in_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_kernel_inputs, - witness_commitments.avm_kernel_kernel_inputs); - transcript->send_to_verifier(commitment_labels.avm_kernel_kernel_metadata_out, - witness_commitments.avm_kernel_kernel_metadata_out); - transcript->send_to_verifier(commitment_labels.avm_kernel_kernel_out_offset, - witness_commitments.avm_kernel_kernel_out_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_kernel_side_effect_out, - witness_commitments.avm_kernel_kernel_side_effect_out); - transcript->send_to_verifier(commitment_labels.avm_kernel_kernel_value_out, - witness_commitments.avm_kernel_kernel_value_out); - transcript->send_to_verifier(commitment_labels.avm_kernel_l1_to_l2_msg_exists_write_offset, - witness_commitments.avm_kernel_l1_to_l2_msg_exists_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_note_hash_exist_write_offset, - witness_commitments.avm_kernel_note_hash_exist_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_nullifier_exists_write_offset, - witness_commitments.avm_kernel_nullifier_exists_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_nullifier_non_exists_write_offset, - witness_commitments.avm_kernel_nullifier_non_exists_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_q_public_input_kernel_add_to_table, - witness_commitments.avm_kernel_q_public_input_kernel_add_to_table); - transcript->send_to_verifier(commitment_labels.avm_kernel_q_public_input_kernel_out_add_to_table, - witness_commitments.avm_kernel_q_public_input_kernel_out_add_to_table); - transcript->send_to_verifier(commitment_labels.avm_kernel_side_effect_counter, - witness_commitments.avm_kernel_side_effect_counter); - transcript->send_to_verifier(commitment_labels.avm_kernel_sload_write_offset, - witness_commitments.avm_kernel_sload_write_offset); - transcript->send_to_verifier(commitment_labels.avm_kernel_sstore_write_offset, - witness_commitments.avm_kernel_sstore_write_offset); - transcript->send_to_verifier(commitment_labels.avm_main_abs_da_rem_gas_hi, - witness_commitments.avm_main_abs_da_rem_gas_hi); - transcript->send_to_verifier(commitment_labels.avm_main_abs_da_rem_gas_lo, - witness_commitments.avm_main_abs_da_rem_gas_lo); - transcript->send_to_verifier(commitment_labels.avm_main_abs_l2_rem_gas_hi, - witness_commitments.avm_main_abs_l2_rem_gas_hi); - transcript->send_to_verifier(commitment_labels.avm_main_abs_l2_rem_gas_lo, - witness_commitments.avm_main_abs_l2_rem_gas_lo); - transcript->send_to_verifier(commitment_labels.avm_main_alu_in_tag, witness_commitments.avm_main_alu_in_tag); - transcript->send_to_verifier(commitment_labels.avm_main_alu_sel, witness_commitments.avm_main_alu_sel); - transcript->send_to_verifier(commitment_labels.avm_main_bin_op_id, witness_commitments.avm_main_bin_op_id); - transcript->send_to_verifier(commitment_labels.avm_main_bin_sel, witness_commitments.avm_main_bin_sel); - transcript->send_to_verifier(commitment_labels.avm_main_call_ptr, witness_commitments.avm_main_call_ptr); - transcript->send_to_verifier(commitment_labels.avm_main_da_gas_op, witness_commitments.avm_main_da_gas_op); - transcript->send_to_verifier(commitment_labels.avm_main_da_gas_remaining, - witness_commitments.avm_main_da_gas_remaining); - transcript->send_to_verifier(commitment_labels.avm_main_da_out_of_gas, witness_commitments.avm_main_da_out_of_gas); - transcript->send_to_verifier(commitment_labels.avm_main_gas_cost_active, - witness_commitments.avm_main_gas_cost_active); - transcript->send_to_verifier(commitment_labels.avm_main_ia, witness_commitments.avm_main_ia); - transcript->send_to_verifier(commitment_labels.avm_main_ib, witness_commitments.avm_main_ib); - transcript->send_to_verifier(commitment_labels.avm_main_ic, witness_commitments.avm_main_ic); - transcript->send_to_verifier(commitment_labels.avm_main_id, witness_commitments.avm_main_id); - transcript->send_to_verifier(commitment_labels.avm_main_id_zero, witness_commitments.avm_main_id_zero); - transcript->send_to_verifier(commitment_labels.avm_main_ind_a, witness_commitments.avm_main_ind_a); - transcript->send_to_verifier(commitment_labels.avm_main_ind_b, witness_commitments.avm_main_ind_b); - transcript->send_to_verifier(commitment_labels.avm_main_ind_c, witness_commitments.avm_main_ind_c); - transcript->send_to_verifier(commitment_labels.avm_main_ind_d, witness_commitments.avm_main_ind_d); - transcript->send_to_verifier(commitment_labels.avm_main_ind_op_a, witness_commitments.avm_main_ind_op_a); - transcript->send_to_verifier(commitment_labels.avm_main_ind_op_b, witness_commitments.avm_main_ind_op_b); - transcript->send_to_verifier(commitment_labels.avm_main_ind_op_c, witness_commitments.avm_main_ind_op_c); - transcript->send_to_verifier(commitment_labels.avm_main_ind_op_d, witness_commitments.avm_main_ind_op_d); - transcript->send_to_verifier(commitment_labels.avm_main_internal_return_ptr, - witness_commitments.avm_main_internal_return_ptr); - transcript->send_to_verifier(commitment_labels.avm_main_inv, witness_commitments.avm_main_inv); - transcript->send_to_verifier(commitment_labels.avm_main_l2_gas_op, witness_commitments.avm_main_l2_gas_op); - transcript->send_to_verifier(commitment_labels.avm_main_l2_gas_remaining, - witness_commitments.avm_main_l2_gas_remaining); - transcript->send_to_verifier(commitment_labels.avm_main_l2_out_of_gas, witness_commitments.avm_main_l2_out_of_gas); - transcript->send_to_verifier(commitment_labels.avm_main_last, witness_commitments.avm_main_last); - transcript->send_to_verifier(commitment_labels.avm_main_mem_idx_a, witness_commitments.avm_main_mem_idx_a); - transcript->send_to_verifier(commitment_labels.avm_main_mem_idx_b, witness_commitments.avm_main_mem_idx_b); - transcript->send_to_verifier(commitment_labels.avm_main_mem_idx_c, witness_commitments.avm_main_mem_idx_c); - transcript->send_to_verifier(commitment_labels.avm_main_mem_idx_d, witness_commitments.avm_main_mem_idx_d); - transcript->send_to_verifier(commitment_labels.avm_main_mem_op_a, witness_commitments.avm_main_mem_op_a); - transcript->send_to_verifier(commitment_labels.avm_main_mem_op_activate_gas, - witness_commitments.avm_main_mem_op_activate_gas); - transcript->send_to_verifier(commitment_labels.avm_main_mem_op_b, witness_commitments.avm_main_mem_op_b); - transcript->send_to_verifier(commitment_labels.avm_main_mem_op_c, witness_commitments.avm_main_mem_op_c); - transcript->send_to_verifier(commitment_labels.avm_main_mem_op_d, witness_commitments.avm_main_mem_op_d); - transcript->send_to_verifier(commitment_labels.avm_main_op_err, witness_commitments.avm_main_op_err); - transcript->send_to_verifier(commitment_labels.avm_main_opcode_val, witness_commitments.avm_main_opcode_val); - transcript->send_to_verifier(commitment_labels.avm_main_pc, witness_commitments.avm_main_pc); - transcript->send_to_verifier(commitment_labels.avm_main_q_kernel_lookup, - witness_commitments.avm_main_q_kernel_lookup); - transcript->send_to_verifier(commitment_labels.avm_main_q_kernel_output_lookup, - witness_commitments.avm_main_q_kernel_output_lookup); - transcript->send_to_verifier(commitment_labels.avm_main_r_in_tag, witness_commitments.avm_main_r_in_tag); - transcript->send_to_verifier(commitment_labels.avm_main_rwa, witness_commitments.avm_main_rwa); - transcript->send_to_verifier(commitment_labels.avm_main_rwb, witness_commitments.avm_main_rwb); - transcript->send_to_verifier(commitment_labels.avm_main_rwc, witness_commitments.avm_main_rwc); - transcript->send_to_verifier(commitment_labels.avm_main_rwd, witness_commitments.avm_main_rwd); - transcript->send_to_verifier(commitment_labels.avm_main_sel_cmov, witness_commitments.avm_main_sel_cmov); - transcript->send_to_verifier(commitment_labels.avm_main_sel_external_call, - witness_commitments.avm_main_sel_external_call); - transcript->send_to_verifier(commitment_labels.avm_main_sel_halt, witness_commitments.avm_main_sel_halt); - transcript->send_to_verifier(commitment_labels.avm_main_sel_internal_call, - witness_commitments.avm_main_sel_internal_call); - transcript->send_to_verifier(commitment_labels.avm_main_sel_internal_return, - witness_commitments.avm_main_sel_internal_return); - transcript->send_to_verifier(commitment_labels.avm_main_sel_jump, witness_commitments.avm_main_sel_jump); - transcript->send_to_verifier(commitment_labels.avm_main_sel_jumpi, witness_commitments.avm_main_sel_jumpi); - transcript->send_to_verifier(commitment_labels.avm_main_sel_mov, witness_commitments.avm_main_sel_mov); - transcript->send_to_verifier(commitment_labels.avm_main_sel_mov_a, witness_commitments.avm_main_sel_mov_a); - transcript->send_to_verifier(commitment_labels.avm_main_sel_mov_b, witness_commitments.avm_main_sel_mov_b); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_add, witness_commitments.avm_main_sel_op_add); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_address, - witness_commitments.avm_main_sel_op_address); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_and, witness_commitments.avm_main_sel_op_and); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_block_number, - witness_commitments.avm_main_sel_op_block_number); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_cast, witness_commitments.avm_main_sel_op_cast); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_chain_id, - witness_commitments.avm_main_sel_op_chain_id); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_coinbase, - witness_commitments.avm_main_sel_op_coinbase); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_dagasleft, - witness_commitments.avm_main_sel_op_dagasleft); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_div, witness_commitments.avm_main_sel_op_div); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_emit_l2_to_l1_msg, - witness_commitments.avm_main_sel_op_emit_l2_to_l1_msg); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_emit_note_hash, - witness_commitments.avm_main_sel_op_emit_note_hash); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_emit_nullifier, - witness_commitments.avm_main_sel_op_emit_nullifier); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_emit_unencrypted_log, - witness_commitments.avm_main_sel_op_emit_unencrypted_log); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_eq, witness_commitments.avm_main_sel_op_eq); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_fdiv, witness_commitments.avm_main_sel_op_fdiv); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_fee_per_da_gas, - witness_commitments.avm_main_sel_op_fee_per_da_gas); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_fee_per_l2_gas, - witness_commitments.avm_main_sel_op_fee_per_l2_gas); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_get_contract_instance, - witness_commitments.avm_main_sel_op_get_contract_instance); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_keccak, witness_commitments.avm_main_sel_op_keccak); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_l1_to_l2_msg_exists, - witness_commitments.avm_main_sel_op_l1_to_l2_msg_exists); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_l2gasleft, - witness_commitments.avm_main_sel_op_l2gasleft); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_lt, witness_commitments.avm_main_sel_op_lt); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_lte, witness_commitments.avm_main_sel_op_lte); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_mul, witness_commitments.avm_main_sel_op_mul); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_not, witness_commitments.avm_main_sel_op_not); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_note_hash_exists, - witness_commitments.avm_main_sel_op_note_hash_exists); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_nullifier_exists, - witness_commitments.avm_main_sel_op_nullifier_exists); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_or, witness_commitments.avm_main_sel_op_or); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_pedersen, - witness_commitments.avm_main_sel_op_pedersen); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_poseidon2, - witness_commitments.avm_main_sel_op_poseidon2); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_radix_le, - witness_commitments.avm_main_sel_op_radix_le); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_sender, witness_commitments.avm_main_sel_op_sender); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_sha256, witness_commitments.avm_main_sel_op_sha256); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_shl, witness_commitments.avm_main_sel_op_shl); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_shr, witness_commitments.avm_main_sel_op_shr); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_sload, witness_commitments.avm_main_sel_op_sload); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_sstore, witness_commitments.avm_main_sel_op_sstore); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_storage_address, - witness_commitments.avm_main_sel_op_storage_address); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_sub, witness_commitments.avm_main_sel_op_sub); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_timestamp, - witness_commitments.avm_main_sel_op_timestamp); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_transaction_fee, - witness_commitments.avm_main_sel_op_transaction_fee); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_version, - witness_commitments.avm_main_sel_op_version); - transcript->send_to_verifier(commitment_labels.avm_main_sel_op_xor, witness_commitments.avm_main_sel_op_xor); - transcript->send_to_verifier(commitment_labels.avm_main_sel_rng_16, witness_commitments.avm_main_sel_rng_16); - transcript->send_to_verifier(commitment_labels.avm_main_sel_rng_8, witness_commitments.avm_main_sel_rng_8); - transcript->send_to_verifier(commitment_labels.avm_main_space_id, witness_commitments.avm_main_space_id); - transcript->send_to_verifier(commitment_labels.avm_main_table_pow_2, witness_commitments.avm_main_table_pow_2); - transcript->send_to_verifier(commitment_labels.avm_main_tag_err, witness_commitments.avm_main_tag_err); - transcript->send_to_verifier(commitment_labels.avm_main_w_in_tag, witness_commitments.avm_main_w_in_tag); - transcript->send_to_verifier(commitment_labels.avm_mem_addr, witness_commitments.avm_mem_addr); - transcript->send_to_verifier(commitment_labels.avm_mem_clk, witness_commitments.avm_mem_clk); - transcript->send_to_verifier(commitment_labels.avm_mem_diff_hi, witness_commitments.avm_mem_diff_hi); - transcript->send_to_verifier(commitment_labels.avm_mem_diff_lo, witness_commitments.avm_mem_diff_lo); - transcript->send_to_verifier(commitment_labels.avm_mem_diff_mid, witness_commitments.avm_mem_diff_mid); - transcript->send_to_verifier(commitment_labels.avm_mem_glob_addr, witness_commitments.avm_mem_glob_addr); - transcript->send_to_verifier(commitment_labels.avm_mem_ind_op_a, witness_commitments.avm_mem_ind_op_a); - transcript->send_to_verifier(commitment_labels.avm_mem_ind_op_b, witness_commitments.avm_mem_ind_op_b); - transcript->send_to_verifier(commitment_labels.avm_mem_ind_op_c, witness_commitments.avm_mem_ind_op_c); - transcript->send_to_verifier(commitment_labels.avm_mem_ind_op_d, witness_commitments.avm_mem_ind_op_d); - transcript->send_to_verifier(commitment_labels.avm_mem_last, witness_commitments.avm_mem_last); - transcript->send_to_verifier(commitment_labels.avm_mem_lastAccess, witness_commitments.avm_mem_lastAccess); - transcript->send_to_verifier(commitment_labels.avm_mem_mem_sel, witness_commitments.avm_mem_mem_sel); - transcript->send_to_verifier(commitment_labels.avm_mem_one_min_inv, witness_commitments.avm_mem_one_min_inv); - transcript->send_to_verifier(commitment_labels.avm_mem_op_a, witness_commitments.avm_mem_op_a); - transcript->send_to_verifier(commitment_labels.avm_mem_op_b, witness_commitments.avm_mem_op_b); - transcript->send_to_verifier(commitment_labels.avm_mem_op_c, witness_commitments.avm_mem_op_c); - transcript->send_to_verifier(commitment_labels.avm_mem_op_d, witness_commitments.avm_mem_op_d); - transcript->send_to_verifier(commitment_labels.avm_mem_r_in_tag, witness_commitments.avm_mem_r_in_tag); - transcript->send_to_verifier(commitment_labels.avm_mem_rng_chk_sel, witness_commitments.avm_mem_rng_chk_sel); - transcript->send_to_verifier(commitment_labels.avm_mem_rw, witness_commitments.avm_mem_rw); - transcript->send_to_verifier(commitment_labels.avm_mem_sel_cmov, witness_commitments.avm_mem_sel_cmov); - transcript->send_to_verifier(commitment_labels.avm_mem_sel_mov_a, witness_commitments.avm_mem_sel_mov_a); - transcript->send_to_verifier(commitment_labels.avm_mem_sel_mov_b, witness_commitments.avm_mem_sel_mov_b); - transcript->send_to_verifier(commitment_labels.avm_mem_skip_check_tag, witness_commitments.avm_mem_skip_check_tag); - transcript->send_to_verifier(commitment_labels.avm_mem_space_id, witness_commitments.avm_mem_space_id); - transcript->send_to_verifier(commitment_labels.avm_mem_tag, witness_commitments.avm_mem_tag); - transcript->send_to_verifier(commitment_labels.avm_mem_tag_err, witness_commitments.avm_mem_tag_err); - transcript->send_to_verifier(commitment_labels.avm_mem_tsp, witness_commitments.avm_mem_tsp); - transcript->send_to_verifier(commitment_labels.avm_mem_val, witness_commitments.avm_mem_val); - transcript->send_to_verifier(commitment_labels.avm_mem_w_in_tag, witness_commitments.avm_mem_w_in_tag); - transcript->send_to_verifier(commitment_labels.avm_pedersen_clk, witness_commitments.avm_pedersen_clk); - transcript->send_to_verifier(commitment_labels.avm_pedersen_input, witness_commitments.avm_pedersen_input); - transcript->send_to_verifier(commitment_labels.avm_pedersen_output, witness_commitments.avm_pedersen_output); - transcript->send_to_verifier(commitment_labels.avm_pedersen_pedersen_sel, - witness_commitments.avm_pedersen_pedersen_sel); - transcript->send_to_verifier(commitment_labels.avm_poseidon2_clk, witness_commitments.avm_poseidon2_clk); - transcript->send_to_verifier(commitment_labels.avm_poseidon2_input, witness_commitments.avm_poseidon2_input); - transcript->send_to_verifier(commitment_labels.avm_poseidon2_output, witness_commitments.avm_poseidon2_output); - transcript->send_to_verifier(commitment_labels.avm_poseidon2_poseidon_perm_sel, - witness_commitments.avm_poseidon2_poseidon_perm_sel); - transcript->send_to_verifier(commitment_labels.avm_sha256_clk, witness_commitments.avm_sha256_clk); - transcript->send_to_verifier(commitment_labels.avm_sha256_input, witness_commitments.avm_sha256_input); - transcript->send_to_verifier(commitment_labels.avm_sha256_output, witness_commitments.avm_sha256_output); - transcript->send_to_verifier(commitment_labels.avm_sha256_sha256_compression_sel, - witness_commitments.avm_sha256_sha256_compression_sel); - transcript->send_to_verifier(commitment_labels.avm_sha256_state, witness_commitments.avm_sha256_state); + transcript->send_to_verifier(commitment_labels.alu_a_hi, witness_commitments.alu_a_hi); + transcript->send_to_verifier(commitment_labels.alu_a_lo, witness_commitments.alu_a_lo); + transcript->send_to_verifier(commitment_labels.alu_alu_sel, witness_commitments.alu_alu_sel); + transcript->send_to_verifier(commitment_labels.alu_b_hi, witness_commitments.alu_b_hi); + transcript->send_to_verifier(commitment_labels.alu_b_lo, witness_commitments.alu_b_lo); + transcript->send_to_verifier(commitment_labels.alu_borrow, witness_commitments.alu_borrow); + transcript->send_to_verifier(commitment_labels.alu_cf, witness_commitments.alu_cf); + transcript->send_to_verifier(commitment_labels.alu_clk, witness_commitments.alu_clk); + transcript->send_to_verifier(commitment_labels.alu_cmp_rng_ctr, witness_commitments.alu_cmp_rng_ctr); + transcript->send_to_verifier(commitment_labels.alu_cmp_sel, witness_commitments.alu_cmp_sel); + transcript->send_to_verifier(commitment_labels.alu_div_rng_chk_selector, + witness_commitments.alu_div_rng_chk_selector); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r0, witness_commitments.alu_div_u16_r0); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r1, witness_commitments.alu_div_u16_r1); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r2, witness_commitments.alu_div_u16_r2); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r3, witness_commitments.alu_div_u16_r3); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r4, witness_commitments.alu_div_u16_r4); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r5, witness_commitments.alu_div_u16_r5); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r6, witness_commitments.alu_div_u16_r6); + transcript->send_to_verifier(commitment_labels.alu_div_u16_r7, witness_commitments.alu_div_u16_r7); + transcript->send_to_verifier(commitment_labels.alu_divisor_hi, witness_commitments.alu_divisor_hi); + transcript->send_to_verifier(commitment_labels.alu_divisor_lo, witness_commitments.alu_divisor_lo); + transcript->send_to_verifier(commitment_labels.alu_ff_tag, witness_commitments.alu_ff_tag); + transcript->send_to_verifier(commitment_labels.alu_ia, witness_commitments.alu_ia); + transcript->send_to_verifier(commitment_labels.alu_ib, witness_commitments.alu_ib); + transcript->send_to_verifier(commitment_labels.alu_ic, witness_commitments.alu_ic); + transcript->send_to_verifier(commitment_labels.alu_in_tag, witness_commitments.alu_in_tag); + transcript->send_to_verifier(commitment_labels.alu_op_add, witness_commitments.alu_op_add); + transcript->send_to_verifier(commitment_labels.alu_op_cast, witness_commitments.alu_op_cast); + transcript->send_to_verifier(commitment_labels.alu_op_cast_prev, witness_commitments.alu_op_cast_prev); + transcript->send_to_verifier(commitment_labels.alu_op_div, witness_commitments.alu_op_div); + transcript->send_to_verifier(commitment_labels.alu_op_div_a_lt_b, witness_commitments.alu_op_div_a_lt_b); + transcript->send_to_verifier(commitment_labels.alu_op_div_std, witness_commitments.alu_op_div_std); + transcript->send_to_verifier(commitment_labels.alu_op_eq, witness_commitments.alu_op_eq); + transcript->send_to_verifier(commitment_labels.alu_op_eq_diff_inv, witness_commitments.alu_op_eq_diff_inv); + transcript->send_to_verifier(commitment_labels.alu_op_lt, witness_commitments.alu_op_lt); + transcript->send_to_verifier(commitment_labels.alu_op_lte, witness_commitments.alu_op_lte); + transcript->send_to_verifier(commitment_labels.alu_op_mul, witness_commitments.alu_op_mul); + transcript->send_to_verifier(commitment_labels.alu_op_not, witness_commitments.alu_op_not); + transcript->send_to_verifier(commitment_labels.alu_op_shl, witness_commitments.alu_op_shl); + transcript->send_to_verifier(commitment_labels.alu_op_shr, witness_commitments.alu_op_shr); + transcript->send_to_verifier(commitment_labels.alu_op_sub, witness_commitments.alu_op_sub); + transcript->send_to_verifier(commitment_labels.alu_p_a_borrow, witness_commitments.alu_p_a_borrow); + transcript->send_to_verifier(commitment_labels.alu_p_b_borrow, witness_commitments.alu_p_b_borrow); + transcript->send_to_verifier(commitment_labels.alu_p_sub_a_hi, witness_commitments.alu_p_sub_a_hi); + transcript->send_to_verifier(commitment_labels.alu_p_sub_a_lo, witness_commitments.alu_p_sub_a_lo); + transcript->send_to_verifier(commitment_labels.alu_p_sub_b_hi, witness_commitments.alu_p_sub_b_hi); + transcript->send_to_verifier(commitment_labels.alu_p_sub_b_lo, witness_commitments.alu_p_sub_b_lo); + transcript->send_to_verifier(commitment_labels.alu_partial_prod_hi, witness_commitments.alu_partial_prod_hi); + transcript->send_to_verifier(commitment_labels.alu_partial_prod_lo, witness_commitments.alu_partial_prod_lo); + transcript->send_to_verifier(commitment_labels.alu_quotient_hi, witness_commitments.alu_quotient_hi); + transcript->send_to_verifier(commitment_labels.alu_quotient_lo, witness_commitments.alu_quotient_lo); + transcript->send_to_verifier(commitment_labels.alu_remainder, witness_commitments.alu_remainder); + transcript->send_to_verifier(commitment_labels.alu_res_hi, witness_commitments.alu_res_hi); + transcript->send_to_verifier(commitment_labels.alu_res_lo, witness_commitments.alu_res_lo); + transcript->send_to_verifier(commitment_labels.alu_rng_chk_lookup_selector, + witness_commitments.alu_rng_chk_lookup_selector); + transcript->send_to_verifier(commitment_labels.alu_rng_chk_sel, witness_commitments.alu_rng_chk_sel); + transcript->send_to_verifier(commitment_labels.alu_shift_lt_bit_len, witness_commitments.alu_shift_lt_bit_len); + transcript->send_to_verifier(commitment_labels.alu_shift_sel, witness_commitments.alu_shift_sel); + transcript->send_to_verifier(commitment_labels.alu_t_sub_s_bits, witness_commitments.alu_t_sub_s_bits); + transcript->send_to_verifier(commitment_labels.alu_two_pow_s, witness_commitments.alu_two_pow_s); + transcript->send_to_verifier(commitment_labels.alu_two_pow_t_sub_s, witness_commitments.alu_two_pow_t_sub_s); + transcript->send_to_verifier(commitment_labels.alu_u128_tag, witness_commitments.alu_u128_tag); + transcript->send_to_verifier(commitment_labels.alu_u16_r0, witness_commitments.alu_u16_r0); + transcript->send_to_verifier(commitment_labels.alu_u16_r1, witness_commitments.alu_u16_r1); + transcript->send_to_verifier(commitment_labels.alu_u16_r10, witness_commitments.alu_u16_r10); + transcript->send_to_verifier(commitment_labels.alu_u16_r11, witness_commitments.alu_u16_r11); + transcript->send_to_verifier(commitment_labels.alu_u16_r12, witness_commitments.alu_u16_r12); + transcript->send_to_verifier(commitment_labels.alu_u16_r13, witness_commitments.alu_u16_r13); + transcript->send_to_verifier(commitment_labels.alu_u16_r14, witness_commitments.alu_u16_r14); + transcript->send_to_verifier(commitment_labels.alu_u16_r2, witness_commitments.alu_u16_r2); + transcript->send_to_verifier(commitment_labels.alu_u16_r3, witness_commitments.alu_u16_r3); + transcript->send_to_verifier(commitment_labels.alu_u16_r4, witness_commitments.alu_u16_r4); + transcript->send_to_verifier(commitment_labels.alu_u16_r5, witness_commitments.alu_u16_r5); + transcript->send_to_verifier(commitment_labels.alu_u16_r6, witness_commitments.alu_u16_r6); + transcript->send_to_verifier(commitment_labels.alu_u16_r7, witness_commitments.alu_u16_r7); + transcript->send_to_verifier(commitment_labels.alu_u16_r8, witness_commitments.alu_u16_r8); + transcript->send_to_verifier(commitment_labels.alu_u16_r9, witness_commitments.alu_u16_r9); + transcript->send_to_verifier(commitment_labels.alu_u16_tag, witness_commitments.alu_u16_tag); + transcript->send_to_verifier(commitment_labels.alu_u32_tag, witness_commitments.alu_u32_tag); + transcript->send_to_verifier(commitment_labels.alu_u64_tag, witness_commitments.alu_u64_tag); + transcript->send_to_verifier(commitment_labels.alu_u8_r0, witness_commitments.alu_u8_r0); + transcript->send_to_verifier(commitment_labels.alu_u8_r1, witness_commitments.alu_u8_r1); + transcript->send_to_verifier(commitment_labels.alu_u8_tag, witness_commitments.alu_u8_tag); + transcript->send_to_verifier(commitment_labels.binary_acc_ia, witness_commitments.binary_acc_ia); + transcript->send_to_verifier(commitment_labels.binary_acc_ib, witness_commitments.binary_acc_ib); + transcript->send_to_verifier(commitment_labels.binary_acc_ic, witness_commitments.binary_acc_ic); + transcript->send_to_verifier(commitment_labels.binary_bin_sel, witness_commitments.binary_bin_sel); + transcript->send_to_verifier(commitment_labels.binary_clk, witness_commitments.binary_clk); + transcript->send_to_verifier(commitment_labels.binary_ia_bytes, witness_commitments.binary_ia_bytes); + transcript->send_to_verifier(commitment_labels.binary_ib_bytes, witness_commitments.binary_ib_bytes); + transcript->send_to_verifier(commitment_labels.binary_ic_bytes, witness_commitments.binary_ic_bytes); + transcript->send_to_verifier(commitment_labels.binary_in_tag, witness_commitments.binary_in_tag); + transcript->send_to_verifier(commitment_labels.binary_mem_tag_ctr, witness_commitments.binary_mem_tag_ctr); + transcript->send_to_verifier(commitment_labels.binary_mem_tag_ctr_inv, witness_commitments.binary_mem_tag_ctr_inv); + transcript->send_to_verifier(commitment_labels.binary_op_id, witness_commitments.binary_op_id); + transcript->send_to_verifier(commitment_labels.binary_start, witness_commitments.binary_start); + transcript->send_to_verifier(commitment_labels.byte_lookup_bin_sel, witness_commitments.byte_lookup_bin_sel); + transcript->send_to_verifier(commitment_labels.byte_lookup_table_byte_lengths, + witness_commitments.byte_lookup_table_byte_lengths); + transcript->send_to_verifier(commitment_labels.byte_lookup_table_in_tags, + witness_commitments.byte_lookup_table_in_tags); + transcript->send_to_verifier(commitment_labels.byte_lookup_table_input_a, + witness_commitments.byte_lookup_table_input_a); + transcript->send_to_verifier(commitment_labels.byte_lookup_table_input_b, + witness_commitments.byte_lookup_table_input_b); + transcript->send_to_verifier(commitment_labels.byte_lookup_table_op_id, + witness_commitments.byte_lookup_table_op_id); + transcript->send_to_verifier(commitment_labels.byte_lookup_table_output, + witness_commitments.byte_lookup_table_output); + transcript->send_to_verifier(commitment_labels.conversion_clk, witness_commitments.conversion_clk); + transcript->send_to_verifier(commitment_labels.conversion_input, witness_commitments.conversion_input); + transcript->send_to_verifier(commitment_labels.conversion_num_limbs, witness_commitments.conversion_num_limbs); + transcript->send_to_verifier(commitment_labels.conversion_radix, witness_commitments.conversion_radix); + transcript->send_to_verifier(commitment_labels.conversion_to_radix_le_sel, + witness_commitments.conversion_to_radix_le_sel); + transcript->send_to_verifier(commitment_labels.gas_da_gas_fixed_table, witness_commitments.gas_da_gas_fixed_table); + transcript->send_to_verifier(commitment_labels.gas_gas_cost_sel, witness_commitments.gas_gas_cost_sel); + transcript->send_to_verifier(commitment_labels.gas_l2_gas_fixed_table, witness_commitments.gas_l2_gas_fixed_table); + transcript->send_to_verifier(commitment_labels.keccakf1600_clk, witness_commitments.keccakf1600_clk); + transcript->send_to_verifier(commitment_labels.keccakf1600_input, witness_commitments.keccakf1600_input); + transcript->send_to_verifier(commitment_labels.keccakf1600_keccakf1600_sel, + witness_commitments.keccakf1600_keccakf1600_sel); + transcript->send_to_verifier(commitment_labels.keccakf1600_output, witness_commitments.keccakf1600_output); + transcript->send_to_verifier(commitment_labels.kernel_emit_l2_to_l1_msg_write_offset, + witness_commitments.kernel_emit_l2_to_l1_msg_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_emit_note_hash_write_offset, + witness_commitments.kernel_emit_note_hash_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_emit_nullifier_write_offset, + witness_commitments.kernel_emit_nullifier_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_emit_unencrypted_log_write_offset, + witness_commitments.kernel_emit_unencrypted_log_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_kernel_in_offset, + witness_commitments.kernel_kernel_in_offset); + transcript->send_to_verifier(commitment_labels.kernel_kernel_inputs, witness_commitments.kernel_kernel_inputs); + transcript->send_to_verifier(commitment_labels.kernel_kernel_metadata_out, + witness_commitments.kernel_kernel_metadata_out); + transcript->send_to_verifier(commitment_labels.kernel_kernel_out_offset, + witness_commitments.kernel_kernel_out_offset); + transcript->send_to_verifier(commitment_labels.kernel_kernel_side_effect_out, + witness_commitments.kernel_kernel_side_effect_out); + transcript->send_to_verifier(commitment_labels.kernel_kernel_value_out, + witness_commitments.kernel_kernel_value_out); + transcript->send_to_verifier(commitment_labels.kernel_l1_to_l2_msg_exists_write_offset, + witness_commitments.kernel_l1_to_l2_msg_exists_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_note_hash_exist_write_offset, + witness_commitments.kernel_note_hash_exist_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_nullifier_exists_write_offset, + witness_commitments.kernel_nullifier_exists_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_nullifier_non_exists_write_offset, + witness_commitments.kernel_nullifier_non_exists_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_q_public_input_kernel_add_to_table, + witness_commitments.kernel_q_public_input_kernel_add_to_table); + transcript->send_to_verifier(commitment_labels.kernel_q_public_input_kernel_out_add_to_table, + witness_commitments.kernel_q_public_input_kernel_out_add_to_table); + transcript->send_to_verifier(commitment_labels.kernel_side_effect_counter, + witness_commitments.kernel_side_effect_counter); + transcript->send_to_verifier(commitment_labels.kernel_sload_write_offset, + witness_commitments.kernel_sload_write_offset); + transcript->send_to_verifier(commitment_labels.kernel_sstore_write_offset, + witness_commitments.kernel_sstore_write_offset); + transcript->send_to_verifier(commitment_labels.main_abs_da_rem_gas_hi, witness_commitments.main_abs_da_rem_gas_hi); + transcript->send_to_verifier(commitment_labels.main_abs_da_rem_gas_lo, witness_commitments.main_abs_da_rem_gas_lo); + transcript->send_to_verifier(commitment_labels.main_abs_l2_rem_gas_hi, witness_commitments.main_abs_l2_rem_gas_hi); + transcript->send_to_verifier(commitment_labels.main_abs_l2_rem_gas_lo, witness_commitments.main_abs_l2_rem_gas_lo); + transcript->send_to_verifier(commitment_labels.main_alu_in_tag, witness_commitments.main_alu_in_tag); + transcript->send_to_verifier(commitment_labels.main_alu_sel, witness_commitments.main_alu_sel); + transcript->send_to_verifier(commitment_labels.main_bin_op_id, witness_commitments.main_bin_op_id); + transcript->send_to_verifier(commitment_labels.main_bin_sel, witness_commitments.main_bin_sel); + transcript->send_to_verifier(commitment_labels.main_call_ptr, witness_commitments.main_call_ptr); + transcript->send_to_verifier(commitment_labels.main_da_gas_op, witness_commitments.main_da_gas_op); + transcript->send_to_verifier(commitment_labels.main_da_gas_remaining, witness_commitments.main_da_gas_remaining); + transcript->send_to_verifier(commitment_labels.main_da_out_of_gas, witness_commitments.main_da_out_of_gas); + transcript->send_to_verifier(commitment_labels.main_gas_cost_active, witness_commitments.main_gas_cost_active); + transcript->send_to_verifier(commitment_labels.main_ia, witness_commitments.main_ia); + transcript->send_to_verifier(commitment_labels.main_ib, witness_commitments.main_ib); + transcript->send_to_verifier(commitment_labels.main_ic, witness_commitments.main_ic); + transcript->send_to_verifier(commitment_labels.main_id, witness_commitments.main_id); + transcript->send_to_verifier(commitment_labels.main_id_zero, witness_commitments.main_id_zero); + transcript->send_to_verifier(commitment_labels.main_ind_a, witness_commitments.main_ind_a); + transcript->send_to_verifier(commitment_labels.main_ind_b, witness_commitments.main_ind_b); + transcript->send_to_verifier(commitment_labels.main_ind_c, witness_commitments.main_ind_c); + transcript->send_to_verifier(commitment_labels.main_ind_d, witness_commitments.main_ind_d); + transcript->send_to_verifier(commitment_labels.main_ind_op_a, witness_commitments.main_ind_op_a); + transcript->send_to_verifier(commitment_labels.main_ind_op_b, witness_commitments.main_ind_op_b); + transcript->send_to_verifier(commitment_labels.main_ind_op_c, witness_commitments.main_ind_op_c); + transcript->send_to_verifier(commitment_labels.main_ind_op_d, witness_commitments.main_ind_op_d); + transcript->send_to_verifier(commitment_labels.main_internal_return_ptr, + witness_commitments.main_internal_return_ptr); + transcript->send_to_verifier(commitment_labels.main_inv, witness_commitments.main_inv); + transcript->send_to_verifier(commitment_labels.main_l2_gas_op, witness_commitments.main_l2_gas_op); + transcript->send_to_verifier(commitment_labels.main_l2_gas_remaining, witness_commitments.main_l2_gas_remaining); + transcript->send_to_verifier(commitment_labels.main_l2_out_of_gas, witness_commitments.main_l2_out_of_gas); + transcript->send_to_verifier(commitment_labels.main_last, witness_commitments.main_last); + transcript->send_to_verifier(commitment_labels.main_mem_idx_a, witness_commitments.main_mem_idx_a); + transcript->send_to_verifier(commitment_labels.main_mem_idx_b, witness_commitments.main_mem_idx_b); + transcript->send_to_verifier(commitment_labels.main_mem_idx_c, witness_commitments.main_mem_idx_c); + transcript->send_to_verifier(commitment_labels.main_mem_idx_d, witness_commitments.main_mem_idx_d); + transcript->send_to_verifier(commitment_labels.main_mem_op_a, witness_commitments.main_mem_op_a); + transcript->send_to_verifier(commitment_labels.main_mem_op_activate_gas, + witness_commitments.main_mem_op_activate_gas); + transcript->send_to_verifier(commitment_labels.main_mem_op_b, witness_commitments.main_mem_op_b); + transcript->send_to_verifier(commitment_labels.main_mem_op_c, witness_commitments.main_mem_op_c); + transcript->send_to_verifier(commitment_labels.main_mem_op_d, witness_commitments.main_mem_op_d); + transcript->send_to_verifier(commitment_labels.main_op_err, witness_commitments.main_op_err); + transcript->send_to_verifier(commitment_labels.main_opcode_val, witness_commitments.main_opcode_val); + transcript->send_to_verifier(commitment_labels.main_pc, witness_commitments.main_pc); + transcript->send_to_verifier(commitment_labels.main_q_kernel_lookup, witness_commitments.main_q_kernel_lookup); + transcript->send_to_verifier(commitment_labels.main_q_kernel_output_lookup, + witness_commitments.main_q_kernel_output_lookup); + transcript->send_to_verifier(commitment_labels.main_r_in_tag, witness_commitments.main_r_in_tag); + transcript->send_to_verifier(commitment_labels.main_rwa, witness_commitments.main_rwa); + transcript->send_to_verifier(commitment_labels.main_rwb, witness_commitments.main_rwb); + transcript->send_to_verifier(commitment_labels.main_rwc, witness_commitments.main_rwc); + transcript->send_to_verifier(commitment_labels.main_rwd, witness_commitments.main_rwd); + transcript->send_to_verifier(commitment_labels.main_sel_cmov, witness_commitments.main_sel_cmov); + transcript->send_to_verifier(commitment_labels.main_sel_external_call, witness_commitments.main_sel_external_call); + transcript->send_to_verifier(commitment_labels.main_sel_halt, witness_commitments.main_sel_halt); + transcript->send_to_verifier(commitment_labels.main_sel_internal_call, witness_commitments.main_sel_internal_call); + transcript->send_to_verifier(commitment_labels.main_sel_internal_return, + witness_commitments.main_sel_internal_return); + transcript->send_to_verifier(commitment_labels.main_sel_jump, witness_commitments.main_sel_jump); + transcript->send_to_verifier(commitment_labels.main_sel_jumpi, witness_commitments.main_sel_jumpi); + transcript->send_to_verifier(commitment_labels.main_sel_mov, witness_commitments.main_sel_mov); + transcript->send_to_verifier(commitment_labels.main_sel_mov_a, witness_commitments.main_sel_mov_a); + transcript->send_to_verifier(commitment_labels.main_sel_mov_b, witness_commitments.main_sel_mov_b); + transcript->send_to_verifier(commitment_labels.main_sel_op_add, witness_commitments.main_sel_op_add); + transcript->send_to_verifier(commitment_labels.main_sel_op_address, witness_commitments.main_sel_op_address); + transcript->send_to_verifier(commitment_labels.main_sel_op_and, witness_commitments.main_sel_op_and); + transcript->send_to_verifier(commitment_labels.main_sel_op_block_number, + witness_commitments.main_sel_op_block_number); + transcript->send_to_verifier(commitment_labels.main_sel_op_cast, witness_commitments.main_sel_op_cast); + transcript->send_to_verifier(commitment_labels.main_sel_op_chain_id, witness_commitments.main_sel_op_chain_id); + transcript->send_to_verifier(commitment_labels.main_sel_op_coinbase, witness_commitments.main_sel_op_coinbase); + transcript->send_to_verifier(commitment_labels.main_sel_op_dagasleft, witness_commitments.main_sel_op_dagasleft); + transcript->send_to_verifier(commitment_labels.main_sel_op_div, witness_commitments.main_sel_op_div); + transcript->send_to_verifier(commitment_labels.main_sel_op_emit_l2_to_l1_msg, + witness_commitments.main_sel_op_emit_l2_to_l1_msg); + transcript->send_to_verifier(commitment_labels.main_sel_op_emit_note_hash, + witness_commitments.main_sel_op_emit_note_hash); + transcript->send_to_verifier(commitment_labels.main_sel_op_emit_nullifier, + witness_commitments.main_sel_op_emit_nullifier); + transcript->send_to_verifier(commitment_labels.main_sel_op_emit_unencrypted_log, + witness_commitments.main_sel_op_emit_unencrypted_log); + transcript->send_to_verifier(commitment_labels.main_sel_op_eq, witness_commitments.main_sel_op_eq); + transcript->send_to_verifier(commitment_labels.main_sel_op_fdiv, witness_commitments.main_sel_op_fdiv); + transcript->send_to_verifier(commitment_labels.main_sel_op_fee_per_da_gas, + witness_commitments.main_sel_op_fee_per_da_gas); + transcript->send_to_verifier(commitment_labels.main_sel_op_fee_per_l2_gas, + witness_commitments.main_sel_op_fee_per_l2_gas); + transcript->send_to_verifier(commitment_labels.main_sel_op_get_contract_instance, + witness_commitments.main_sel_op_get_contract_instance); + transcript->send_to_verifier(commitment_labels.main_sel_op_keccak, witness_commitments.main_sel_op_keccak); + transcript->send_to_verifier(commitment_labels.main_sel_op_l1_to_l2_msg_exists, + witness_commitments.main_sel_op_l1_to_l2_msg_exists); + transcript->send_to_verifier(commitment_labels.main_sel_op_l2gasleft, witness_commitments.main_sel_op_l2gasleft); + transcript->send_to_verifier(commitment_labels.main_sel_op_lt, witness_commitments.main_sel_op_lt); + transcript->send_to_verifier(commitment_labels.main_sel_op_lte, witness_commitments.main_sel_op_lte); + transcript->send_to_verifier(commitment_labels.main_sel_op_mul, witness_commitments.main_sel_op_mul); + transcript->send_to_verifier(commitment_labels.main_sel_op_not, witness_commitments.main_sel_op_not); + transcript->send_to_verifier(commitment_labels.main_sel_op_note_hash_exists, + witness_commitments.main_sel_op_note_hash_exists); + transcript->send_to_verifier(commitment_labels.main_sel_op_nullifier_exists, + witness_commitments.main_sel_op_nullifier_exists); + transcript->send_to_verifier(commitment_labels.main_sel_op_or, witness_commitments.main_sel_op_or); + transcript->send_to_verifier(commitment_labels.main_sel_op_pedersen, witness_commitments.main_sel_op_pedersen); + transcript->send_to_verifier(commitment_labels.main_sel_op_poseidon2, witness_commitments.main_sel_op_poseidon2); + transcript->send_to_verifier(commitment_labels.main_sel_op_radix_le, witness_commitments.main_sel_op_radix_le); + transcript->send_to_verifier(commitment_labels.main_sel_op_sender, witness_commitments.main_sel_op_sender); + transcript->send_to_verifier(commitment_labels.main_sel_op_sha256, witness_commitments.main_sel_op_sha256); + transcript->send_to_verifier(commitment_labels.main_sel_op_shl, witness_commitments.main_sel_op_shl); + transcript->send_to_verifier(commitment_labels.main_sel_op_shr, witness_commitments.main_sel_op_shr); + transcript->send_to_verifier(commitment_labels.main_sel_op_sload, witness_commitments.main_sel_op_sload); + transcript->send_to_verifier(commitment_labels.main_sel_op_sstore, witness_commitments.main_sel_op_sstore); + transcript->send_to_verifier(commitment_labels.main_sel_op_storage_address, + witness_commitments.main_sel_op_storage_address); + transcript->send_to_verifier(commitment_labels.main_sel_op_sub, witness_commitments.main_sel_op_sub); + transcript->send_to_verifier(commitment_labels.main_sel_op_timestamp, witness_commitments.main_sel_op_timestamp); + transcript->send_to_verifier(commitment_labels.main_sel_op_transaction_fee, + witness_commitments.main_sel_op_transaction_fee); + transcript->send_to_verifier(commitment_labels.main_sel_op_version, witness_commitments.main_sel_op_version); + transcript->send_to_verifier(commitment_labels.main_sel_op_xor, witness_commitments.main_sel_op_xor); + transcript->send_to_verifier(commitment_labels.main_sel_rng_16, witness_commitments.main_sel_rng_16); + transcript->send_to_verifier(commitment_labels.main_sel_rng_8, witness_commitments.main_sel_rng_8); + transcript->send_to_verifier(commitment_labels.main_space_id, witness_commitments.main_space_id); + transcript->send_to_verifier(commitment_labels.main_table_pow_2, witness_commitments.main_table_pow_2); + transcript->send_to_verifier(commitment_labels.main_tag_err, witness_commitments.main_tag_err); + transcript->send_to_verifier(commitment_labels.main_w_in_tag, witness_commitments.main_w_in_tag); + transcript->send_to_verifier(commitment_labels.mem_addr, witness_commitments.mem_addr); + transcript->send_to_verifier(commitment_labels.mem_clk, witness_commitments.mem_clk); + transcript->send_to_verifier(commitment_labels.mem_diff_hi, witness_commitments.mem_diff_hi); + transcript->send_to_verifier(commitment_labels.mem_diff_lo, witness_commitments.mem_diff_lo); + transcript->send_to_verifier(commitment_labels.mem_diff_mid, witness_commitments.mem_diff_mid); + transcript->send_to_verifier(commitment_labels.mem_glob_addr, witness_commitments.mem_glob_addr); + transcript->send_to_verifier(commitment_labels.mem_ind_op_a, witness_commitments.mem_ind_op_a); + transcript->send_to_verifier(commitment_labels.mem_ind_op_b, witness_commitments.mem_ind_op_b); + transcript->send_to_verifier(commitment_labels.mem_ind_op_c, witness_commitments.mem_ind_op_c); + transcript->send_to_verifier(commitment_labels.mem_ind_op_d, witness_commitments.mem_ind_op_d); + transcript->send_to_verifier(commitment_labels.mem_last, witness_commitments.mem_last); + transcript->send_to_verifier(commitment_labels.mem_lastAccess, witness_commitments.mem_lastAccess); + transcript->send_to_verifier(commitment_labels.mem_mem_sel, witness_commitments.mem_mem_sel); + transcript->send_to_verifier(commitment_labels.mem_one_min_inv, witness_commitments.mem_one_min_inv); + transcript->send_to_verifier(commitment_labels.mem_op_a, witness_commitments.mem_op_a); + transcript->send_to_verifier(commitment_labels.mem_op_b, witness_commitments.mem_op_b); + transcript->send_to_verifier(commitment_labels.mem_op_c, witness_commitments.mem_op_c); + transcript->send_to_verifier(commitment_labels.mem_op_d, witness_commitments.mem_op_d); + transcript->send_to_verifier(commitment_labels.mem_r_in_tag, witness_commitments.mem_r_in_tag); + transcript->send_to_verifier(commitment_labels.mem_rng_chk_sel, witness_commitments.mem_rng_chk_sel); + transcript->send_to_verifier(commitment_labels.mem_rw, witness_commitments.mem_rw); + transcript->send_to_verifier(commitment_labels.mem_sel_cmov, witness_commitments.mem_sel_cmov); + transcript->send_to_verifier(commitment_labels.mem_sel_mov_a, witness_commitments.mem_sel_mov_a); + transcript->send_to_verifier(commitment_labels.mem_sel_mov_b, witness_commitments.mem_sel_mov_b); + transcript->send_to_verifier(commitment_labels.mem_skip_check_tag, witness_commitments.mem_skip_check_tag); + transcript->send_to_verifier(commitment_labels.mem_space_id, witness_commitments.mem_space_id); + transcript->send_to_verifier(commitment_labels.mem_tag, witness_commitments.mem_tag); + transcript->send_to_verifier(commitment_labels.mem_tag_err, witness_commitments.mem_tag_err); + transcript->send_to_verifier(commitment_labels.mem_tsp, witness_commitments.mem_tsp); + transcript->send_to_verifier(commitment_labels.mem_val, witness_commitments.mem_val); + transcript->send_to_verifier(commitment_labels.mem_w_in_tag, witness_commitments.mem_w_in_tag); + transcript->send_to_verifier(commitment_labels.pedersen_clk, witness_commitments.pedersen_clk); + transcript->send_to_verifier(commitment_labels.pedersen_input, witness_commitments.pedersen_input); + transcript->send_to_verifier(commitment_labels.pedersen_output, witness_commitments.pedersen_output); + transcript->send_to_verifier(commitment_labels.pedersen_pedersen_sel, witness_commitments.pedersen_pedersen_sel); + transcript->send_to_verifier(commitment_labels.poseidon2_clk, witness_commitments.poseidon2_clk); + transcript->send_to_verifier(commitment_labels.poseidon2_input, witness_commitments.poseidon2_input); + transcript->send_to_verifier(commitment_labels.poseidon2_output, witness_commitments.poseidon2_output); + transcript->send_to_verifier(commitment_labels.poseidon2_poseidon_perm_sel, + witness_commitments.poseidon2_poseidon_perm_sel); + transcript->send_to_verifier(commitment_labels.sha256_clk, witness_commitments.sha256_clk); + transcript->send_to_verifier(commitment_labels.sha256_input, witness_commitments.sha256_input); + transcript->send_to_verifier(commitment_labels.sha256_output, witness_commitments.sha256_output); + transcript->send_to_verifier(commitment_labels.sha256_sha256_compression_sel, + witness_commitments.sha256_sha256_compression_sel); + transcript->send_to_verifier(commitment_labels.sha256_state, witness_commitments.sha256_state); transcript->send_to_verifier(commitment_labels.lookup_byte_lengths_counts, witness_commitments.lookup_byte_lengths_counts); transcript->send_to_verifier(commitment_labels.lookup_byte_operations_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp index 70dcfeda257..0f459049f34 100644 --- a/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp @@ -70,518 +70,419 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vectortemplate receive_from_prover(commitment_labels.avm_alu_a_hi); - commitments.avm_alu_a_lo = transcript->template receive_from_prover(commitment_labels.avm_alu_a_lo); - commitments.avm_alu_alu_sel = - transcript->template receive_from_prover(commitment_labels.avm_alu_alu_sel); - commitments.avm_alu_b_hi = transcript->template receive_from_prover(commitment_labels.avm_alu_b_hi); - commitments.avm_alu_b_lo = transcript->template receive_from_prover(commitment_labels.avm_alu_b_lo); - commitments.avm_alu_borrow = transcript->template receive_from_prover(commitment_labels.avm_alu_borrow); - commitments.avm_alu_cf = transcript->template receive_from_prover(commitment_labels.avm_alu_cf); - commitments.avm_alu_clk = transcript->template receive_from_prover(commitment_labels.avm_alu_clk); - commitments.avm_alu_cmp_rng_ctr = - transcript->template receive_from_prover(commitment_labels.avm_alu_cmp_rng_ctr); - commitments.avm_alu_cmp_sel = - transcript->template receive_from_prover(commitment_labels.avm_alu_cmp_sel); - commitments.avm_alu_div_rng_chk_selector = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_rng_chk_selector); - commitments.avm_alu_div_u16_r0 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r0); - commitments.avm_alu_div_u16_r1 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r1); - commitments.avm_alu_div_u16_r2 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r2); - commitments.avm_alu_div_u16_r3 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r3); - commitments.avm_alu_div_u16_r4 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r4); - commitments.avm_alu_div_u16_r5 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r5); - commitments.avm_alu_div_u16_r6 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r6); - commitments.avm_alu_div_u16_r7 = - transcript->template receive_from_prover(commitment_labels.avm_alu_div_u16_r7); - commitments.avm_alu_divisor_hi = - transcript->template receive_from_prover(commitment_labels.avm_alu_divisor_hi); - commitments.avm_alu_divisor_lo = - transcript->template receive_from_prover(commitment_labels.avm_alu_divisor_lo); - commitments.avm_alu_ff_tag = transcript->template receive_from_prover(commitment_labels.avm_alu_ff_tag); - commitments.avm_alu_ia = transcript->template receive_from_prover(commitment_labels.avm_alu_ia); - commitments.avm_alu_ib = transcript->template receive_from_prover(commitment_labels.avm_alu_ib); - commitments.avm_alu_ic = transcript->template receive_from_prover(commitment_labels.avm_alu_ic); - commitments.avm_alu_in_tag = transcript->template receive_from_prover(commitment_labels.avm_alu_in_tag); - commitments.avm_alu_op_add = transcript->template receive_from_prover(commitment_labels.avm_alu_op_add); - commitments.avm_alu_op_cast = - transcript->template receive_from_prover(commitment_labels.avm_alu_op_cast); - commitments.avm_alu_op_cast_prev = - transcript->template receive_from_prover(commitment_labels.avm_alu_op_cast_prev); - commitments.avm_alu_op_div = transcript->template receive_from_prover(commitment_labels.avm_alu_op_div); - commitments.avm_alu_op_div_a_lt_b = - transcript->template receive_from_prover(commitment_labels.avm_alu_op_div_a_lt_b); - commitments.avm_alu_op_div_std = - transcript->template receive_from_prover(commitment_labels.avm_alu_op_div_std); - commitments.avm_alu_op_eq = transcript->template receive_from_prover(commitment_labels.avm_alu_op_eq); - commitments.avm_alu_op_eq_diff_inv = - transcript->template receive_from_prover(commitment_labels.avm_alu_op_eq_diff_inv); - commitments.avm_alu_op_lt = transcript->template receive_from_prover(commitment_labels.avm_alu_op_lt); - commitments.avm_alu_op_lte = transcript->template receive_from_prover(commitment_labels.avm_alu_op_lte); - commitments.avm_alu_op_mul = transcript->template receive_from_prover(commitment_labels.avm_alu_op_mul); - commitments.avm_alu_op_not = transcript->template receive_from_prover(commitment_labels.avm_alu_op_not); - commitments.avm_alu_op_shl = transcript->template receive_from_prover(commitment_labels.avm_alu_op_shl); - commitments.avm_alu_op_shr = transcript->template receive_from_prover(commitment_labels.avm_alu_op_shr); - commitments.avm_alu_op_sub = transcript->template receive_from_prover(commitment_labels.avm_alu_op_sub); - commitments.avm_alu_p_a_borrow = - transcript->template receive_from_prover(commitment_labels.avm_alu_p_a_borrow); - commitments.avm_alu_p_b_borrow = - transcript->template receive_from_prover(commitment_labels.avm_alu_p_b_borrow); - commitments.avm_alu_p_sub_a_hi = - transcript->template receive_from_prover(commitment_labels.avm_alu_p_sub_a_hi); - commitments.avm_alu_p_sub_a_lo = - transcript->template receive_from_prover(commitment_labels.avm_alu_p_sub_a_lo); - commitments.avm_alu_p_sub_b_hi = - transcript->template receive_from_prover(commitment_labels.avm_alu_p_sub_b_hi); - commitments.avm_alu_p_sub_b_lo = - transcript->template receive_from_prover(commitment_labels.avm_alu_p_sub_b_lo); - commitments.avm_alu_partial_prod_hi = - transcript->template receive_from_prover(commitment_labels.avm_alu_partial_prod_hi); - commitments.avm_alu_partial_prod_lo = - transcript->template receive_from_prover(commitment_labels.avm_alu_partial_prod_lo); - commitments.avm_alu_quotient_hi = - transcript->template receive_from_prover(commitment_labels.avm_alu_quotient_hi); - commitments.avm_alu_quotient_lo = - transcript->template receive_from_prover(commitment_labels.avm_alu_quotient_lo); - commitments.avm_alu_remainder = - transcript->template receive_from_prover(commitment_labels.avm_alu_remainder); - commitments.avm_alu_res_hi = transcript->template receive_from_prover(commitment_labels.avm_alu_res_hi); - commitments.avm_alu_res_lo = transcript->template receive_from_prover(commitment_labels.avm_alu_res_lo); - commitments.avm_alu_rng_chk_lookup_selector = - transcript->template receive_from_prover(commitment_labels.avm_alu_rng_chk_lookup_selector); - commitments.avm_alu_rng_chk_sel = - transcript->template receive_from_prover(commitment_labels.avm_alu_rng_chk_sel); - commitments.avm_alu_shift_lt_bit_len = - transcript->template receive_from_prover(commitment_labels.avm_alu_shift_lt_bit_len); - commitments.avm_alu_shift_sel = - transcript->template receive_from_prover(commitment_labels.avm_alu_shift_sel); - commitments.avm_alu_t_sub_s_bits = - transcript->template receive_from_prover(commitment_labels.avm_alu_t_sub_s_bits); - commitments.avm_alu_two_pow_s = - transcript->template receive_from_prover(commitment_labels.avm_alu_two_pow_s); - commitments.avm_alu_two_pow_t_sub_s = - transcript->template receive_from_prover(commitment_labels.avm_alu_two_pow_t_sub_s); - commitments.avm_alu_u128_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_u128_tag); - commitments.avm_alu_u16_r0 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r0); - commitments.avm_alu_u16_r1 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r1); - commitments.avm_alu_u16_r10 = - transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r10); - commitments.avm_alu_u16_r11 = - transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r11); - commitments.avm_alu_u16_r12 = - transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r12); - commitments.avm_alu_u16_r13 = - transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r13); - commitments.avm_alu_u16_r14 = - transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r14); - commitments.avm_alu_u16_r2 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r2); - commitments.avm_alu_u16_r3 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r3); - commitments.avm_alu_u16_r4 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r4); - commitments.avm_alu_u16_r5 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r5); - commitments.avm_alu_u16_r6 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r6); - commitments.avm_alu_u16_r7 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r7); - commitments.avm_alu_u16_r8 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r8); - commitments.avm_alu_u16_r9 = transcript->template receive_from_prover(commitment_labels.avm_alu_u16_r9); - commitments.avm_alu_u16_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_u16_tag); - commitments.avm_alu_u32_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_u32_tag); - commitments.avm_alu_u64_tag = - transcript->template receive_from_prover(commitment_labels.avm_alu_u64_tag); - commitments.avm_alu_u8_r0 = transcript->template receive_from_prover(commitment_labels.avm_alu_u8_r0); - commitments.avm_alu_u8_r1 = transcript->template receive_from_prover(commitment_labels.avm_alu_u8_r1); - commitments.avm_alu_u8_tag = transcript->template receive_from_prover(commitment_labels.avm_alu_u8_tag); - commitments.avm_binary_acc_ia = - transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ia); - commitments.avm_binary_acc_ib = - transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ib); - commitments.avm_binary_acc_ic = - transcript->template receive_from_prover(commitment_labels.avm_binary_acc_ic); - commitments.avm_binary_bin_sel = - transcript->template receive_from_prover(commitment_labels.avm_binary_bin_sel); - commitments.avm_binary_clk = transcript->template receive_from_prover(commitment_labels.avm_binary_clk); - commitments.avm_binary_ia_bytes = - transcript->template receive_from_prover(commitment_labels.avm_binary_ia_bytes); - commitments.avm_binary_ib_bytes = - transcript->template receive_from_prover(commitment_labels.avm_binary_ib_bytes); - commitments.avm_binary_ic_bytes = - transcript->template receive_from_prover(commitment_labels.avm_binary_ic_bytes); - commitments.avm_binary_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_binary_in_tag); - commitments.avm_binary_mem_tag_ctr = - transcript->template receive_from_prover(commitment_labels.avm_binary_mem_tag_ctr); - commitments.avm_binary_mem_tag_ctr_inv = - transcript->template receive_from_prover(commitment_labels.avm_binary_mem_tag_ctr_inv); - commitments.avm_binary_op_id = - transcript->template receive_from_prover(commitment_labels.avm_binary_op_id); - commitments.avm_binary_start = - transcript->template receive_from_prover(commitment_labels.avm_binary_start); - commitments.avm_byte_lookup_bin_sel = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_bin_sel); - commitments.avm_byte_lookup_table_byte_lengths = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_byte_lengths); - commitments.avm_byte_lookup_table_in_tags = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_in_tags); - commitments.avm_byte_lookup_table_input_a = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_input_a); - commitments.avm_byte_lookup_table_input_b = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_input_b); - commitments.avm_byte_lookup_table_op_id = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_op_id); - commitments.avm_byte_lookup_table_output = - transcript->template receive_from_prover(commitment_labels.avm_byte_lookup_table_output); - commitments.avm_conversion_clk = - transcript->template receive_from_prover(commitment_labels.avm_conversion_clk); - commitments.avm_conversion_input = - transcript->template receive_from_prover(commitment_labels.avm_conversion_input); - commitments.avm_conversion_num_limbs = - transcript->template receive_from_prover(commitment_labels.avm_conversion_num_limbs); - commitments.avm_conversion_radix = - transcript->template receive_from_prover(commitment_labels.avm_conversion_radix); - commitments.avm_conversion_to_radix_le_sel = - transcript->template receive_from_prover(commitment_labels.avm_conversion_to_radix_le_sel); - commitments.avm_gas_da_gas_fixed_table = - transcript->template receive_from_prover(commitment_labels.avm_gas_da_gas_fixed_table); - commitments.avm_gas_gas_cost_sel = - transcript->template receive_from_prover(commitment_labels.avm_gas_gas_cost_sel); - commitments.avm_gas_l2_gas_fixed_table = - transcript->template receive_from_prover(commitment_labels.avm_gas_l2_gas_fixed_table); - commitments.avm_keccakf1600_clk = - transcript->template receive_from_prover(commitment_labels.avm_keccakf1600_clk); - commitments.avm_keccakf1600_input = - transcript->template receive_from_prover(commitment_labels.avm_keccakf1600_input); - commitments.avm_keccakf1600_keccakf1600_sel = - transcript->template receive_from_prover(commitment_labels.avm_keccakf1600_keccakf1600_sel); - commitments.avm_keccakf1600_output = - transcript->template receive_from_prover(commitment_labels.avm_keccakf1600_output); - commitments.avm_kernel_emit_l2_to_l1_msg_write_offset = transcript->template receive_from_prover( - commitment_labels.avm_kernel_emit_l2_to_l1_msg_write_offset); - commitments.avm_kernel_emit_note_hash_write_offset = - transcript->template receive_from_prover(commitment_labels.avm_kernel_emit_note_hash_write_offset); - commitments.avm_kernel_emit_nullifier_write_offset = - transcript->template receive_from_prover(commitment_labels.avm_kernel_emit_nullifier_write_offset); - commitments.avm_kernel_emit_unencrypted_log_write_offset = transcript->template receive_from_prover( - commitment_labels.avm_kernel_emit_unencrypted_log_write_offset); - commitments.avm_kernel_kernel_in_offset = - transcript->template receive_from_prover(commitment_labels.avm_kernel_kernel_in_offset); - commitments.avm_kernel_kernel_inputs = - transcript->template receive_from_prover(commitment_labels.avm_kernel_kernel_inputs); - commitments.avm_kernel_kernel_metadata_out = - transcript->template receive_from_prover(commitment_labels.avm_kernel_kernel_metadata_out); - commitments.avm_kernel_kernel_out_offset = - transcript->template receive_from_prover(commitment_labels.avm_kernel_kernel_out_offset); - commitments.avm_kernel_kernel_side_effect_out = - transcript->template receive_from_prover(commitment_labels.avm_kernel_kernel_side_effect_out); - commitments.avm_kernel_kernel_value_out = - transcript->template receive_from_prover(commitment_labels.avm_kernel_kernel_value_out); - commitments.avm_kernel_l1_to_l2_msg_exists_write_offset = transcript->template receive_from_prover( - commitment_labels.avm_kernel_l1_to_l2_msg_exists_write_offset); - commitments.avm_kernel_note_hash_exist_write_offset = - transcript->template receive_from_prover(commitment_labels.avm_kernel_note_hash_exist_write_offset); - commitments.avm_kernel_nullifier_exists_write_offset = transcript->template receive_from_prover( - commitment_labels.avm_kernel_nullifier_exists_write_offset); - commitments.avm_kernel_nullifier_non_exists_write_offset = transcript->template receive_from_prover( - commitment_labels.avm_kernel_nullifier_non_exists_write_offset); - commitments.avm_kernel_q_public_input_kernel_add_to_table = transcript->template receive_from_prover( - commitment_labels.avm_kernel_q_public_input_kernel_add_to_table); - commitments.avm_kernel_q_public_input_kernel_out_add_to_table = - transcript->template receive_from_prover( - commitment_labels.avm_kernel_q_public_input_kernel_out_add_to_table); - commitments.avm_kernel_side_effect_counter = - transcript->template receive_from_prover(commitment_labels.avm_kernel_side_effect_counter); - commitments.avm_kernel_sload_write_offset = - transcript->template receive_from_prover(commitment_labels.avm_kernel_sload_write_offset); - commitments.avm_kernel_sstore_write_offset = - transcript->template receive_from_prover(commitment_labels.avm_kernel_sstore_write_offset); - commitments.avm_main_abs_da_rem_gas_hi = - transcript->template receive_from_prover(commitment_labels.avm_main_abs_da_rem_gas_hi); - commitments.avm_main_abs_da_rem_gas_lo = - transcript->template receive_from_prover(commitment_labels.avm_main_abs_da_rem_gas_lo); - commitments.avm_main_abs_l2_rem_gas_hi = - transcript->template receive_from_prover(commitment_labels.avm_main_abs_l2_rem_gas_hi); - commitments.avm_main_abs_l2_rem_gas_lo = - transcript->template receive_from_prover(commitment_labels.avm_main_abs_l2_rem_gas_lo); - commitments.avm_main_alu_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_main_alu_in_tag); - commitments.avm_main_alu_sel = - transcript->template receive_from_prover(commitment_labels.avm_main_alu_sel); - commitments.avm_main_bin_op_id = - transcript->template receive_from_prover(commitment_labels.avm_main_bin_op_id); - commitments.avm_main_bin_sel = - transcript->template receive_from_prover(commitment_labels.avm_main_bin_sel); - commitments.avm_main_call_ptr = - transcript->template receive_from_prover(commitment_labels.avm_main_call_ptr); - commitments.avm_main_da_gas_op = - transcript->template receive_from_prover(commitment_labels.avm_main_da_gas_op); - commitments.avm_main_da_gas_remaining = - transcript->template receive_from_prover(commitment_labels.avm_main_da_gas_remaining); - commitments.avm_main_da_out_of_gas = - transcript->template receive_from_prover(commitment_labels.avm_main_da_out_of_gas); - commitments.avm_main_gas_cost_active = - transcript->template receive_from_prover(commitment_labels.avm_main_gas_cost_active); - commitments.avm_main_ia = transcript->template receive_from_prover(commitment_labels.avm_main_ia); - commitments.avm_main_ib = transcript->template receive_from_prover(commitment_labels.avm_main_ib); - commitments.avm_main_ic = transcript->template receive_from_prover(commitment_labels.avm_main_ic); - commitments.avm_main_id = transcript->template receive_from_prover(commitment_labels.avm_main_id); - commitments.avm_main_id_zero = - transcript->template receive_from_prover(commitment_labels.avm_main_id_zero); - commitments.avm_main_ind_a = transcript->template receive_from_prover(commitment_labels.avm_main_ind_a); - commitments.avm_main_ind_b = transcript->template receive_from_prover(commitment_labels.avm_main_ind_b); - commitments.avm_main_ind_c = transcript->template receive_from_prover(commitment_labels.avm_main_ind_c); - commitments.avm_main_ind_d = transcript->template receive_from_prover(commitment_labels.avm_main_ind_d); - commitments.avm_main_ind_op_a = - transcript->template receive_from_prover(commitment_labels.avm_main_ind_op_a); - commitments.avm_main_ind_op_b = - transcript->template receive_from_prover(commitment_labels.avm_main_ind_op_b); - commitments.avm_main_ind_op_c = - transcript->template receive_from_prover(commitment_labels.avm_main_ind_op_c); - commitments.avm_main_ind_op_d = - transcript->template receive_from_prover(commitment_labels.avm_main_ind_op_d); - commitments.avm_main_internal_return_ptr = - transcript->template receive_from_prover(commitment_labels.avm_main_internal_return_ptr); - commitments.avm_main_inv = transcript->template receive_from_prover(commitment_labels.avm_main_inv); - commitments.avm_main_l2_gas_op = - transcript->template receive_from_prover(commitment_labels.avm_main_l2_gas_op); - commitments.avm_main_l2_gas_remaining = - transcript->template receive_from_prover(commitment_labels.avm_main_l2_gas_remaining); - commitments.avm_main_l2_out_of_gas = - transcript->template receive_from_prover(commitment_labels.avm_main_l2_out_of_gas); - commitments.avm_main_last = transcript->template receive_from_prover(commitment_labels.avm_main_last); - commitments.avm_main_mem_idx_a = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_idx_a); - commitments.avm_main_mem_idx_b = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_idx_b); - commitments.avm_main_mem_idx_c = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_idx_c); - commitments.avm_main_mem_idx_d = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_idx_d); - commitments.avm_main_mem_op_a = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_a); - commitments.avm_main_mem_op_activate_gas = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_activate_gas); - commitments.avm_main_mem_op_b = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_b); - commitments.avm_main_mem_op_c = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_c); - commitments.avm_main_mem_op_d = - transcript->template receive_from_prover(commitment_labels.avm_main_mem_op_d); - commitments.avm_main_op_err = - transcript->template receive_from_prover(commitment_labels.avm_main_op_err); - commitments.avm_main_opcode_val = - transcript->template receive_from_prover(commitment_labels.avm_main_opcode_val); - commitments.avm_main_pc = transcript->template receive_from_prover(commitment_labels.avm_main_pc); - commitments.avm_main_q_kernel_lookup = - transcript->template receive_from_prover(commitment_labels.avm_main_q_kernel_lookup); - commitments.avm_main_q_kernel_output_lookup = - transcript->template receive_from_prover(commitment_labels.avm_main_q_kernel_output_lookup); - commitments.avm_main_r_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_main_r_in_tag); - commitments.avm_main_rwa = transcript->template receive_from_prover(commitment_labels.avm_main_rwa); - commitments.avm_main_rwb = transcript->template receive_from_prover(commitment_labels.avm_main_rwb); - commitments.avm_main_rwc = transcript->template receive_from_prover(commitment_labels.avm_main_rwc); - commitments.avm_main_rwd = transcript->template receive_from_prover(commitment_labels.avm_main_rwd); - commitments.avm_main_sel_cmov = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_cmov); - commitments.avm_main_sel_external_call = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_external_call); - commitments.avm_main_sel_halt = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_halt); - commitments.avm_main_sel_internal_call = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_internal_call); - commitments.avm_main_sel_internal_return = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_internal_return); - commitments.avm_main_sel_jump = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_jump); - commitments.avm_main_sel_jumpi = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_jumpi); - commitments.avm_main_sel_mov = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_mov); - commitments.avm_main_sel_mov_a = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_mov_a); - commitments.avm_main_sel_mov_b = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_mov_b); - commitments.avm_main_sel_op_add = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_add); - commitments.avm_main_sel_op_address = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_address); - commitments.avm_main_sel_op_and = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_and); - commitments.avm_main_sel_op_block_number = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_block_number); - commitments.avm_main_sel_op_cast = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_cast); - commitments.avm_main_sel_op_chain_id = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_chain_id); - commitments.avm_main_sel_op_coinbase = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_coinbase); - commitments.avm_main_sel_op_dagasleft = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_dagasleft); - commitments.avm_main_sel_op_div = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_div); - commitments.avm_main_sel_op_emit_l2_to_l1_msg = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_emit_l2_to_l1_msg); - commitments.avm_main_sel_op_emit_note_hash = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_emit_note_hash); - commitments.avm_main_sel_op_emit_nullifier = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_emit_nullifier); - commitments.avm_main_sel_op_emit_unencrypted_log = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_emit_unencrypted_log); - commitments.avm_main_sel_op_eq = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_eq); - commitments.avm_main_sel_op_fdiv = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_fdiv); - commitments.avm_main_sel_op_fee_per_da_gas = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_fee_per_da_gas); - commitments.avm_main_sel_op_fee_per_l2_gas = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_fee_per_l2_gas); - commitments.avm_main_sel_op_get_contract_instance = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_get_contract_instance); - commitments.avm_main_sel_op_keccak = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_keccak); - commitments.avm_main_sel_op_l1_to_l2_msg_exists = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_l1_to_l2_msg_exists); - commitments.avm_main_sel_op_l2gasleft = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_l2gasleft); - commitments.avm_main_sel_op_lt = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_lt); - commitments.avm_main_sel_op_lte = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_lte); - commitments.avm_main_sel_op_mul = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_mul); - commitments.avm_main_sel_op_not = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_not); - commitments.avm_main_sel_op_note_hash_exists = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_note_hash_exists); - commitments.avm_main_sel_op_nullifier_exists = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_nullifier_exists); - commitments.avm_main_sel_op_or = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_or); - commitments.avm_main_sel_op_pedersen = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_pedersen); - commitments.avm_main_sel_op_poseidon2 = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_poseidon2); - commitments.avm_main_sel_op_radix_le = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_radix_le); - commitments.avm_main_sel_op_sender = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_sender); - commitments.avm_main_sel_op_sha256 = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_sha256); - commitments.avm_main_sel_op_shl = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_shl); - commitments.avm_main_sel_op_shr = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_shr); - commitments.avm_main_sel_op_sload = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_sload); - commitments.avm_main_sel_op_sstore = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_sstore); - commitments.avm_main_sel_op_storage_address = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_storage_address); - commitments.avm_main_sel_op_sub = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_sub); - commitments.avm_main_sel_op_timestamp = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_timestamp); - commitments.avm_main_sel_op_transaction_fee = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_transaction_fee); - commitments.avm_main_sel_op_version = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_version); - commitments.avm_main_sel_op_xor = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_op_xor); - commitments.avm_main_sel_rng_16 = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_rng_16); - commitments.avm_main_sel_rng_8 = - transcript->template receive_from_prover(commitment_labels.avm_main_sel_rng_8); - commitments.avm_main_space_id = - transcript->template receive_from_prover(commitment_labels.avm_main_space_id); - commitments.avm_main_table_pow_2 = - transcript->template receive_from_prover(commitment_labels.avm_main_table_pow_2); - commitments.avm_main_tag_err = - transcript->template receive_from_prover(commitment_labels.avm_main_tag_err); - commitments.avm_main_w_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_main_w_in_tag); - commitments.avm_mem_addr = transcript->template receive_from_prover(commitment_labels.avm_mem_addr); - commitments.avm_mem_clk = transcript->template receive_from_prover(commitment_labels.avm_mem_clk); - commitments.avm_mem_diff_hi = - transcript->template receive_from_prover(commitment_labels.avm_mem_diff_hi); - commitments.avm_mem_diff_lo = - transcript->template receive_from_prover(commitment_labels.avm_mem_diff_lo); - commitments.avm_mem_diff_mid = - transcript->template receive_from_prover(commitment_labels.avm_mem_diff_mid); - commitments.avm_mem_glob_addr = - transcript->template receive_from_prover(commitment_labels.avm_mem_glob_addr); - commitments.avm_mem_ind_op_a = - transcript->template receive_from_prover(commitment_labels.avm_mem_ind_op_a); - commitments.avm_mem_ind_op_b = - transcript->template receive_from_prover(commitment_labels.avm_mem_ind_op_b); - commitments.avm_mem_ind_op_c = - transcript->template receive_from_prover(commitment_labels.avm_mem_ind_op_c); - commitments.avm_mem_ind_op_d = - transcript->template receive_from_prover(commitment_labels.avm_mem_ind_op_d); - commitments.avm_mem_last = transcript->template receive_from_prover(commitment_labels.avm_mem_last); - commitments.avm_mem_lastAccess = - transcript->template receive_from_prover(commitment_labels.avm_mem_lastAccess); - commitments.avm_mem_mem_sel = - transcript->template receive_from_prover(commitment_labels.avm_mem_mem_sel); - commitments.avm_mem_one_min_inv = - transcript->template receive_from_prover(commitment_labels.avm_mem_one_min_inv); - commitments.avm_mem_op_a = transcript->template receive_from_prover(commitment_labels.avm_mem_op_a); - commitments.avm_mem_op_b = transcript->template receive_from_prover(commitment_labels.avm_mem_op_b); - commitments.avm_mem_op_c = transcript->template receive_from_prover(commitment_labels.avm_mem_op_c); - commitments.avm_mem_op_d = transcript->template receive_from_prover(commitment_labels.avm_mem_op_d); - commitments.avm_mem_r_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_mem_r_in_tag); - commitments.avm_mem_rng_chk_sel = - transcript->template receive_from_prover(commitment_labels.avm_mem_rng_chk_sel); - commitments.avm_mem_rw = transcript->template receive_from_prover(commitment_labels.avm_mem_rw); - commitments.avm_mem_sel_cmov = - transcript->template receive_from_prover(commitment_labels.avm_mem_sel_cmov); - commitments.avm_mem_sel_mov_a = - transcript->template receive_from_prover(commitment_labels.avm_mem_sel_mov_a); - commitments.avm_mem_sel_mov_b = - transcript->template receive_from_prover(commitment_labels.avm_mem_sel_mov_b); - commitments.avm_mem_skip_check_tag = - transcript->template receive_from_prover(commitment_labels.avm_mem_skip_check_tag); - commitments.avm_mem_space_id = - transcript->template receive_from_prover(commitment_labels.avm_mem_space_id); - commitments.avm_mem_tag = transcript->template receive_from_prover(commitment_labels.avm_mem_tag); - commitments.avm_mem_tag_err = - transcript->template receive_from_prover(commitment_labels.avm_mem_tag_err); - commitments.avm_mem_tsp = transcript->template receive_from_prover(commitment_labels.avm_mem_tsp); - commitments.avm_mem_val = transcript->template receive_from_prover(commitment_labels.avm_mem_val); - commitments.avm_mem_w_in_tag = - transcript->template receive_from_prover(commitment_labels.avm_mem_w_in_tag); - commitments.avm_pedersen_clk = - transcript->template receive_from_prover(commitment_labels.avm_pedersen_clk); - commitments.avm_pedersen_input = - transcript->template receive_from_prover(commitment_labels.avm_pedersen_input); - commitments.avm_pedersen_output = - transcript->template receive_from_prover(commitment_labels.avm_pedersen_output); - commitments.avm_pedersen_pedersen_sel = - transcript->template receive_from_prover(commitment_labels.avm_pedersen_pedersen_sel); - commitments.avm_poseidon2_clk = - transcript->template receive_from_prover(commitment_labels.avm_poseidon2_clk); - commitments.avm_poseidon2_input = - transcript->template receive_from_prover(commitment_labels.avm_poseidon2_input); - commitments.avm_poseidon2_output = - transcript->template receive_from_prover(commitment_labels.avm_poseidon2_output); - commitments.avm_poseidon2_poseidon_perm_sel = - transcript->template receive_from_prover(commitment_labels.avm_poseidon2_poseidon_perm_sel); - commitments.avm_sha256_clk = transcript->template receive_from_prover(commitment_labels.avm_sha256_clk); - commitments.avm_sha256_input = - transcript->template receive_from_prover(commitment_labels.avm_sha256_input); - commitments.avm_sha256_output = - transcript->template receive_from_prover(commitment_labels.avm_sha256_output); - commitments.avm_sha256_sha256_compression_sel = - transcript->template receive_from_prover(commitment_labels.avm_sha256_sha256_compression_sel); - commitments.avm_sha256_state = - transcript->template receive_from_prover(commitment_labels.avm_sha256_state); + commitments.alu_a_hi = transcript->template receive_from_prover(commitment_labels.alu_a_hi); + commitments.alu_a_lo = transcript->template receive_from_prover(commitment_labels.alu_a_lo); + commitments.alu_alu_sel = transcript->template receive_from_prover(commitment_labels.alu_alu_sel); + commitments.alu_b_hi = transcript->template receive_from_prover(commitment_labels.alu_b_hi); + commitments.alu_b_lo = transcript->template receive_from_prover(commitment_labels.alu_b_lo); + commitments.alu_borrow = transcript->template receive_from_prover(commitment_labels.alu_borrow); + commitments.alu_cf = transcript->template receive_from_prover(commitment_labels.alu_cf); + commitments.alu_clk = transcript->template receive_from_prover(commitment_labels.alu_clk); + commitments.alu_cmp_rng_ctr = + transcript->template receive_from_prover(commitment_labels.alu_cmp_rng_ctr); + commitments.alu_cmp_sel = transcript->template receive_from_prover(commitment_labels.alu_cmp_sel); + commitments.alu_div_rng_chk_selector = + transcript->template receive_from_prover(commitment_labels.alu_div_rng_chk_selector); + commitments.alu_div_u16_r0 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r0); + commitments.alu_div_u16_r1 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r1); + commitments.alu_div_u16_r2 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r2); + commitments.alu_div_u16_r3 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r3); + commitments.alu_div_u16_r4 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r4); + commitments.alu_div_u16_r5 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r5); + commitments.alu_div_u16_r6 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r6); + commitments.alu_div_u16_r7 = transcript->template receive_from_prover(commitment_labels.alu_div_u16_r7); + commitments.alu_divisor_hi = transcript->template receive_from_prover(commitment_labels.alu_divisor_hi); + commitments.alu_divisor_lo = transcript->template receive_from_prover(commitment_labels.alu_divisor_lo); + commitments.alu_ff_tag = transcript->template receive_from_prover(commitment_labels.alu_ff_tag); + commitments.alu_ia = transcript->template receive_from_prover(commitment_labels.alu_ia); + commitments.alu_ib = transcript->template receive_from_prover(commitment_labels.alu_ib); + commitments.alu_ic = transcript->template receive_from_prover(commitment_labels.alu_ic); + commitments.alu_in_tag = transcript->template receive_from_prover(commitment_labels.alu_in_tag); + commitments.alu_op_add = transcript->template receive_from_prover(commitment_labels.alu_op_add); + commitments.alu_op_cast = transcript->template receive_from_prover(commitment_labels.alu_op_cast); + commitments.alu_op_cast_prev = + transcript->template receive_from_prover(commitment_labels.alu_op_cast_prev); + commitments.alu_op_div = transcript->template receive_from_prover(commitment_labels.alu_op_div); + commitments.alu_op_div_a_lt_b = + transcript->template receive_from_prover(commitment_labels.alu_op_div_a_lt_b); + commitments.alu_op_div_std = transcript->template receive_from_prover(commitment_labels.alu_op_div_std); + commitments.alu_op_eq = transcript->template receive_from_prover(commitment_labels.alu_op_eq); + commitments.alu_op_eq_diff_inv = + transcript->template receive_from_prover(commitment_labels.alu_op_eq_diff_inv); + commitments.alu_op_lt = transcript->template receive_from_prover(commitment_labels.alu_op_lt); + commitments.alu_op_lte = transcript->template receive_from_prover(commitment_labels.alu_op_lte); + commitments.alu_op_mul = transcript->template receive_from_prover(commitment_labels.alu_op_mul); + commitments.alu_op_not = transcript->template receive_from_prover(commitment_labels.alu_op_not); + commitments.alu_op_shl = transcript->template receive_from_prover(commitment_labels.alu_op_shl); + commitments.alu_op_shr = transcript->template receive_from_prover(commitment_labels.alu_op_shr); + commitments.alu_op_sub = transcript->template receive_from_prover(commitment_labels.alu_op_sub); + commitments.alu_p_a_borrow = transcript->template receive_from_prover(commitment_labels.alu_p_a_borrow); + commitments.alu_p_b_borrow = transcript->template receive_from_prover(commitment_labels.alu_p_b_borrow); + commitments.alu_p_sub_a_hi = transcript->template receive_from_prover(commitment_labels.alu_p_sub_a_hi); + commitments.alu_p_sub_a_lo = transcript->template receive_from_prover(commitment_labels.alu_p_sub_a_lo); + commitments.alu_p_sub_b_hi = transcript->template receive_from_prover(commitment_labels.alu_p_sub_b_hi); + commitments.alu_p_sub_b_lo = transcript->template receive_from_prover(commitment_labels.alu_p_sub_b_lo); + commitments.alu_partial_prod_hi = + transcript->template receive_from_prover(commitment_labels.alu_partial_prod_hi); + commitments.alu_partial_prod_lo = + transcript->template receive_from_prover(commitment_labels.alu_partial_prod_lo); + commitments.alu_quotient_hi = + transcript->template receive_from_prover(commitment_labels.alu_quotient_hi); + commitments.alu_quotient_lo = + transcript->template receive_from_prover(commitment_labels.alu_quotient_lo); + commitments.alu_remainder = transcript->template receive_from_prover(commitment_labels.alu_remainder); + commitments.alu_res_hi = transcript->template receive_from_prover(commitment_labels.alu_res_hi); + commitments.alu_res_lo = transcript->template receive_from_prover(commitment_labels.alu_res_lo); + commitments.alu_rng_chk_lookup_selector = + transcript->template receive_from_prover(commitment_labels.alu_rng_chk_lookup_selector); + commitments.alu_rng_chk_sel = + transcript->template receive_from_prover(commitment_labels.alu_rng_chk_sel); + commitments.alu_shift_lt_bit_len = + transcript->template receive_from_prover(commitment_labels.alu_shift_lt_bit_len); + commitments.alu_shift_sel = transcript->template receive_from_prover(commitment_labels.alu_shift_sel); + commitments.alu_t_sub_s_bits = + transcript->template receive_from_prover(commitment_labels.alu_t_sub_s_bits); + commitments.alu_two_pow_s = transcript->template receive_from_prover(commitment_labels.alu_two_pow_s); + commitments.alu_two_pow_t_sub_s = + transcript->template receive_from_prover(commitment_labels.alu_two_pow_t_sub_s); + commitments.alu_u128_tag = transcript->template receive_from_prover(commitment_labels.alu_u128_tag); + commitments.alu_u16_r0 = transcript->template receive_from_prover(commitment_labels.alu_u16_r0); + commitments.alu_u16_r1 = transcript->template receive_from_prover(commitment_labels.alu_u16_r1); + commitments.alu_u16_r10 = transcript->template receive_from_prover(commitment_labels.alu_u16_r10); + commitments.alu_u16_r11 = transcript->template receive_from_prover(commitment_labels.alu_u16_r11); + commitments.alu_u16_r12 = transcript->template receive_from_prover(commitment_labels.alu_u16_r12); + commitments.alu_u16_r13 = transcript->template receive_from_prover(commitment_labels.alu_u16_r13); + commitments.alu_u16_r14 = transcript->template receive_from_prover(commitment_labels.alu_u16_r14); + commitments.alu_u16_r2 = transcript->template receive_from_prover(commitment_labels.alu_u16_r2); + commitments.alu_u16_r3 = transcript->template receive_from_prover(commitment_labels.alu_u16_r3); + commitments.alu_u16_r4 = transcript->template receive_from_prover(commitment_labels.alu_u16_r4); + commitments.alu_u16_r5 = transcript->template receive_from_prover(commitment_labels.alu_u16_r5); + commitments.alu_u16_r6 = transcript->template receive_from_prover(commitment_labels.alu_u16_r6); + commitments.alu_u16_r7 = transcript->template receive_from_prover(commitment_labels.alu_u16_r7); + commitments.alu_u16_r8 = transcript->template receive_from_prover(commitment_labels.alu_u16_r8); + commitments.alu_u16_r9 = transcript->template receive_from_prover(commitment_labels.alu_u16_r9); + commitments.alu_u16_tag = transcript->template receive_from_prover(commitment_labels.alu_u16_tag); + commitments.alu_u32_tag = transcript->template receive_from_prover(commitment_labels.alu_u32_tag); + commitments.alu_u64_tag = transcript->template receive_from_prover(commitment_labels.alu_u64_tag); + commitments.alu_u8_r0 = transcript->template receive_from_prover(commitment_labels.alu_u8_r0); + commitments.alu_u8_r1 = transcript->template receive_from_prover(commitment_labels.alu_u8_r1); + commitments.alu_u8_tag = transcript->template receive_from_prover(commitment_labels.alu_u8_tag); + commitments.binary_acc_ia = transcript->template receive_from_prover(commitment_labels.binary_acc_ia); + commitments.binary_acc_ib = transcript->template receive_from_prover(commitment_labels.binary_acc_ib); + commitments.binary_acc_ic = transcript->template receive_from_prover(commitment_labels.binary_acc_ic); + commitments.binary_bin_sel = transcript->template receive_from_prover(commitment_labels.binary_bin_sel); + commitments.binary_clk = transcript->template receive_from_prover(commitment_labels.binary_clk); + commitments.binary_ia_bytes = + transcript->template receive_from_prover(commitment_labels.binary_ia_bytes); + commitments.binary_ib_bytes = + transcript->template receive_from_prover(commitment_labels.binary_ib_bytes); + commitments.binary_ic_bytes = + transcript->template receive_from_prover(commitment_labels.binary_ic_bytes); + commitments.binary_in_tag = transcript->template receive_from_prover(commitment_labels.binary_in_tag); + commitments.binary_mem_tag_ctr = + transcript->template receive_from_prover(commitment_labels.binary_mem_tag_ctr); + commitments.binary_mem_tag_ctr_inv = + transcript->template receive_from_prover(commitment_labels.binary_mem_tag_ctr_inv); + commitments.binary_op_id = transcript->template receive_from_prover(commitment_labels.binary_op_id); + commitments.binary_start = transcript->template receive_from_prover(commitment_labels.binary_start); + commitments.byte_lookup_bin_sel = + transcript->template receive_from_prover(commitment_labels.byte_lookup_bin_sel); + commitments.byte_lookup_table_byte_lengths = + transcript->template receive_from_prover(commitment_labels.byte_lookup_table_byte_lengths); + commitments.byte_lookup_table_in_tags = + transcript->template receive_from_prover(commitment_labels.byte_lookup_table_in_tags); + commitments.byte_lookup_table_input_a = + transcript->template receive_from_prover(commitment_labels.byte_lookup_table_input_a); + commitments.byte_lookup_table_input_b = + transcript->template receive_from_prover(commitment_labels.byte_lookup_table_input_b); + commitments.byte_lookup_table_op_id = + transcript->template receive_from_prover(commitment_labels.byte_lookup_table_op_id); + commitments.byte_lookup_table_output = + transcript->template receive_from_prover(commitment_labels.byte_lookup_table_output); + commitments.conversion_clk = transcript->template receive_from_prover(commitment_labels.conversion_clk); + commitments.conversion_input = + transcript->template receive_from_prover(commitment_labels.conversion_input); + commitments.conversion_num_limbs = + transcript->template receive_from_prover(commitment_labels.conversion_num_limbs); + commitments.conversion_radix = + transcript->template receive_from_prover(commitment_labels.conversion_radix); + commitments.conversion_to_radix_le_sel = + transcript->template receive_from_prover(commitment_labels.conversion_to_radix_le_sel); + commitments.gas_da_gas_fixed_table = + transcript->template receive_from_prover(commitment_labels.gas_da_gas_fixed_table); + commitments.gas_gas_cost_sel = + transcript->template receive_from_prover(commitment_labels.gas_gas_cost_sel); + commitments.gas_l2_gas_fixed_table = + transcript->template receive_from_prover(commitment_labels.gas_l2_gas_fixed_table); + commitments.keccakf1600_clk = + transcript->template receive_from_prover(commitment_labels.keccakf1600_clk); + commitments.keccakf1600_input = + transcript->template receive_from_prover(commitment_labels.keccakf1600_input); + commitments.keccakf1600_keccakf1600_sel = + transcript->template receive_from_prover(commitment_labels.keccakf1600_keccakf1600_sel); + commitments.keccakf1600_output = + transcript->template receive_from_prover(commitment_labels.keccakf1600_output); + commitments.kernel_emit_l2_to_l1_msg_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_emit_l2_to_l1_msg_write_offset); + commitments.kernel_emit_note_hash_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_emit_note_hash_write_offset); + commitments.kernel_emit_nullifier_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_emit_nullifier_write_offset); + commitments.kernel_emit_unencrypted_log_write_offset = transcript->template receive_from_prover( + commitment_labels.kernel_emit_unencrypted_log_write_offset); + commitments.kernel_kernel_in_offset = + transcript->template receive_from_prover(commitment_labels.kernel_kernel_in_offset); + commitments.kernel_kernel_inputs = + transcript->template receive_from_prover(commitment_labels.kernel_kernel_inputs); + commitments.kernel_kernel_metadata_out = + transcript->template receive_from_prover(commitment_labels.kernel_kernel_metadata_out); + commitments.kernel_kernel_out_offset = + transcript->template receive_from_prover(commitment_labels.kernel_kernel_out_offset); + commitments.kernel_kernel_side_effect_out = + transcript->template receive_from_prover(commitment_labels.kernel_kernel_side_effect_out); + commitments.kernel_kernel_value_out = + transcript->template receive_from_prover(commitment_labels.kernel_kernel_value_out); + commitments.kernel_l1_to_l2_msg_exists_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_l1_to_l2_msg_exists_write_offset); + commitments.kernel_note_hash_exist_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_note_hash_exist_write_offset); + commitments.kernel_nullifier_exists_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_nullifier_exists_write_offset); + commitments.kernel_nullifier_non_exists_write_offset = transcript->template receive_from_prover( + commitment_labels.kernel_nullifier_non_exists_write_offset); + commitments.kernel_q_public_input_kernel_add_to_table = transcript->template receive_from_prover( + commitment_labels.kernel_q_public_input_kernel_add_to_table); + commitments.kernel_q_public_input_kernel_out_add_to_table = transcript->template receive_from_prover( + commitment_labels.kernel_q_public_input_kernel_out_add_to_table); + commitments.kernel_side_effect_counter = + transcript->template receive_from_prover(commitment_labels.kernel_side_effect_counter); + commitments.kernel_sload_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_sload_write_offset); + commitments.kernel_sstore_write_offset = + transcript->template receive_from_prover(commitment_labels.kernel_sstore_write_offset); + commitments.main_abs_da_rem_gas_hi = + transcript->template receive_from_prover(commitment_labels.main_abs_da_rem_gas_hi); + commitments.main_abs_da_rem_gas_lo = + transcript->template receive_from_prover(commitment_labels.main_abs_da_rem_gas_lo); + commitments.main_abs_l2_rem_gas_hi = + transcript->template receive_from_prover(commitment_labels.main_abs_l2_rem_gas_hi); + commitments.main_abs_l2_rem_gas_lo = + transcript->template receive_from_prover(commitment_labels.main_abs_l2_rem_gas_lo); + commitments.main_alu_in_tag = + transcript->template receive_from_prover(commitment_labels.main_alu_in_tag); + commitments.main_alu_sel = transcript->template receive_from_prover(commitment_labels.main_alu_sel); + commitments.main_bin_op_id = transcript->template receive_from_prover(commitment_labels.main_bin_op_id); + commitments.main_bin_sel = transcript->template receive_from_prover(commitment_labels.main_bin_sel); + commitments.main_call_ptr = transcript->template receive_from_prover(commitment_labels.main_call_ptr); + commitments.main_da_gas_op = transcript->template receive_from_prover(commitment_labels.main_da_gas_op); + commitments.main_da_gas_remaining = + transcript->template receive_from_prover(commitment_labels.main_da_gas_remaining); + commitments.main_da_out_of_gas = + transcript->template receive_from_prover(commitment_labels.main_da_out_of_gas); + commitments.main_gas_cost_active = + transcript->template receive_from_prover(commitment_labels.main_gas_cost_active); + commitments.main_ia = transcript->template receive_from_prover(commitment_labels.main_ia); + commitments.main_ib = transcript->template receive_from_prover(commitment_labels.main_ib); + commitments.main_ic = transcript->template receive_from_prover(commitment_labels.main_ic); + commitments.main_id = transcript->template receive_from_prover(commitment_labels.main_id); + commitments.main_id_zero = transcript->template receive_from_prover(commitment_labels.main_id_zero); + commitments.main_ind_a = transcript->template receive_from_prover(commitment_labels.main_ind_a); + commitments.main_ind_b = transcript->template receive_from_prover(commitment_labels.main_ind_b); + commitments.main_ind_c = transcript->template receive_from_prover(commitment_labels.main_ind_c); + commitments.main_ind_d = transcript->template receive_from_prover(commitment_labels.main_ind_d); + commitments.main_ind_op_a = transcript->template receive_from_prover(commitment_labels.main_ind_op_a); + commitments.main_ind_op_b = transcript->template receive_from_prover(commitment_labels.main_ind_op_b); + commitments.main_ind_op_c = transcript->template receive_from_prover(commitment_labels.main_ind_op_c); + commitments.main_ind_op_d = transcript->template receive_from_prover(commitment_labels.main_ind_op_d); + commitments.main_internal_return_ptr = + transcript->template receive_from_prover(commitment_labels.main_internal_return_ptr); + commitments.main_inv = transcript->template receive_from_prover(commitment_labels.main_inv); + commitments.main_l2_gas_op = transcript->template receive_from_prover(commitment_labels.main_l2_gas_op); + commitments.main_l2_gas_remaining = + transcript->template receive_from_prover(commitment_labels.main_l2_gas_remaining); + commitments.main_l2_out_of_gas = + transcript->template receive_from_prover(commitment_labels.main_l2_out_of_gas); + commitments.main_last = transcript->template receive_from_prover(commitment_labels.main_last); + commitments.main_mem_idx_a = transcript->template receive_from_prover(commitment_labels.main_mem_idx_a); + commitments.main_mem_idx_b = transcript->template receive_from_prover(commitment_labels.main_mem_idx_b); + commitments.main_mem_idx_c = transcript->template receive_from_prover(commitment_labels.main_mem_idx_c); + commitments.main_mem_idx_d = transcript->template receive_from_prover(commitment_labels.main_mem_idx_d); + commitments.main_mem_op_a = transcript->template receive_from_prover(commitment_labels.main_mem_op_a); + commitments.main_mem_op_activate_gas = + transcript->template receive_from_prover(commitment_labels.main_mem_op_activate_gas); + commitments.main_mem_op_b = transcript->template receive_from_prover(commitment_labels.main_mem_op_b); + commitments.main_mem_op_c = transcript->template receive_from_prover(commitment_labels.main_mem_op_c); + commitments.main_mem_op_d = transcript->template receive_from_prover(commitment_labels.main_mem_op_d); + commitments.main_op_err = transcript->template receive_from_prover(commitment_labels.main_op_err); + commitments.main_opcode_val = + transcript->template receive_from_prover(commitment_labels.main_opcode_val); + commitments.main_pc = transcript->template receive_from_prover(commitment_labels.main_pc); + commitments.main_q_kernel_lookup = + transcript->template receive_from_prover(commitment_labels.main_q_kernel_lookup); + commitments.main_q_kernel_output_lookup = + transcript->template receive_from_prover(commitment_labels.main_q_kernel_output_lookup); + commitments.main_r_in_tag = transcript->template receive_from_prover(commitment_labels.main_r_in_tag); + commitments.main_rwa = transcript->template receive_from_prover(commitment_labels.main_rwa); + commitments.main_rwb = transcript->template receive_from_prover(commitment_labels.main_rwb); + commitments.main_rwc = transcript->template receive_from_prover(commitment_labels.main_rwc); + commitments.main_rwd = transcript->template receive_from_prover(commitment_labels.main_rwd); + commitments.main_sel_cmov = transcript->template receive_from_prover(commitment_labels.main_sel_cmov); + commitments.main_sel_external_call = + transcript->template receive_from_prover(commitment_labels.main_sel_external_call); + commitments.main_sel_halt = transcript->template receive_from_prover(commitment_labels.main_sel_halt); + commitments.main_sel_internal_call = + transcript->template receive_from_prover(commitment_labels.main_sel_internal_call); + commitments.main_sel_internal_return = + transcript->template receive_from_prover(commitment_labels.main_sel_internal_return); + commitments.main_sel_jump = transcript->template receive_from_prover(commitment_labels.main_sel_jump); + commitments.main_sel_jumpi = transcript->template receive_from_prover(commitment_labels.main_sel_jumpi); + commitments.main_sel_mov = transcript->template receive_from_prover(commitment_labels.main_sel_mov); + commitments.main_sel_mov_a = transcript->template receive_from_prover(commitment_labels.main_sel_mov_a); + commitments.main_sel_mov_b = transcript->template receive_from_prover(commitment_labels.main_sel_mov_b); + commitments.main_sel_op_add = + transcript->template receive_from_prover(commitment_labels.main_sel_op_add); + commitments.main_sel_op_address = + transcript->template receive_from_prover(commitment_labels.main_sel_op_address); + commitments.main_sel_op_and = + transcript->template receive_from_prover(commitment_labels.main_sel_op_and); + commitments.main_sel_op_block_number = + transcript->template receive_from_prover(commitment_labels.main_sel_op_block_number); + commitments.main_sel_op_cast = + transcript->template receive_from_prover(commitment_labels.main_sel_op_cast); + commitments.main_sel_op_chain_id = + transcript->template receive_from_prover(commitment_labels.main_sel_op_chain_id); + commitments.main_sel_op_coinbase = + transcript->template receive_from_prover(commitment_labels.main_sel_op_coinbase); + commitments.main_sel_op_dagasleft = + transcript->template receive_from_prover(commitment_labels.main_sel_op_dagasleft); + commitments.main_sel_op_div = + transcript->template receive_from_prover(commitment_labels.main_sel_op_div); + commitments.main_sel_op_emit_l2_to_l1_msg = + transcript->template receive_from_prover(commitment_labels.main_sel_op_emit_l2_to_l1_msg); + commitments.main_sel_op_emit_note_hash = + transcript->template receive_from_prover(commitment_labels.main_sel_op_emit_note_hash); + commitments.main_sel_op_emit_nullifier = + transcript->template receive_from_prover(commitment_labels.main_sel_op_emit_nullifier); + commitments.main_sel_op_emit_unencrypted_log = + transcript->template receive_from_prover(commitment_labels.main_sel_op_emit_unencrypted_log); + commitments.main_sel_op_eq = transcript->template receive_from_prover(commitment_labels.main_sel_op_eq); + commitments.main_sel_op_fdiv = + transcript->template receive_from_prover(commitment_labels.main_sel_op_fdiv); + commitments.main_sel_op_fee_per_da_gas = + transcript->template receive_from_prover(commitment_labels.main_sel_op_fee_per_da_gas); + commitments.main_sel_op_fee_per_l2_gas = + transcript->template receive_from_prover(commitment_labels.main_sel_op_fee_per_l2_gas); + commitments.main_sel_op_get_contract_instance = + transcript->template receive_from_prover(commitment_labels.main_sel_op_get_contract_instance); + commitments.main_sel_op_keccak = + transcript->template receive_from_prover(commitment_labels.main_sel_op_keccak); + commitments.main_sel_op_l1_to_l2_msg_exists = + transcript->template receive_from_prover(commitment_labels.main_sel_op_l1_to_l2_msg_exists); + commitments.main_sel_op_l2gasleft = + transcript->template receive_from_prover(commitment_labels.main_sel_op_l2gasleft); + commitments.main_sel_op_lt = transcript->template receive_from_prover(commitment_labels.main_sel_op_lt); + commitments.main_sel_op_lte = + transcript->template receive_from_prover(commitment_labels.main_sel_op_lte); + commitments.main_sel_op_mul = + transcript->template receive_from_prover(commitment_labels.main_sel_op_mul); + commitments.main_sel_op_not = + transcript->template receive_from_prover(commitment_labels.main_sel_op_not); + commitments.main_sel_op_note_hash_exists = + transcript->template receive_from_prover(commitment_labels.main_sel_op_note_hash_exists); + commitments.main_sel_op_nullifier_exists = + transcript->template receive_from_prover(commitment_labels.main_sel_op_nullifier_exists); + commitments.main_sel_op_or = transcript->template receive_from_prover(commitment_labels.main_sel_op_or); + commitments.main_sel_op_pedersen = + transcript->template receive_from_prover(commitment_labels.main_sel_op_pedersen); + commitments.main_sel_op_poseidon2 = + transcript->template receive_from_prover(commitment_labels.main_sel_op_poseidon2); + commitments.main_sel_op_radix_le = + transcript->template receive_from_prover(commitment_labels.main_sel_op_radix_le); + commitments.main_sel_op_sender = + transcript->template receive_from_prover(commitment_labels.main_sel_op_sender); + commitments.main_sel_op_sha256 = + transcript->template receive_from_prover(commitment_labels.main_sel_op_sha256); + commitments.main_sel_op_shl = + transcript->template receive_from_prover(commitment_labels.main_sel_op_shl); + commitments.main_sel_op_shr = + transcript->template receive_from_prover(commitment_labels.main_sel_op_shr); + commitments.main_sel_op_sload = + transcript->template receive_from_prover(commitment_labels.main_sel_op_sload); + commitments.main_sel_op_sstore = + transcript->template receive_from_prover(commitment_labels.main_sel_op_sstore); + commitments.main_sel_op_storage_address = + transcript->template receive_from_prover(commitment_labels.main_sel_op_storage_address); + commitments.main_sel_op_sub = + transcript->template receive_from_prover(commitment_labels.main_sel_op_sub); + commitments.main_sel_op_timestamp = + transcript->template receive_from_prover(commitment_labels.main_sel_op_timestamp); + commitments.main_sel_op_transaction_fee = + transcript->template receive_from_prover(commitment_labels.main_sel_op_transaction_fee); + commitments.main_sel_op_version = + transcript->template receive_from_prover(commitment_labels.main_sel_op_version); + commitments.main_sel_op_xor = + transcript->template receive_from_prover(commitment_labels.main_sel_op_xor); + commitments.main_sel_rng_16 = + transcript->template receive_from_prover(commitment_labels.main_sel_rng_16); + commitments.main_sel_rng_8 = transcript->template receive_from_prover(commitment_labels.main_sel_rng_8); + commitments.main_space_id = transcript->template receive_from_prover(commitment_labels.main_space_id); + commitments.main_table_pow_2 = + transcript->template receive_from_prover(commitment_labels.main_table_pow_2); + commitments.main_tag_err = transcript->template receive_from_prover(commitment_labels.main_tag_err); + commitments.main_w_in_tag = transcript->template receive_from_prover(commitment_labels.main_w_in_tag); + commitments.mem_addr = transcript->template receive_from_prover(commitment_labels.mem_addr); + commitments.mem_clk = transcript->template receive_from_prover(commitment_labels.mem_clk); + commitments.mem_diff_hi = transcript->template receive_from_prover(commitment_labels.mem_diff_hi); + commitments.mem_diff_lo = transcript->template receive_from_prover(commitment_labels.mem_diff_lo); + commitments.mem_diff_mid = transcript->template receive_from_prover(commitment_labels.mem_diff_mid); + commitments.mem_glob_addr = transcript->template receive_from_prover(commitment_labels.mem_glob_addr); + commitments.mem_ind_op_a = transcript->template receive_from_prover(commitment_labels.mem_ind_op_a); + commitments.mem_ind_op_b = transcript->template receive_from_prover(commitment_labels.mem_ind_op_b); + commitments.mem_ind_op_c = transcript->template receive_from_prover(commitment_labels.mem_ind_op_c); + commitments.mem_ind_op_d = transcript->template receive_from_prover(commitment_labels.mem_ind_op_d); + commitments.mem_last = transcript->template receive_from_prover(commitment_labels.mem_last); + commitments.mem_lastAccess = transcript->template receive_from_prover(commitment_labels.mem_lastAccess); + commitments.mem_mem_sel = transcript->template receive_from_prover(commitment_labels.mem_mem_sel); + commitments.mem_one_min_inv = + transcript->template receive_from_prover(commitment_labels.mem_one_min_inv); + commitments.mem_op_a = transcript->template receive_from_prover(commitment_labels.mem_op_a); + commitments.mem_op_b = transcript->template receive_from_prover(commitment_labels.mem_op_b); + commitments.mem_op_c = transcript->template receive_from_prover(commitment_labels.mem_op_c); + commitments.mem_op_d = transcript->template receive_from_prover(commitment_labels.mem_op_d); + commitments.mem_r_in_tag = transcript->template receive_from_prover(commitment_labels.mem_r_in_tag); + commitments.mem_rng_chk_sel = + transcript->template receive_from_prover(commitment_labels.mem_rng_chk_sel); + commitments.mem_rw = transcript->template receive_from_prover(commitment_labels.mem_rw); + commitments.mem_sel_cmov = transcript->template receive_from_prover(commitment_labels.mem_sel_cmov); + commitments.mem_sel_mov_a = transcript->template receive_from_prover(commitment_labels.mem_sel_mov_a); + commitments.mem_sel_mov_b = transcript->template receive_from_prover(commitment_labels.mem_sel_mov_b); + commitments.mem_skip_check_tag = + transcript->template receive_from_prover(commitment_labels.mem_skip_check_tag); + commitments.mem_space_id = transcript->template receive_from_prover(commitment_labels.mem_space_id); + commitments.mem_tag = transcript->template receive_from_prover(commitment_labels.mem_tag); + commitments.mem_tag_err = transcript->template receive_from_prover(commitment_labels.mem_tag_err); + commitments.mem_tsp = transcript->template receive_from_prover(commitment_labels.mem_tsp); + commitments.mem_val = transcript->template receive_from_prover(commitment_labels.mem_val); + commitments.mem_w_in_tag = transcript->template receive_from_prover(commitment_labels.mem_w_in_tag); + commitments.pedersen_clk = transcript->template receive_from_prover(commitment_labels.pedersen_clk); + commitments.pedersen_input = transcript->template receive_from_prover(commitment_labels.pedersen_input); + commitments.pedersen_output = + transcript->template receive_from_prover(commitment_labels.pedersen_output); + commitments.pedersen_pedersen_sel = + transcript->template receive_from_prover(commitment_labels.pedersen_pedersen_sel); + commitments.poseidon2_clk = transcript->template receive_from_prover(commitment_labels.poseidon2_clk); + commitments.poseidon2_input = + transcript->template receive_from_prover(commitment_labels.poseidon2_input); + commitments.poseidon2_output = + transcript->template receive_from_prover(commitment_labels.poseidon2_output); + commitments.poseidon2_poseidon_perm_sel = + transcript->template receive_from_prover(commitment_labels.poseidon2_poseidon_perm_sel); + commitments.sha256_clk = transcript->template receive_from_prover(commitment_labels.sha256_clk); + commitments.sha256_input = transcript->template receive_from_prover(commitment_labels.sha256_input); + commitments.sha256_output = transcript->template receive_from_prover(commitment_labels.sha256_output); + commitments.sha256_sha256_compression_sel = + transcript->template receive_from_prover(commitment_labels.sha256_sha256_compression_sel); + commitments.sha256_state = transcript->template receive_from_prover(commitment_labels.sha256_state); commitments.lookup_byte_lengths_counts = transcript->template receive_from_prover(commitment_labels.lookup_byte_lengths_counts); commitments.lookup_byte_operations_counts = @@ -778,27 +679,27 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vector(tag))); + EXPECT_EQ(main_row.main_r_in_tag, FF(static_cast(tag))); // Check that intermediate registers are correctly copied in Alu trace - EXPECT_EQ(alu_row.avm_alu_ia, a); - EXPECT_EQ(alu_row.avm_alu_ib, b); - EXPECT_EQ(alu_row.avm_alu_ic, c); + EXPECT_EQ(alu_row.alu_ia, a); + EXPECT_EQ(alu_row.alu_ib, b); + EXPECT_EQ(alu_row.alu_ic, c); // Check that no error is raised - EXPECT_EQ(main_row.avm_main_tag_err, FF(0)); - EXPECT_EQ(main_row.avm_main_op_err, FF(0)); + EXPECT_EQ(main_row.main_tag_err, FF(0)); + EXPECT_EQ(main_row.main_op_err, FF(0)); } Row common_validate_add(std::vector const& trace, @@ -62,22 +62,22 @@ Row common_validate_add(std::vector const& trace, avm_trace::AvmMemoryTag const tag) { // Find the first row enabling the addition selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_add == FF(1); }); // Find the corresponding Alu trace row - auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); EXPECT_TRUE(alu_row != trace.end()); common_validate_arithmetic_op(*row, *alu_row, a, b, c, addr_a, addr_b, addr_c, tag); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(tag))); // Check that addition selector is set. - EXPECT_EQ(row->avm_main_sel_op_add, FF(1)); - EXPECT_EQ(alu_row->avm_alu_op_add, FF(1)); + EXPECT_EQ(row->main_sel_op_add, FF(1)); + EXPECT_EQ(alu_row->alu_op_add, FF(1)); return *alu_row; } @@ -92,22 +92,22 @@ Row common_validate_sub(std::vector const& trace, avm_trace::AvmMemoryTag const tag) { // Find the first row enabling the subtraction selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == FF(1); }); // Find the corresponding Alu trace row - auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); EXPECT_TRUE(alu_row != trace.end()); common_validate_arithmetic_op(*row, *alu_row, a, b, c, addr_a, addr_b, addr_c, tag); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(tag))); // Check that subtraction selector is set. - EXPECT_EQ(row->avm_main_sel_op_sub, FF(1)); - EXPECT_EQ(alu_row->avm_alu_op_sub, FF(1)); + EXPECT_EQ(row->main_sel_op_sub, FF(1)); + EXPECT_EQ(alu_row->alu_op_sub, FF(1)); return *alu_row; } @@ -122,22 +122,22 @@ size_t common_validate_mul(std::vector const& trace, avm_trace::AvmMemoryTag const tag) { // Find the first row enabling the multiplication selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == FF(1); }); // Find the corresponding Alu trace row - auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); EXPECT_TRUE(alu_row != trace.end()); common_validate_arithmetic_op(*row, *alu_row, a, b, c, addr_a, addr_b, addr_c, tag); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(tag))); // Check that multiplication selector is set. - EXPECT_EQ(row->avm_main_sel_op_mul, FF(1)); - EXPECT_EQ(alu_row->avm_alu_op_mul, FF(1)); + EXPECT_EQ(row->main_sel_op_mul, FF(1)); + EXPECT_EQ(alu_row->alu_op_mul, FF(1)); return static_cast(alu_row - trace.begin()); } @@ -152,22 +152,22 @@ size_t common_validate_eq(std::vector const& trace, avm_trace::AvmMemoryTag const tag) { // Find the first row enabling the equality selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); // Find the corresponding Alu trace row - auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); EXPECT_TRUE(alu_row != trace.end()); common_validate_arithmetic_op(*row, *alu_row, a, b, c, addr_a, addr_b, addr_c, tag); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(AvmMemoryTag::U8))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(AvmMemoryTag::U8))); // Check that equality selector is set. - EXPECT_EQ(row->avm_main_sel_op_eq, FF(1)); - EXPECT_EQ(alu_row->avm_alu_op_eq, FF(1)); + EXPECT_EQ(row->main_sel_op_eq, FF(1)); + EXPECT_EQ(alu_row->alu_op_eq, FF(1)); return static_cast(alu_row - trace.begin()); } @@ -182,21 +182,21 @@ size_t common_validate_div(std::vector const& trace, avm_trace::AvmMemoryTag const tag) { // Find the first row enabling the division selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_div == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_div == FF(1); }); // Find the corresponding Alu trace row - auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); EXPECT_TRUE(alu_row != trace.end()); common_validate_arithmetic_op(*row, *alu_row, a, b, c, addr_a, addr_b, addr_c, tag); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(tag))); // Check that division selector is set. - EXPECT_EQ(alu_row->avm_alu_op_div, FF(1)); + EXPECT_EQ(alu_row->alu_op_div, FF(1)); return static_cast(alu_row - trace.begin()); } @@ -245,7 +245,7 @@ class AvmArithmeticTests : public ::testing::Test { trace_builder.halt(); auto trace = trace_builder.finalize(); - auto select_row = [](Row r) { return r.avm_main_sel_op_add == FF(1); }; + auto select_row = [](Row r) { return r.main_sel_op_add == FF(1); }; mutate_ic_in_trace(trace, select_row, c_mutated, true); return trace; @@ -262,7 +262,7 @@ class AvmArithmeticTests : public ::testing::Test { trace_builder.halt(); auto trace = trace_builder.finalize(); - auto select_row = [](Row r) { return r.avm_main_sel_op_sub == FF(1); }; + auto select_row = [](Row r) { return r.main_sel_op_sub == FF(1); }; mutate_ic_in_trace(trace, select_row, c_mutated, true); return trace; @@ -279,7 +279,7 @@ class AvmArithmeticTests : public ::testing::Test { trace_builder.halt(); auto trace = trace_builder.finalize(); - auto select_row = [](Row r) { return r.avm_main_sel_op_mul == FF(1); }; + auto select_row = [](Row r) { return r.main_sel_op_mul == FF(1); }; mutate_ic_in_trace(trace, select_row, c_mutated, true); return trace; @@ -299,16 +299,16 @@ class AvmArithmeticTests : public ::testing::Test { trace_builder.halt(); auto trace = trace_builder.finalize(); - auto select_row = [](Row r) { return r.avm_main_sel_op_eq == FF(1); }; + auto select_row = [](Row r) { return r.main_sel_op_eq == FF(1); }; mutate_ic_in_trace(trace, select_row, c_mutated, true); auto main_trace_row = std::ranges::find_if(trace.begin(), trace.end(), select_row); - auto main_clk = main_trace_row->avm_main_clk; + auto main_clk = main_trace_row->main_clk; auto alu_row = - std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_alu_clk == main_clk; }); + std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.alu_clk == main_clk; }); - main_trace_row->avm_alu_op_eq_diff_inv = mutated_inv_diff; - alu_row->avm_alu_op_eq_diff_inv = mutated_inv_diff; + main_trace_row->alu_op_eq_diff_inv = mutated_inv_diff; + alu_row->alu_op_eq_diff_inv = mutated_inv_diff; return trace; } @@ -381,9 +381,9 @@ TEST_F(AvmArithmeticTestsFF, addition) auto alu_row = common_validate_add(trace, FF(37), FF(4), FF(41), FF(0), FF(1), FF(4), AvmMemoryTag::FF); - EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); validate_trace(std::move(trace), public_inputs, true); } @@ -400,9 +400,9 @@ TEST_F(AvmArithmeticTestsFF, subtraction) auto alu_row = common_validate_sub(trace, FF(17), FF(8), FF(9), FF(2), FF(0), FF(1), AvmMemoryTag::FF); - EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -420,9 +420,9 @@ TEST_F(AvmArithmeticTestsFF, multiplication) auto alu_row_index = common_validate_mul(trace, FF(20), FF(5), FF(100), FF(2), FF(0), FF(1), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -440,9 +440,9 @@ TEST_F(AvmArithmeticTestsFF, multiplicationByZero) auto alu_row_index = common_validate_mul(trace, FF(127), FF(0), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -458,14 +458,14 @@ TEST_F(AvmArithmeticTestsFF, fDivision) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Check that the correct result is stored at the expected memory location. EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_main_ic, FF(21)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(2)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); + EXPECT_EQ(row->main_ic, FF(21)); + EXPECT_EQ(row->main_mem_idx_c, FF(2)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -481,14 +481,14 @@ TEST_F(AvmArithmeticTestsFF, fDivisionNumeratorZero) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Check that the correct result is stored at the expected memory location. EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_main_ic, FF(0)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(0)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); + EXPECT_EQ(row->main_ic, FF(0)); + EXPECT_EQ(row->main_mem_idx_c, FF(0)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -505,15 +505,15 @@ TEST_F(AvmArithmeticTestsFF, fDivisionByZeroError) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Check that the correct result is stored at the expected memory location. EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_main_ic, FF(0)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(2)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); - EXPECT_EQ(row->avm_main_op_err, FF(1)); + EXPECT_EQ(row->main_ic, FF(0)); + EXPECT_EQ(row->main_mem_idx_c, FF(2)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); + EXPECT_EQ(row->main_op_err, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -528,15 +528,15 @@ TEST_F(AvmArithmeticTestsFF, fDivisionZeroByZeroError) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Check that the correct result is stored at the expected memory location. EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_main_ic, FF(0)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(2)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); - EXPECT_EQ(row->avm_main_op_err, FF(1)); + EXPECT_EQ(row->main_ic, FF(0)); + EXPECT_EQ(row->main_mem_idx_c, FF(2)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); + EXPECT_EQ(row->main_op_err, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -578,8 +578,8 @@ TEST_F(AvmArithmeticTestsFF, equality) auto alu_row_index = common_validate_eq(trace, elem, elem, FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); // Expect 0 as inv of (q-1) - (q-1) + EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0)); // Expect 0 as inv of (q-1) - (q-1) validate_trace(std::move(trace), public_inputs); } @@ -595,8 +595,8 @@ TEST_F(AvmArithmeticTestsFF, nonEquality) auto alu_row_index = common_validate_eq(trace, elem, FF(0), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::FF); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_ff_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-1).invert()); + EXPECT_EQ(alu_row.alu_ff_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(-1).invert()); validate_trace(std::move(trace), public_inputs); } @@ -630,15 +630,15 @@ TEST_F(AvmArithmeticTests, DivisionByZeroError) auto trace = trace_builder.finalize(); // Find the first row enabling the div selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_div == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_div == FF(1); }); // Check that the correct result is stored at the expected memory location. EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_main_ic, FF(0)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(2)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); - EXPECT_EQ(row->avm_main_op_err, FF(1)); + EXPECT_EQ(row->main_ic, FF(0)); + EXPECT_EQ(row->main_mem_idx_c, FF(2)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); + EXPECT_EQ(row->main_op_err, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -661,9 +661,9 @@ TEST_F(AvmArithmeticTestsU8, addition) auto alu_row = common_validate_add(trace, FF(62), FF(29), FF(91), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(91)); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(91)); validate_trace(std::move(trace), public_inputs); } @@ -682,10 +682,10 @@ TEST_F(AvmArithmeticTestsU8, additionCarry) auto alu_row = common_validate_add(trace, FF(159), FF(100), FF(3), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(3)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(1)); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(3)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -704,9 +704,9 @@ TEST_F(AvmArithmeticTestsU8, subtraction) auto alu_row = common_validate_sub(trace, FF(162), FF(29), FF(133), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(133)); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(133)); validate_trace(std::move(trace), public_inputs); } @@ -726,17 +726,17 @@ TEST_F(AvmArithmeticTestsU8, subtractionCarry) auto alu_row = common_validate_sub(trace, FF(5), FF(29), FF(232), FF(0), FF(1), FF(2), AvmMemoryTag::U8); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(232)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(1)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(232)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(UINT8_MAX)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(UINT16_MAX)); validate_trace(std::move(trace), public_inputs); } @@ -755,11 +755,11 @@ TEST_F(AvmArithmeticTestsU8, multiplication) auto alu_row_index = common_validate_mul(trace, FF(13), FF(15), FF(195), FF(0), FF(1), FF(2), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); // Decomposition of integer multiplication in 8-bit registers - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(195)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(195)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -778,12 +778,12 @@ TEST_F(AvmArithmeticTestsU8, multiplicationOverflow) auto alu_row_index = common_validate_mul(trace, FF(200), FF(170), FF(208), FF(0), FF(1), FF(2), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); // Decomposition of integer multiplication in 8-bit registers // 34'000 = 208 + 132 * 256 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(208)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(132)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(208)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(132)); validate_trace(std::move(trace), public_inputs); } @@ -796,8 +796,8 @@ TEST_F(AvmArithmeticTestsU8, equality) auto alu_row_index = common_validate_eq(trace, FF(128), FF(128), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -809,8 +809,8 @@ TEST_F(AvmArithmeticTestsU8, nonEquality) auto alu_row_index = common_validate_eq(trace, 84, 200, FF(0), FF(12), FF(15), FF(28), AvmMemoryTag::U8); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u8_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-116).invert()); + EXPECT_EQ(alu_row.alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(-116).invert()); validate_trace(std::move(trace), public_inputs); } @@ -832,10 +832,10 @@ TEST_F(AvmArithmeticTestsU16, addition) auto alu_row = common_validate_add(trace, FF(33005), FF(1775), FF(34780), FF(546), FF(119), FF(5), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xDC)); // 34780 = 0x87DC - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x87)); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0xDC)); // 34780 = 0x87DC + EXPECT_EQ(alu_row.alu_u8_r1, FF(0x87)); validate_trace(std::move(trace), public_inputs); } @@ -854,10 +854,10 @@ TEST_F(AvmArithmeticTestsU16, additionCarry) auto alu_row = common_validate_add(trace, FF(1000), FF(UINT16_MAX - 982), FF(17), FF(1), FF(0), FF(0), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(17)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(17)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -876,11 +876,11 @@ TEST_F(AvmArithmeticTestsU16, subtraction) auto alu_row = common_validate_sub(trace, FF(33005), FF(1775), FF(31230), FF(546), FF(119), FF(5), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xFE)); // 31230 in Hex: 79FE - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x79)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0xFE)); // 31230 in Hex: 79FE + EXPECT_EQ(alu_row.alu_u8_r1, FF(0x79)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -900,17 +900,17 @@ TEST_F(AvmArithmeticTestsU16, subtractionCarry) auto alu_row = common_validate_sub(trace, FF(1000), FF(UINT16_MAX - 982), FF(1983), FF(1), FF(0), FF(0), AvmMemoryTag::U16); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xBF)); // 1983 = 0x7BF - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(7)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(1)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0xBF)); // 1983 = 0x7BF + EXPECT_EQ(alu_row.alu_u8_r1, FF(7)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(UINT16_MAX)); validate_trace(std::move(trace), public_inputs); } @@ -930,12 +930,12 @@ TEST_F(AvmArithmeticTestsU16, multiplication) common_validate_mul(trace, FF(200), FF(245), FF(49000), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x68)); // 49000 = 0xBF68 - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xBF)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0x68)); // 49000 = 0xBF68 + EXPECT_EQ(alu_row.alu_u8_r1, FF(0xBF)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -954,14 +954,14 @@ TEST_F(AvmArithmeticTestsU16, multiplicationOverflow) auto alu_row_index = common_validate_mul(trace, FF(512), FF(1024), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 512 * 1024 = 0 + 8 * 2^16 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(8)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(8)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -974,8 +974,8 @@ TEST_F(AvmArithmeticTestsU16, equality) auto alu_row_index = common_validate_eq(trace, FF(35823), FF(35823), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -987,8 +987,8 @@ TEST_F(AvmArithmeticTestsU16, nonEquality) auto alu_row_index = common_validate_eq(trace, 35'823, 50'123, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U16); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u16_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(-14'300).invert()); + EXPECT_EQ(alu_row.alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(-14'300).invert()); validate_trace(std::move(trace), public_inputs); } @@ -1010,11 +1010,11 @@ TEST_F(AvmArithmeticTestsU32, addition) auto alu_row = common_validate_add( trace, FF(1000000000), FF(1234567891), FF(2234567891LLU), FF(8), FF(9), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(2234567891LLU & UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF((2234567891LLU >> 8) & UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(2234567891LLU >> 16)); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(2234567891LLU & UINT8_MAX)); + EXPECT_EQ(alu_row.alu_u8_r1, FF((2234567891LLU >> 8) & UINT8_MAX)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(2234567891LLU >> 16)); validate_trace(std::move(trace), public_inputs); } @@ -1033,10 +1033,10 @@ TEST_F(AvmArithmeticTestsU32, additionCarry) auto alu_row = common_validate_add(trace, FF(UINT32_MAX - 1293), FF(2293), FF(999), FF(8), FF(9), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(231)); // 999 = 3 * 256 + 231 - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(3)); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(231)); // 999 = 3 * 256 + 231 + EXPECT_EQ(alu_row.alu_u8_r1, FF(3)); validate_trace(std::move(trace), public_inputs); } @@ -1055,14 +1055,14 @@ TEST_F(AvmArithmeticTestsU32, subtraction) auto alu_row = common_validate_sub( trace, FF(1345678991), FF(1234567891), FF(111111100), FF(8), FF(9), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); // 111111100 = 0x69F6BBC - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xBC)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x6B)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x69F)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0xBC)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0x6B)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0x69F)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1082,19 +1082,19 @@ TEST_F(AvmArithmeticTestsU32, subtractionCarry) auto alu_row = common_validate_sub( trace, FF(3210987654LLU), FF(UINT32_MAX - 99), FF(3210987754LLU), FF(9), FF(8), FF(0), AvmMemoryTag::U32); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(1)); // 3210987754 = 0xBF63C8EA - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xEA)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xC8)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xBF63)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0xEA)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0xC8)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0xBF63)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(UINT16_MAX)); validate_trace(std::move(trace), public_inputs); } @@ -1114,16 +1114,16 @@ TEST_F(AvmArithmeticTestsU32, multiplication) common_validate_mul(trace, FF(11111), FF(11111), FF(123454321), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 123454321 = 0x75BC371 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x71)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xC3)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x75B)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0x71)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0xC3)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0x75B)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1143,16 +1143,16 @@ TEST_F(AvmArithmeticTestsU32, multiplicationOverflow) common_validate_mul(trace, FF(11 << 25), FF(13 << 22), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 143 * 2^47 = 0 + 0 * 2^16 + 2^15 * 2^32 + 71 * 2^48 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(32768)); // 2^15 - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(71)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(32768)); // 2^15 + EXPECT_EQ(alu_row.alu_u16_r2, FF(71)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1166,8 +1166,8 @@ TEST_F(AvmArithmeticTestsU32, equality) common_validate_eq(trace, 0xb435e9c1, 0xb435e9c1, FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1180,8 +1180,8 @@ TEST_F(AvmArithmeticTestsU32, nonEquality) common_validate_eq(trace, 0xb435e9c1, 0xb435e9c0, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U32); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u32_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(1).invert()); + EXPECT_EQ(alu_row.alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(1).invert()); validate_trace(std::move(trace), public_inputs); } @@ -1206,15 +1206,15 @@ TEST_F(AvmArithmeticTestsU64, addition) auto alu_row = common_validate_add(trace, FF(a), FF(b), FF(c), FF(8), FF(9), FF(9), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); // c in HEX: 2436849FE16F1D - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x1D)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x6F)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x9FE1)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0x3684)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x24)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0x1D)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0x6F)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0x9FE1)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0x3684)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0x24)); validate_trace(std::move(trace), public_inputs); } @@ -1236,13 +1236,13 @@ TEST_F(AvmArithmeticTestsU64, additionCarry) auto alu_row = common_validate_add(trace, FF(a), FF(b), FF(c), FF(0), FF(1), FF(0), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(UINT8_MAX - 201)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(UINT8_MAX - 201)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(UINT8_MAX)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(UINT16_MAX)); validate_trace(std::move(trace), public_inputs); } @@ -1264,16 +1264,16 @@ TEST_F(AvmArithmeticTestsU64, subtraction) auto alu_row = common_validate_sub(trace, FF(a), FF(b), FF(c), FF(8), FF(9), FF(9), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); // 10000000000000000 = 0x2386F26FC10000 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0X6FC1)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0X86F2)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0X23)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0X6FC1)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0X86F2)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0X23)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1296,18 +1296,18 @@ TEST_F(AvmArithmeticTestsU64, subtractionCarry) auto alu_row = common_validate_sub(trace, FF(a), FF(b), FF(c), FF(0), FF(1), FF(0), AvmMemoryTag::U64); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); - - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(UINT8_MAX - 74)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(UINT8_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(1)); + + EXPECT_EQ(alu_row.alu_u8_r0, FF(UINT8_MAX - 74)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(UINT8_MAX)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(UINT16_MAX)); validate_trace(std::move(trace), public_inputs); } @@ -1326,16 +1326,16 @@ TEST_F(AvmArithmeticTestsU64, multiplication) trace, FF(999888777), FF(555444333), FF(555382554814950741LLU), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 555,382,554,814,950,741 = 0x 7B5 1D7D B631 AD55 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x55)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xAD)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xB631)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0x1D7D)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x7B5)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0x55)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0xAD)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0xB631)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0x1D7D)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0x7B5)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1358,19 +1358,19 @@ TEST_F(AvmArithmeticTestsU64, multiplicationOverflow) auto alu_row_index = common_validate_mul(trace, FF(a), FF(b), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); // Decomposition of integer multiplication in 8-bit and 16-bit registers // 2^128 - 2^65 + 1 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(1)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(UINT16_MAX - 1)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(1)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(UINT16_MAX - 1)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(UINT16_MAX)); validate_trace(std::move(trace), public_inputs); } @@ -1383,8 +1383,8 @@ TEST_F(AvmArithmeticTestsU64, equality) trace, 0xffffffffffffffe0LLU, 0xffffffffffffffe0LLU, FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1397,8 +1397,8 @@ TEST_F(AvmArithmeticTestsU64, nonEquality) trace, 0xffffffffffffffe0LLU, 0xffffffffffaeffe0LLU, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U64); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u64_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0x510000).invert()); + EXPECT_EQ(alu_row.alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0x510000).invert()); validate_trace(std::move(trace), public_inputs); } @@ -1430,17 +1430,17 @@ TEST_F(AvmArithmeticTestsU128, addition) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xEE)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xEE)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0xAAAA)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0xDDDD)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0x5555)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0x6666)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0x4444)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0x8888)); + EXPECT_EQ(alu_row.alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0xEE)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0xEE)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0xFFFF)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0xAAAA)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0xDDDD)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0x5555)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(0x6666)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(0x4444)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(0x8888)); validate_trace(std::move(trace), public_inputs); } @@ -1470,17 +1470,17 @@ TEST_F(AvmArithmeticTestsU128, additionCarry) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(1)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x9B)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0xDD)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0xF97E)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0xFFFF)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0xFFFF)); + EXPECT_EQ(alu_row.alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(1)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0x9B)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0xDD)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0xF97E)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0xFFFF)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0xFFFF)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0xFFFF)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(0xFFFF)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(0xFFFF)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(0xFFFF)); validate_trace(std::move(trace), public_inputs); } @@ -1509,20 +1509,20 @@ TEST_F(AvmArithmeticTestsU128, subtraction) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); // 36771555 = 23116E3 - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0xE3)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x16)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x231)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r7, FF(0)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0xE3)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0x16)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0x231)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r7, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1551,18 +1551,18 @@ TEST_F(AvmArithmeticTestsU128, subtractionCarry) FF(9), AvmMemoryTag::U128); - EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_cf, FF(0)); + EXPECT_EQ(alu_row.alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.alu_cf, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u8_r0, FF(0x88)); - EXPECT_EQ(alu_row.avm_alu_u8_r1, FF(0x88)); - EXPECT_EQ(alu_row.avm_alu_u16_r0, FF(0x5555)); - EXPECT_EQ(alu_row.avm_alu_u16_r1, FF(0x8888)); - EXPECT_EQ(alu_row.avm_alu_u16_r2, FF(0x3333)); - EXPECT_EQ(alu_row.avm_alu_u16_r3, FF(0x3333)); - EXPECT_EQ(alu_row.avm_alu_u16_r4, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r5, FF(0)); - EXPECT_EQ(alu_row.avm_alu_u16_r6, FF(0x2222)); + EXPECT_EQ(alu_row.alu_u8_r0, FF(0x88)); + EXPECT_EQ(alu_row.alu_u8_r1, FF(0x88)); + EXPECT_EQ(alu_row.alu_u16_r0, FF(0x5555)); + EXPECT_EQ(alu_row.alu_u16_r1, FF(0x8888)); + EXPECT_EQ(alu_row.alu_u16_r2, FF(0x3333)); + EXPECT_EQ(alu_row.alu_u16_r3, FF(0x3333)); + EXPECT_EQ(alu_row.alu_u16_r4, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r5, FF(0)); + EXPECT_EQ(alu_row.alu_u16_r6, FF(0x2222)); validate_trace(std::move(trace), public_inputs); } @@ -1584,22 +1584,22 @@ TEST_F(AvmArithmeticTestsU128, multiplication) trace, FF(0x38D64BF685FFBLLU), FF(555444333222111LLU), c, FF(0), FF(1), FF(2), AvmMemoryTag::U128); auto alu_row_first = trace.at(alu_row_index); - EXPECT_EQ(alu_row_first.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row_first.alu_u128_tag, FF(1)); // Decomposition of the first operand in 16-bit registers - EXPECT_EQ(alu_row_first.avm_alu_u8_r0, FF(0xFB)); - EXPECT_EQ(alu_row_first.avm_alu_u8_r1, FF(0x5F)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r0, FF(0xBF68)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r1, FF(0x8D64)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r2, FF(0x3)); + EXPECT_EQ(alu_row_first.alu_u8_r0, FF(0xFB)); + EXPECT_EQ(alu_row_first.alu_u8_r1, FF(0x5F)); + EXPECT_EQ(alu_row_first.alu_u16_r0, FF(0xBF68)); + EXPECT_EQ(alu_row_first.alu_u16_r1, FF(0x8D64)); + EXPECT_EQ(alu_row_first.alu_u16_r2, FF(0x3)); // Decomposition of the second operand in 16-bit registers auto alu_row_second = trace.at(alu_row_index + 1); - EXPECT_EQ(alu_row_second.avm_alu_u8_r0, FF(0xDF)); - EXPECT_EQ(alu_row_second.avm_alu_u8_r1, FF(0x98)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r0, FF(0x762C)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r1, FF(0xF92C)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r2, FF(0x1)); + EXPECT_EQ(alu_row_second.alu_u8_r0, FF(0xDF)); + EXPECT_EQ(alu_row_second.alu_u8_r1, FF(0x98)); + EXPECT_EQ(alu_row_second.alu_u16_r0, FF(0x762C)); + EXPECT_EQ(alu_row_second.alu_u16_r1, FF(0xF92C)); + EXPECT_EQ(alu_row_second.alu_u16_r2, FF(0x1)); validate_trace(std::move(trace), public_inputs); } @@ -1629,30 +1629,30 @@ TEST_F(AvmArithmeticTestsU128, multiplicationOverflow) AvmMemoryTag::U128); auto alu_row_first = trace.at(alu_row_index); - EXPECT_EQ(alu_row_first.avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row_first.alu_u128_tag, FF(1)); // Decomposition of the first operand in 16-bit registers - EXPECT_EQ(alu_row_first.avm_alu_u8_r0, FF(0xFE)); - EXPECT_EQ(alu_row_first.avm_alu_u8_r1, FF(0xFF)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u8_r0, FF(0xFE)); + EXPECT_EQ(alu_row_first.alu_u8_r1, FF(0xFF)); + EXPECT_EQ(alu_row_first.alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r6, FF(UINT16_MAX)); // Decomposition of the second operand in 16-bit registers auto alu_row_second = trace.at(alu_row_index + 1); - EXPECT_EQ(alu_row_second.avm_alu_u8_r0, FF(0xFC)); - EXPECT_EQ(alu_row_second.avm_alu_u8_r1, FF(0xFF)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r0, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r1, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r2, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r3, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r4, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r5, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_second.avm_alu_u16_r6, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.alu_u8_r0, FF(0xFC)); + EXPECT_EQ(alu_row_second.alu_u8_r1, FF(0xFF)); + EXPECT_EQ(alu_row_second.alu_u16_r0, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.alu_u16_r1, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.alu_u16_r2, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.alu_u16_r3, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.alu_u16_r4, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.alu_u16_r5, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_second.alu_u16_r6, FF(UINT16_MAX)); // Other registers involved in the relevant relations // PIL relation (avm_alu.pil): a * b_l + a_l * b_h * 2^64 = (CF * 2^64 + R_64) * 2^128 + c @@ -1661,12 +1661,12 @@ TEST_F(AvmArithmeticTestsU128, multiplicationOverflow) // Therefore, CF = 1 and R_64 = 2^64 - 7 // R_64 is decomposed over the 4 following 16-bit registers - EXPECT_EQ(alu_row_first.avm_alu_u16_r7, FF(UINT16_MAX - 6)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r8, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r9, FF(UINT16_MAX)); - EXPECT_EQ(alu_row_first.avm_alu_u16_r10, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r7, FF(UINT16_MAX - 6)); + EXPECT_EQ(alu_row_first.alu_u16_r8, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r9, FF(UINT16_MAX)); + EXPECT_EQ(alu_row_first.alu_u16_r10, FF(UINT16_MAX)); // CF - EXPECT_EQ(alu_row_first.avm_alu_cf, FF(1)); + EXPECT_EQ(alu_row_first.alu_cf, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -1686,8 +1686,8 @@ TEST_F(AvmArithmeticTestsU128, equality) AvmMemoryTag::U128); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0)); + EXPECT_EQ(alu_row.alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0)); validate_trace(std::move(trace), public_inputs); } @@ -1708,8 +1708,8 @@ TEST_F(AvmArithmeticTestsU128, nonEquality) AvmMemoryTag::U128); auto alu_row = trace.at(alu_row_index); - EXPECT_EQ(alu_row.avm_alu_u128_tag, FF(1)); - EXPECT_EQ(alu_row.avm_alu_op_eq_diff_inv, FF(0xdeadbeefLLU << 32).invert()); + EXPECT_EQ(alu_row.alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row.alu_op_eq_diff_inv, FF(0xdeadbeefLLU << 32).invert()); validate_trace(std::move(trace), public_inputs); } @@ -1769,7 +1769,7 @@ TEST_F(AvmArithmeticNegativeTestsFF, fDivision) trace_builder.halt(); auto trace = trace_builder.finalize(); - auto select_row = [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }; + auto select_row = [](Row r) { return r.main_sel_op_fdiv == FF(1); }; mutate_ic_in_trace(trace, std::move(select_row), FF(0)); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_FDIV"); @@ -1787,18 +1787,18 @@ TEST_F(AvmArithmeticNegativeTestsFF, fDivisionNoZeroButError) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); size_t const index = static_cast(row - trace.begin()); // Activate the operator error - trace[index].avm_main_op_err = FF(1); + trace[index].main_op_err = FF(1); auto trace2 = trace; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_FDIV_ZERO_ERR1"); // Even more malicious, one makes the first relation passes by setting the inverse to zero. - trace2[index].avm_main_inv = FF(0); + trace2[index].main_inv = FF(0); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace2)), "SUBOP_FDIV_ZERO_ERR2"); } @@ -1813,10 +1813,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, fDivisionByZeroNoError) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Remove the operator error flag - row->avm_main_op_err = FF(0); + row->main_op_err = FF(0); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_FDIV"); } @@ -1830,10 +1830,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, fDivisionZeroByZeroNoError) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Remove the operator error flag - row->avm_main_op_err = FF(0); + row->main_op_err = FF(0); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_FDIV_ZERO_ERR1"); } @@ -1848,10 +1848,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, fDivisionWrongRInTag) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Change read instruction tag - row->avm_main_r_in_tag = FF(3); + row->main_r_in_tag = FF(3); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_FDIV_R_IN_TAG_FF"); } @@ -1866,10 +1866,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, fDivisionWrongWInTag) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); // Change write instruction tag - row->avm_main_w_in_tag = FF(3); + row->main_w_in_tag = FF(3); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_FDIV_W_IN_TAG_FF"); } @@ -1887,10 +1887,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, operationWithErrorFlag) auto trace = trace_builder.finalize(); // Find the first row enabling the addition selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_add == FF(1); }); // Activate the operator error - row->avm_main_op_err = FF(1); + row->main_op_err = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_ERROR_RELEVANT_OP"); @@ -1904,10 +1904,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, operationWithErrorFlag) trace = trace_builder.finalize(); // Find the first row enabling the subtraction selector - row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == FF(1); }); + row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == FF(1); }); // Activate the operator error - row->avm_main_op_err = FF(1); + row->main_op_err = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_ERROR_RELEVANT_OP"); @@ -1921,10 +1921,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, operationWithErrorFlag) trace = trace_builder.finalize(); // Find the first row enabling the multiplication selector - row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == FF(1); }); + row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == FF(1); }); // Activate the operator error - row->avm_main_op_err = FF(1); + row->main_op_err = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUBOP_ERROR_RELEVANT_OP"); } @@ -1962,10 +1962,10 @@ TEST_F(AvmArithmeticNegativeTestsFF, eqOutputWrongTag) auto trace = trace_builder.finalize(); // Find the first row enabling the eq selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); ASSERT_TRUE(row != trace.end()); - row->avm_main_w_in_tag = FF(4); + row->main_w_in_tag = FF(4); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OUTPUT_U8"); } @@ -2030,10 +2030,10 @@ TEST_F(AvmArithmeticNegativeTestsU8, eqOutputWrongTag) auto trace = gen_trace_eq(2, 3, 23, 24, 25, AvmMemoryTag::U8); // Find the first row enabling the eq selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); ASSERT_TRUE(row != trace.end()); - row->avm_main_w_in_tag = FF(3); + row->main_w_in_tag = FF(3); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OUTPUT_U8"); } @@ -2097,10 +2097,10 @@ TEST_F(AvmArithmeticNegativeTestsU16, eqOutputWrongTag) auto trace = gen_trace_eq(1515, 1515, 23, 24, 25, AvmMemoryTag::U16); // Find the first row enabling the eq selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); ASSERT_TRUE(row != trace.end()); - row->avm_main_w_in_tag = FF(5); + row->main_w_in_tag = FF(5); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OUTPUT_U8"); } @@ -2164,10 +2164,10 @@ TEST_F(AvmArithmeticNegativeTestsU32, eqOutputWrongTag) auto trace = gen_trace_eq(15, 15, 23, 24, 25, AvmMemoryTag::U32); // Find the first row enabling the eq selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); ASSERT_TRUE(row != trace.end()); - row->avm_main_w_in_tag = FF(6); + row->main_w_in_tag = FF(6); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OUTPUT_U8"); } @@ -2238,10 +2238,10 @@ TEST_F(AvmArithmeticNegativeTestsU64, eqOutputWrongTag) auto trace = gen_trace_eq(198732, 15, 23, 24, 25, AvmMemoryTag::U64); // Find the first row enabling the eq selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); ASSERT_TRUE(row != trace.end()); - row->avm_main_w_in_tag = FF(2); + row->main_w_in_tag = FF(2); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OUTPUT_U8"); } @@ -2314,24 +2314,24 @@ TEST_F(AvmArithmeticNegativeTestsU128, multiplicationSecondRowNoOp) auto alu_row_index = common_validate_mul(trace, FF(3), FF(4), FF(12), FF(0), FF(1), FF(2), AvmMemoryTag::U128); // We have to enable alu_sel otherwise another relation will fail. - trace.at(alu_row_index + 1).avm_alu_alu_sel = 1; + trace.at(alu_row_index + 1).alu_alu_sel = 1; // Add an LTE selector in the next row (second part of U128 multiplication) auto trace_lte = trace; - trace_lte.at(alu_row_index + 1).avm_alu_op_lte = 1; + trace_lte.at(alu_row_index + 1).alu_op_lte = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace_lte)), "TWO_LINE_OP_NO_OVERLAP"); // Try with SUB selector. auto trace_sub = trace; - trace_sub.at(alu_row_index + 1).avm_alu_op_sub = 1; + trace_sub.at(alu_row_index + 1).alu_op_sub = 1; // Adjust to not violate #[RNG_CHK_LOOKUP_SELECTOR] - trace_sub.at(alu_row_index + 1).avm_alu_rng_chk_lookup_selector = 2; + trace_sub.at(alu_row_index + 1).alu_rng_chk_lookup_selector = 2; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace_sub)), "TWO_LINE_OP_NO_OVERLAP"); // Try with another MUL selector. - trace.at(alu_row_index + 1).avm_alu_op_mul = 1; + trace.at(alu_row_index + 1).alu_op_mul = 1; // Adjust to not violate #[RNG_CHK_LOOKUP_SELECTOR] - trace.at(alu_row_index + 1).avm_alu_rng_chk_lookup_selector = 2; + trace.at(alu_row_index + 1).alu_rng_chk_lookup_selector = 2; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "TWO_LINE_OP_NO_OVERLAP"); } @@ -2372,10 +2372,10 @@ TEST_F(AvmArithmeticNegativeTestsU128, eqOutputWrongTag) auto trace = gen_trace_eq(1587, 1587, 23, 24, 25, AvmMemoryTag::U128); // Find the first row enabling the eq selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); ASSERT_TRUE(row != trace.end()); - row->avm_main_w_in_tag = FF(4); + row->main_w_in_tag = FF(4); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OUTPUT_U8"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp index 9e52825df4b..3bdef33f39f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp @@ -26,40 +26,40 @@ void common_validate_op_not(std::vector const& trace, { // Find the first row enabling the not selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_not == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_not == FF(1); }); // Use the row in the main trace to find the same operation in the alu trace. - FF clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + FF clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); // Check that both rows were found EXPECT_TRUE(row != trace.end()); EXPECT_TRUE(alu_row != trace.end()); // Check that the correct result is stored at the expected memory location. - EXPECT_EQ(row->avm_main_ic, c); - EXPECT_EQ(row->avm_main_mem_idx_c, addr_c); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); + EXPECT_EQ(row->main_ic, c); + EXPECT_EQ(row->main_mem_idx_c, addr_c); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); // Check that ia register is correctly set with memory load operations. - EXPECT_EQ(row->avm_main_ia, a); - EXPECT_EQ(row->avm_main_mem_idx_a, addr_a); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_rwa, FF(0)); + EXPECT_EQ(row->main_ia, a); + EXPECT_EQ(row->main_mem_idx_a, addr_a); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_rwa, FF(0)); // Check the instruction tags - EXPECT_EQ(row->avm_main_r_in_tag, FF(static_cast(tag))); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_r_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(tag))); // Check that intermediate registers are correctly copied in Alu trace - EXPECT_EQ(alu_row->avm_alu_ia, a); - EXPECT_EQ(alu_row->avm_alu_ib, FF(0)); - EXPECT_EQ(alu_row->avm_alu_ic, c); + EXPECT_EQ(alu_row->alu_ia, a); + EXPECT_EQ(alu_row->alu_ib, FF(0)); + EXPECT_EQ(alu_row->alu_ic, c); // Check that not selector is set. - EXPECT_EQ(row->avm_main_sel_op_not, FF(1)); - EXPECT_EQ(alu_row->avm_alu_op_not, FF(1)); + EXPECT_EQ(row->main_sel_op_not, FF(1)); + EXPECT_EQ(alu_row->alu_op_not, FF(1)); switch (tag) { // Handle the different mem_tags here since this is part of a // parameterised test @@ -67,19 +67,19 @@ void common_validate_op_not(std::vector const& trace, FAIL() << "Unintialized Mem Tags Disallowed"; break; case AvmMemoryTag::U8: - EXPECT_EQ(alu_row->avm_alu_u8_tag, FF(1)); + EXPECT_EQ(alu_row->alu_u8_tag, FF(1)); break; case AvmMemoryTag::U16: - EXPECT_EQ(alu_row->avm_alu_u16_tag, FF(1)); + EXPECT_EQ(alu_row->alu_u16_tag, FF(1)); break; case AvmMemoryTag::U32: - EXPECT_EQ(alu_row->avm_alu_u32_tag, FF(1)); + EXPECT_EQ(alu_row->alu_u32_tag, FF(1)); break; case AvmMemoryTag::U64: - EXPECT_EQ(alu_row->avm_alu_u64_tag, FF(1)); + EXPECT_EQ(alu_row->alu_u64_tag, FF(1)); break; case AvmMemoryTag::U128: - EXPECT_EQ(alu_row->avm_alu_u128_tag, FF(1)); + EXPECT_EQ(alu_row->alu_u128_tag, FF(1)); break; case AvmMemoryTag::FF: FAIL() << "FF Mem Tags Disallowed for bitwise"; @@ -97,40 +97,39 @@ void common_validate_shift_op(std::vector const& trace, avm_trace::AvmMemoryTag const tag, bool shr) { - auto row = - shr ? std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_shr == FF(1); }) - : std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_shl == FF(1); }); + auto row = shr ? std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_shr == FF(1); }) + : std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_shl == FF(1); }); ASSERT_TRUE(row != trace.end()); - FF clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + FF clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); // Check that the correct result is stored at the expected memory location. - EXPECT_EQ(row->avm_main_ic, c); - EXPECT_EQ(row->avm_main_mem_idx_c, addr_c); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); + EXPECT_EQ(row->main_ic, c); + EXPECT_EQ(row->main_mem_idx_c, addr_c); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); // Check that ia register is correctly set with memory load operations. - EXPECT_EQ(row->avm_main_ia, a); - EXPECT_EQ(row->avm_main_mem_idx_a, addr_a); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_rwa, FF(0)); + EXPECT_EQ(row->main_ia, a); + EXPECT_EQ(row->main_mem_idx_a, addr_a); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_rwa, FF(0)); // Check that ib register is correctly set with memory load operations. - EXPECT_EQ(row->avm_main_ib, b); - EXPECT_EQ(row->avm_main_mem_idx_b, addr_b); - EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); - EXPECT_EQ(row->avm_main_rwb, FF(0)); + EXPECT_EQ(row->main_ib, b); + EXPECT_EQ(row->main_mem_idx_b, addr_b); + EXPECT_EQ(row->main_mem_op_b, FF(1)); + EXPECT_EQ(row->main_rwb, FF(0)); // Check the instruction tags - EXPECT_EQ(row->avm_main_r_in_tag, FF(static_cast(tag))); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_r_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(tag))); // Check that start row is the same as what is copied into the main trace - EXPECT_EQ(alu_row->avm_alu_ia, a); - EXPECT_EQ(alu_row->avm_alu_ib, b); - EXPECT_EQ(alu_row->avm_alu_ic, c); + EXPECT_EQ(alu_row->alu_ia, a); + EXPECT_EQ(alu_row->alu_ib, b); + EXPECT_EQ(alu_row->alu_ic, c); } void common_validate_bit_op(std::vector const& trace, @@ -144,52 +143,52 @@ void common_validate_bit_op(std::vector const& trace, avm_trace::AvmMemoryTag const tag) { - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_xor == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_xor == FF(1); }); if (op_id == 0) { - row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_and == FF(1); }); + row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_and == FF(1); }); } else if (op_id == 1) { - row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_or == FF(1); }); + row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_or == FF(1); }); } // Use the row in the main trace to find the same operation in the alu trace. - FF clk = row->avm_main_clk; + FF clk = row->main_clk; auto bin_row_start = std::ranges::find_if( - trace.begin(), trace.end(), [clk](Row r) { return r.avm_binary_clk == clk && r.avm_binary_start == FF(1); }); + trace.begin(), trace.end(), [clk](Row r) { return r.binary_clk == clk && r.binary_start == FF(1); }); // Check that both rows were found ASSERT_TRUE(bin_row_start != trace.end()); ASSERT_TRUE(row != trace.end()); // Check that the correct result is stored at the expected memory location. - EXPECT_EQ(row->avm_main_ic, c); - EXPECT_EQ(row->avm_main_mem_idx_c, addr_c); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row->avm_main_rwc, FF(1)); + EXPECT_EQ(row->main_ic, c); + EXPECT_EQ(row->main_mem_idx_c, addr_c); + EXPECT_EQ(row->main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_rwc, FF(1)); // Check that ia register is correctly set with memory load operations. - EXPECT_EQ(row->avm_main_ia, a); - EXPECT_EQ(row->avm_main_mem_idx_a, addr_a); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_rwa, FF(0)); + EXPECT_EQ(row->main_ia, a); + EXPECT_EQ(row->main_mem_idx_a, addr_a); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_rwa, FF(0)); // Check that ia register is correctly set with memory load operations. - EXPECT_EQ(row->avm_main_ib, b); - EXPECT_EQ(row->avm_main_mem_idx_b, addr_b); - EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); - EXPECT_EQ(row->avm_main_rwb, FF(0)); + EXPECT_EQ(row->main_ib, b); + EXPECT_EQ(row->main_mem_idx_b, addr_b); + EXPECT_EQ(row->main_mem_op_b, FF(1)); + EXPECT_EQ(row->main_rwb, FF(0)); // Check the instruction tags - EXPECT_EQ(row->avm_main_r_in_tag, FF(static_cast(tag))); - EXPECT_EQ(row->avm_main_w_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_r_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row->main_w_in_tag, FF(static_cast(tag))); // Check that start row is the same as what is copied into the main trace - EXPECT_EQ(bin_row_start->avm_binary_acc_ia, a); - EXPECT_EQ(bin_row_start->avm_binary_acc_ib, b); - EXPECT_EQ(bin_row_start->avm_binary_acc_ic, c); + EXPECT_EQ(bin_row_start->binary_acc_ia, a); + EXPECT_EQ(bin_row_start->binary_acc_ib, b); + EXPECT_EQ(bin_row_start->binary_acc_ic, c); - EXPECT_EQ(bin_row_start->avm_binary_op_id, op_id); - EXPECT_EQ(bin_row_start->avm_binary_bin_sel, FF(1)); - EXPECT_EQ(bin_row_start->avm_binary_in_tag, static_cast(tag)); + EXPECT_EQ(bin_row_start->binary_op_id, op_id); + EXPECT_EQ(bin_row_start->binary_bin_sel, FF(1)); + EXPECT_EQ(bin_row_start->binary_in_tag, static_cast(tag)); } // These are the potential failures we handle for the negative tests involving the binary trace. @@ -216,48 +215,48 @@ std::tuple, std::string> gen_mutated_trace_shift(std::vectoravm_main_clk; + auto main_clk = main_trace_row->main_clk; // The corresponding row in the alu trace as well as the row where start = 1 auto alu_row = - std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_alu_clk == main_clk; }); + std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.alu_clk == main_clk; }); std::string failure; switch (fail_mode) { case IncorrectShiftPastBitLength: - alu_row->avm_alu_shift_lt_bit_len = FF(0); + alu_row->alu_shift_lt_bit_len = FF(0); update_slice_registers(*alu_row, uint256_t{ 0 }); - alu_row->avm_alu_a_lo = FF(0); - alu_row->avm_alu_a_hi = FF(0); + alu_row->alu_a_lo = FF(0); + alu_row->alu_a_hi = FF(0); failure = "SHIFT_LT_BIT_LEN"; return std::make_tuple(trace, failure); case IncorrectInputDecomposition: { // Subtrace one from b_lo and update b_lo - uint256_t b_lo = alu_row->avm_alu_b_lo - 1; - uint256_t b_hi = alu_row->avm_alu_b_hi; - alu_row->avm_alu_b_lo = b_lo; + uint256_t b_lo = alu_row->alu_b_lo - 1; + uint256_t b_hi = alu_row->alu_b_hi; + alu_row->alu_b_lo = b_lo; // Update the range checks involving b_lo and b_hi so we dont throw an error about the range checks if (shr) { - uint256_t a_lo = (uint256_t(1) << alu_row->avm_alu_ib) - b_lo - 1; - uint256_t a_hi = (uint256_t(1) << (32 - uint8_t(alu_row->avm_alu_ib))) - b_hi - 1; - alu_row->avm_alu_a_lo = a_lo & ((uint256_t(1) << 128) - 1); - alu_row->avm_alu_a_hi = a_hi; + uint256_t a_lo = (uint256_t(1) << alu_row->alu_ib) - b_lo - 1; + uint256_t a_hi = (uint256_t(1) << (32 - uint8_t(alu_row->alu_ib))) - b_hi - 1; + alu_row->alu_a_lo = a_lo & ((uint256_t(1) << 128) - 1); + alu_row->alu_a_hi = a_hi; // Update slice registers update_slice_registers(*alu_row, a_lo + (a_hi << 128)); failure = "SHR_INPUT_DECOMPOSITION"; return std::make_tuple(trace, failure); } - uint256_t a_lo = (uint256_t(1) << (32 - uint8_t(alu_row->avm_alu_ib))) - b_lo - 1; - uint256_t a_hi = (uint256_t(1) << alu_row->avm_alu_ib) - b_hi - 1; - alu_row->avm_alu_a_lo = a_lo & ((uint256_t(1) << 128) - 1); - alu_row->avm_alu_a_hi = a_hi; + uint256_t a_lo = (uint256_t(1) << (32 - uint8_t(alu_row->alu_ib))) - b_lo - 1; + uint256_t a_hi = (uint256_t(1) << alu_row->alu_ib) - b_hi - 1; + alu_row->alu_a_lo = a_lo & ((uint256_t(1) << 128) - 1); + alu_row->alu_a_hi = a_hi; // Update slice registers update_slice_registers(*alu_row, a_lo + (a_hi << 128)); failure = "SHL_INPUT_DECOMPOSITION"; return std::make_tuple(trace, failure); } case ShiftOutputIncorrect: - alu_row->avm_alu_ic = c_mutated; + alu_row->alu_ic = c_mutated; failure = shr ? "SHR_OUTPUT" : "SHL_OUTPUT"; return std::make_tuple(trace, failure); } @@ -269,36 +268,36 @@ std::vector gen_mutated_trace_bit(std::vector trace, BIT_FAILURES fail_mode) { auto main_trace_row = std::ranges::find_if(trace.begin(), trace.end(), select_row); - auto main_clk = main_trace_row->avm_main_clk; + auto main_clk = main_trace_row->main_clk; // The corresponding row in the binary trace as well as the row where start = 1 auto binary_row = - std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_binary_clk == main_clk; }); + std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.binary_clk == main_clk; }); // The corresponding row in the binary trace where the computation ends. auto last_row = std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { - return r.avm_binary_clk == main_clk && r.avm_binary_mem_tag_ctr == FF(0); + return r.binary_clk == main_clk && r.binary_mem_tag_ctr == FF(0); }); switch (fail_mode) { case BitDecomposition: { // Incrementing the bytes should indicate an incorrect decomposition // The lookups are checked later so this will throw an error about decomposition - binary_row->avm_binary_ic_bytes++; + binary_row->binary_ic_bytes++; break; } case MemTagCtr: { // Increment instead of decrementing - binary_row->avm_binary_mem_tag_ctr++; + binary_row->binary_mem_tag_ctr++; break; } case IncorrectAcc: { // The lookups are checked later so this will throw an error about accumulation - binary_row->avm_binary_acc_ic++; + binary_row->binary_acc_ic++; break; } case InconsistentOpId: { // We don't update the first index as that is checked by the permutation check. // So we update the next op_id to be incorrect. auto first_index = static_cast(std::distance(trace.begin(), binary_row)); - trace.at(first_index + 1).avm_binary_op_id++; + trace.at(first_index + 1).binary_op_id++; break; } case ByteLookupError: { @@ -307,8 +306,8 @@ std::vector gen_mutated_trace_bit(std::vector trace, // We intentionally select the mutated value to be 0-bytes everywhere else so we dont need to // update anything there or in the corresponding accumulators. mutate_ic_in_trace(trace, std::move(select_row), c_mutated, false); - binary_row->avm_binary_acc_ic = c_mutated; - binary_row->avm_binary_ic_bytes = static_cast(uint128_t{ c_mutated }); + binary_row->binary_acc_ic = c_mutated; + binary_row->binary_ic_bytes = static_cast(uint128_t{ c_mutated }); break; } case ByteLengthError: { @@ -318,26 +317,26 @@ std::vector gen_mutated_trace_bit(std::vector trace, auto last_index = static_cast(std::distance(trace.begin(), last_row)); auto first_index = static_cast(std::distance(trace.begin(), binary_row)); for (size_t i = first_index; i <= last_index; i++) { - FF ctr = trace.at(i).avm_binary_mem_tag_ctr; + FF ctr = trace.at(i).binary_mem_tag_ctr; if (ctr == FF::one()) { // If the tag is currently 1, it will be set to 0 which means we need to set bin_sel to 0. - trace.at(i).avm_binary_bin_sel = FF(0); - trace.at(i).avm_binary_mem_tag_ctr = FF(0); - trace.at(i).avm_binary_mem_tag_ctr_inv = FF(0); + trace.at(i).binary_bin_sel = FF(0); + trace.at(i).binary_mem_tag_ctr = FF(0); + trace.at(i).binary_mem_tag_ctr_inv = FF(0); } else if (ctr == FF::zero()) { // Leave as zero instead of underflowing - trace.at(i).avm_binary_mem_tag_ctr = FF(0); + trace.at(i).binary_mem_tag_ctr = FF(0); } else { // Replace the values with the next row's values - trace.at(i).avm_binary_mem_tag_ctr = trace.at(i + 1).avm_binary_mem_tag_ctr; - trace.at(i).avm_binary_mem_tag_ctr_inv = trace.at(i + 1).avm_binary_mem_tag_ctr_inv; - trace.at(i).avm_binary_bin_sel = trace.at(i + 1).avm_binary_bin_sel; + trace.at(i).binary_mem_tag_ctr = trace.at(i + 1).binary_mem_tag_ctr; + trace.at(i).binary_mem_tag_ctr_inv = trace.at(i + 1).binary_mem_tag_ctr_inv; + trace.at(i).binary_bin_sel = trace.at(i + 1).binary_bin_sel; } } break; } case IncorrectBinSelector: - binary_row->avm_binary_bin_sel = FF(0); + binary_row->binary_bin_sel = FF(0); break; } return trace; @@ -368,7 +367,7 @@ class AvmBitwiseTests : public ::testing::Test { trace_builder.halt(); auto trace = trace_builder.finalize(); - auto select_row = [](Row r) { return r.avm_main_sel_op_not == FF(1); }; + auto select_row = [](Row r) { return r.main_sel_op_not == FF(1); }; mutate_ic_in_trace(trace, select_row, c_mutated, true); return trace; @@ -632,7 +631,7 @@ TEST_P(AvmBitwiseNegativeTestsAnd, AllNegativeTests) trace_builder.op_and(0, 0, 1, 2, mem_tag); trace_builder.halt(); auto trace = trace_builder.finalize(); - std::function&& select_row = [](Row r) { return r.avm_main_sel_op_and == FF(1); }; + std::function&& select_row = [](Row r) { return r.main_sel_op_and == FF(1); }; trace = gen_mutated_trace_bit(trace, std::move(select_row), output, failure_mode); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), failure_string); } @@ -651,7 +650,7 @@ TEST_P(AvmBitwiseNegativeTestsOr, AllNegativeTests) trace_builder.op_or(0, 0, 1, 2, mem_tag); trace_builder.halt(); auto trace = trace_builder.finalize(); - std::function&& select_row = [](Row r) { return r.avm_main_sel_op_or == FF(1); }; + std::function&& select_row = [](Row r) { return r.main_sel_op_or == FF(1); }; trace = gen_mutated_trace_bit(trace, std::move(select_row), output, failure_mode); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), failure_string); } @@ -669,7 +668,7 @@ TEST_P(AvmBitwiseNegativeTestsXor, AllNegativeTests) trace_builder.op_xor(0, 0, 1, 2, mem_tag); trace_builder.halt(); auto trace = trace_builder.finalize(); - std::function&& select_row = [](Row r) { return r.avm_main_sel_op_xor == FF(1); }; + std::function&& select_row = [](Row r) { return r.main_sel_op_xor == FF(1); }; trace = gen_mutated_trace_bit(trace, std::move(select_row), output, failure_mode); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), failure_string) } @@ -687,7 +686,7 @@ TEST_P(AvmBitwiseNegativeTestsShr, AllNegativeTests) trace_builder.op_shr(0, 0, 1, 2, mem_tag); trace_builder.halt(); auto trace = trace_builder.finalize(); - std::function&& select_row = [](Row r) { return r.avm_main_sel_op_shr == FF(1); }; + std::function&& select_row = [](Row r) { return r.main_sel_op_shr == FF(1); }; auto [mutated_trace, str] = gen_mutated_trace_shift(std::move(trace), std::move(select_row), output, failure, true); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(mutated_trace)), str); @@ -706,7 +705,7 @@ TEST_P(AvmBitwiseNegativeTestsShl, AllNegativeTests) trace_builder.op_shl(0, 0, 1, 2, mem_tag); trace_builder.halt(); auto trace = trace_builder.finalize(); - std::function&& select_row = [](Row r) { return r.avm_main_sel_op_shl == FF(1); }; + std::function&& select_row = [](Row r) { return r.main_sel_op_shl == FF(1); }; auto [mutated_trace, str] = gen_mutated_trace_shift(std::move(trace), std::move(select_row), output, failure, false); @@ -730,14 +729,14 @@ TEST_F(AvmBitwiseNegativeTestsFF, UndefinedOverFF) // TODO(ilyas): When the SET opcodes applies relational constraints, this will fail // we will need to look at a new way of doing this test. for (size_t i = 1; i < 4; i++) { - trace.at(i).avm_mem_tag = FF(6); - trace.at(i).avm_mem_r_in_tag = FF(6); - trace.at(i).avm_mem_w_in_tag = FF(6); - trace.at(i).avm_alu_ff_tag = FF::one(); - trace.at(i).avm_alu_u8_tag = FF::zero(); - trace.at(i).avm_main_r_in_tag = FF(6); - trace.at(i).avm_main_w_in_tag = FF(6); - trace.at(i).avm_alu_in_tag = FF(6); + trace.at(i).mem_tag = FF(6); + trace.at(i).mem_r_in_tag = FF(6); + trace.at(i).mem_w_in_tag = FF(6); + trace.at(i).alu_ff_tag = FF::one(); + trace.at(i).alu_u8_tag = FF::zero(); + trace.at(i).main_r_in_tag = FF(6); + trace.at(i).main_w_in_tag = FF(6); + trace.at(i).alu_in_tag = FF(6); } EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "ALU_FF_NOT_XOR"); diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp index 245a4f2f282..ba933285f11 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp @@ -41,20 +41,19 @@ class AvmCastTests : public ::testing::Test { void gen_indices() { - auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_cast == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cast == FF(1); }); ASSERT_TRUE(row != trace.end()); main_idx = static_cast(row - trace.begin()); // Find the corresponding Alu trace row - auto clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto clk = row->main_clk; + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); alu_idx = static_cast(alu_row - trace.begin()); // Mem entry output ic write operation auto mem_row_c = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_STORE_C; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_STORE_C; }); ASSERT_TRUE(mem_row_c != trace.end()); mem_idx_c = static_cast(mem_row_c - trace.begin()); @@ -72,46 +71,45 @@ class AvmCastTests : public ::testing::Test { { auto const& row = trace.at(main_idx); EXPECT_THAT(row, - AllOf(Field("sel_op_cast", &Row::avm_main_sel_op_cast, 1), - Field("ia", &Row::avm_main_ia, a), - Field("ib", &Row::avm_main_ib, 0), - Field("ic", &Row::avm_main_ic, cast_val), - Field("r_in_tag", &Row::avm_main_r_in_tag, static_cast(src_tag)), - Field("w_in_tag", &Row::avm_main_w_in_tag, static_cast(dst_tag)), - Field("alu_in_tag", &Row::avm_main_alu_in_tag, static_cast(dst_tag)), - Field("op_a", &Row::avm_main_mem_op_a, 1), - Field("op_c", &Row::avm_main_mem_op_c, 1), - Field("rwa", &Row::avm_main_rwa, 0), - Field("rwc", &Row::avm_main_rwc, 1), - Field("mem_idx_a", &Row::avm_main_mem_idx_a, src_address), - Field("mem_idx_c", &Row::avm_main_mem_idx_c, dst_address), - Field("tag_err", &Row::avm_main_tag_err, 0), - Field("alu_sel", &Row::avm_main_alu_sel, 1), - Field("sel_rng_8", &Row::avm_main_sel_rng_8, 1), - Field("sel_rng_16", &Row::avm_main_sel_rng_16, 1))); + AllOf(Field("sel_op_cast", &Row::main_sel_op_cast, 1), + Field("ia", &Row::main_ia, a), + Field("ib", &Row::main_ib, 0), + Field("ic", &Row::main_ic, cast_val), + Field("r_in_tag", &Row::main_r_in_tag, static_cast(src_tag)), + Field("w_in_tag", &Row::main_w_in_tag, static_cast(dst_tag)), + Field("alu_in_tag", &Row::main_alu_in_tag, static_cast(dst_tag)), + Field("op_a", &Row::main_mem_op_a, 1), + Field("op_c", &Row::main_mem_op_c, 1), + Field("rwa", &Row::main_rwa, 0), + Field("rwc", &Row::main_rwc, 1), + Field("mem_idx_a", &Row::main_mem_idx_a, src_address), + Field("mem_idx_c", &Row::main_mem_idx_c, dst_address), + Field("tag_err", &Row::main_tag_err, 0), + Field("alu_sel", &Row::main_alu_sel, 1), + Field("sel_rng_8", &Row::main_sel_rng_8, 1), + Field("sel_rng_16", &Row::main_sel_rng_16, 1))); auto const& alu_row = trace.at(alu_idx); EXPECT_THAT(alu_row, - AllOf(Field("op_cast", &Row::avm_alu_op_cast, 1), - Field("alu_ia", &Row::avm_alu_ia, a), - Field("alu_ib", &Row::avm_alu_ib, 0), - Field("alu_ic", &Row::avm_alu_ic, cast_val), - Field("u8_tag", &Row::avm_alu_u8_tag, dst_tag == AvmMemoryTag::U8), - Field("u16_tag", &Row::avm_alu_u16_tag, dst_tag == AvmMemoryTag::U16), - Field("u32_tag", &Row::avm_alu_u32_tag, dst_tag == AvmMemoryTag::U32), - Field("u64_tag", &Row::avm_alu_u64_tag, dst_tag == AvmMemoryTag::U64), - Field("u128_tag", &Row::avm_alu_u128_tag, dst_tag == AvmMemoryTag::U128), - Field("ff_tag", &Row::avm_alu_ff_tag, dst_tag == AvmMemoryTag::FF), - Field("in_tag", &Row::avm_alu_in_tag, static_cast(dst_tag)), - Field("op_cast_prev", &Row::avm_alu_op_cast_prev, 0), - Field("lookup_selector", &Row::avm_alu_rng_chk_lookup_selector, 1), - Field("alu_sel", &Row::avm_alu_alu_sel, 1))); + AllOf(Field("op_cast", &Row::alu_op_cast, 1), + Field("alu_ia", &Row::alu_ia, a), + Field("alu_ib", &Row::alu_ib, 0), + Field("alu_ic", &Row::alu_ic, cast_val), + Field("u8_tag", &Row::alu_u8_tag, dst_tag == AvmMemoryTag::U8), + Field("u16_tag", &Row::alu_u16_tag, dst_tag == AvmMemoryTag::U16), + Field("u32_tag", &Row::alu_u32_tag, dst_tag == AvmMemoryTag::U32), + Field("u64_tag", &Row::alu_u64_tag, dst_tag == AvmMemoryTag::U64), + Field("u128_tag", &Row::alu_u128_tag, dst_tag == AvmMemoryTag::U128), + Field("ff_tag", &Row::alu_ff_tag, dst_tag == AvmMemoryTag::FF), + Field("in_tag", &Row::alu_in_tag, static_cast(dst_tag)), + Field("op_cast_prev", &Row::alu_op_cast_prev, 0), + Field("lookup_selector", &Row::alu_rng_chk_lookup_selector, 1), + Field("alu_sel", &Row::alu_alu_sel, 1))); // Check that there is a second ALU row auto alu_row_next = trace.at(alu_idx + 1); - EXPECT_THAT( - alu_row_next, - AllOf(Field("op_cast", &Row::avm_alu_op_cast, 0), Field("op_cast_prev", &Row::avm_alu_op_cast_prev, 1))); + EXPECT_THAT(alu_row_next, + AllOf(Field("op_cast", &Row::alu_op_cast, 0), Field("op_cast_prev", &Row::alu_op_cast_prev, 1))); // We still want the ability to enable proving through the environment variable and therefore we do not pass // the boolean variable force_proof to validate_trace second argument. @@ -229,24 +227,24 @@ TEST_F(AvmCastTests, indirectAddrWrongResolutionU64ToU8) trace_builder.return_op(0, 0, 0); trace = trace_builder.finalize(); - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_cast == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cast == FF(1); }); ASSERT_TRUE(row != trace.end()); EXPECT_THAT(*row, - AllOf(Field("sel_op_cast", &Row::avm_main_sel_op_cast, 1), - Field("r_in_tag", &Row::avm_main_r_in_tag, static_cast(AvmMemoryTag::U64)), - Field("w_in_tag", &Row::avm_main_w_in_tag, static_cast(AvmMemoryTag::U8)), - Field("alu_in_tag", &Row::avm_main_alu_in_tag, static_cast(AvmMemoryTag::U8)), - Field("op_a", &Row::avm_main_mem_op_a, 1), - Field("op_c", &Row::avm_main_mem_op_c, 1), - Field("ind_op_a", &Row::avm_main_ind_op_a, 1), - Field("ind_op_c", &Row::avm_main_ind_op_c, 1), - Field("ind_a", &Row::avm_main_ind_a, 5), - Field("ind_c", &Row::avm_main_ind_c, 6), - Field("rwa", &Row::avm_main_rwa, 0), - Field("rwc", &Row::avm_main_rwc, 1), - Field("alu_sel", &Row::avm_main_alu_sel, 0), // ALU trace not activated - Field("tag_err", &Row::avm_main_tag_err, 1))); // Error activated + AllOf(Field("sel_op_cast", &Row::main_sel_op_cast, 1), + Field("r_in_tag", &Row::main_r_in_tag, static_cast(AvmMemoryTag::U64)), + Field("w_in_tag", &Row::main_w_in_tag, static_cast(AvmMemoryTag::U8)), + Field("alu_in_tag", &Row::main_alu_in_tag, static_cast(AvmMemoryTag::U8)), + Field("op_a", &Row::main_mem_op_a, 1), + Field("op_c", &Row::main_mem_op_c, 1), + Field("ind_op_a", &Row::main_ind_op_a, 1), + Field("ind_op_c", &Row::main_ind_op_c, 1), + Field("ind_a", &Row::main_ind_a, 5), + Field("ind_c", &Row::main_ind_c, 6), + Field("rwa", &Row::main_rwa, 0), + Field("rwc", &Row::main_rwc, 1), + Field("alu_sel", &Row::main_alu_sel, 0), // ALU trace not activated + Field("tag_err", &Row::main_tag_err, 1))); // Error activated validate_trace(std::move(trace), public_inputs); } @@ -254,13 +252,13 @@ TEST_F(AvmCastTests, indirectAddrWrongResolutionU64ToU8) TEST_F(AvmCastNegativeTests, nonTruncatedOutputMainIc) { gen_trace(300, 0, 1, AvmMemoryTag::U16, AvmMemoryTag::U8); - ASSERT_EQ(trace.at(main_idx).avm_main_ic, 44); + ASSERT_EQ(trace.at(main_idx).main_ic, 44); // Replace the output in main trace with the non-truncated value - trace.at(main_idx).avm_main_ic = 300; + trace.at(main_idx).main_ic = 300; // Adapt the memory trace entry - trace.at(mem_idx_c).avm_mem_val = 300; + trace.at(mem_idx_c).mem_val = 300; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -268,13 +266,13 @@ TEST_F(AvmCastNegativeTests, nonTruncatedOutputMainIc) TEST_F(AvmCastNegativeTests, wrongOutputMainIc) { gen_trace(151515, 0, 1, AvmMemoryTag::U32, AvmMemoryTag::FF); - ASSERT_EQ(trace.at(main_idx).avm_main_ic, 151515); + ASSERT_EQ(trace.at(main_idx).main_ic, 151515); // Replace the output in main trace with a wrong value - trace.at(main_idx).avm_main_ic = 151516; + trace.at(main_idx).main_ic = 151516; // Adapt the memory trace entry - trace.at(mem_idx_c).avm_mem_val = 151516; + trace.at(mem_idx_c).mem_val = 151516; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -282,12 +280,12 @@ TEST_F(AvmCastNegativeTests, wrongOutputMainIc) TEST_F(AvmCastNegativeTests, wrongOutputAluIc) { gen_trace(6582736, 0, 1, AvmMemoryTag::U128, AvmMemoryTag::U16); - ASSERT_EQ(trace.at(alu_idx).avm_alu_ic, 29136); + ASSERT_EQ(trace.at(alu_idx).alu_ic, 29136); // Replace output in ALU, MAIN, and MEM trace - trace.at(alu_idx).avm_alu_ic = 33; - trace.at(main_idx).avm_main_ic = 33; - trace.at(mem_idx_c).avm_mem_val = 33; + trace.at(alu_idx).alu_ic = 33; + trace.at(main_idx).main_ic = 33; + trace.at(mem_idx_c).mem_val = 33; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "ALU_OP_CAST"); } @@ -300,7 +298,7 @@ TEST_F(AvmCastNegativeTests, wrongLimbDecompositionInput) trace = trace_builder.finalize(); gen_indices(); - trace.at(alu_idx).avm_alu_a_lo -= 23; + trace.at(alu_idx).alu_a_lo -= 23; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "INPUT_DECOMP_1"); } @@ -308,9 +306,9 @@ TEST_F(AvmCastNegativeTests, wrongLimbDecompositionInput) TEST_F(AvmCastNegativeTests, wrongPSubALo) { gen_trace(12345, 0, 1, AvmMemoryTag::U32, AvmMemoryTag::U16); - ASSERT_EQ(trace.at(alu_idx).avm_alu_ic, 12345); + ASSERT_EQ(trace.at(alu_idx).alu_ic, 12345); - trace.at(alu_idx).avm_alu_p_sub_a_lo += 3; + trace.at(alu_idx).alu_p_sub_a_lo += 3; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUB_LO_1"); } @@ -323,7 +321,7 @@ TEST_F(AvmCastNegativeTests, wrongPSubAHi) trace = trace_builder.finalize(); gen_indices(); - trace.at(alu_idx).avm_alu_p_sub_a_hi += 3; + trace.at(alu_idx).alu_p_sub_a_hi += 3; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SUB_HI_1"); } @@ -332,7 +330,7 @@ TEST_F(AvmCastNegativeTests, disableRangecheck) { gen_trace(123, 23, 43, AvmMemoryTag::U8, AvmMemoryTag::U8); - trace.at(alu_idx).avm_alu_rng_chk_lookup_selector = 0; + trace.at(alu_idx).alu_rng_chk_lookup_selector = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "RNG_CHK_LOOKUP_SELECTOR"); } @@ -340,16 +338,16 @@ TEST_F(AvmCastNegativeTests, disableRangecheckSub) { gen_trace(123, 23, 43, AvmMemoryTag::U8, AvmMemoryTag::U8); - trace.at(alu_idx + 1).avm_alu_rng_chk_lookup_selector = 0; + trace.at(alu_idx + 1).alu_rng_chk_lookup_selector = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "RNG_CHK_LOOKUP_SELECTOR"); } TEST_F(AvmCastNegativeTests, wrongRangeCheckDecompositionLo) { gen_trace(987344323, 23, 43, AvmMemoryTag::FF, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_idx).avm_alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_idx).alu_ic, 987344323); - trace.at(alu_idx).avm_alu_u16_r0 = 5555; + trace.at(alu_idx).alu_u16_r0 = 5555; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOWER_CMP_RNG_CHK"); } @@ -361,17 +359,17 @@ TEST_F(AvmCastNegativeTests, wrongRangeCheckDecompositionHi) trace = trace_builder.finalize(); gen_indices(); - trace.at(alu_idx).avm_alu_u16_r9 = 5555; + trace.at(alu_idx).alu_u16_r9 = 5555; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "UPPER_CMP_RNG_CHK"); } TEST_F(AvmCastNegativeTests, outOfRangeU8Registers) { gen_trace(987344323, 23, 43, AvmMemoryTag::FF, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_idx).avm_alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_idx).alu_ic, 987344323); - trace.at(alu_idx).avm_alu_u8_r0 += 256; - trace.at(alu_idx).avm_alu_u8_r1 -= 1; // Adjust so that the decomposition is correct. + trace.at(alu_idx).alu_u8_r0 += 256; + trace.at(alu_idx).alu_u8_r1 -= 1; // Adjust so that the decomposition is correct. EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "Lookup LOOKUP_U8_0"); } @@ -379,10 +377,10 @@ TEST_F(AvmCastNegativeTests, outOfRangeU8Registers) TEST_F(AvmCastNegativeTests, outOfRangeU16Registers) { gen_trace(987344323, 23, 43, AvmMemoryTag::FF, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_idx).avm_alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_idx).alu_ic, 987344323); - trace.at(alu_idx).avm_alu_u16_r0 += 65536; - trace.at(alu_idx).avm_alu_u16_r1 -= 1; // Adjust so that the decomposition is correct. + trace.at(alu_idx).alu_u16_r0 += 65536; + trace.at(alu_idx).alu_u16_r1 -= 1; // Adjust so that the decomposition is correct. EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "Lookup LOOKUP_U16_0"); } @@ -390,10 +388,10 @@ TEST_F(AvmCastNegativeTests, outOfRangeU16Registers) TEST_F(AvmCastNegativeTests, wrongCopySubLoForRangeCheck) { gen_trace(987344323, 23, 43, AvmMemoryTag::U64, AvmMemoryTag::U128); - ASSERT_EQ(trace.at(alu_idx).avm_alu_ic, 987344323); + ASSERT_EQ(trace.at(alu_idx).alu_ic, 987344323); - ASSERT_EQ(trace.at(alu_idx + 1).avm_alu_a_lo, trace.at(alu_idx).avm_alu_p_sub_a_lo); - trace.at(alu_idx + 1).avm_alu_a_lo -= 1; + ASSERT_EQ(trace.at(alu_idx + 1).alu_a_lo, trace.at(alu_idx).alu_p_sub_a_lo); + trace.at(alu_idx + 1).alu_a_lo -= 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OP_CAST_RNG_CHECK_P_SUB_A_LOW"); } @@ -405,33 +403,33 @@ TEST_F(AvmCastNegativeTests, wrongCopySubHiForRangeCheck) trace = trace_builder.finalize(); gen_indices(); - ASSERT_EQ(trace.at(alu_idx + 1).avm_alu_a_hi, trace.at(alu_idx).avm_alu_p_sub_a_hi); - trace.at(alu_idx + 1).avm_alu_a_hi += 2; + ASSERT_EQ(trace.at(alu_idx + 1).alu_a_hi, trace.at(alu_idx).alu_p_sub_a_hi); + trace.at(alu_idx + 1).alu_a_hi += 2; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "OP_CAST_RNG_CHECK_P_SUB_A_HIGH"); } TEST_F(AvmCastNegativeTests, secondRowNoOp) { gen_trace(6583, 0, 1, AvmMemoryTag::U64, AvmMemoryTag::U8); - ASSERT_EQ(trace.at(alu_idx).avm_alu_ic, 183); + ASSERT_EQ(trace.at(alu_idx).alu_ic, 183); // We have to enable alu_sel otherwise another relation will fail. - trace.at(alu_idx + 1).avm_alu_alu_sel = 1; + trace.at(alu_idx + 1).alu_alu_sel = 1; // Add an LT selector in the next row (second part of the cast operation) auto trace_lt = trace; - trace_lt.at(alu_idx + 1).avm_alu_op_lt = 1; + trace_lt.at(alu_idx + 1).alu_op_lt = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace_lt)), "TWO_LINE_OP_NO_OVERLAP"); // Try with EQ selector auto trace_eq = trace; - trace_eq.at(alu_idx + 1).avm_alu_op_eq = 1; + trace_eq.at(alu_idx + 1).alu_op_eq = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace_eq)), "TWO_LINE_OP_NO_OVERLAP"); // Try with a second cast selector - trace.at(alu_idx + 1).avm_alu_op_cast = 1; + trace.at(alu_idx + 1).alu_op_cast = 1; // Adjust to not violate #[RNG_CHK_LOOKUP_SELECTOR] - trace.at(alu_idx + 1).avm_alu_rng_chk_lookup_selector = 2; + trace.at(alu_idx + 1).alu_rng_chk_lookup_selector = 2; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "TWO_LINE_OP_NO_OVERLAP"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp index 8530fa19c20..1bf44438e5e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_comparison.test.cpp @@ -31,31 +31,31 @@ void common_validate_cmp(Row const& row, // Use the row in the main trace to find the same operation in the alu trace. // Check that the correct result is stored at the expected memory location. - EXPECT_EQ(row.avm_main_ic, c); - EXPECT_EQ(row.avm_main_mem_idx_c, addr_c); - EXPECT_EQ(row.avm_main_mem_op_c, FF(1)); - EXPECT_EQ(row.avm_main_rwc, FF(1)); + EXPECT_EQ(row.main_ic, c); + EXPECT_EQ(row.main_mem_idx_c, addr_c); + EXPECT_EQ(row.main_mem_op_c, FF(1)); + EXPECT_EQ(row.main_rwc, FF(1)); // Check that ia register is correctly set with memory load operations. - EXPECT_EQ(row.avm_main_ia, a); - EXPECT_EQ(row.avm_main_mem_idx_a, addr_a); - EXPECT_EQ(row.avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row.avm_main_rwa, FF(0)); + EXPECT_EQ(row.main_ia, a); + EXPECT_EQ(row.main_mem_idx_a, addr_a); + EXPECT_EQ(row.main_mem_op_a, FF(1)); + EXPECT_EQ(row.main_rwa, FF(0)); // Check that ib register is correctly set with memory load operations. - EXPECT_EQ(row.avm_main_ib, b); - EXPECT_EQ(row.avm_main_mem_idx_b, addr_b); - EXPECT_EQ(row.avm_main_mem_op_b, FF(1)); - EXPECT_EQ(row.avm_main_rwb, FF(0)); + EXPECT_EQ(row.main_ib, b); + EXPECT_EQ(row.main_mem_idx_b, addr_b); + EXPECT_EQ(row.main_mem_op_b, FF(1)); + EXPECT_EQ(row.main_rwb, FF(0)); // Check the instruction tags - EXPECT_EQ(row.avm_main_r_in_tag, FF(static_cast(tag))); - EXPECT_EQ(row.avm_main_w_in_tag, FF(static_cast(AvmMemoryTag::U8))); + EXPECT_EQ(row.main_r_in_tag, FF(static_cast(tag))); + EXPECT_EQ(row.main_w_in_tag, FF(static_cast(AvmMemoryTag::U8))); // Check that intermediate registers are correctly copied in Alu trace - EXPECT_EQ(alu_row.avm_alu_ia, a); - EXPECT_EQ(alu_row.avm_alu_ib, b); - EXPECT_EQ(alu_row.avm_alu_ic, c); + EXPECT_EQ(alu_row.alu_ia, a); + EXPECT_EQ(alu_row.alu_ib, b); + EXPECT_EQ(alu_row.alu_ic, c); } } // namespace std::vector positive_op_lt_test_values = { { { FF(1), FF(1), FF(0) }, @@ -119,12 +119,12 @@ TEST_P(AvmCmpTestsLT, ParamTest) auto trace = trace_builder.finalize(); // Get the row in the avm with the LT selector set - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_lt == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_lt == FF(1); }); // Use the row in the main trace to find the same operation in the alu trace. - FF clk = row->avm_main_clk; + FF clk = row->main_clk; auto alu_row = std::ranges::find_if( - trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk && r.avm_alu_op_lt == FF(1); }); + trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk && r.alu_op_lt == FF(1); }); // Check that both rows were found ASSERT_TRUE(row != trace.end()); ASSERT_TRUE(alu_row != trace.end()); @@ -149,12 +149,12 @@ TEST_P(AvmCmpTestsLTE, ParamTest) trace_builder.op_lte(0, 0, 1, 2, mem_tag); trace_builder.return_op(0, 0, 0); auto trace = trace_builder.finalize(); - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_lte == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_lte == FF(1); }); // Use the row in the main trace to find the same operation in the alu trace. - FF clk = row->avm_main_clk; - auto alu_row = std::ranges::find_if( - trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk && r.avm_alu_op_lte; }); + FF clk = row->main_clk; + auto alu_row = + std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk && r.alu_op_lte; }); // Check that both rows were found ASSERT_TRUE(row != trace.end()); ASSERT_TRUE(alu_row != trace.end()); @@ -200,36 +200,36 @@ std::vector gen_mutated_trace_cmp( std::vector trace, std::function select_row, FF c_mutated, CMP_FAILURES fail_mode, bool is_lte) { auto main_trace_row = std::ranges::find_if(trace.begin(), trace.end(), select_row); - auto main_clk = main_trace_row->avm_main_clk; + auto main_clk = main_trace_row->main_clk; // The corresponding row in the alu trace as well as the row where start = 1 auto alu_row = - std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.avm_alu_clk == main_clk; }); + std::ranges::find_if(trace.begin(), trace.end(), [main_clk](Row r) { return r.alu_clk == main_clk; }); // The corresponding row in the alu trace where the computation ends. auto range_check_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_alu_cmp_rng_ctr > FF(0); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.alu_cmp_rng_ctr > FF(0); }); switch (fail_mode) { case IncorrectInputDecomposition: - alu_row->avm_alu_a_lo = alu_row->avm_alu_a_lo + FF(1); + alu_row->alu_a_lo = alu_row->alu_a_lo + FF(1); break; case SubLoCheckFailed: - alu_row->avm_alu_p_a_borrow = FF::one() - alu_row->avm_alu_p_a_borrow; + alu_row->alu_p_a_borrow = FF::one() - alu_row->alu_p_a_borrow; break; case ResLoCheckFailed: - alu_row->avm_alu_res_lo = alu_row->avm_alu_res_lo - FF(1); + alu_row->alu_res_lo = alu_row->alu_res_lo - FF(1); break; case ResHiCheckFailed: - alu_row->avm_alu_res_hi = FF(1); + alu_row->alu_res_hi = FF(1); break; case CounterRelationFailed: - range_check_row->avm_alu_cmp_rng_ctr = FF(0); + range_check_row->alu_cmp_rng_ctr = FF(0); break; case CounterNonZeroCheckFailed: - range_check_row->avm_alu_rng_chk_sel = FF(0); - range_check_row->avm_alu_rng_chk_lookup_selector = FF(0); + range_check_row->alu_rng_chk_sel = FF(0); + range_check_row->alu_rng_chk_lookup_selector = FF(0); break; case ShiftRelationFailed: - range_check_row->avm_alu_a_lo = range_check_row->avm_alu_res_lo; - range_check_row->avm_alu_a_hi = range_check_row->avm_alu_res_hi; + range_check_row->alu_a_lo = range_check_row->alu_res_lo; + range_check_row->alu_a_hi = range_check_row->alu_res_hi; break; case RangeCheckFailed: // Canonicalisation check failure // TODO: We can probably refactor this to another function later as it is a bit verbose @@ -241,62 +241,61 @@ std::vector gen_mutated_trace_cmp( mutate_ic_in_trace(trace, std::move(select_row), c_mutated, true); // Now we have to also update the value of res_lo = (A_SUB_B_LO * IS_GT + B_SUB_A_LO * (1 - IS_GT)) - alu_row->avm_alu_borrow = FF(0); - FF mutated_res_lo = - alu_row->avm_alu_b_lo - alu_row->avm_alu_a_lo + alu_row->avm_alu_borrow * (uint256_t(1) << 128); - FF mutated_res_hi = alu_row->avm_alu_b_hi - alu_row->avm_alu_a_hi - alu_row->avm_alu_borrow; + alu_row->alu_borrow = FF(0); + FF mutated_res_lo = alu_row->alu_b_lo - alu_row->alu_a_lo + alu_row->alu_borrow * (uint256_t(1) << 128); + FF mutated_res_hi = alu_row->alu_b_hi - alu_row->alu_a_hi - alu_row->alu_borrow; if (is_lte) { - mutated_res_lo = alu_row->avm_alu_a_lo - alu_row->avm_alu_b_lo - FF::one() + - alu_row->avm_alu_borrow * (uint256_t(1) << 128); - mutated_res_hi = alu_row->avm_alu_a_hi - alu_row->avm_alu_b_hi - alu_row->avm_alu_borrow; + mutated_res_lo = + alu_row->alu_a_lo - alu_row->alu_b_lo - FF::one() + alu_row->alu_borrow * (uint256_t(1) << 128); + mutated_res_hi = alu_row->alu_a_hi - alu_row->alu_b_hi - alu_row->alu_borrow; } - alu_row->avm_alu_res_lo = mutated_res_lo; - alu_row->avm_alu_res_hi = mutated_res_hi; + alu_row->alu_res_lo = mutated_res_lo; + alu_row->alu_res_hi = mutated_res_hi; // For each subsequent row that involve the range check, we need to update the shifted values auto next_row = alu_row + 1; - next_row->avm_alu_p_sub_b_lo = mutated_res_lo; - next_row->avm_alu_p_sub_b_hi = mutated_res_hi; + next_row->alu_p_sub_b_lo = mutated_res_lo; + next_row->alu_p_sub_b_hi = mutated_res_hi; next_row = alu_row + 2; - next_row->avm_alu_p_sub_a_lo = mutated_res_lo; - next_row->avm_alu_p_sub_a_hi = mutated_res_hi; + next_row->alu_p_sub_a_lo = mutated_res_lo; + next_row->alu_p_sub_a_hi = mutated_res_hi; next_row = alu_row + 3; - next_row->avm_alu_b_lo = mutated_res_lo; - next_row->avm_alu_b_hi = mutated_res_hi; + next_row->alu_b_lo = mutated_res_lo; + next_row->alu_b_hi = mutated_res_hi; // The final row contains the mutated res_x values at the a_x slots that will be range check. auto final_row = alu_row + 4; // To prevent a trivial range check failure, we need to clear the lookup counters for the // current value of res_lo stored in a_lo - clear_range_check_counters(trace, final_row->avm_alu_a_lo); - final_row->avm_alu_a_lo = mutated_res_lo; - final_row->avm_alu_a_hi = mutated_res_hi; + clear_range_check_counters(trace, final_row->alu_a_lo); + final_row->alu_a_lo = mutated_res_lo; + final_row->alu_a_hi = mutated_res_hi; uint256_t mutated_res_lo_u256 = mutated_res_lo; // We update range check lookup counters and the registers here // Assign the new u8 value that goes into the first slice register. - final_row->avm_alu_u8_r0 = static_cast(mutated_res_lo_u256); + final_row->alu_u8_r0 = static_cast(mutated_res_lo_u256); // Find the main row where the new u8 value in the first register WILL be looked up auto new_lookup_row = std::ranges::find_if(trace.begin(), trace.end(), [final_row](Row r) { - return r.avm_main_clk == final_row->avm_alu_u8_r0 && r.avm_main_sel_rng_8 == FF(1); + return r.main_clk == final_row->alu_u8_r0 && r.main_sel_rng_8 == FF(1); }); // Increment the counter new_lookup_row->lookup_u8_0_counts = new_lookup_row->lookup_u8_0_counts + 1; mutated_res_lo_u256 >>= 8; // Assign the new u8 value that goes into the second slice register. - final_row->avm_alu_u8_r1 = static_cast(mutated_res_lo_u256); + final_row->alu_u8_r1 = static_cast(mutated_res_lo_u256); new_lookup_row = std::ranges::find_if(trace.begin(), trace.end(), [final_row](Row r) { - return r.avm_main_clk == final_row->avm_alu_u8_r1 && r.avm_main_sel_rng_8 == FF(1); + return r.main_clk == final_row->alu_u8_r1 && r.main_sel_rng_8 == FF(1); }); new_lookup_row->lookup_u8_1_counts = new_lookup_row->lookup_u8_1_counts + 1; mutated_res_lo_u256 >>= 8; // Set the remaining bits (that are > 16) to the first u16 register to trigger the overflow - final_row->avm_alu_u16_r0 = mutated_res_lo_u256; + final_row->alu_u16_r0 = mutated_res_lo_u256; break; } @@ -316,7 +315,7 @@ TEST_P(AvmCmpNegativeTestsLT, ParamTest) trace_builder.op_lt(0, 0, 1, 2, AvmMemoryTag::FF); trace_builder.return_op(0, 0, 0); auto trace = trace_builder.finalize(); - std::function select_row = [](Row r) { return r.avm_main_sel_op_lt == FF(1); }; + std::function select_row = [](Row r) { return r.main_sel_op_lt == FF(1); }; trace = gen_mutated_trace_cmp(trace, select_row, output, failure_mode, false); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), failure_string); } @@ -334,7 +333,7 @@ TEST_P(AvmCmpNegativeTestsLTE, ParamTest) trace_builder.op_lte(0, 0, 1, 2, AvmMemoryTag::FF); trace_builder.return_op(0, 0, 0); auto trace = trace_builder.finalize(); - std::function select_row = [](Row r) { return r.avm_main_sel_op_lte == FF(1); }; + std::function select_row = [](Row r) { return r.main_sel_op_lte == FF(1); }; trace = gen_mutated_trace_cmp(trace, select_row, output, failure_mode, true); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), failure_string); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp index 3bf8ad942d6..bf68433369e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_control_flow.test.cpp @@ -8,29 +8,29 @@ namespace { void validate_internal_call(Row const& row, uint32_t current_pc, uint32_t target_pc, uint32_t stack_ptr) { - EXPECT_EQ(row.avm_main_sel_internal_call, FF(1)); - EXPECT_EQ(row.avm_main_pc, FF(current_pc)); - EXPECT_EQ(row.avm_main_ia, FF(target_pc)); - EXPECT_EQ(row.avm_main_internal_return_ptr, FF(stack_ptr)); - EXPECT_EQ(row.avm_main_mem_op_b, FF(1)); - EXPECT_EQ(row.avm_main_rwb, FF(1)); - EXPECT_EQ(row.avm_main_ib, FF(current_pc + 1)); - EXPECT_EQ(row.avm_main_mem_idx_b, FF(stack_ptr)); - EXPECT_EQ(row.avm_main_w_in_tag, FF(static_cast(AvmMemoryTag::U32))); - EXPECT_EQ(row.avm_main_space_id, FF(INTERNAL_CALL_SPACE_ID)); + EXPECT_EQ(row.main_sel_internal_call, FF(1)); + EXPECT_EQ(row.main_pc, FF(current_pc)); + EXPECT_EQ(row.main_ia, FF(target_pc)); + EXPECT_EQ(row.main_internal_return_ptr, FF(stack_ptr)); + EXPECT_EQ(row.main_mem_op_b, FF(1)); + EXPECT_EQ(row.main_rwb, FF(1)); + EXPECT_EQ(row.main_ib, FF(current_pc + 1)); + EXPECT_EQ(row.main_mem_idx_b, FF(stack_ptr)); + EXPECT_EQ(row.main_w_in_tag, FF(static_cast(AvmMemoryTag::U32))); + EXPECT_EQ(row.main_space_id, FF(INTERNAL_CALL_SPACE_ID)); }; void validate_internal_return(Row const& row, uint32_t current_pc, uint32_t return_pc, uint32_t stack_ptr) { - EXPECT_EQ(row.avm_main_sel_internal_return, FF(1)); - EXPECT_EQ(row.avm_main_pc, FF(current_pc)); - EXPECT_EQ(row.avm_main_ia, FF(return_pc)); - EXPECT_EQ(row.avm_main_internal_return_ptr, FF(stack_ptr)); - EXPECT_EQ(row.avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row.avm_main_rwa, FF(0)); - EXPECT_EQ(row.avm_main_mem_idx_a, FF(stack_ptr - 1)); - EXPECT_EQ(row.avm_main_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); - EXPECT_EQ(row.avm_main_space_id, FF(INTERNAL_CALL_SPACE_ID)); + EXPECT_EQ(row.main_sel_internal_return, FF(1)); + EXPECT_EQ(row.main_pc, FF(current_pc)); + EXPECT_EQ(row.main_ia, FF(return_pc)); + EXPECT_EQ(row.main_internal_return_ptr, FF(stack_ptr)); + EXPECT_EQ(row.main_mem_op_a, FF(1)); + EXPECT_EQ(row.main_rwa, FF(0)); + EXPECT_EQ(row.main_mem_idx_a, FF(stack_ptr - 1)); + EXPECT_EQ(row.main_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); + EXPECT_EQ(row.main_space_id, FF(INTERNAL_CALL_SPACE_ID)); }; } // namespace @@ -74,8 +74,8 @@ TEST_F(AvmControlFlowTests, simpleCall) // Check call { - auto call_row_iter = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_internal_call == FF(1); }); + auto call_row_iter = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_internal_call == FF(1); }); EXPECT_TRUE(call_row_iter != trace.end()); auto& call_row = trace.at(static_cast(call_row_iter - trace.begin())); validate_internal_call(call_row, 0, CALL_PC, 0); @@ -84,12 +84,12 @@ TEST_F(AvmControlFlowTests, simpleCall) // Check halt { auto halt_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_halt == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_halt == FF(1); }); // Check that the correct result is stored at the expected memory location. EXPECT_TRUE(halt_row != trace.end()); - EXPECT_EQ(halt_row->avm_main_pc, FF(CALL_PC)); - EXPECT_EQ(halt_row->avm_main_internal_return_ptr, FF(1)); + EXPECT_EQ(halt_row->main_pc, FF(CALL_PC)); + EXPECT_EQ(halt_row->main_internal_return_ptr, FF(1)); } validate_trace(std::move(trace), public_inputs, true); } @@ -110,19 +110,19 @@ TEST_F(AvmControlFlowTests, simpleJump) // Check jump { auto call_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_jump == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_jump == FF(1); }); EXPECT_TRUE(call_row != trace.end()); - EXPECT_EQ(call_row->avm_main_pc, FF(0)); - EXPECT_EQ(call_row->avm_main_ia, FF(JUMP_PC)); + EXPECT_EQ(call_row->main_pc, FF(0)); + EXPECT_EQ(call_row->main_ia, FF(JUMP_PC)); } // Check halt { auto halt_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_halt == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_halt == FF(1); }); EXPECT_TRUE(halt_row != trace.end()); - EXPECT_EQ(halt_row->avm_main_pc, FF(JUMP_PC)); + EXPECT_EQ(halt_row->main_pc, FF(JUMP_PC)); } validate_trace(std::move(trace), public_inputs); } @@ -144,8 +144,8 @@ TEST_F(AvmControlFlowTests, simpleCallAndReturn) // Check call { - auto call_row_iter = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_internal_call == FF(1); }); + auto call_row_iter = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_internal_call == FF(1); }); EXPECT_TRUE(call_row_iter != trace.end()); auto& call_row = trace.at(static_cast(call_row_iter - trace.begin())); validate_internal_call(call_row, 0, CALL_PC, 0); @@ -153,8 +153,8 @@ TEST_F(AvmControlFlowTests, simpleCallAndReturn) // Check return { - auto return_row_iter = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_internal_return == FF(1); }); + auto return_row_iter = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_internal_return == FF(1); }); // Check that the correct result is stored at the expected memory location. EXPECT_TRUE(return_row_iter != trace.end()); @@ -165,10 +165,10 @@ TEST_F(AvmControlFlowTests, simpleCallAndReturn) // Check halt { auto halt_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_halt == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_halt == FF(1); }); EXPECT_TRUE(halt_row != trace.end()); - EXPECT_EQ(halt_row->avm_main_pc, FF(RETURN_PC)); + EXPECT_EQ(halt_row->main_pc, FF(RETURN_PC)); } validate_trace(std::move(trace), public_inputs); @@ -210,9 +210,8 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Check call 1 { - auto call_1 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_internal_call == FF(1) && r.avm_main_ib == FF(1); - }); + auto call_1 = std::ranges::find_if( + trace.begin(), trace.end(), [](Row r) { return r.main_sel_internal_call == FF(1) && r.main_ib == FF(1); }); EXPECT_TRUE(call_1 != trace.end()); auto& call_1_row = trace.at(static_cast(call_1 - trace.begin())); validate_internal_call(call_1_row, 0, CALL_PC_1, 0); @@ -221,7 +220,7 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Call 2 { auto call_2 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_internal_call == FF(1) && r.avm_main_pc == FF(CALL_PC_1); + return r.main_sel_internal_call == FF(1) && r.main_pc == FF(CALL_PC_1); }); EXPECT_TRUE(call_2 != trace.end()); auto& call_2_row = trace.at(static_cast(call_2 - trace.begin())); @@ -231,7 +230,7 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Call 3 { auto call_3 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_internal_call == FF(1) && r.avm_main_pc == FF(CALL_PC_2); + return r.main_sel_internal_call == FF(1) && r.main_pc == FF(CALL_PC_2); }); EXPECT_TRUE(call_3 != trace.end()); auto& call_3_row = trace.at(static_cast(call_3 - trace.begin())); @@ -240,8 +239,8 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Return 1 { - auto return_1 = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_internal_return == FF(1); }); + auto return_1 = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_internal_return == FF(1); }); EXPECT_TRUE(return_1 != trace.end()); auto& return_1_row = trace.at(static_cast(return_1 - trace.begin())); validate_internal_return(return_1_row, CALL_PC_3, CALL_PC_2 + 1, 3); @@ -250,7 +249,7 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Call 4 { auto call_4 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_internal_call == FF(1) && r.avm_main_pc == FF(CALL_PC_2 + 1); + return r.main_sel_internal_call == FF(1) && r.main_pc == FF(CALL_PC_2 + 1); }); EXPECT_TRUE(call_4 != trace.end()); auto& call_4_row = trace.at(static_cast(call_4 - trace.begin())); @@ -260,7 +259,7 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Return 2 { auto return_2 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_internal_return == FF(1) && r.avm_main_pc == FF(CALL_PC_4); + return r.main_sel_internal_return == FF(1) && r.main_pc == FF(CALL_PC_4); }); EXPECT_TRUE(return_2 != trace.end()); auto& return_2_row = trace.at(static_cast(return_2 - trace.begin())); @@ -270,17 +269,17 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Jump 1 { auto jump_1 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_jump == FF(1) && r.avm_main_pc == FF(CALL_PC_2 + 2); + return r.main_sel_jump == FF(1) && r.main_pc == FF(CALL_PC_2 + 2); }); EXPECT_TRUE(jump_1 != trace.end()); - EXPECT_EQ(jump_1->avm_main_ia, FF(JUMP_PC_1)); - EXPECT_EQ(jump_1->avm_main_internal_return_ptr, FF(2)); + EXPECT_EQ(jump_1->main_ia, FF(JUMP_PC_1)); + EXPECT_EQ(jump_1->main_internal_return_ptr, FF(2)); } // Return 3 { auto return_3 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_internal_return == FF(1) && r.avm_main_pc == FF(JUMP_PC_1); + return r.main_sel_internal_return == FF(1) && r.main_pc == FF(JUMP_PC_1); }); EXPECT_TRUE(return_3 != trace.end()); auto& return_3_row = trace.at(static_cast(return_3 - trace.begin())); @@ -290,7 +289,7 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) // Return 4 { auto return_4 = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { - return r.avm_main_sel_internal_return == FF(1) && r.avm_main_pc == FF(CALL_PC_1 + 1); + return r.main_sel_internal_return == FF(1) && r.main_pc == FF(CALL_PC_1 + 1); }); EXPECT_TRUE(return_4 != trace.end()); auto& return_4_row = trace.at(static_cast(return_4 - trace.begin())); @@ -298,11 +297,10 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns) } // Halt row - auto halt_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_halt == FF(1); }); + auto halt_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_halt == FF(1); }); EXPECT_TRUE(halt_row != trace.end()); - EXPECT_EQ(halt_row->avm_main_pc, FF(1)); + EXPECT_EQ(halt_row->main_pc, FF(1)); validate_trace(std::move(trace), public_inputs); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp index 9f3d453452b..f05eb875f45 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp @@ -157,8 +157,8 @@ TEST_F(AvmExecutionTests, setAndSubOpcodes) auto trace = gen_trace_from_instr(instructions); // Find the first row enabling the subtraction selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == 1; }); - EXPECT_EQ(row->avm_main_ic, 10000); // 47123 - 37123 = 10000 + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == 1; }); + EXPECT_EQ(row->main_ic, 10000); // 47123 - 37123 = 10000 validate_trace(std::move(trace), public_inputs, true); } @@ -236,8 +236,8 @@ TEST_F(AvmExecutionTests, powerWithMulOpcodes) // Find the first row enabling the multiplication selector and pc = 13 auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == 1 && r.avm_main_pc == 13; }); - EXPECT_EQ(row->avm_main_ic, 244140625); // 5^12 = 244140625 + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == 1 && r.main_pc == 13; }); + EXPECT_EQ(row->main_ic, 244140625); // 5^12 = 244140625 validate_trace(std::move(trace), public_inputs); } @@ -299,12 +299,12 @@ TEST_F(AvmExecutionTests, simpleInternalCall) std::vector pc_sequence{ 0, 1, 4, 5, 2, 3 }; for (size_t i = 0; i < 6; i++) { - EXPECT_EQ(trace.at(i + 1).avm_main_pc, pc_sequence.at(i)); + EXPECT_EQ(trace.at(i + 1).main_pc, pc_sequence.at(i)); } // Find the first row enabling the addition selector. - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == 1; }); - EXPECT_EQ(row->avm_main_ic, 345567789); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_add == 1; }); + EXPECT_EQ(row->main_ic, 345567789); validate_trace(std::move(trace), public_inputs); } @@ -378,13 +378,13 @@ TEST_F(AvmExecutionTests, nestedInternalCalls) std::vector pc_sequence{ 0, 1, 2, 8, 6, 7, 9, 10, 4, 5, 11, 3 }; for (size_t i = 0; i < 6; i++) { - EXPECT_EQ(trace.at(i + 1).avm_main_pc, pc_sequence.at(i)); + EXPECT_EQ(trace.at(i + 1).main_pc, pc_sequence.at(i)); } // Find the first row enabling the multiplication selector. - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == 1; }); - EXPECT_EQ(row->avm_main_ic, 187); - EXPECT_EQ(row->avm_main_pc, 4); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == 1; }); + EXPECT_EQ(row->main_ic, 187); + EXPECT_EQ(row->main_pc, 4); validate_trace(std::move(trace), public_inputs); } @@ -449,15 +449,15 @@ TEST_F(AvmExecutionTests, jumpAndCalldatacopy) std::vector pc_sequence{ 0, 1, 3, 4 }; for (size_t i = 0; i < 4; i++) { - EXPECT_EQ(trace.at(i + 1).avm_main_pc, pc_sequence.at(i)); + EXPECT_EQ(trace.at(i + 1).main_pc, pc_sequence.at(i)); } // Find the first row enabling the fdiv selector. - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == 1; }); - EXPECT_EQ(row->avm_main_ic, 12); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == 1; }); + EXPECT_EQ(row->main_ic, 12); // Find the first row enabling the subtraction selector. - row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == 1; }); + row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == 1; }); // It must have failed as subtraction was "jumped over". EXPECT_EQ(row, trace.end()); @@ -531,29 +531,28 @@ TEST_F(AvmExecutionTests, jumpiAndCalldatacopy) std::vector pc_sequence_no_jump{ 0, 1, 2, 3, 4, 5 }; for (size_t i = 0; i < 5; i++) { - EXPECT_EQ(trace_jump.at(i + 1).avm_main_pc, pc_sequence_jump.at(i)); + EXPECT_EQ(trace_jump.at(i + 1).main_pc, pc_sequence_jump.at(i)); } for (size_t i = 0; i < 6; i++) { - EXPECT_EQ(trace_no_jump.at(i + 1).avm_main_pc, pc_sequence_no_jump.at(i)); + EXPECT_EQ(trace_no_jump.at(i + 1).main_pc, pc_sequence_no_jump.at(i)); } // JUMP CASE // Find the first row enabling the MUL opcode - auto row = - std::ranges::find_if(trace_jump.begin(), trace_jump.end(), [](Row r) { return r.avm_main_sel_op_mul == 1; }); - EXPECT_EQ(row->avm_main_ic, 400); // 400 = 20 * 20 + auto row = std::ranges::find_if(trace_jump.begin(), trace_jump.end(), [](Row r) { return r.main_sel_op_mul == 1; }); + EXPECT_EQ(row->main_ic, 400); // 400 = 20 * 20 // Find the first row enabling the addition selector. - row = std::ranges::find_if(trace_jump.begin(), trace_jump.end(), [](Row r) { return r.avm_main_sel_op_add == 1; }); + row = std::ranges::find_if(trace_jump.begin(), trace_jump.end(), [](Row r) { return r.main_sel_op_add == 1; }); // It must have failed as addition was "jumped over". EXPECT_EQ(row, trace_jump.end()); // NO JUMP CASE // Find the first row enabling the MUL opcode - row = std::ranges::find_if( - trace_no_jump.begin(), trace_no_jump.end(), [](Row r) { return r.avm_main_sel_op_mul == 1; }); - EXPECT_EQ(row->avm_main_ic, 1600); // 800 = (20 + 20) * (20 + 20) + row = + std::ranges::find_if(trace_no_jump.begin(), trace_no_jump.end(), [](Row r) { return r.main_sel_op_mul == 1; }); + EXPECT_EQ(row->main_ic, 1600); // 800 = (20 + 20) * (20 + 20) // traces validation validate_trace(std::move(trace_jump), public_inputs); @@ -601,9 +600,9 @@ TEST_F(AvmExecutionTests, movOpcode) auto trace = gen_trace_from_instr(instructions); // Find the first row enabling the MOV selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_mov == 1; }); - EXPECT_EQ(row->avm_main_ia, 19); - EXPECT_EQ(row->avm_main_ic, 19); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_mov == 1; }); + EXPECT_EQ(row->main_ia, 19); + EXPECT_EQ(row->main_ic, 19); validate_trace(std::move(trace), public_inputs); } @@ -655,11 +654,11 @@ TEST_F(AvmExecutionTests, cmovOpcode) auto trace = gen_trace_from_instr(instructions); // Find the first row enabling the CMOV selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_cmov == 1; }); - EXPECT_EQ(row->avm_main_ia, 3); - EXPECT_EQ(row->avm_main_ib, 4); - EXPECT_EQ(row->avm_main_ic, 3); - EXPECT_EQ(row->avm_main_id, 5); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_cmov == 1; }); + EXPECT_EQ(row->main_ia, 3); + EXPECT_EQ(row->main_ib, 4); + EXPECT_EQ(row->main_ic, 3); + EXPECT_EQ(row->main_id, 5); validate_trace(std::move(trace), public_inputs); } @@ -705,9 +704,9 @@ TEST_F(AvmExecutionTests, indMovOpcode) auto trace = gen_trace_from_instr(instructions); // Find the first row enabling the MOV selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_mov == 1; }); - EXPECT_EQ(row->avm_main_ia, 255); - EXPECT_EQ(row->avm_main_ic, 255); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_mov == 1; }); + EXPECT_EQ(row->main_ia, 255); + EXPECT_EQ(row->main_ic, 255); validate_trace(std::move(trace), public_inputs); } @@ -747,8 +746,8 @@ TEST_F(AvmExecutionTests, setAndCastOpcodes) auto trace = gen_trace_from_instr(instructions); // Find the first row enabling the cast selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_cast == 1; }); - EXPECT_EQ(row->avm_main_ic, 19); // 0XB813 --> 0X13 = 19 + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cast == 1; }); + EXPECT_EQ(row->main_ic, 19); // 0XB813 --> 0X13 = 19 validate_trace(std::move(trace), public_inputs); } @@ -803,15 +802,15 @@ TEST_F(AvmExecutionTests, toRadixLeOpcode) Execution::gen_trace(instructions, returndata, std::vector{ FF::modulus - FF(1) }, public_inputs_vec); // Find the first row enabling the TORADIXLE selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_radix_le == 1; }); - EXPECT_EQ(row->avm_main_ind_a, 17); - EXPECT_EQ(row->avm_main_ind_b, 21); - EXPECT_EQ(row->avm_main_mem_idx_a, 1); // Indirect(17) -> 1 - EXPECT_EQ(row->avm_main_mem_idx_b, 5); // Indirect(21) -> 5 - EXPECT_EQ(row->avm_main_ia, FF(FF::modulus - FF(1))); // Indirect(17) -> Direct(1) -> FF::modulus - FF(1) - EXPECT_EQ(row->avm_main_ib, 0); // Indirect(21) -> 5 -> Unintialized memory - EXPECT_EQ(row->avm_main_ic, 2); - EXPECT_EQ(row->avm_main_id, 256); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_radix_le == 1; }); + EXPECT_EQ(row->main_ind_a, 17); + EXPECT_EQ(row->main_ind_b, 21); + EXPECT_EQ(row->main_mem_idx_a, 1); // Indirect(17) -> 1 + EXPECT_EQ(row->main_mem_idx_b, 5); // Indirect(21) -> 5 + EXPECT_EQ(row->main_ia, FF(FF::modulus - FF(1))); // Indirect(17) -> Direct(1) -> FF::modulus - FF(1) + EXPECT_EQ(row->main_ib, 0); // Indirect(21) -> 5 -> Unintialized memory + EXPECT_EQ(row->main_ic, 2); + EXPECT_EQ(row->main_id, 256); // Expected output is bitwise decomposition of MODULUS - 1..could hardcode the result but it's a bit long std::vector expected_output; @@ -902,16 +901,16 @@ TEST_F(AvmExecutionTests, sha256CompressionOpcode) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // Find the first row enabling the Sha256Compression selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sha256 == 1; }); - EXPECT_EQ(row->avm_main_ind_a, 34); - EXPECT_EQ(row->avm_main_ind_b, 35); - EXPECT_EQ(row->avm_main_ind_c, 36); - EXPECT_EQ(row->avm_main_mem_idx_a, 1); // Indirect(34) -> 9 - EXPECT_EQ(row->avm_main_mem_idx_b, 9); // Indirect(35) -> 9 - EXPECT_EQ(row->avm_main_mem_idx_c, 256); // Indirect(36) -> 256 - EXPECT_EQ(row->avm_main_ia, 1); // Trivially contains 0. (See avm_trace for explanation why) - EXPECT_EQ(row->avm_main_ib, 1); // Contains first element of the state - EXPECT_EQ(row->avm_main_ic, 0); // Contains first element of the input + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sha256 == 1; }); + EXPECT_EQ(row->main_ind_a, 34); + EXPECT_EQ(row->main_ind_b, 35); + EXPECT_EQ(row->main_ind_c, 36); + EXPECT_EQ(row->main_mem_idx_a, 1); // Indirect(34) -> 9 + EXPECT_EQ(row->main_mem_idx_b, 9); // Indirect(35) -> 9 + EXPECT_EQ(row->main_mem_idx_c, 256); // Indirect(36) -> 256 + EXPECT_EQ(row->main_ia, 1); // Trivially contains 0. (See avm_trace for explanation why) + EXPECT_EQ(row->main_ib, 1); // Contains first element of the state + EXPECT_EQ(row->main_ic, 0); // Contains first element of the input EXPECT_EQ(returndata, expected_output); @@ -993,18 +992,18 @@ TEST_F(AvmExecutionTests, sha256Opcode) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // Find the first row enabling the sha256 selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sha256 == 1; }); - EXPECT_EQ(row->avm_main_ind_a, 36); // Register A is indirect - EXPECT_EQ(row->avm_main_ind_c, 35); // Register C is indirect - EXPECT_EQ(row->avm_main_mem_idx_a, 1); // Indirect(36) -> 1 - EXPECT_EQ(row->avm_main_mem_idx_c, 256); // Indirect(35) -> 256 - EXPECT_EQ(row->avm_main_ia, 97); - EXPECT_EQ(row->avm_main_ic, 0); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sha256 == 1; }); + EXPECT_EQ(row->main_ind_a, 36); // Register A is indirect + EXPECT_EQ(row->main_ind_c, 35); // Register C is indirect + EXPECT_EQ(row->main_mem_idx_a, 1); // Indirect(36) -> 1 + EXPECT_EQ(row->main_mem_idx_c, 256); // Indirect(35) -> 256 + EXPECT_EQ(row->main_ia, 97); + EXPECT_EQ(row->main_ic, 0); // Register b checks are done in the next row due to the difference in the memory tag std::advance(row, 1); - EXPECT_EQ(row->avm_main_ind_b, 0); // Register B is not - EXPECT_EQ(row->avm_main_mem_idx_b, 37); // Load(37) -> input length - EXPECT_EQ(row->avm_main_ib, 3); // Input length + EXPECT_EQ(row->main_ind_b, 0); // Register B is not + EXPECT_EQ(row->main_mem_idx_b, 37); // Load(37) -> input length + EXPECT_EQ(row->main_ib, 3); // Input length EXPECT_EQ(returndata, expected_output); @@ -1069,13 +1068,13 @@ TEST_F(AvmExecutionTests, poseidon2PermutationOpCode) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // Find the first row enabling the poseidon2 selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_poseidon2 == 1; }); - EXPECT_EQ(row->avm_main_ind_a, 36); - EXPECT_EQ(row->avm_main_ind_b, 35); - EXPECT_EQ(row->avm_main_mem_idx_a, 1); // Indirect(36) -> 1 - EXPECT_EQ(row->avm_main_mem_idx_b, 9); // Indirect(34) -> 9 - EXPECT_EQ(row->avm_main_ia, FF(std::string("9a807b615c4d3e2fa0b1c2d3e4f56789fedcba9876543210abcdef0123456789"))); - EXPECT_EQ(row->avm_main_ib, 0); // Contains first element of the output (trivially 0) + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_poseidon2 == 1; }); + EXPECT_EQ(row->main_ind_a, 36); + EXPECT_EQ(row->main_ind_b, 35); + EXPECT_EQ(row->main_mem_idx_a, 1); // Indirect(36) -> 1 + EXPECT_EQ(row->main_mem_idx_b, 9); // Indirect(34) -> 9 + EXPECT_EQ(row->main_ia, FF(std::string("9a807b615c4d3e2fa0b1c2d3e4f56789fedcba9876543210abcdef0123456789"))); + EXPECT_EQ(row->main_ib, 0); // Contains first element of the output (trivially 0) EXPECT_EQ(returndata, expected_output); @@ -1164,18 +1163,18 @@ TEST_F(AvmExecutionTests, keccakf1600OpCode) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // Find the first row enabling the keccak selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_keccak == 1; }); - EXPECT_EQ(row->avm_main_ind_a, 36); // Register A is indirect - EXPECT_EQ(row->avm_main_ind_c, 35); // Register C is indirect - EXPECT_EQ(row->avm_main_mem_idx_a, 1); // Indirect(36) -> 1 - EXPECT_EQ(row->avm_main_mem_idx_c, 256); // Indirect(35) -> 256 - EXPECT_EQ(row->avm_main_ia, (0xF1258F7940E1DDE7LLU)); - EXPECT_EQ(row->avm_main_ic, 0); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_keccak == 1; }); + EXPECT_EQ(row->main_ind_a, 36); // Register A is indirect + EXPECT_EQ(row->main_ind_c, 35); // Register C is indirect + EXPECT_EQ(row->main_mem_idx_a, 1); // Indirect(36) -> 1 + EXPECT_EQ(row->main_mem_idx_c, 256); // Indirect(35) -> 256 + EXPECT_EQ(row->main_ia, (0xF1258F7940E1DDE7LLU)); + EXPECT_EQ(row->main_ic, 0); std::advance(row, 1); - EXPECT_EQ(row->avm_main_ind_b, 0); // Register B is not - EXPECT_EQ(row->avm_main_mem_idx_b, 37); // Load(37) -> input length - EXPECT_EQ(row->avm_main_ib, 25); // Input length + EXPECT_EQ(row->main_ind_b, 0); // Register B is not + EXPECT_EQ(row->main_mem_idx_b, 37); // Load(37) -> input length + EXPECT_EQ(row->main_ib, 25); // Input length EXPECT_EQ(returndata, expected_output); validate_trace(std::move(trace), public_inputs); @@ -1246,18 +1245,18 @@ TEST_F(AvmExecutionTests, keccakOpCode) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // Find the first row enabling the keccak selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_keccak == 1; }); - EXPECT_EQ(row->avm_main_ind_a, 36); // Register A is indirect - EXPECT_EQ(row->avm_main_ind_c, 35); // Register C is indirect - EXPECT_EQ(row->avm_main_mem_idx_a, 1); // Indirect(36) -> 1 - EXPECT_EQ(row->avm_main_mem_idx_c, 256); // Indirect(35) -> 256 - EXPECT_EQ(row->avm_main_ia, 189); - EXPECT_EQ(row->avm_main_ic, 0); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_keccak == 1; }); + EXPECT_EQ(row->main_ind_a, 36); // Register A is indirect + EXPECT_EQ(row->main_ind_c, 35); // Register C is indirect + EXPECT_EQ(row->main_mem_idx_a, 1); // Indirect(36) -> 1 + EXPECT_EQ(row->main_mem_idx_c, 256); // Indirect(35) -> 256 + EXPECT_EQ(row->main_ia, 189); + EXPECT_EQ(row->main_ic, 0); // Register b checks are done in the next row due to the difference in the memory tag std::advance(row, 1); - EXPECT_EQ(row->avm_main_ind_b, 0); // Register B is not - EXPECT_EQ(row->avm_main_mem_idx_b, 37); // Load(37) -> input length - EXPECT_EQ(row->avm_main_ib, 1); // Input length + EXPECT_EQ(row->main_ind_b, 0); // Register B is not + EXPECT_EQ(row->main_mem_idx_b, 37); // Load(37) -> input length + EXPECT_EQ(row->main_ib, 1); // Input length EXPECT_EQ(returndata, expected_output); @@ -1324,14 +1323,14 @@ TEST_F(AvmExecutionTests, pedersenHashOpCode) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // Find the first row enabling the pedersen selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_pedersen == 1; }); - EXPECT_EQ(row->avm_main_ind_a, 4); // Register A is indirect - EXPECT_EQ(row->avm_main_mem_idx_a, 0); // Indirect(4) -> 1 - EXPECT_EQ(row->avm_main_ia, 1); // The first input + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_pedersen == 1; }); + EXPECT_EQ(row->main_ind_a, 4); // Register A is indirect + EXPECT_EQ(row->main_mem_idx_a, 0); // Indirect(4) -> 1 + EXPECT_EQ(row->main_ia, 1); // The first input // The second row loads the U32 values std::advance(row, 1); - EXPECT_EQ(row->avm_main_ia, 2); // Input length is 2 - EXPECT_EQ(row->avm_main_ib, 5); // Hash offset is 5 + EXPECT_EQ(row->main_ia, 2); // Input length is 2 + EXPECT_EQ(row->main_ib, 5); // Hash offset is 5 EXPECT_EQ(returndata[0], expected_output); @@ -1626,60 +1625,59 @@ TEST_F(AvmExecutionTests, kernelInputOpcodes) // Validate that the opcode read the correct value into ia // Check sender - auto sender_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sender == 1; }); - EXPECT_EQ(sender_row->avm_main_ia, sender); + auto sender_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sender == 1; }); + EXPECT_EQ(sender_row->main_ia, sender); // Check address auto address_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_address == 1; }); - EXPECT_EQ(address_row->avm_main_ia, address); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_address == 1; }); + EXPECT_EQ(address_row->main_ia, address); // Check storage address auto storage_addr_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_storage_address == 1; }); - EXPECT_EQ(storage_addr_row->avm_main_ia, storage_address); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_storage_address == 1; }); + EXPECT_EQ(storage_addr_row->main_ia, storage_address); // Check chain id auto chainid_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_chain_id == 1; }); - EXPECT_EQ(chainid_row->avm_main_ia, chainid); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_chain_id == 1; }); + EXPECT_EQ(chainid_row->main_ia, chainid); // Check version auto version_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_version == 1; }); - EXPECT_EQ(version_row->avm_main_ia, version); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_version == 1; }); + EXPECT_EQ(version_row->main_ia, version); // Check blocknumber auto blocknumber_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_block_number == 1; }); - EXPECT_EQ(blocknumber_row->avm_main_ia, blocknumber); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_block_number == 1; }); + EXPECT_EQ(blocknumber_row->main_ia, blocknumber); // Check timestamp auto timestamp_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_timestamp == 1; }); - EXPECT_EQ(timestamp_row->avm_main_ia, timestamp); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_timestamp == 1; }); + EXPECT_EQ(timestamp_row->main_ia, timestamp); // Check feeperdagas auto feeperdagas_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fee_per_da_gas == 1; }); - EXPECT_EQ(feeperdagas_row->avm_main_ia, feeperdagas); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fee_per_da_gas == 1; }); + EXPECT_EQ(feeperdagas_row->main_ia, feeperdagas); // Check feeperl2gas auto feeperl2gas_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fee_per_l2_gas == 1; }); - EXPECT_EQ(feeperl2gas_row->avm_main_ia, feeperl2gas); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fee_per_l2_gas == 1; }); + EXPECT_EQ(feeperl2gas_row->main_ia, feeperl2gas); // Check transactionfee auto transactionfee_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_transaction_fee == 1; }); - EXPECT_EQ(transactionfee_row->avm_main_ia, transactionfee); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_transaction_fee == 1; }); + EXPECT_EQ(transactionfee_row->main_ia, transactionfee); // // Check coinbase // Not in simulator // auto coinbase_row = - // std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_coinbase == 1; }); - // EXPECT_EQ(coinbase_row->avm_main_ia, coinbase); + // std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_coinbase == 1; }); + // EXPECT_EQ(coinbase_row->main_ia, coinbase); validate_trace(std::move(trace), Execution::convert_public_inputs(public_inputs_vec)); } @@ -1713,13 +1711,13 @@ TEST_F(AvmExecutionTests, l2GasLeft) auto trace = gen_trace_from_instr(instructions); // Find the first row enabling the L2GASLEFT selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_l2gasleft == 1; }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_l2gasleft == 1; }); uint32_t expected_rem_gas = DEFAULT_INITIAL_L2_GAS - GAS_COST_TABLE.at(OpCode::SET).l2_fixed_gas_cost - GAS_COST_TABLE.at(OpCode::L2GASLEFT).l2_fixed_gas_cost; - EXPECT_EQ(row->avm_main_ia, expected_rem_gas); - EXPECT_EQ(row->avm_main_mem_idx_a, 257); // Resolved direct address: 257 + EXPECT_EQ(row->main_ia, expected_rem_gas); + EXPECT_EQ(row->main_mem_idx_a, 257); // Resolved direct address: 257 validate_trace(std::move(trace), public_inputs); } @@ -1754,13 +1752,13 @@ TEST_F(AvmExecutionTests, daGasLeft) auto trace = gen_trace_from_instr(instructions); // Find the first row enabling the DAGASLEFT selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_dagasleft == 1; }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_dagasleft == 1; }); uint32_t expected_rem_gas = DEFAULT_INITIAL_DA_GAS - GAS_COST_TABLE.at(OpCode::ADD).da_fixed_gas_cost - GAS_COST_TABLE.at(OpCode::DAGASLEFT).da_fixed_gas_cost; - EXPECT_EQ(row->avm_main_ia, expected_rem_gas); - EXPECT_EQ(row->avm_main_mem_idx_a, 39); + EXPECT_EQ(row->main_ia, expected_rem_gas); + EXPECT_EQ(row->main_mem_idx_a, 39); validate_trace(std::move(trace), public_inputs); } @@ -1827,57 +1825,57 @@ TEST_F(AvmExecutionTests, kernelOutputEmitOpcodes) // CHECK EMIT NOTE HASH // Check output data + side effect counters have been set correctly auto emit_note_hash_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_note_hash == 1; }); - EXPECT_EQ(emit_note_hash_row->avm_main_ia, 1); - EXPECT_EQ(emit_note_hash_row->avm_kernel_side_effect_counter, 0); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_note_hash == 1; }); + EXPECT_EQ(emit_note_hash_row->main_ia, 1); + EXPECT_EQ(emit_note_hash_row->kernel_side_effect_counter, 0); // Get the row of the first note hash out uint32_t emit_note_hash_out_offset = AvmKernelTraceBuilder::START_EMIT_NOTE_HASH_WRITE_OFFSET; auto emit_note_hash_kernel_out_row = std::ranges::find_if( - trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == emit_note_hash_out_offset; }); - EXPECT_EQ(emit_note_hash_kernel_out_row->avm_kernel_kernel_value_out, 1); - EXPECT_EQ(emit_note_hash_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); + trace.begin(), trace.end(), [&](Row r) { return r.main_clk == emit_note_hash_out_offset; }); + EXPECT_EQ(emit_note_hash_kernel_out_row->kernel_kernel_value_out, 1); + EXPECT_EQ(emit_note_hash_kernel_out_row->kernel_kernel_side_effect_out, 0); feed_output(emit_note_hash_out_offset, 1, 0, 0); // CHECK EMIT NULLIFIER auto emit_nullifier_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_nullifier == 1; }); - EXPECT_EQ(emit_nullifier_row->avm_main_ia, 1); - EXPECT_EQ(emit_nullifier_row->avm_kernel_side_effect_counter, 1); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_nullifier == 1; }); + EXPECT_EQ(emit_nullifier_row->main_ia, 1); + EXPECT_EQ(emit_nullifier_row->kernel_side_effect_counter, 1); uint32_t emit_nullifier_out_offset = AvmKernelTraceBuilder::START_EMIT_NULLIFIER_WRITE_OFFSET; auto emit_nullifier_kernel_out_row = std::ranges::find_if( - trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == emit_nullifier_out_offset; }); - EXPECT_EQ(emit_nullifier_kernel_out_row->avm_kernel_kernel_value_out, 1); - EXPECT_EQ(emit_nullifier_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); + trace.begin(), trace.end(), [&](Row r) { return r.main_clk == emit_nullifier_out_offset; }); + EXPECT_EQ(emit_nullifier_kernel_out_row->kernel_kernel_value_out, 1); + EXPECT_EQ(emit_nullifier_kernel_out_row->kernel_kernel_side_effect_out, 1); feed_output(emit_nullifier_out_offset, 1, 1, 0); // CHECK EMIT UNENCRYPTED LOG - auto emit_log_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_unencrypted_log == 1; }); - EXPECT_EQ(emit_log_row->avm_main_ia, 1); - EXPECT_EQ(emit_log_row->avm_kernel_side_effect_counter, 2); + auto emit_log_row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_unencrypted_log == 1; }); + EXPECT_EQ(emit_log_row->main_ia, 1); + EXPECT_EQ(emit_log_row->kernel_side_effect_counter, 2); uint32_t emit_log_out_offset = AvmKernelTraceBuilder::START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET; auto emit_log_kernel_out_row = - std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == emit_log_out_offset; }); - EXPECT_EQ(emit_log_kernel_out_row->avm_kernel_kernel_value_out, 1); - EXPECT_EQ(emit_log_kernel_out_row->avm_kernel_kernel_side_effect_out, 2); + std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.main_clk == emit_log_out_offset; }); + EXPECT_EQ(emit_log_kernel_out_row->kernel_kernel_value_out, 1); + EXPECT_EQ(emit_log_kernel_out_row->kernel_kernel_side_effect_out, 2); feed_output(emit_log_out_offset, 1, 2, 0); // CHECK SEND L2 TO L1 MSG - auto send_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_l2_to_l1_msg == 1; }); - EXPECT_EQ(send_row->avm_main_ia, 1); - EXPECT_EQ(send_row->avm_main_ib, 1); - EXPECT_EQ(send_row->avm_kernel_side_effect_counter, 3); + auto send_row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_l2_to_l1_msg == 1; }); + EXPECT_EQ(send_row->main_ia, 1); + EXPECT_EQ(send_row->main_ib, 1); + EXPECT_EQ(send_row->kernel_side_effect_counter, 3); auto msg_out_row = std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { - return r.avm_main_clk == AvmKernelTraceBuilder::START_L2_TO_L1_MSG_WRITE_OFFSET; + return r.main_clk == AvmKernelTraceBuilder::START_L2_TO_L1_MSG_WRITE_OFFSET; }); - EXPECT_EQ(msg_out_row->avm_kernel_kernel_value_out, 1); - EXPECT_EQ(msg_out_row->avm_kernel_kernel_side_effect_out, 3); - EXPECT_EQ(msg_out_row->avm_kernel_kernel_metadata_out, 1); + EXPECT_EQ(msg_out_row->kernel_kernel_value_out, 1); + EXPECT_EQ(msg_out_row->kernel_kernel_side_effect_out, 3); + EXPECT_EQ(msg_out_row->kernel_kernel_metadata_out, 1); feed_output(AvmKernelTraceBuilder::START_L2_TO_L1_MSG_WRITE_OFFSET, 1, 3, 1); validate_trace(std::move(trace), public_inputs); @@ -1924,19 +1922,18 @@ TEST_F(AvmExecutionTests, kernelOutputStorageLoadOpcodeSimple) // CHECK SLOAD // Check output data + side effect counters have been set correctly - auto sload_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sload == 1; }); - EXPECT_EQ(sload_row->avm_main_ia, 42); // Read value - EXPECT_EQ(sload_row->avm_main_ib, 9); // Storage slot - EXPECT_EQ(sload_row->avm_kernel_side_effect_counter, 0); + auto sload_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sload == 1; }); + EXPECT_EQ(sload_row->main_ia, 42); // Read value + EXPECT_EQ(sload_row->main_ib, 9); // Storage slot + EXPECT_EQ(sload_row->kernel_side_effect_counter, 0); // Get the row of the first read storage read out uint32_t sload_out_offset = AvmKernelTraceBuilder::START_SLOAD_WRITE_OFFSET; auto sload_kernel_out_row = - std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == sload_out_offset; }); - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_value_out, 42); // value - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot + std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.main_clk == sload_out_offset; }); + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_value_out, 42); // value + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_side_effect_out, 0); + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_metadata_out, 9); // slot feed_output(sload_out_offset, 42, 0, 9); validate_trace(std::move(trace), public_inputs); } @@ -1982,27 +1979,26 @@ TEST_F(AvmExecutionTests, kernelOutputStorageLoadOpcodeComplex) // CHECK SLOAD // Check output data + side effect counters have been set correctly - auto sload_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sload == 1; }); - EXPECT_EQ(sload_row->avm_main_ia, 42); // Read value - EXPECT_EQ(sload_row->avm_main_ib, 9); // Storage slot - EXPECT_EQ(sload_row->avm_kernel_side_effect_counter, 0); + auto sload_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sload == 1; }); + EXPECT_EQ(sload_row->main_ia, 42); // Read value + EXPECT_EQ(sload_row->main_ib, 9); // Storage slot + EXPECT_EQ(sload_row->kernel_side_effect_counter, 0); sload_row++; - EXPECT_EQ(sload_row->avm_main_ia, 123); // Read value - EXPECT_EQ(sload_row->avm_main_ib, 10); // Storage slot - EXPECT_EQ(sload_row->avm_kernel_side_effect_counter, 1); + EXPECT_EQ(sload_row->main_ia, 123); // Read value + EXPECT_EQ(sload_row->main_ib, 10); // Storage slot + EXPECT_EQ(sload_row->kernel_side_effect_counter, 1); // Get the row of the first read storage read out uint32_t sload_out_offset = AvmKernelTraceBuilder::START_SLOAD_WRITE_OFFSET; auto sload_kernel_out_row = - std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == sload_out_offset; }); - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_value_out, 42); // value - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot + std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.main_clk == sload_out_offset; }); + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_value_out, 42); // value + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_side_effect_out, 0); + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_metadata_out, 9); // slot sload_kernel_out_row++; - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_value_out, 123); // value - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_metadata_out, 10); // slot + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_value_out, 123); // value + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_side_effect_out, 1); + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_metadata_out, 10); // slot feed_output(sload_out_offset, 42, 0, 9); feed_output(sload_out_offset + 1, 123, 1, 10); @@ -2039,20 +2035,19 @@ TEST_F(AvmExecutionTests, kernelOutputStorageStoreOpcodeSimple) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // CHECK SSTORE - auto sstore_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sstore == 1; }); - EXPECT_EQ(sstore_row->avm_main_ia, 42); // Read value - EXPECT_EQ(sstore_row->avm_main_ib, 9); // Storage slot - EXPECT_EQ(sstore_row->avm_kernel_side_effect_counter, 0); + auto sstore_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sstore == 1; }); + EXPECT_EQ(sstore_row->main_ia, 42); // Read value + EXPECT_EQ(sstore_row->main_ib, 9); // Storage slot + EXPECT_EQ(sstore_row->kernel_side_effect_counter, 0); // Get the row of the first storage write out uint32_t sstore_out_offset = AvmKernelTraceBuilder::START_SSTORE_WRITE_OFFSET; auto sstore_kernel_out_row = - std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == sstore_out_offset; }); + std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.main_clk == sstore_out_offset; }); - auto value_out = sstore_kernel_out_row->avm_kernel_kernel_value_out; - auto side_effect_out = sstore_kernel_out_row->avm_kernel_kernel_side_effect_out; - auto metadata_out = sstore_kernel_out_row->avm_kernel_kernel_metadata_out; + auto value_out = sstore_kernel_out_row->kernel_kernel_value_out; + auto side_effect_out = sstore_kernel_out_row->kernel_kernel_side_effect_out; + auto metadata_out = sstore_kernel_out_row->kernel_kernel_metadata_out; EXPECT_EQ(value_out, 42); // value EXPECT_EQ(side_effect_out, 0); EXPECT_EQ(metadata_out, 9); // slot @@ -2095,28 +2090,27 @@ TEST_F(AvmExecutionTests, kernelOutputStorageStoreOpcodeComplex) auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); // CHECK SSTORE - auto sstore_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sstore == 1; }); - EXPECT_EQ(sstore_row->avm_main_ia, 42); // Read value - EXPECT_EQ(sstore_row->avm_main_ib, 9); // Storage slot - EXPECT_EQ(sstore_row->avm_kernel_side_effect_counter, 0); + auto sstore_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sstore == 1; }); + EXPECT_EQ(sstore_row->main_ia, 42); // Read value + EXPECT_EQ(sstore_row->main_ib, 9); // Storage slot + EXPECT_EQ(sstore_row->kernel_side_effect_counter, 0); sstore_row++; - EXPECT_EQ(sstore_row->avm_main_ia, 123); // Read value - EXPECT_EQ(sstore_row->avm_main_ib, 10); // Storage slot - EXPECT_EQ(sstore_row->avm_kernel_side_effect_counter, 1); + EXPECT_EQ(sstore_row->main_ia, 123); // Read value + EXPECT_EQ(sstore_row->main_ib, 10); // Storage slot + EXPECT_EQ(sstore_row->kernel_side_effect_counter, 1); // Get the row of the first storage write out uint32_t sstore_out_offset = AvmKernelTraceBuilder::START_SSTORE_WRITE_OFFSET; auto sstore_kernel_out_row = - std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == sstore_out_offset; }); - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_value_out, 42); // value - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot + std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.main_clk == sstore_out_offset; }); + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_value_out, 42); // value + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_side_effect_out, 0); + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_metadata_out, 9); // slot sstore_kernel_out_row++; - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_value_out, 123); // value - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_metadata_out, 10); // slot + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_value_out, 123); // value + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_side_effect_out, 1); + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_metadata_out, 10); // slot feed_output(sstore_out_offset, 42, 0, 9); feed_output(sstore_out_offset + 1, 123, 1, 10); @@ -2170,35 +2164,33 @@ TEST_F(AvmExecutionTests, kernelOutputStorageOpcodes) // CHECK SLOAD // Check output data + side effect counters have been set correctly - auto sload_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sload == 1; }); - EXPECT_EQ(sload_row->avm_main_ia, 42); // Read value - EXPECT_EQ(sload_row->avm_main_ib, 9); // Storage slot - EXPECT_EQ(sload_row->avm_kernel_side_effect_counter, 0); + auto sload_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sload == 1; }); + EXPECT_EQ(sload_row->main_ia, 42); // Read value + EXPECT_EQ(sload_row->main_ib, 9); // Storage slot + EXPECT_EQ(sload_row->kernel_side_effect_counter, 0); // Get the row of the first storage read out uint32_t sload_out_offset = AvmKernelTraceBuilder::START_SLOAD_WRITE_OFFSET; auto sload_kernel_out_row = - std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == sload_out_offset; }); - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_value_out, 42); // value - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_side_effect_out, 0); - EXPECT_EQ(sload_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot + std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.main_clk == sload_out_offset; }); + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_value_out, 42); // value + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_side_effect_out, 0); + EXPECT_EQ(sload_kernel_out_row->kernel_kernel_metadata_out, 9); // slot feed_output(sload_out_offset, 42, 0, 9); // CHECK SSTORE - auto sstore_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sstore == 1; }); - EXPECT_EQ(sstore_row->avm_main_ia, 42); // Read value - EXPECT_EQ(sstore_row->avm_main_ib, 9); // Storage slot - EXPECT_EQ(sstore_row->avm_kernel_side_effect_counter, 1); + auto sstore_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sstore == 1; }); + EXPECT_EQ(sstore_row->main_ia, 42); // Read value + EXPECT_EQ(sstore_row->main_ib, 9); // Storage slot + EXPECT_EQ(sstore_row->kernel_side_effect_counter, 1); // Get the row of the first storage write out uint32_t sstore_out_offset = AvmKernelTraceBuilder::START_SSTORE_WRITE_OFFSET; auto sstore_kernel_out_row = - std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.avm_main_clk == sstore_out_offset; }); - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_value_out, 42); // value - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_side_effect_out, 1); - EXPECT_EQ(sstore_kernel_out_row->avm_kernel_kernel_metadata_out, 9); // slot + std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { return r.main_clk == sstore_out_offset; }); + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_value_out, 42); // value + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_side_effect_out, 1); + EXPECT_EQ(sstore_kernel_out_row->kernel_kernel_metadata_out, 9); // slot feed_output(sstore_out_offset, 42, 1, 9); validate_trace(std::move(trace), public_inputs); @@ -2253,47 +2245,47 @@ TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) // CHECK NOTEHASHEXISTS auto note_hash_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_note_hash_exists == 1; }); - EXPECT_EQ(note_hash_row->avm_main_ia, 1); // Read value - EXPECT_EQ(note_hash_row->avm_main_ib, 1); // Storage slot - EXPECT_EQ(note_hash_row->avm_kernel_side_effect_counter, 0); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_note_hash_exists == 1; }); + EXPECT_EQ(note_hash_row->main_ia, 1); // Read value + EXPECT_EQ(note_hash_row->main_ib, 1); // Storage slot + EXPECT_EQ(note_hash_row->kernel_side_effect_counter, 0); auto note_hash_out_row = std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { - return r.avm_main_clk == AvmKernelTraceBuilder::START_NOTE_HASH_EXISTS_WRITE_OFFSET; + return r.main_clk == AvmKernelTraceBuilder::START_NOTE_HASH_EXISTS_WRITE_OFFSET; }); - EXPECT_EQ(note_hash_out_row->avm_kernel_kernel_value_out, 1); // value - EXPECT_EQ(note_hash_out_row->avm_kernel_kernel_side_effect_out, 0); - EXPECT_EQ(note_hash_out_row->avm_kernel_kernel_metadata_out, 1); // exists + EXPECT_EQ(note_hash_out_row->kernel_kernel_value_out, 1); // value + EXPECT_EQ(note_hash_out_row->kernel_kernel_side_effect_out, 0); + EXPECT_EQ(note_hash_out_row->kernel_kernel_metadata_out, 1); // exists feed_output(AvmKernelTraceBuilder::START_NOTE_HASH_EXISTS_WRITE_OFFSET, 1, 0, 1); // CHECK NULLIFIEREXISTS auto nullifier_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_nullifier_exists == 1; }); - EXPECT_EQ(nullifier_row->avm_main_ia, 1); // Read value - EXPECT_EQ(nullifier_row->avm_main_ib, 1); // Storage slot - EXPECT_EQ(nullifier_row->avm_kernel_side_effect_counter, 1); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_nullifier_exists == 1; }); + EXPECT_EQ(nullifier_row->main_ia, 1); // Read value + EXPECT_EQ(nullifier_row->main_ib, 1); // Storage slot + EXPECT_EQ(nullifier_row->kernel_side_effect_counter, 1); auto nullifier_out_row = std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { - return r.avm_main_clk == AvmKernelTraceBuilder::START_NULLIFIER_EXISTS_OFFSET; + return r.main_clk == AvmKernelTraceBuilder::START_NULLIFIER_EXISTS_OFFSET; }); - EXPECT_EQ(nullifier_out_row->avm_kernel_kernel_value_out, 1); // value - EXPECT_EQ(nullifier_out_row->avm_kernel_kernel_side_effect_out, 1); - EXPECT_EQ(nullifier_out_row->avm_kernel_kernel_metadata_out, 1); // exists + EXPECT_EQ(nullifier_out_row->kernel_kernel_value_out, 1); // value + EXPECT_EQ(nullifier_out_row->kernel_kernel_side_effect_out, 1); + EXPECT_EQ(nullifier_out_row->kernel_kernel_metadata_out, 1); // exists feed_output(AvmKernelTraceBuilder::START_NULLIFIER_EXISTS_OFFSET, 1, 1, 1); // CHECK L1TOL2MSGEXISTS - auto l1_to_l2_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_l1_to_l2_msg_exists == 1; }); - EXPECT_EQ(l1_to_l2_row->avm_main_ia, 1); // Read value - EXPECT_EQ(l1_to_l2_row->avm_main_ib, 1); // Storage slot - EXPECT_EQ(l1_to_l2_row->avm_kernel_side_effect_counter, 2); + auto l1_to_l2_row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_l1_to_l2_msg_exists == 1; }); + EXPECT_EQ(l1_to_l2_row->main_ia, 1); // Read value + EXPECT_EQ(l1_to_l2_row->main_ib, 1); // Storage slot + EXPECT_EQ(l1_to_l2_row->kernel_side_effect_counter, 2); auto msg_out_row = std::ranges::find_if(trace.begin(), trace.end(), [&](Row r) { - return r.avm_main_clk == AvmKernelTraceBuilder::START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET; + return r.main_clk == AvmKernelTraceBuilder::START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET; }); - EXPECT_EQ(msg_out_row->avm_kernel_kernel_value_out, 1); // value - EXPECT_EQ(msg_out_row->avm_kernel_kernel_side_effect_out, 2); - EXPECT_EQ(msg_out_row->avm_kernel_kernel_metadata_out, 1); // exists + EXPECT_EQ(msg_out_row->kernel_kernel_value_out, 1); // value + EXPECT_EQ(msg_out_row->kernel_kernel_side_effect_out, 2); + EXPECT_EQ(msg_out_row->kernel_kernel_metadata_out, 1); // exists feed_output(AvmKernelTraceBuilder::START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET, 1, 2, 1); validate_trace(std::move(trace), public_inputs); diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_gas.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_gas.test.cpp index 42d1f37ee00..92de4348951 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_gas.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_gas.test.cpp @@ -67,7 +67,7 @@ TEST_F(AvmGasPositiveTests, gasAdd) auto checks = [=](const std::vector& trace) { auto sender_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_add == FF(1); }); EXPECT_TRUE(sender_row != trace.end()); }; diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp index ac6e29fb9d7..eccca07ae99 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_indirect_mem.test.cpp @@ -50,28 +50,28 @@ TEST_F(AvmIndirectMemTests, allIndirectAdd) auto trace = trace_builder.finalize(); // Find the first row enabling the addition selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_add == FF(1); }); EXPECT_TRUE(row != trace.end()); // Check all addresses and values - EXPECT_EQ(row->avm_main_ia, FF(100)); - EXPECT_EQ(row->avm_main_ib, FF(101)); - EXPECT_EQ(row->avm_main_ic, FF(201)); - EXPECT_EQ(row->avm_main_ind_a, FF(0)); - EXPECT_EQ(row->avm_main_ind_b, FF(1)); - EXPECT_EQ(row->avm_main_ind_c, FF(2)); - EXPECT_EQ(row->avm_main_mem_idx_a, FF(10)); - EXPECT_EQ(row->avm_main_mem_idx_b, FF(11)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(12)); + EXPECT_EQ(row->main_ia, FF(100)); + EXPECT_EQ(row->main_ib, FF(101)); + EXPECT_EQ(row->main_ic, FF(201)); + EXPECT_EQ(row->main_ind_a, FF(0)); + EXPECT_EQ(row->main_ind_b, FF(1)); + EXPECT_EQ(row->main_ind_c, FF(2)); + EXPECT_EQ(row->main_mem_idx_a, FF(10)); + EXPECT_EQ(row->main_mem_idx_b, FF(11)); + EXPECT_EQ(row->main_mem_idx_c, FF(12)); // Check memory operation tags - EXPECT_EQ(row->avm_main_ind_op_a, FF(1)); - EXPECT_EQ(row->avm_main_ind_op_b, FF(1)); - EXPECT_EQ(row->avm_main_ind_op_c, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_ind_op_a, FF(1)); + EXPECT_EQ(row->main_ind_op_b, FF(1)); + EXPECT_EQ(row->main_ind_op_c, FF(1)); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_mem_op_b, FF(1)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); validate_trace(std::move(trace), public_inputs, true); } @@ -96,28 +96,28 @@ TEST_F(AvmIndirectMemTests, indirectOutputSub) auto trace = trace_builder.finalize(); // Find the first row enabling the subtraction selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == FF(1); }); EXPECT_TRUE(row != trace.end()); // Check all addresses and values - EXPECT_EQ(row->avm_main_ia, FF(600)); - EXPECT_EQ(row->avm_main_ib, FF(500)); - EXPECT_EQ(row->avm_main_ic, FF(100)); - EXPECT_EQ(row->avm_main_ind_a, FF(0)); - EXPECT_EQ(row->avm_main_ind_b, FF(0)); - EXPECT_EQ(row->avm_main_ind_c, FF(5)); - EXPECT_EQ(row->avm_main_mem_idx_a, FF(50)); - EXPECT_EQ(row->avm_main_mem_idx_b, FF(51)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(52)); + EXPECT_EQ(row->main_ia, FF(600)); + EXPECT_EQ(row->main_ib, FF(500)); + EXPECT_EQ(row->main_ic, FF(100)); + EXPECT_EQ(row->main_ind_a, FF(0)); + EXPECT_EQ(row->main_ind_b, FF(0)); + EXPECT_EQ(row->main_ind_c, FF(5)); + EXPECT_EQ(row->main_mem_idx_a, FF(50)); + EXPECT_EQ(row->main_mem_idx_b, FF(51)); + EXPECT_EQ(row->main_mem_idx_c, FF(52)); // Check memory operation tags - EXPECT_EQ(row->avm_main_ind_op_a, FF(0)); - EXPECT_EQ(row->avm_main_ind_op_b, FF(0)); - EXPECT_EQ(row->avm_main_ind_op_c, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_ind_op_a, FF(0)); + EXPECT_EQ(row->main_ind_op_b, FF(0)); + EXPECT_EQ(row->main_ind_op_c, FF(1)); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_mem_op_b, FF(1)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); validate_trace(std::move(trace), public_inputs); } @@ -142,28 +142,28 @@ TEST_F(AvmIndirectMemTests, indirectInputAMul) auto trace = trace_builder.finalize(); // Find the first row enabling the multiplication selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == FF(1); }); EXPECT_TRUE(row != trace.end()); // Check all addresses and values - EXPECT_EQ(row->avm_main_ia, FF(4)); - EXPECT_EQ(row->avm_main_ib, FF(7)); - EXPECT_EQ(row->avm_main_ic, FF(28)); - EXPECT_EQ(row->avm_main_ind_a, FF(1000)); - EXPECT_EQ(row->avm_main_ind_b, FF(0)); - EXPECT_EQ(row->avm_main_ind_c, FF(0)); - EXPECT_EQ(row->avm_main_mem_idx_a, FF(100)); - EXPECT_EQ(row->avm_main_mem_idx_b, FF(101)); - EXPECT_EQ(row->avm_main_mem_idx_c, FF(102)); + EXPECT_EQ(row->main_ia, FF(4)); + EXPECT_EQ(row->main_ib, FF(7)); + EXPECT_EQ(row->main_ic, FF(28)); + EXPECT_EQ(row->main_ind_a, FF(1000)); + EXPECT_EQ(row->main_ind_b, FF(0)); + EXPECT_EQ(row->main_ind_c, FF(0)); + EXPECT_EQ(row->main_mem_idx_a, FF(100)); + EXPECT_EQ(row->main_mem_idx_b, FF(101)); + EXPECT_EQ(row->main_mem_idx_c, FF(102)); // Check memory operation tags - EXPECT_EQ(row->avm_main_ind_op_a, FF(1)); - EXPECT_EQ(row->avm_main_ind_op_b, FF(0)); - EXPECT_EQ(row->avm_main_ind_op_c, FF(0)); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); - EXPECT_EQ(row->avm_main_mem_op_c, FF(1)); + EXPECT_EQ(row->main_ind_op_a, FF(1)); + EXPECT_EQ(row->main_ind_op_b, FF(0)); + EXPECT_EQ(row->main_ind_op_c, FF(0)); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_mem_op_b, FF(1)); + EXPECT_EQ(row->main_mem_op_c, FF(1)); validate_trace(std::move(trace), public_inputs); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp index f09d2612094..d0522bbb391 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_inter_table.test.cpp @@ -67,20 +67,19 @@ class AvmPermMainAluNegativeTests : public AvmInterTableTests { trace = trace_builder.finalize(); // Find the row with multiplication operation and retrieve clk. - auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == FF(1); }); ASSERT_TRUE(row != trace.end()); - ASSERT_EQ(row->avm_main_ic, 1007); // Sanity check - auto clk = row->avm_main_clk; + ASSERT_EQ(row->main_ic, 1007); // Sanity check + auto clk = row->main_clk; // Find the corresponding Alu trace row - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); // Find memory trace entry related to storing output (intermediate register Ic) in memory. auto mem_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_clk == clk && r.avm_mem_op_c == FF(1) && r.avm_mem_rw == FF(1); + return r.mem_clk == clk && r.mem_op_c == FF(1) && r.mem_rw == FF(1); }); ASSERT_TRUE(mem_row != trace.end()); @@ -94,8 +93,8 @@ TEST_F(AvmPermMainAluNegativeTests, wrongAluOutputCopyInMain) { // Mutate the multiplication output. Note that the output alu counterpart is still valid // and pass the multiplication relation. - trace.at(main_idx).avm_main_ic = 1008; - trace.at(mem_idx).avm_mem_val = 1008; + trace.at(main_idx).main_ic = 1008; + trace.at(mem_idx).mem_val = 1008; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -103,10 +102,10 @@ TEST_F(AvmPermMainAluNegativeTests, wrongAluOutputCopyInMain) TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIaInput) { // Mutate the input of alu_ia and adapt the output ic accordingly. - trace.at(alu_idx).avm_alu_ia = 20; - trace.at(alu_idx).avm_alu_ic = 1060; // 20 * 53; required to pass the alu mul relation - trace.at(alu_idx).avm_alu_u8_r0 = 36; // 1060 % 256 = 36 - trace.at(alu_idx).avm_alu_u8_r1 = 4; // 4 * 256 = 1024 + trace.at(alu_idx).alu_ia = 20; + trace.at(alu_idx).alu_ic = 1060; // 20 * 53; required to pass the alu mul relation + trace.at(alu_idx).alu_u8_r0 = 36; // 1060 % 256 = 36 + trace.at(alu_idx).alu_u8_r1 = 4; // 4 * 256 = 1024 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -114,30 +113,30 @@ TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIaInput) TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluIbInput) { // Mutate the input of alu_ia and adapt the output ic accordingly. - trace.at(alu_idx).avm_alu_ib = 10; - trace.at(alu_idx).avm_alu_ic = 190; // 19 * 10; required to pass the alu mul relation - trace.at(alu_idx).avm_alu_u8_r0 = 190; - trace.at(alu_idx).avm_alu_u8_r1 = 0; + trace.at(alu_idx).alu_ib = 10; + trace.at(alu_idx).alu_ic = 190; // 19 * 10; required to pass the alu mul relation + trace.at(alu_idx).alu_u8_r0 = 190; + trace.at(alu_idx).alu_u8_r1 = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } TEST_F(AvmPermMainAluNegativeTests, wrongCopyToAluOpSelector) { - trace.at(alu_idx).avm_alu_op_mul = 0; - trace.at(alu_idx).avm_alu_op_add = 1; - trace.at(alu_idx).avm_alu_ic = 72; // 19 + 53 - trace.at(alu_idx).avm_alu_u8_r0 = 72; - trace.at(alu_idx).avm_alu_u8_r1 = 0; + trace.at(alu_idx).alu_op_mul = 0; + trace.at(alu_idx).alu_op_add = 1; + trace.at(alu_idx).alu_ic = 72; // 19 + 53 + trace.at(alu_idx).alu_u8_r0 = 72; + trace.at(alu_idx).alu_u8_r1 = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } TEST_F(AvmPermMainAluNegativeTests, removeAluSelector) { - trace.at(alu_idx).avm_alu_alu_sel = 0; - trace.at(alu_idx).avm_alu_op_mul = 0; - trace.at(alu_idx).avm_alu_rng_chk_lookup_selector = 0; + trace.at(alu_idx).alu_alu_sel = 0; + trace.at(alu_idx).alu_op_mul = 0; + trace.at(alu_idx).alu_rng_chk_lookup_selector = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_ALU"); } @@ -162,22 +161,21 @@ class AvmRangeCheckNegativeTests : public AvmInterTableTests { trace = trace_builder.finalize(min_trace_size); // Find the row with addition operation and retrieve clk. - auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_add == FF(1); }); ASSERT_TRUE(row != trace.end()); - ASSERT_EQ(row->avm_main_ia, FF(uint256_t::from_uint128(a))); - ASSERT_EQ(row->avm_main_ib, FF(uint256_t::from_uint128(b))); - ASSERT_EQ(row->avm_main_ic, FF(uint256_t::from_uint128(c))); - auto clk = row->avm_main_clk; + ASSERT_EQ(row->main_ia, FF(uint256_t::from_uint128(a))); + ASSERT_EQ(row->main_ib, FF(uint256_t::from_uint128(b))); + ASSERT_EQ(row->main_ic, FF(uint256_t::from_uint128(c))); + auto clk = row->main_clk; // Find the corresponding Alu trace row - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); // Find memory trace entry related to storing output (intermediate register Ic) in memory. auto mem_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_clk == clk && r.avm_mem_op_c == FF(1) && r.avm_mem_rw == FF(1); + return r.mem_clk == clk && r.mem_op_c == FF(1) && r.mem_rw == FF(1); }); ASSERT_TRUE(mem_row != trace.end()); @@ -202,15 +200,15 @@ TEST_F(AvmRangeCheckNegativeTests, additionU8Reg0) auto& mem_row = trace.at(mem_idx); auto& alu_row = trace.at(alu_idx); - row.avm_main_ic = fake_c; - mem_row.avm_mem_val = fake_c; - alu_row.avm_alu_ic = fake_c; + row.main_ic = fake_c; + mem_row.mem_val = fake_c; + alu_row.alu_ic = fake_c; - ASSERT_EQ(alu_row.avm_alu_u8_r0, 15); - ASSERT_EQ(alu_row.avm_alu_u8_r1, 0); + ASSERT_EQ(alu_row.alu_u8_r0, 15); + ASSERT_EQ(alu_row.alu_u8_r1, 0); - alu_row.avm_alu_u8_r0 = fake_c; - alu_row.avm_alu_u8_r1 = FF(2).pow(246); + alu_row.alu_u8_r0 = fake_c; + alu_row.alu_u8_r1 = FF(2).pow(246); // We first try to validate without any range check counters adjustment. auto trace_same_cnt = trace; @@ -240,15 +238,15 @@ TEST_F(AvmRangeCheckNegativeTests, additionU8Reg1) uint256_t const r1 = (uint256_t(FF::modulus) - 1) / 256; FF const fake_c = FF(40); - row.avm_main_ic = fake_c; - mem_row.avm_mem_val = fake_c; - alu_row.avm_alu_ic = fake_c; + row.main_ic = fake_c; + mem_row.mem_val = fake_c; + alu_row.alu_ic = fake_c; - ASSERT_EQ(alu_row.avm_alu_u8_r0, 39); - ASSERT_EQ(alu_row.avm_alu_u8_r1, 0); + ASSERT_EQ(alu_row.alu_u8_r0, 39); + ASSERT_EQ(alu_row.alu_u8_r1, 0); - alu_row.avm_alu_u8_r0 = fake_c; - alu_row.avm_alu_u8_r1 = FF(r1); + alu_row.alu_u8_r0 = fake_c; + alu_row.alu_u8_r1 = FF(r1); // We adjust counter to pass range check lookup for u8_r0 trace.at(39).lookup_u8_0_counts -= FF(1); @@ -278,17 +276,17 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg0) uint256_t const u16_r0 = (uint256_t(FF::modulus) - 1) / 65536; FF const fake_c = FF(3201); - row.avm_main_ic = fake_c; - mem_row.avm_mem_val = fake_c; - alu_row.avm_alu_ic = fake_c; + row.main_ic = fake_c; + mem_row.mem_val = fake_c; + alu_row.alu_ic = fake_c; - ASSERT_EQ(alu_row.avm_alu_u8_r0, FF(128)); // 3200 % 256 = 128 - ASSERT_EQ(alu_row.avm_alu_u8_r1, FF(12)); // 3200/256 = 12 - ASSERT_EQ(alu_row.avm_alu_u16_r0, 0); + ASSERT_EQ(alu_row.alu_u8_r0, FF(128)); // 3200 % 256 = 128 + ASSERT_EQ(alu_row.alu_u8_r1, FF(12)); // 3200/256 = 12 + ASSERT_EQ(alu_row.alu_u16_r0, 0); - alu_row.avm_alu_u8_r0 = FF(129); // 3201 % 256 = 129 - // alu_row.avm_alu_u8_r1 = FF(r1); // Does not change 3201/256 = 12 - alu_row.avm_alu_u16_r0 = FF(u16_r0); + alu_row.alu_u8_r0 = FF(129); // 3201 % 256 = 129 + // alu_row.alu_u8_r1 = FF(r1); // Does not change 3201/256 = 12 + alu_row.alu_u16_r0 = FF(u16_r0); // We adjust counter to pass range check lookup for u8_r0 trace.at(128).lookup_u8_0_counts -= FF(1); @@ -314,7 +312,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg7) auto trace_original = trace; auto& alu_row = trace.at(alu_idx); - alu_row.avm_alu_u16_r7 = FF(235655); + alu_row.alu_u16_r7 = FF(235655); auto trace_same_cnt = trace; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace_same_cnt)), "LOOKUP_U16_7"); @@ -330,7 +328,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg7) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg8) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_idx).avm_alu_u16_r8 = FF(235655); + trace.at(alu_idx).alu_u16_r8 = FF(235655); trace.at(1).lookup_u16_8_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_8"); } @@ -339,7 +337,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg8) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg9) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_idx).avm_alu_u16_r9 = FF(235655); + trace.at(alu_idx).alu_u16_r9 = FF(235655); trace.at(1).lookup_u16_9_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_9"); } @@ -348,7 +346,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg9) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg10) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_idx).avm_alu_u16_r10 = FF(235655); + trace.at(alu_idx).alu_u16_r10 = FF(235655); trace.at(1).lookup_u16_10_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_10"); } @@ -357,7 +355,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg10) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg11) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_idx).avm_alu_u16_r11 = FF(235655); + trace.at(alu_idx).alu_u16_r11 = FF(235655); trace.at(1).lookup_u16_11_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_11"); } @@ -366,7 +364,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg11) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg12) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_idx).avm_alu_u16_r12 = FF(235655); + trace.at(alu_idx).alu_u16_r12 = FF(235655); trace.at(1).lookup_u16_12_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_12"); } @@ -375,7 +373,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg12) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg13) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_idx).avm_alu_u16_r13 = FF(235655); + trace.at(alu_idx).alu_u16_r13 = FF(235655); trace.at(1).lookup_u16_13_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_13"); } @@ -384,7 +382,7 @@ TEST_F(AvmRangeCheckNegativeTests, additionU16Reg13) TEST_F(AvmRangeCheckNegativeTests, additionU16Reg14) { genTraceAdd(4500, 45, 4545, AvmMemoryTag::U16); - trace.at(alu_idx).avm_alu_u16_r14 = FF(235655); + trace.at(alu_idx).alu_u16_r14 = FF(235655); trace.at(1).lookup_u16_14_counts -= FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "LOOKUP_U16_14"); } @@ -413,31 +411,30 @@ class AvmPermMainMemNegativeTests : public AvmInterTableTests { trace = trace_builder.finalize(); // Find the row with subtraction operation and retrieve clk. - auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == FF(1); }); ASSERT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; // Find the corresponding Alu trace row - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); ASSERT_TRUE(alu_row != trace.end()); // Find memory trace entry related to storing output (intermediate register Ic) in memory. auto mem_row_c = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_clk == clk && r.avm_mem_op_c == FF(1) && r.avm_mem_rw == FF(1); + return r.mem_clk == clk && r.mem_op_c == FF(1) && r.mem_rw == FF(1); }); ASSERT_TRUE(mem_row_c != trace.end()); // Find memory trace entry related to loading first input (intermediate register Ia) in memory. auto mem_row_a = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_clk == clk && r.avm_mem_op_a == FF(1) && r.avm_mem_rw == FF(0); + return r.mem_clk == clk && r.mem_op_a == FF(1) && r.mem_rw == FF(0); }); ASSERT_TRUE(mem_row_a != trace.end()); // Find memory trace entry related to loading second input (intermediate register Ib) in memory. auto mem_row_b = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_clk == clk && r.avm_mem_op_b == FF(1) && r.avm_mem_rw == FF(0); + return r.mem_clk == clk && r.mem_op_b == FF(1) && r.mem_rw == FF(0); }); ASSERT_TRUE(mem_row_b != trace.end()); @@ -459,40 +456,40 @@ TEST_F(AvmPermMainMemNegativeTests, tagErrNotCopiedInMain) auto trace = trace_builder.finalize(); // Find the row with equality operation and mutate the error tag. - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == 1; }); - ASSERT_EQ(row->avm_main_tag_err, FF(1)); // Sanity check that the error tag is set. - row->avm_main_tag_err = 0; - row->avm_main_alu_sel = 1; // We have to activate ALU trace if no error tag is present. - auto const clk = row->avm_main_clk; + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == 1; }); + ASSERT_EQ(row->main_tag_err, FF(1)); // Sanity check that the error tag is set. + row->main_tag_err = 0; + row->main_alu_sel = 1; // We have to activate ALU trace if no error tag is present. + auto const clk = row->main_clk; // Create a valid ALU entry for this equality operation. auto& alu_row = trace.at(1); - alu_row.avm_alu_clk = clk; - alu_row.avm_alu_alu_sel = 1; - alu_row.avm_alu_ia = 32; - alu_row.avm_alu_ib = 32; - alu_row.avm_alu_ic = 1; - alu_row.avm_alu_op_eq = 1; - alu_row.avm_alu_in_tag = static_cast(AvmMemoryTag::U128); - alu_row.avm_alu_u128_tag = 1; + alu_row.alu_clk = clk; + alu_row.alu_alu_sel = 1; + alu_row.alu_ia = 32; + alu_row.alu_ib = 32; + alu_row.alu_ic = 1; + alu_row.alu_op_eq = 1; + alu_row.alu_in_tag = static_cast(AvmMemoryTag::U128); + alu_row.alu_u128_tag = 1; // Adjust the output of the computation as it would have been performed without tag check. - row->avm_main_ic = 1; + row->main_ic = 1; // Find the memory row pertaining to write operation from Ic. auto mem_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_STORE_C; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_STORE_C; }); // Adjust the output in the memory trace. - mem_row->avm_mem_val = 1; + mem_row->mem_val = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "INCL_MAIN_TAG_ERR"); } TEST_F(AvmPermMainMemNegativeTests, wrongValueIaInMem) { executeSub(21, 3); - trace.at(mem_idx_a).avm_mem_val = 26; // Correct value: 21 - trace.at(mem_idx_a - 1).avm_mem_val = 26; // We need to adjust the write operation beforehand (set opcode). + trace.at(mem_idx_a).mem_val = 26; // Correct value: 21 + trace.at(mem_idx_a - 1).mem_val = 26; // We need to adjust the write operation beforehand (set opcode). EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -500,8 +497,8 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongValueIbInMem) { executeSub(21, 3); - trace.at(mem_idx_b).avm_mem_val = 7; // Correct value: 3 - trace.at(mem_idx_b - 1).avm_mem_val = 7; // We need to adjust the write operation beforehand (set opcode). + trace.at(mem_idx_b).mem_val = 7; // Correct value: 3 + trace.at(mem_idx_b - 1).mem_val = 7; // We need to adjust the write operation beforehand (set opcode). EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -509,7 +506,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIbInMem) TEST_F(AvmPermMainMemNegativeTests, wrongValueIcInMem) { executeSub(21, 3); - trace.at(mem_idx_c).avm_mem_val = 17; // Correct value: 18 = 21 - 3 + trace.at(mem_idx_c).mem_val = 17; // Correct value: 18 = 21 - 3 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -517,7 +514,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongValueIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongAddressIaInMain) { executeSub(21, 3); - trace.at(main_idx).avm_main_mem_idx_a = 28; // Correct address: 52 + trace.at(main_idx).main_mem_idx_a = 28; // Correct address: 52 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -525,7 +522,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongAddressIaInMain) TEST_F(AvmPermMainMemNegativeTests, wrongAddressIbInMain) { executeSub(21, 3); - trace.at(main_idx).avm_main_mem_idx_b = 2; // Correct address: 11 + trace.at(main_idx).main_mem_idx_b = 2; // Correct address: 11 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -533,7 +530,7 @@ TEST_F(AvmPermMainMemNegativeTests, wrongAddressIbInMain) TEST_F(AvmPermMainMemNegativeTests, wrongAddressIcInMain) { executeSub(21, 3); - trace.at(main_idx).avm_main_mem_idx_c = 75; // Correct address: 55 + trace.at(main_idx).main_mem_idx_c = 75; // Correct address: 55 EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -542,13 +539,13 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIaInMem) { executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U32); - trace.at(mem_idx_a).avm_mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_idx_a).avm_mem_tag = wrong_in_tag; + trace.at(mem_idx_a).mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 + trace.at(mem_idx_a).mem_tag = wrong_in_tag; // We need to adjust the write operation beforehand (set opcode). - trace.at(mem_idx_a - 1).avm_mem_r_in_tag = wrong_in_tag; - trace.at(mem_idx_a - 1).avm_mem_w_in_tag = wrong_in_tag; - trace.at(mem_idx_a - 1).avm_mem_tag = wrong_in_tag; + trace.at(mem_idx_a - 1).mem_r_in_tag = wrong_in_tag; + trace.at(mem_idx_a - 1).mem_w_in_tag = wrong_in_tag; + trace.at(mem_idx_a - 1).mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -557,13 +554,13 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIbInMem) { executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U16); - trace.at(mem_idx_b).avm_mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_idx_b).avm_mem_tag = wrong_in_tag; + trace.at(mem_idx_b).mem_r_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 + trace.at(mem_idx_b).mem_tag = wrong_in_tag; // We need to adjust the write operation beforehand (set opcode). - trace.at(mem_idx_b - 1).avm_mem_r_in_tag = wrong_in_tag; - trace.at(mem_idx_b - 1).avm_mem_w_in_tag = wrong_in_tag; - trace.at(mem_idx_b - 1).avm_mem_tag = wrong_in_tag; + trace.at(mem_idx_b - 1).mem_r_in_tag = wrong_in_tag; + trace.at(mem_idx_b - 1).mem_w_in_tag = wrong_in_tag; + trace.at(mem_idx_b - 1).mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -572,8 +569,8 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIcInMem) { executeSub(21, 3); auto wrong_in_tag = static_cast(AvmMemoryTag::U128); - trace.at(mem_idx_c).avm_mem_w_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 - trace.at(mem_idx_c).avm_mem_tag = wrong_in_tag; + trace.at(mem_idx_c).mem_w_in_tag = wrong_in_tag; // Correct value: AvmMemoryTag::U8 + trace.at(mem_idx_c).mem_tag = wrong_in_tag; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -581,15 +578,15 @@ TEST_F(AvmPermMainMemNegativeTests, wrongInTagIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongRwIaInMem) { executeSub(21, 3); - trace.at(mem_idx_a).avm_mem_rw = 1; // Write instead of read. + trace.at(mem_idx_a).mem_rw = 1; // Write instead of read. // Adjust timestamp value - trace.at(mem_idx_a).avm_mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_A - AvmMemTraceBuilder::SUB_CLK_LOAD_A); + trace.at(mem_idx_a).mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_A - AvmMemTraceBuilder::SUB_CLK_LOAD_A); // Adjust diff value of previous row as well - FF diff = trace.at(mem_idx_a - 1).avm_mem_diff_lo + trace.at(mem_idx_a - 1).avm_mem_diff_mid * FF(1 << 16) + + FF diff = trace.at(mem_idx_a - 1).mem_diff_lo + trace.at(mem_idx_a - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::SUB_CLK_STORE_A - AvmMemTraceBuilder::SUB_CLK_LOAD_A); - trace.at(mem_idx_a - 1).avm_mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_idx_a - 1).avm_mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_idx_a - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_idx_a - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -597,15 +594,15 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongRwIbInMem) { executeSub(21, 3); - trace.at(mem_idx_b).avm_mem_rw = 1; // Write instead of read. + trace.at(mem_idx_b).mem_rw = 1; // Write instead of read. // Adjust timestamp value - trace.at(mem_idx_b).avm_mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_B - AvmMemTraceBuilder::SUB_CLK_LOAD_B); + trace.at(mem_idx_b).mem_tsp += FF(AvmMemTraceBuilder::SUB_CLK_STORE_B - AvmMemTraceBuilder::SUB_CLK_LOAD_B); // Adjust diff value of previous row as well - FF diff = trace.at(mem_idx_b - 1).avm_mem_diff_lo + trace.at(mem_idx_b - 1).avm_mem_diff_mid * FF(1 << 16) + + FF diff = trace.at(mem_idx_b - 1).mem_diff_lo + trace.at(mem_idx_b - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::SUB_CLK_STORE_B - AvmMemTraceBuilder::SUB_CLK_LOAD_B); - trace.at(mem_idx_b - 1).avm_mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_idx_b - 1).avm_mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_idx_b - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_idx_b - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -616,10 +613,10 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIcInMem) // a write for a read of Ic below leads to a violation that the memory // is initialized with zero values. executeSub(11, 11); - trace.at(mem_idx_c).avm_mem_rw = 0; // Read instead of write. + trace.at(mem_idx_c).mem_rw = 0; // Read instead of write. // Adjust timestamp value. - trace.at(mem_idx_c).avm_mem_tsp -= FF(AvmMemTraceBuilder::SUB_CLK_STORE_C - AvmMemTraceBuilder::SUB_CLK_LOAD_C); + trace.at(mem_idx_c).mem_tsp -= FF(AvmMemTraceBuilder::SUB_CLK_STORE_C - AvmMemTraceBuilder::SUB_CLK_LOAD_C); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -627,13 +624,13 @@ TEST_F(AvmPermMainMemNegativeTests, wrongRwIcInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIaInMem) { executeSub(87, 23); - trace.at(mem_idx_a).avm_mem_clk += 3; - trace.at(mem_idx_a).avm_mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 3; + trace.at(mem_idx_a).mem_clk += 3; + trace.at(mem_idx_a).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 3; // Adjust diff value of previous row as well - FF diff = trace.at(mem_idx_a - 1).avm_mem_diff_lo + trace.at(mem_idx_a - 1).avm_mem_diff_mid * FF(1 << 16) + + FF diff = trace.at(mem_idx_a - 1).mem_diff_lo + trace.at(mem_idx_a - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::NUM_SUB_CLK * 3); - trace.at(mem_idx_a - 1).avm_mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_idx_a - 1).avm_mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_idx_a - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_idx_a - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -641,12 +638,12 @@ TEST_F(AvmPermMainMemNegativeTests, wrongClkIaInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIbInMem) { executeSub(87, 23); - trace.at(mem_idx_b).avm_mem_clk += 5; - trace.at(mem_idx_b).avm_mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 5; - FF diff = trace.at(mem_idx_b - 1).avm_mem_diff_lo + trace.at(mem_idx_b - 1).avm_mem_diff_mid * FF(1 << 16) + + trace.at(mem_idx_b).mem_clk += 5; + trace.at(mem_idx_b).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 5; + FF diff = trace.at(mem_idx_b - 1).mem_diff_lo + trace.at(mem_idx_b - 1).mem_diff_mid * FF(1 << 16) + FF(AvmMemTraceBuilder::NUM_SUB_CLK * 5); - trace.at(mem_idx_b - 1).avm_mem_diff_mid = FF(uint32_t(diff) >> 16); - trace.at(mem_idx_b - 1).avm_mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); + trace.at(mem_idx_b - 1).mem_diff_mid = FF(uint32_t(diff) >> 16); + trace.at(mem_idx_b - 1).mem_diff_lo = FF(uint32_t(diff) & UINT16_MAX); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } @@ -654,8 +651,8 @@ TEST_F(AvmPermMainMemNegativeTests, wrongClkIbInMem) TEST_F(AvmPermMainMemNegativeTests, wrongClkIcInMem) { executeSub(87, 23); - trace.at(mem_idx_c).avm_mem_clk += 7; - trace.at(mem_idx_c).avm_mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 7; + trace.at(mem_idx_c).mem_clk += 7; + trace.at(mem_idx_c).mem_tsp += AvmMemTraceBuilder::NUM_SUB_CLK * 7; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_kernel.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_kernel.test.cpp index dba9a4eda4f..c898d9d07ba 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_kernel.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_kernel.test.cpp @@ -82,17 +82,17 @@ void test_kernel_lookup(bool indirect, void expect_row(auto row, FF selector, FF ia, FF ind_a, FF mem_idx_a, AvmMemoryTag w_in_tag) { // Checks dependent on the opcode - EXPECT_EQ(row->avm_kernel_kernel_in_offset, selector); - EXPECT_EQ(row->avm_main_ia, ia); - EXPECT_EQ(row->avm_main_mem_idx_a, mem_idx_a); + EXPECT_EQ(row->kernel_kernel_in_offset, selector); + EXPECT_EQ(row->main_ia, ia); + EXPECT_EQ(row->main_mem_idx_a, mem_idx_a); // Checks that are fixed for kernel inputs - EXPECT_EQ(row->avm_main_rwa, FF(1)); - EXPECT_EQ(row->avm_main_ind_a, ind_a); - EXPECT_EQ(row->avm_main_ind_op_a, FF(ind_a != 0)); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_w_in_tag, static_cast(w_in_tag)); - EXPECT_EQ(row->avm_main_q_kernel_lookup, FF(1)); + EXPECT_EQ(row->main_rwa, FF(1)); + EXPECT_EQ(row->main_ind_a, ind_a); + EXPECT_EQ(row->main_ind_op_a, FF(ind_a != 0)); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_w_in_tag, static_cast(w_in_tag)); + EXPECT_EQ(row->main_q_kernel_lookup, FF(1)); } void expect_output_table_row(auto row, @@ -105,19 +105,19 @@ void expect_output_table_row(auto row, uint32_t rwa = 0) { // Checks dependent on the opcode - EXPECT_EQ(row->avm_kernel_kernel_out_offset, selector); - EXPECT_EQ(row->avm_main_ia, ia); - EXPECT_EQ(row->avm_main_mem_idx_a, mem_idx_a); + EXPECT_EQ(row->kernel_kernel_out_offset, selector); + EXPECT_EQ(row->main_ia, ia); + EXPECT_EQ(row->main_mem_idx_a, mem_idx_a); // Checks that are fixed for kernel inputs - EXPECT_EQ(row->avm_main_rwa, FF(rwa)); - EXPECT_EQ(row->avm_main_ind_a, ind_a); - EXPECT_EQ(row->avm_main_ind_op_a, FF(ind_a != 0)); - EXPECT_EQ(row->avm_main_mem_op_a, FF(1)); - EXPECT_EQ(row->avm_main_r_in_tag, static_cast(r_in_tag)); - EXPECT_EQ(row->avm_main_q_kernel_output_lookup, FF(1)); - - EXPECT_EQ(row->avm_kernel_side_effect_counter, FF(side_effect_counter)); + EXPECT_EQ(row->main_rwa, FF(rwa)); + EXPECT_EQ(row->main_ind_a, ind_a); + EXPECT_EQ(row->main_ind_op_a, FF(ind_a != 0)); + EXPECT_EQ(row->main_mem_op_a, FF(1)); + EXPECT_EQ(row->main_r_in_tag, static_cast(r_in_tag)); + EXPECT_EQ(row->main_q_kernel_output_lookup, FF(1)); + + EXPECT_EQ(row->kernel_side_effect_counter, FF(side_effect_counter)); } void expect_output_table_row_with_metadata(auto row, @@ -135,16 +135,16 @@ void expect_output_table_row_with_metadata(auto row, { expect_output_table_row(row, selector, ia, mem_idx_a, ind_a, r_in_tag, side_effect_counter, rwa); - EXPECT_EQ(row->avm_main_ib, ib); - EXPECT_EQ(row->avm_main_mem_idx_b, mem_idx_b); + EXPECT_EQ(row->main_ib, ib); + EXPECT_EQ(row->main_mem_idx_b, mem_idx_b); // Checks that are fixed for kernel inputs - EXPECT_EQ(row->avm_main_rwb, FF(0)); + EXPECT_EQ(row->main_rwb, FF(0)); if (!no_b) { - EXPECT_EQ(row->avm_main_ind_b, ind_b); - EXPECT_EQ(row->avm_main_ind_op_b, FF(ind_b != 0)); - EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); + EXPECT_EQ(row->main_ind_b, ind_b); + EXPECT_EQ(row->main_ind_op_b, FF(ind_b != 0)); + EXPECT_EQ(row->main_mem_op_b, FF(1)); } } @@ -161,21 +161,21 @@ void expect_output_table_row_with_exists_metadata(auto row, { expect_output_table_row(row, selector, ia, mem_idx_a, ind_a, w_in_tag, side_effect_counter); - EXPECT_EQ(row->avm_main_ib, ib); - EXPECT_EQ(row->avm_main_mem_idx_b, mem_idx_b); + EXPECT_EQ(row->main_ib, ib); + EXPECT_EQ(row->main_mem_idx_b, mem_idx_b); // Checks that are fixed for kernel inputs - EXPECT_EQ(row->avm_main_rwb, FF(1)); - EXPECT_EQ(row->avm_main_ind_b, ind_b); - EXPECT_EQ(row->avm_main_ind_op_b, FF(ind_b != 0)); - EXPECT_EQ(row->avm_main_mem_op_b, FF(1)); + EXPECT_EQ(row->main_rwb, FF(1)); + EXPECT_EQ(row->main_ind_b, ind_b); + EXPECT_EQ(row->main_ind_op_b, FF(ind_b != 0)); + EXPECT_EQ(row->main_mem_op_b, FF(1)); } void check_kernel_outputs(const Row& row, FF value, FF side_effect_counter, FF metadata) { - EXPECT_EQ(row.avm_kernel_kernel_value_out, value); - EXPECT_EQ(row.avm_kernel_kernel_side_effect_out, side_effect_counter); - EXPECT_EQ(row.avm_kernel_kernel_metadata_out, metadata); + EXPECT_EQ(row.kernel_kernel_value_out, value); + EXPECT_EQ(row.kernel_kernel_side_effect_out, side_effect_counter); + EXPECT_EQ(row.kernel_kernel_metadata_out, metadata); } TEST_F(AvmKernelPositiveTests, kernelSender) @@ -198,7 +198,7 @@ TEST_F(AvmKernelPositiveTests, kernelSender) auto checks = [=](bool indirect, const std::vector& trace) { auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sender == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sender == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row(row, @@ -232,7 +232,7 @@ TEST_F(AvmKernelPositiveTests, kernelAddress) auto checks = [=](bool indirect, const std::vector& trace) { auto address_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_address == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_address == FF(1); }); EXPECT_TRUE(address_row != trace.end()); expect_row(address_row, @@ -265,7 +265,7 @@ TEST_F(AvmKernelPositiveTests, kernelStorageAddress) auto checks = [=](bool indirect, const std::vector& trace) { auto storage_address_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_storage_address == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_storage_address == FF(1); }); EXPECT_TRUE(storage_address_row != trace.end()); expect_row(storage_address_row, @@ -299,7 +299,7 @@ TEST_F(AvmKernelPositiveTests, kernelFeePerDa) auto checks = [=](bool indirect, const std::vector& trace) { auto fee_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fee_per_da_gas == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fee_per_da_gas == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -333,7 +333,7 @@ TEST_F(AvmKernelPositiveTests, kernelFeePerL2) auto checks = [=](bool indirect, const std::vector& trace) { auto fee_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fee_per_l2_gas == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fee_per_l2_gas == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -367,7 +367,7 @@ TEST_F(AvmKernelPositiveTests, kernelTransactionFee) auto checks = [=](bool indirect, const std::vector& trace) { auto fee_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_transaction_fee == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_transaction_fee == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -401,7 +401,7 @@ TEST_F(AvmKernelPositiveTests, kernelChainId) auto checks = [=](bool indirect, const std::vector& trace) { auto fee_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_chain_id == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_chain_id == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -435,7 +435,7 @@ TEST_F(AvmKernelPositiveTests, kernelVersion) auto checks = [=](bool indirect, const std::vector& trace) { auto fee_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_version == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_version == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -468,8 +468,8 @@ TEST_F(AvmKernelPositiveTests, kernelBlockNumber) }; auto checks = [=](bool indirect, const std::vector& trace) { - auto fee_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_block_number == FF(1); }); + auto fee_row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_block_number == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -503,7 +503,7 @@ TEST_F(AvmKernelPositiveTests, kernelCoinbase) auto checks = [=](bool indirect, const std::vector& trace) { auto fee_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_coinbase == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_coinbase == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -536,8 +536,8 @@ TEST_F(AvmKernelPositiveTests, kernelTimestamp) }; auto checks = [=](bool indirect, const std::vector& trace) { - auto fee_row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_timestamp == FF(1); }); + auto fee_row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_timestamp == FF(1); }); EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, @@ -578,7 +578,7 @@ void negative_test_incorrect_ia_kernel_lookup(OpcodesFunc apply_opcodes, // Change the first row, as that will be where each of the opcodes are in the test auto& ta = trace.at(1); - ta.avm_main_ia = incorrect_ia; + ta.main_ia = incorrect_ia; check_trace(/*indirect*/ false, trace); @@ -596,7 +596,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaSender) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sender == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sender == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -622,7 +622,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaAddress) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_address == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_address == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -648,7 +648,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaStorageAddress) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_storage_address == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_storage_address == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -674,7 +674,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaDaGas) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fee_per_da_gas == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fee_per_da_gas == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -700,7 +700,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIal2Gas) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fee_per_l2_gas == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fee_per_l2_gas == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -726,7 +726,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaTransactionFee) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_transaction_fee == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_transaction_fee == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -752,7 +752,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaChainId) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_chain_id == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_chain_id == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -778,7 +778,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaVersion) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_version == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_version == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -803,8 +803,8 @@ TEST_F(AvmKernelNegativeTests, incorrectIaBlockNumber) trace_builder.op_block_number(/*indirect*/ false, dst_offset); }; auto checks = [=](bool indirect, const std::vector& trace) { - auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_block_number == FF(1); }); + auto row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_block_number == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -829,8 +829,8 @@ TEST_F(AvmKernelNegativeTests, incorrectIaTimestamp) trace_builder.op_timestamp(/*indirect*/ false, dst_offset); }; auto checks = [=](bool indirect, const std::vector& trace) { - auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_timestamp == FF(1); }); + auto row = + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_timestamp == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -856,7 +856,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaCoinbase) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_coinbase == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_coinbase == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_row( @@ -896,7 +896,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelEmitNoteHash) auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_note_hash == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_note_hash == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row( @@ -938,7 +938,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelEmitNullifier) auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_nullifier == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_nullifier == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row( @@ -988,7 +988,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelEmitL2ToL1Msg) auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_l2_to_l1_msg == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_l2_to_l1_msg == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row_with_metadata( @@ -1033,7 +1033,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelEmitUnencryptedLog) auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_emit_unencrypted_log == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_emit_unencrypted_log == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row( @@ -1071,8 +1071,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelSload) trace_builder.op_sload(indirect, slot_offset, size, dest_offset); }; auto checks = [=]([[maybe_unused]] bool indirect, const std::vector& trace) { - auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sload == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sload == FF(1); }); ASSERT_TRUE(row != trace.end()); // TODO: temporarily hardcoded to direct, resolved by dbanks12 / ilyas pr - use your changes @@ -1114,7 +1113,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelSstore) }; auto checks = [=]([[maybe_unused]] bool indirect, const std::vector& trace) { auto row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sstore == FF(1); }); + std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sstore == FF(1); }); EXPECT_TRUE(row != trace.end()); // TODO: temporarily hardcoded to direct, resolved by dbanks12 / ilyas pr - use your changes @@ -1164,7 +1163,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelNoteHashExists) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_note_hash_exists == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_note_hash_exists == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row_with_exists_metadata( @@ -1204,7 +1203,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelNullifierExists) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_nullifier_exists == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_nullifier_exists == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row_with_exists_metadata( @@ -1243,7 +1242,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelNullifierNonExists) }; auto checks = [=](bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_nullifier_exists == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_nullifier_exists == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row_with_exists_metadata( @@ -1283,7 +1282,7 @@ TEST_F(AvmKernelOutputPositiveTests, kernelL1ToL2MsgExists) }; auto checks = [=]([[maybe_unused]] bool indirect, const std::vector& trace) { auto row = std::ranges::find_if( - trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_l1_to_l2_msg_exists == FF(1); }); + trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_l1_to_l2_msg_exists == FF(1); }); EXPECT_TRUE(row != trace.end()); expect_output_table_row_with_exists_metadata( diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp index e1dea4420ed..3ebcb8cfa44 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_mem_opcodes.test.cpp @@ -76,7 +76,7 @@ class AvmMemOpcodeTests : public ::testing::Test { static std::function gen_matcher(FF clk, uint32_t sub_clk) { - return [clk, sub_clk](Row r) { return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + sub_clk; }; + return [clk, sub_clk](Row r) { return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + sub_clk; }; }; void compute_index_a(FF clk, bool indirect) @@ -116,11 +116,11 @@ class AvmMemOpcodeTests : public ::testing::Test { void compute_mov_indices(bool indirect) { // Find the first row enabling the MOV selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_mov == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_mov == FF(1); }); ASSERT_TRUE(row != trace.end()); main_idx = static_cast(row - trace.begin()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; compute_index_a(clk, indirect); compute_index_c(clk, indirect); @@ -129,11 +129,11 @@ class AvmMemOpcodeTests : public ::testing::Test { void compute_cmov_indices(uint8_t indirect) { // Find the first row enabling the CMOV selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_cmov == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_cmov == FF(1); }); ASSERT_TRUE(row != trace.end()); main_idx = static_cast(row - trace.begin()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; compute_index_a(clk, is_operand_indirect(indirect, 0)); compute_index_c(clk, is_operand_indirect(indirect, 2)); @@ -177,59 +177,59 @@ class AvmMemOpcodeTests : public ::testing::Test { auto const& main_row = trace.at(main_idx); if (indirect) { - EXPECT_THAT(main_row, - AllOf(Field(&Row::avm_main_mem_idx_a, dir_src_offset), - Field(&Row::avm_main_mem_idx_c, dir_dst_offset))); + EXPECT_THAT( + main_row, + AllOf(Field(&Row::main_mem_idx_a, dir_src_offset), Field(&Row::main_mem_idx_c, dir_dst_offset))); } EXPECT_THAT(main_row, - AllOf(Field(&Row::avm_main_sel_mov, 1), - Field(&Row::avm_main_sel_mov_a, 1), - Field(&Row::avm_main_ia, val_ff), - Field(&Row::avm_main_ib, 0), - Field(&Row::avm_main_ic, val_ff), - Field(&Row::avm_main_r_in_tag, static_cast(tag)), - Field(&Row::avm_main_w_in_tag, static_cast(tag)))); + AllOf(Field(&Row::main_sel_mov, 1), + Field(&Row::main_sel_mov_a, 1), + Field(&Row::main_ia, val_ff), + Field(&Row::main_ib, 0), + Field(&Row::main_ic, val_ff), + Field(&Row::main_r_in_tag, static_cast(tag)), + Field(&Row::main_w_in_tag, static_cast(tag)))); auto const& mem_a_row = trace.at(mem_a_idx); EXPECT_THAT(mem_a_row, - AllOf(Field(&Row::avm_mem_tag_err, 0), - Field(&Row::avm_mem_r_in_tag, static_cast(tag)), - Field(&Row::avm_mem_tag, static_cast(tag)), - Field(&Row::avm_mem_sel_mov_a, 1), - Field(&Row::avm_mem_addr, indirect ? dir_src_offset : src_offset), - Field(&Row::avm_mem_val, val_ff), - Field(&Row::avm_mem_rw, 0), - Field(&Row::avm_mem_op_a, 1))); + AllOf(Field(&Row::mem_tag_err, 0), + Field(&Row::mem_r_in_tag, static_cast(tag)), + Field(&Row::mem_tag, static_cast(tag)), + Field(&Row::mem_sel_mov_a, 1), + Field(&Row::mem_addr, indirect ? dir_src_offset : src_offset), + Field(&Row::mem_val, val_ff), + Field(&Row::mem_rw, 0), + Field(&Row::mem_op_a, 1))); auto const& mem_c_row = trace.at(mem_c_idx); EXPECT_THAT(mem_c_row, - AllOf(Field(&Row::avm_mem_tag_err, 0), - Field(&Row::avm_mem_w_in_tag, static_cast(tag)), - Field(&Row::avm_mem_tag, static_cast(tag)), - Field(&Row::avm_mem_addr, indirect ? dir_dst_offset : dst_offset), - Field(&Row::avm_mem_val, val_ff), - Field(&Row::avm_mem_op_c, 1))); + AllOf(Field(&Row::mem_tag_err, 0), + Field(&Row::mem_w_in_tag, static_cast(tag)), + Field(&Row::mem_tag, static_cast(tag)), + Field(&Row::mem_addr, indirect ? dir_dst_offset : dst_offset), + Field(&Row::mem_val, val_ff), + Field(&Row::mem_op_c, 1))); if (indirect) { auto const& mem_ind_a_row = trace.at(mem_ind_a_idx); EXPECT_THAT(mem_ind_a_row, - AllOf(Field(&Row::avm_mem_tag_err, 0), - Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_addr, src_offset), - Field(&Row::avm_mem_val, dir_src_offset), - Field(&Row::avm_mem_ind_op_a, 1))); + AllOf(Field(&Row::mem_tag_err, 0), + Field(&Row::mem_r_in_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::mem_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::mem_addr, src_offset), + Field(&Row::mem_val, dir_src_offset), + Field(&Row::mem_ind_op_a, 1))); auto const& mem_ind_c_row = trace.at(mem_ind_c_idx); EXPECT_THAT(mem_ind_c_row, - AllOf(Field(&Row::avm_mem_tag_err, 0), - Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_addr, dst_offset), - Field(&Row::avm_mem_val, dir_dst_offset), - Field(&Row::avm_mem_ind_op_c, 1))); + AllOf(Field(&Row::mem_tag_err, 0), + Field(&Row::mem_r_in_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::mem_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::mem_addr, dst_offset), + Field(&Row::mem_val, dir_dst_offset), + Field(&Row::mem_ind_op_c, 1))); } validate_trace(std::move(trace), public_inputs); @@ -253,81 +253,81 @@ class AvmMemOpcodeTests : public ::testing::Test { FF const inv = mov_a ? d.invert() : 1; EXPECT_THAT(trace.at(main_idx), - AllOf(Field("ia", &Row::avm_main_ia, a), - Field("ib", &Row::avm_main_ib, b), - Field("ic", &Row::avm_main_ic, mov_val), - Field("id", &Row::avm_main_id, d), - Field("op_a", &Row::avm_main_mem_op_a, 1), - Field("op_b", &Row::avm_main_mem_op_b, 1), - Field("op_c", &Row::avm_main_mem_op_c, 1), - Field("op_d", &Row::avm_main_mem_op_d, 1), - Field("rwa", &Row::avm_main_rwa, 0), - Field("rwb", &Row::avm_main_rwb, 0), - Field("rwc", &Row::avm_main_rwc, 1), - Field("rwd", &Row::avm_main_rwd, 0), - Field("mem_idx_a", &Row::avm_main_mem_idx_a, addr_a), - Field("mem_idx_b", &Row::avm_main_mem_idx_b, addr_b), - Field("mem_idx_c", &Row::avm_main_mem_idx_c, addr_c), - Field("mem_idx_d", &Row::avm_main_mem_idx_d, addr_d), - Field("ind_op_a", &Row::avm_main_ind_op_a, static_cast(indirect)), - Field("ind_op_b", &Row::avm_main_ind_op_b, static_cast(indirect)), - Field("ind_op_c", &Row::avm_main_ind_op_c, static_cast(indirect)), - Field("ind_op_d", &Row::avm_main_ind_op_d, static_cast(indirect)), - Field("sel_cmov", &Row::avm_main_sel_cmov, 1), - Field("sel_mov_a", &Row::avm_main_sel_mov_a, mov_a), - Field("sel_mov_b", &Row::avm_main_sel_mov_b, !mov_a), - Field("r_in_tag", &Row::avm_main_r_in_tag, static_cast(mov_tag)), - Field("w_in_tag", &Row::avm_main_w_in_tag, static_cast(mov_tag)), - Field("inv", &Row::avm_main_inv, inv))); + AllOf(Field("ia", &Row::main_ia, a), + Field("ib", &Row::main_ib, b), + Field("ic", &Row::main_ic, mov_val), + Field("id", &Row::main_id, d), + Field("op_a", &Row::main_mem_op_a, 1), + Field("op_b", &Row::main_mem_op_b, 1), + Field("op_c", &Row::main_mem_op_c, 1), + Field("op_d", &Row::main_mem_op_d, 1), + Field("rwa", &Row::main_rwa, 0), + Field("rwb", &Row::main_rwb, 0), + Field("rwc", &Row::main_rwc, 1), + Field("rwd", &Row::main_rwd, 0), + Field("mem_idx_a", &Row::main_mem_idx_a, addr_a), + Field("mem_idx_b", &Row::main_mem_idx_b, addr_b), + Field("mem_idx_c", &Row::main_mem_idx_c, addr_c), + Field("mem_idx_d", &Row::main_mem_idx_d, addr_d), + Field("ind_op_a", &Row::main_ind_op_a, static_cast(indirect)), + Field("ind_op_b", &Row::main_ind_op_b, static_cast(indirect)), + Field("ind_op_c", &Row::main_ind_op_c, static_cast(indirect)), + Field("ind_op_d", &Row::main_ind_op_d, static_cast(indirect)), + Field("sel_cmov", &Row::main_sel_cmov, 1), + Field("sel_mov_a", &Row::main_sel_mov_a, mov_a), + Field("sel_mov_b", &Row::main_sel_mov_b, !mov_a), + Field("r_in_tag", &Row::main_r_in_tag, static_cast(mov_tag)), + Field("w_in_tag", &Row::main_w_in_tag, static_cast(mov_tag)), + Field("inv", &Row::main_inv, inv))); EXPECT_THAT(trace.at(mem_a_idx), - AllOf(Field("r_in_tag", &Row::avm_mem_r_in_tag, static_cast(mov_tag)), - Field("w_in_tag", &Row::avm_mem_w_in_tag, static_cast(mov_tag)), - Field("tag", &Row::avm_mem_tag, static_cast(tag_a)), - Field("sel_mov_a", &Row::avm_mem_sel_mov_a, mov_a), - Field("mem_addr", &Row::avm_mem_addr, addr_a), - Field("val", &Row::avm_mem_val, a), - Field("rw", &Row::avm_mem_rw, 0), - Field("skip_check_tag", &Row::avm_mem_skip_check_tag, mov_a ? 0 : 1), - Field("op_a", &Row::avm_mem_op_a, 1), - Field("ind_op_a", &Row::avm_mem_ind_op_a, 0))); + AllOf(Field("r_in_tag", &Row::mem_r_in_tag, static_cast(mov_tag)), + Field("w_in_tag", &Row::mem_w_in_tag, static_cast(mov_tag)), + Field("tag", &Row::mem_tag, static_cast(tag_a)), + Field("sel_mov_a", &Row::mem_sel_mov_a, mov_a), + Field("mem_addr", &Row::mem_addr, addr_a), + Field("val", &Row::mem_val, a), + Field("rw", &Row::mem_rw, 0), + Field("skip_check_tag", &Row::mem_skip_check_tag, mov_a ? 0 : 1), + Field("op_a", &Row::mem_op_a, 1), + Field("ind_op_a", &Row::mem_ind_op_a, 0))); EXPECT_THAT(trace.at(mem_b_idx), - AllOf(Field("r_in_tag", &Row::avm_mem_r_in_tag, static_cast(mov_tag)), - Field("w_in_tag", &Row::avm_mem_w_in_tag, static_cast(mov_tag)), - Field("tag", &Row::avm_mem_tag, static_cast(tag_b)), - Field("tag_err", &Row::avm_mem_tag_err, 0), - Field("sel_mov_b", &Row::avm_mem_sel_mov_b, !mov_a), - Field("mem_addr", &Row::avm_mem_addr, addr_b), - Field("val", &Row::avm_mem_val, b), - Field("rw", &Row::avm_mem_rw, 0), - Field("skip_check_tag", &Row::avm_mem_skip_check_tag, mov_a ? 1 : 0), - Field("op_b", &Row::avm_mem_op_b, 1), - Field("ind_op_b", &Row::avm_mem_ind_op_b, 0))); + AllOf(Field("r_in_tag", &Row::mem_r_in_tag, static_cast(mov_tag)), + Field("w_in_tag", &Row::mem_w_in_tag, static_cast(mov_tag)), + Field("tag", &Row::mem_tag, static_cast(tag_b)), + Field("tag_err", &Row::mem_tag_err, 0), + Field("sel_mov_b", &Row::mem_sel_mov_b, !mov_a), + Field("mem_addr", &Row::mem_addr, addr_b), + Field("val", &Row::mem_val, b), + Field("rw", &Row::mem_rw, 0), + Field("skip_check_tag", &Row::mem_skip_check_tag, mov_a ? 1 : 0), + Field("op_b", &Row::mem_op_b, 1), + Field("ind_op_b", &Row::mem_ind_op_b, 0))); EXPECT_THAT(trace.at(mem_c_idx), - AllOf(Field("r_in_tag", &Row::avm_mem_r_in_tag, static_cast(mov_tag)), - Field("w_in_tag", &Row::avm_mem_w_in_tag, static_cast(mov_tag)), - Field("tag", &Row::avm_mem_tag, static_cast(mov_tag)), - Field("tag_err", &Row::avm_mem_tag_err, 0), - Field("mem_addr", &Row::avm_mem_addr, addr_c), - Field("val", &Row::avm_mem_val, mov_a ? a : b), - Field("rw", &Row::avm_mem_rw, 1), - Field("skip_check_tag", &Row::avm_mem_skip_check_tag, 0), - Field("op_c", &Row::avm_mem_op_c, 1), - Field("ind_op_c", &Row::avm_mem_ind_op_c, 0))); + AllOf(Field("r_in_tag", &Row::mem_r_in_tag, static_cast(mov_tag)), + Field("w_in_tag", &Row::mem_w_in_tag, static_cast(mov_tag)), + Field("tag", &Row::mem_tag, static_cast(mov_tag)), + Field("tag_err", &Row::mem_tag_err, 0), + Field("mem_addr", &Row::mem_addr, addr_c), + Field("val", &Row::mem_val, mov_a ? a : b), + Field("rw", &Row::mem_rw, 1), + Field("skip_check_tag", &Row::mem_skip_check_tag, 0), + Field("op_c", &Row::mem_op_c, 1), + Field("ind_op_c", &Row::mem_ind_op_c, 0))); EXPECT_THAT(trace.at(mem_d_idx), - AllOf(Field("r_in_tag", &Row::avm_mem_r_in_tag, static_cast(mov_tag)), - Field("w_in_tag", &Row::avm_mem_w_in_tag, static_cast(mov_tag)), - Field("tag", &Row::avm_mem_tag, static_cast(tag_d)), - Field("tag_err", &Row::avm_mem_tag_err, 0), - Field("mem_addr", &Row::avm_mem_addr, addr_d), - Field("val", &Row::avm_mem_val, d), - Field("rw", &Row::avm_mem_rw, 0), - Field("skip_check_tag", &Row::avm_mem_skip_check_tag, 1), - Field("op_d", &Row::avm_mem_op_d, 1), - Field("ind_op_d", &Row::avm_mem_ind_op_d, 0))); + AllOf(Field("r_in_tag", &Row::mem_r_in_tag, static_cast(mov_tag)), + Field("w_in_tag", &Row::mem_w_in_tag, static_cast(mov_tag)), + Field("tag", &Row::mem_tag, static_cast(tag_d)), + Field("tag_err", &Row::mem_tag_err, 0), + Field("mem_addr", &Row::mem_addr, addr_d), + Field("val", &Row::mem_val, d), + Field("rw", &Row::mem_rw, 0), + Field("skip_check_tag", &Row::mem_skip_check_tag, 1), + Field("op_d", &Row::mem_op_d, 1), + Field("ind_op_d", &Row::mem_ind_op_d, 0))); } }; @@ -393,12 +393,12 @@ TEST_F(AvmMemOpcodeTests, indirectMovInvalidAddressTag) compute_mov_indices(true); - EXPECT_EQ(trace.at(main_idx).avm_main_tag_err, 1); + EXPECT_EQ(trace.at(main_idx).main_tag_err, 1); EXPECT_THAT(trace.at(mem_ind_c_idx), - AllOf(Field(&Row::avm_mem_tag_err, 1), - Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U128)), - Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_ind_op_c, 1))); + AllOf(Field(&Row::mem_tag_err, 1), + Field(&Row::mem_tag, static_cast(AvmMemoryTag::U128)), + Field(&Row::mem_r_in_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::mem_ind_op_c, 1))); validate_trace(std::move(trace), public_inputs, true); } @@ -526,19 +526,19 @@ TEST_F(AvmMemOpcodeTests, directSet) auto const& row = trace.at(1); EXPECT_THAT(row, - AllOf(Field(&Row::avm_main_tag_err, 0), - Field(&Row::avm_main_ic, 5683), - Field(&Row::avm_main_mem_idx_c, 99), - Field(&Row::avm_main_mem_op_c, 1), - Field(&Row::avm_main_rwc, 1), - Field(&Row::avm_main_ind_op_c, 0))); + AllOf(Field(&Row::main_tag_err, 0), + Field(&Row::main_ic, 5683), + Field(&Row::main_mem_idx_c, 99), + Field(&Row::main_mem_op_c, 1), + Field(&Row::main_rwc, 1), + Field(&Row::main_ind_op_c, 0))); EXPECT_THAT(trace.at(mem_c_idx), - AllOf(Field(&Row::avm_mem_val, 5683), - Field(&Row::avm_mem_addr, 99), - Field(&Row::avm_mem_op_c, 1), - Field(&Row::avm_mem_rw, 1), - Field(&Row::avm_mem_ind_op_c, 0))); + AllOf(Field(&Row::mem_val, 5683), + Field(&Row::mem_addr, 99), + Field(&Row::mem_op_c, 1), + Field(&Row::mem_rw, 1), + Field(&Row::mem_ind_op_c, 0))); validate_trace(std::move(trace), public_inputs); } @@ -554,31 +554,31 @@ TEST_F(AvmMemOpcodeTests, indirectSet) auto const& row = trace.at(2); EXPECT_THAT(row, - AllOf(Field(&Row::avm_main_tag_err, 0), - Field(&Row::avm_main_ic, 1979), - Field(&Row::avm_main_mem_idx_c, 100), - Field(&Row::avm_main_mem_op_c, 1), - Field(&Row::avm_main_rwc, 1), - Field(&Row::avm_main_ind_op_c, 1), - Field(&Row::avm_main_ind_c, 10))); + AllOf(Field(&Row::main_tag_err, 0), + Field(&Row::main_ic, 1979), + Field(&Row::main_mem_idx_c, 100), + Field(&Row::main_mem_op_c, 1), + Field(&Row::main_rwc, 1), + Field(&Row::main_ind_op_c, 1), + Field(&Row::main_ind_c, 10))); EXPECT_THAT(trace.at(mem_c_idx), - AllOf(Field(&Row::avm_mem_val, 1979), - Field(&Row::avm_mem_addr, 100), - Field(&Row::avm_mem_op_c, 1), - Field(&Row::avm_mem_rw, 1), - Field(&Row::avm_mem_ind_op_c, 0), - Field(&Row::avm_mem_w_in_tag, static_cast(AvmMemoryTag::U64)), - Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U64)))); + AllOf(Field(&Row::mem_val, 1979), + Field(&Row::mem_addr, 100), + Field(&Row::mem_op_c, 1), + Field(&Row::mem_rw, 1), + Field(&Row::mem_ind_op_c, 0), + Field(&Row::mem_w_in_tag, static_cast(AvmMemoryTag::U64)), + Field(&Row::mem_tag, static_cast(AvmMemoryTag::U64)))); EXPECT_THAT(trace.at(mem_ind_c_idx), - AllOf(Field(&Row::avm_mem_val, 100), - Field(&Row::avm_mem_addr, 10), - Field(&Row::avm_mem_op_c, 0), - Field(&Row::avm_mem_rw, 0), - Field(&Row::avm_mem_ind_op_c, 1), - Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U32)))); + AllOf(Field(&Row::mem_val, 100), + Field(&Row::mem_addr, 10), + Field(&Row::mem_op_c, 0), + Field(&Row::mem_rw, 0), + Field(&Row::mem_ind_op_c, 1), + Field(&Row::mem_r_in_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::mem_tag, static_cast(AvmMemoryTag::U32)))); validate_trace(std::move(trace), public_inputs); } @@ -594,21 +594,21 @@ TEST_F(AvmMemOpcodeTests, indirectSetWrongTag) auto const& row = trace.at(2); EXPECT_THAT(row, - AllOf(Field(&Row::avm_main_tag_err, 1), - Field(&Row::avm_main_mem_op_c, 1), - Field(&Row::avm_main_rwc, 1), - Field(&Row::avm_main_ind_op_c, 1), - Field(&Row::avm_main_ind_c, 10))); + AllOf(Field(&Row::main_tag_err, 1), + Field(&Row::main_mem_op_c, 1), + Field(&Row::main_rwc, 1), + Field(&Row::main_ind_op_c, 1), + Field(&Row::main_ind_c, 10))); EXPECT_THAT(trace.at(mem_ind_c_idx), - AllOf(Field(&Row::avm_mem_val, 100), - Field(&Row::avm_mem_addr, 10), - Field(&Row::avm_mem_op_c, 0), - Field(&Row::avm_mem_rw, 0), - Field(&Row::avm_mem_ind_op_c, 1), - Field(&Row::avm_mem_r_in_tag, static_cast(AvmMemoryTag::U32)), - Field(&Row::avm_mem_tag, static_cast(AvmMemoryTag::U8)), - Field(&Row::avm_mem_tag_err, 1))); + AllOf(Field(&Row::mem_val, 100), + Field(&Row::mem_addr, 10), + Field(&Row::mem_op_c, 0), + Field(&Row::mem_rw, 0), + Field(&Row::mem_ind_op_c, 1), + Field(&Row::mem_r_in_tag, static_cast(AvmMemoryTag::U32)), + Field(&Row::mem_tag, static_cast(AvmMemoryTag::U8)), + Field(&Row::mem_tag_err, 1))); validate_trace(std::move(trace), public_inputs); } @@ -627,7 +627,7 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputErrorTag) { build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(main_idx).avm_main_tag_err = 1; + trace.at(main_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "INCL_MEM_TAG_ERR"); } @@ -636,7 +636,7 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputValue) { build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(main_idx).avm_main_ic = 233; + trace.at(main_idx).main_ic = 233; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_A"); } @@ -645,7 +645,7 @@ TEST_F(AvmMemOpcodeNegativeTests, indMovWrongOutputValue) { build_mov_trace(true, 8732, 23, 24, AvmMemoryTag::U16, 432, 876); compute_mov_indices(true); - trace.at(main_idx).avm_main_ic = 8733; + trace.at(main_idx).main_ic = 8733; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_A"); } @@ -665,14 +665,14 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagLoadIa) auto trace_tmp = trace; - trace.at(mem_a_idx).avm_mem_r_in_tag = tag_u64; - trace.at(mem_a_idx).avm_mem_tag_err = 1; - trace.at(mem_a_idx).avm_mem_one_min_inv = one_min_inverse_diff; - trace.at(mem_c_idx).avm_mem_tag = tag_u64; - trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; - trace.at(main_idx).avm_main_r_in_tag = tag_u64; - trace.at(main_idx).avm_main_w_in_tag = tag_u64; - trace.at(main_idx).avm_main_tag_err = 1; + trace.at(mem_a_idx).mem_r_in_tag = tag_u64; + trace.at(mem_a_idx).mem_tag_err = 1; + trace.at(mem_a_idx).mem_one_min_inv = one_min_inverse_diff; + trace.at(mem_c_idx).mem_tag = tag_u64; + trace.at(mem_c_idx).mem_w_in_tag = tag_u64; + trace.at(main_idx).main_r_in_tag = tag_u64; + trace.at(main_idx).main_w_in_tag = tag_u64; + trace.at(main_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_TAG"); } @@ -688,17 +688,17 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagDisabledSelector) build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(mem_a_idx).avm_mem_r_in_tag = tag_u64; - trace.at(mem_a_idx).avm_mem_w_in_tag = tag_u64; - trace.at(mem_a_idx).avm_mem_tag_err = 1; - trace.at(mem_a_idx).avm_mem_one_min_inv = one_min_inverse_diff; - trace.at(mem_a_idx).avm_mem_sel_mov_a = 0; - trace.at(mem_c_idx).avm_mem_tag = tag_u64; - trace.at(mem_c_idx).avm_mem_r_in_tag = tag_u64; - trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; - trace.at(main_idx).avm_main_r_in_tag = tag_u64; - trace.at(main_idx).avm_main_w_in_tag = tag_u64; - trace.at(main_idx).avm_main_tag_err = 1; + trace.at(mem_a_idx).mem_r_in_tag = tag_u64; + trace.at(mem_a_idx).mem_w_in_tag = tag_u64; + trace.at(mem_a_idx).mem_tag_err = 1; + trace.at(mem_a_idx).mem_one_min_inv = one_min_inverse_diff; + trace.at(mem_a_idx).mem_sel_mov_a = 0; + trace.at(mem_c_idx).mem_tag = tag_u64; + trace.at(mem_c_idx).mem_r_in_tag = tag_u64; + trace.at(mem_c_idx).mem_w_in_tag = tag_u64; + trace.at(main_idx).main_r_in_tag = tag_u64; + trace.at(main_idx).main_w_in_tag = tag_u64; + trace.at(main_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -712,10 +712,10 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagInMainTrace) build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(mem_c_idx).avm_mem_tag = tag_u64; - trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; - trace.at(main_idx).avm_main_w_in_tag = tag_u64; - trace.at(main_idx).avm_main_tag_err = 1; + trace.at(mem_c_idx).mem_tag = tag_u64; + trace.at(mem_c_idx).mem_w_in_tag = tag_u64; + trace.at(main_idx).main_w_in_tag = tag_u64; + trace.at(main_idx).main_tag_err = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_MAIN_SAME_TAG"); } @@ -728,8 +728,8 @@ TEST_F(AvmMemOpcodeNegativeTests, movWrongOutputTagMainTraceRead) build_mov_trace(false, 234, 0, 1, AvmMemoryTag::U8); compute_mov_indices(false); - trace.at(mem_c_idx).avm_mem_tag = tag_u64; - trace.at(mem_c_idx).avm_mem_w_in_tag = tag_u64; + trace.at(mem_c_idx).mem_tag = tag_u64; + trace.at(mem_c_idx).mem_w_in_tag = tag_u64; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_C"); } @@ -741,7 +741,7 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovBInsteadA) { build_cmov_trace_neg_test(true); - trace.at(main_idx).avm_main_ic = 1980; + trace.at(main_idx).main_ic = 1980; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_A"); } @@ -749,7 +749,7 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovAInsteadB) { build_cmov_trace_neg_test(false); - trace.at(main_idx).avm_main_ic = 1979; + trace.at(main_idx).main_ic = 1979; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_SAME_VALUE_B"); } @@ -757,9 +757,9 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovAChangeTag) { build_cmov_trace_neg_test(true); - trace.at(mem_c_idx).avm_mem_tag = static_cast(AvmMemoryTag::U32); - trace.at(mem_c_idx).avm_mem_w_in_tag = static_cast(AvmMemoryTag::U32); - trace.at(main_idx).avm_main_w_in_tag = static_cast(AvmMemoryTag::U32); + trace.at(mem_c_idx).mem_tag = static_cast(AvmMemoryTag::U32); + trace.at(mem_c_idx).mem_w_in_tag = static_cast(AvmMemoryTag::U32); + trace.at(main_idx).main_w_in_tag = static_cast(AvmMemoryTag::U32); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MOV_MAIN_SAME_TAG"); } @@ -768,7 +768,7 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovASkipCheckAbuse) { build_cmov_trace_neg_test(true); - trace.at(mem_a_idx).avm_mem_skip_check_tag = 1; + trace.at(mem_a_idx).mem_skip_check_tag = 1; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "SKIP_CHECK_TAG"); } @@ -777,8 +777,8 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovASkipCheckAbuseDisableSelMovA) { build_cmov_trace_neg_test(true); - trace.at(mem_a_idx).avm_mem_skip_check_tag = 1; - trace.at(mem_a_idx).avm_mem_sel_mov_a = 0; + trace.at(mem_a_idx).mem_skip_check_tag = 1; + trace.at(mem_a_idx).mem_sel_mov_a = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_A"); } @@ -787,8 +787,8 @@ TEST_F(AvmMemOpcodeNegativeTests, cmovBSkipCheckAbuseDisableSelMovB) { build_cmov_trace_neg_test(false); - trace.at(mem_b_idx).avm_mem_skip_check_tag = 1; - trace.at(mem_b_idx).avm_mem_sel_mov_b = 0; + trace.at(mem_b_idx).mem_skip_check_tag = 1; + trace.at(mem_b_idx).mem_sel_mov_b = 0; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "PERM_MAIN_MEM_B"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp index 46c07555798..38428559194 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_memory.test.cpp @@ -47,37 +47,37 @@ TEST_F(AvmMemoryTests, mismatchedTagAddOperation) auto trace = trace_builder.finalize(); // Find the first row enabling the addition selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_add == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_add == FF(1); }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_main_ia, FF(98)); - EXPECT_EQ(row->avm_main_ib, FF(12)); - EXPECT_EQ(row->avm_main_ic, FF(0)); + EXPECT_EQ(row->main_ia, FF(98)); + EXPECT_EQ(row->main_ib, FF(12)); + EXPECT_EQ(row->main_ic, FF(0)); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; // Find the memory trace position corresponding to the load sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_tag_err, FF(1)); // Error is raised - EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U8))); - EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::FF))); + EXPECT_EQ(row->mem_tag_err, FF(1)); // Error is raised + EXPECT_EQ(row->mem_r_in_tag, FF(static_cast(AvmMemoryTag::U8))); + EXPECT_EQ(row->mem_tag, FF(static_cast(AvmMemoryTag::FF))); // Find the memory trace position corresponding to the add sub-operation of register ib. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_B; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_B; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_tag_err, FF(1)); // Error is raised - EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U8))); - EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::FF))); + EXPECT_EQ(row->mem_tag_err, FF(1)); // Error is raised + EXPECT_EQ(row->mem_r_in_tag, FF(static_cast(AvmMemoryTag::U8))); + EXPECT_EQ(row->mem_tag, FF(static_cast(AvmMemoryTag::FF))); validate_trace(std::move(trace), public_inputs, true); } @@ -94,33 +94,33 @@ TEST_F(AvmMemoryTests, mismatchedTagEqOperation) auto trace = trace_builder.finalize(); // Find the first row enabling the equality selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_eq == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_eq == FF(1); }); EXPECT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; // Find the memory trace position corresponding to the load sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_tag_err, FF(0)); // Error is NOT raised - EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); - EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::U32))); + EXPECT_EQ(row->mem_tag_err, FF(0)); // Error is NOT raised + EXPECT_EQ(row->mem_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); + EXPECT_EQ(row->mem_tag, FF(static_cast(AvmMemoryTag::U32))); // Find the memory trace position corresponding to the load sub-operation of register ib. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_B; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_B; }); EXPECT_TRUE(row != trace.end()); - EXPECT_EQ(row->avm_mem_tag_err, FF(1)); // Error is raised - EXPECT_EQ(row->avm_mem_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); - EXPECT_EQ(row->avm_mem_tag, FF(static_cast(AvmMemoryTag::U16))); + EXPECT_EQ(row->mem_tag_err, FF(1)); // Error is raised + EXPECT_EQ(row->mem_r_in_tag, FF(static_cast(AvmMemoryTag::U32))); + EXPECT_EQ(row->mem_tag, FF(static_cast(AvmMemoryTag::U16))); validate_trace(std::move(trace), public_inputs); } @@ -138,20 +138,20 @@ TEST_F(AvmMemoryTests, mLastAccessViolation) auto trace = trace_builder.finalize(); // Find the row with subtraction operation - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == FF(1); }); EXPECT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; // Find the row for memory trace with last memory entry for address 1 (read for subtraction) row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_addr == FF(1) && - r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.mem_addr == FF(1) && + r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - row->avm_mem_lastAccess = FF(0); + row->mem_lastAccess = FF(0); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MEM_LAST_ACCESS_DELIMITER"); } @@ -169,20 +169,20 @@ TEST_F(AvmMemoryTests, readWriteConsistencyValViolation) auto trace = trace_builder.finalize(); // Find the row with multiplication operation - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == FF(1); }); EXPECT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk + 1; // return operation is just after the multiplication + auto clk = row->main_clk + 1; // return operation is just after the multiplication // Find the row for memory trace with last memory entry for address 2 (read for multiplication) row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_addr == FF(2) && - r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.mem_addr == FF(2) && + r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - row->avm_mem_val = FF(35); + row->mem_val = FF(35); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MEM_READ_WRITE_VAL_CONSISTENCY"); } @@ -199,20 +199,20 @@ TEST_F(AvmMemoryTests, readWriteConsistencyTagViolation) auto trace = trace_builder.finalize(); // Find the row with multiplication operation - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_mul == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mul == FF(1); }); EXPECT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk + 1; // return operation is just after the multiplication + auto clk = row->main_clk + 1; // return operation is just after the multiplication // Find the row for memory trace with last memory entry for address 2 (read for multiplication) row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_addr == FF(2) && - r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.mem_addr == FF(2) && + r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); EXPECT_TRUE(row != trace.end()); - row->avm_mem_tag = static_cast(AvmMemoryTag::U16); + row->mem_tag = static_cast(AvmMemoryTag::U16); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MEM_READ_WRITE_TAG_CONSISTENCY"); } @@ -223,7 +223,7 @@ TEST_F(AvmMemoryTests, readUninitializedMemoryViolation) trace_builder.return_op(0, 1, 1); // Return single memory word at position 1 auto trace = trace_builder.finalize(); - trace[1].avm_mem_val = 9; + trace[1].mem_val = 9; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MEM_ZERO_INIT"); } @@ -239,25 +239,25 @@ TEST_F(AvmMemoryTests, mismatchedTagErrorViolation) auto trace = trace_builder.finalize(); // Find the first row enabling the subtraction selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_sub == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == FF(1); }); EXPECT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; // Find the memory trace position corresponding to the subtraction sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); - row->avm_mem_tag_err = FF(0); + row->mem_tag_err = FF(0); auto index = static_cast(row - trace.begin()); auto trace2 = trace; EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MEM_IN_TAG_CONSISTENCY_1"); // More sophisticated attempt by adapting witness "on_min_inv" to make pass the above constraint - trace2[index].avm_mem_one_min_inv = FF(1); + trace2[index].mem_one_min_inv = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace2)), "MEM_IN_TAG_CONSISTENCY_2"); } @@ -273,18 +273,18 @@ TEST_F(AvmMemoryTests, consistentTagNoErrorViolation) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); EXPECT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; // Find the memory trace position corresponding to the fdiv sub-operation of register ia. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_LOAD_A; }); - row->avm_mem_tag_err = FF(1); + row->mem_tag_err = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "MEM_IN_TAG_CONSISTENCY_1"); } @@ -299,19 +299,19 @@ TEST_F(AvmMemoryTests, noErrorTagWriteViolation) auto trace = trace_builder.finalize(); // Find the first row enabling the fdiv selector - auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.avm_main_sel_op_fdiv == FF(1); }); + auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fdiv == FF(1); }); ASSERT_TRUE(row != trace.end()); - auto clk = row->avm_main_clk; + auto clk = row->main_clk; // Find the memory trace position corresponding to the fdiv sub-operation of register ic. row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { - return r.avm_mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_STORE_C; + return r.mem_tsp == FF(AvmMemTraceBuilder::NUM_SUB_CLK) * clk + AvmMemTraceBuilder::SUB_CLK_STORE_C; }); ASSERT_TRUE(row != trace.end()); - row->avm_mem_tag_err = FF(1); + row->mem_tag_err = FF(1); EXPECT_THROW_WITH_MESSAGE(validate_trace_check_circuit(std::move(trace)), "NO_TAG_ERR_WRITE"); } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp index 46cd2d48aa3..ff475e14ea6 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.cpp @@ -73,66 +73,66 @@ void mutate_ic_in_trace(std::vector& trace, std::function&& sele EXPECT_TRUE(row != trace.end()); // Mutate the correct result in the main trace - row->avm_main_ic = newValue; + row->main_ic = newValue; // Optionally mutate the corresponding ic value in alu if (alu) { - auto const clk = row->avm_main_clk; + auto const clk = row->main_clk; // Find the relevant alu trace entry. - auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.avm_alu_clk == clk; }); + auto alu_row = std::ranges::find_if(trace.begin(), trace.end(), [clk](Row r) { return r.alu_clk == clk; }); EXPECT_TRUE(alu_row != trace.end()); - alu_row->avm_alu_ic = newValue; + alu_row->alu_ic = newValue; } // Adapt the memory trace to be consistent with the wrong result - auto const clk = row->avm_main_clk; - auto const addr = row->avm_main_mem_idx_c; + auto const clk = row->main_clk; + auto const addr = row->main_mem_idx_c; // Find the relevant memory trace entry. auto mem_row = std::ranges::find_if( - trace.begin(), trace.end(), [clk, addr](Row r) { return r.avm_mem_clk == clk && r.avm_mem_addr == addr; }); + trace.begin(), trace.end(), [clk, addr](Row r) { return r.mem_clk == clk && r.mem_addr == addr; }); EXPECT_TRUE(mem_row != trace.end()); - mem_row->avm_mem_val = newValue; + mem_row->mem_val = newValue; }; // TODO: Should be a cleaner way to do this void update_slice_registers(Row& row, uint256_t a) { - row.avm_alu_u8_r0 = static_cast(a); + row.alu_u8_r0 = static_cast(a); a >>= 8; - row.avm_alu_u8_r1 = static_cast(a); + row.alu_u8_r1 = static_cast(a); a >>= 8; - row.avm_alu_u16_r0 = static_cast(a); + row.alu_u16_r0 = static_cast(a); a >>= 16; - row.avm_alu_u16_r1 = static_cast(a); + row.alu_u16_r1 = static_cast(a); a >>= 16; - row.avm_alu_u16_r2 = static_cast(a); + row.alu_u16_r2 = static_cast(a); a >>= 16; - row.avm_alu_u16_r3 = static_cast(a); + row.alu_u16_r3 = static_cast(a); a >>= 16; - row.avm_alu_u16_r4 = static_cast(a); + row.alu_u16_r4 = static_cast(a); a >>= 16; - row.avm_alu_u16_r5 = static_cast(a); + row.alu_u16_r5 = static_cast(a); a >>= 16; - row.avm_alu_u16_r6 = static_cast(a); + row.alu_u16_r6 = static_cast(a); a >>= 16; - row.avm_alu_u16_r7 = static_cast(a); + row.alu_u16_r7 = static_cast(a); a >>= 16; - row.avm_alu_u16_r8 = static_cast(a); + row.alu_u16_r8 = static_cast(a); a >>= 16; - row.avm_alu_u16_r9 = static_cast(a); + row.alu_u16_r9 = static_cast(a); a >>= 16; - row.avm_alu_u16_r10 = static_cast(a); + row.alu_u16_r10 = static_cast(a); a >>= 16; - row.avm_alu_u16_r11 = static_cast(a); + row.alu_u16_r11 = static_cast(a); a >>= 16; - row.avm_alu_u16_r12 = static_cast(a); + row.alu_u16_r12 = static_cast(a); a >>= 16; - row.avm_alu_u16_r13 = static_cast(a); + row.alu_u16_r13 = static_cast(a); a >>= 16; - row.avm_alu_u16_r14 = static_cast(a); + row.alu_u16_r14 = static_cast(a); } // TODO: There has to be a better way to do. From fcc15faffac98ab844dbad51e949c24114a8bcf0 Mon Sep 17 00:00:00 2001 From: esau <152162806+sklppy88@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:19:43 +0200 Subject: [PATCH 19/25] fix: export event selector and replace function selector with event selector where appropriate (#7095) Addresses #7089 --- yarn-project/aztec.js/src/api/abi.ts | 2 +- yarn-project/aztec.js/src/index.ts | 1 + yarn-project/aztec.js/src/utils/abi_types.ts | 13 +++++++++++-- .../src/contract-interface-gen/typescript.ts | 15 ++++++++------- yarn-project/circuit-types/src/interfaces/pxe.ts | 4 ++-- yarn-project/circuits.js/src/structs/index.ts | 2 +- yarn-project/pxe/src/pxe_service/pxe_service.ts | 10 ++++++++-- 7 files changed, 32 insertions(+), 15 deletions(-) diff --git a/yarn-project/aztec.js/src/api/abi.ts b/yarn-project/aztec.js/src/api/abi.ts index 69f8b095aee..2f76188c5cd 100644 --- a/yarn-project/aztec.js/src/api/abi.ts +++ b/yarn-project/aztec.js/src/api/abi.ts @@ -1,3 +1,3 @@ -export { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/foundation/abi'; +export { type ContractArtifact, type FunctionArtifact, EventSelector, FunctionSelector } from '@aztec/foundation/abi'; export { loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer } from '@aztec/types/abi'; export { type NoirCompiledContract } from '@aztec/types/noir'; diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 79eef304370..8fabb0e8f91 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -41,6 +41,7 @@ export { CheatCodes, EthAddressLike, EthCheatCodes, + EventSelectorLike, FieldLike, FunctionSelectorLike, WrappedFieldLike, diff --git a/yarn-project/aztec.js/src/utils/abi_types.ts b/yarn-project/aztec.js/src/utils/abi_types.ts index 71b88b89848..304c109899b 100644 --- a/yarn-project/aztec.js/src/utils/abi_types.ts +++ b/yarn-project/aztec.js/src/utils/abi_types.ts @@ -1,4 +1,10 @@ -import { type AztecAddress, type EthAddress, type Fr, type FunctionSelector } from '@aztec/circuits.js'; +import { + type AztecAddress, + type EthAddress, + type EventSelector, + type Fr, + type FunctionSelector, +} from '@aztec/circuits.js'; /** Any type that can be converted into a field for a contract call. */ export type FieldLike = Fr | Buffer | bigint | number | { /** Converts to field */ toField: () => Fr }; @@ -9,8 +15,11 @@ export type EthAddressLike = { /** Wrapped address */ address: FieldLike } | Eth /** Any type that can be converted into an AztecAddress Aztec.nr struct. */ export type AztecAddressLike = { /** Wrapped address */ address: FieldLike } | AztecAddress; -/** Any type that can be converted into an FunctionSelector Aztec.nr struct. */ +/** Any type that can be converted into a FunctionSelector Aztec.nr struct. */ export type FunctionSelectorLike = FieldLike | FunctionSelector; +/** Any type that can be converted into an EventSelector Aztec.nr struct. */ +export type EventSelectorLike = FieldLike | EventSelector; + /** Any type that can be converted into a struct with a single `inner` field. */ export type WrappedFieldLike = { /** Wrapped value */ inner: FieldLike } | FieldLike; diff --git a/yarn-project/builder/src/contract-interface-gen/typescript.ts b/yarn-project/builder/src/contract-interface-gen/typescript.ts index 2a51d433bc9..5fc2828c500 100644 --- a/yarn-project/builder/src/contract-interface-gen/typescript.ts +++ b/yarn-project/builder/src/contract-interface-gen/typescript.ts @@ -255,13 +255,13 @@ function generateEvents(events: any[] | undefined) { `; const fieldNames = event.fields.map((field: any) => `"${field.name}"`); - const eventType = `${eventName}: {decode: (payload: L1EventPayload | undefined) => ${eventName} | undefined, functionSelector: FunctionSelector, fieldNames: string[] }`; + const eventType = `${eventName}: {decode: (payload: L1EventPayload | undefined) => ${eventName} | undefined, eventSelector: EventSelector, fieldNames: string[] }`; const eventImpl = `${eventName}: { - decode: this.decodeEvent(${event.fields.length}, FunctionSelector.fromSignature('${eventName}(${event.fields + decode: this.decodeEvent(${event.fields.length}, EventSelector.fromSignature('${eventName}(${event.fields .map(() => 'Field') .join(',')})'), [${fieldNames}]), - functionSelector: FunctionSelector.fromSignature('${eventName}(${event.fields.map(() => 'Field').join(',')})'), + eventSelector: EventSelector.fromSignature('${eventName}(${event.fields.map(() => 'Field').join(',')})'), fieldNames: [${fieldNames}], }`; @@ -276,21 +276,21 @@ function generateEvents(events: any[] | undefined) { eventDefs: eventsMetadata.map(({ eventDef }) => eventDef).join('\n'), events: ` // Partial application is chosen is to avoid the duplication of so much codegen. - private static decodeEvent(fieldsLength: number, functionSelector: FunctionSelector, fields: string[]): (payload: L1EventPayload | undefined) => T | undefined { + private static decodeEvent(fieldsLength: number, eventSelector: EventSelector, fields: string[]): (payload: L1EventPayload | undefined) => T | undefined { return (payload: L1EventPayload | undefined): T | undefined => { if (payload === undefined) { return undefined; } if ( - !functionSelector.equals( - FunctionSelector.fromField(payload.eventTypeId), + !eventSelector.equals( + EventSelector.fromField(payload.eventTypeId), ) ) { return undefined; } if (payload.event.items.length !== fieldsLength) { throw new Error( - 'Something is weird here, we have matching FunctionSelectors, but the actual payload has mismatched length', + 'Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length', ); } @@ -351,6 +351,7 @@ import { EthAddressLike, FieldLike, Fr, + EventSelector, FunctionSelector, FunctionSelectorLike, L1EventPayload, diff --git a/yarn-project/circuit-types/src/interfaces/pxe.ts b/yarn-project/circuit-types/src/interfaces/pxe.ts index 0c32d8140a9..6092eda2780 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.ts @@ -6,7 +6,7 @@ import { type PartialAddress, type Point, } from '@aztec/circuits.js'; -import { type ContractArtifact, type FunctionSelector } from '@aztec/foundation/abi'; +import { type ContractArtifact, type EventSelector } from '@aztec/foundation/abi'; import { type ContractClassWithId, type ContractInstanceWithAddress, @@ -397,7 +397,7 @@ export interface PXE { */ export interface EventMetadata { decode(payload: L1EventPayload): T | undefined; - functionSelector: FunctionSelector; + eventSelector: EventSelector; fieldNames: string[]; } diff --git a/yarn-project/circuits.js/src/structs/index.ts b/yarn-project/circuits.js/src/structs/index.ts index c8bf5154dc5..d90356a074a 100644 --- a/yarn-project/circuits.js/src/structs/index.ts +++ b/yarn-project/circuits.js/src/structs/index.ts @@ -84,6 +84,6 @@ export * from './tx_request.js'; export * from './validation_requests.js'; export * from './verification_key.js'; -export { FunctionSelector } from '@aztec/foundation/abi'; +export { EventSelector, FunctionSelector } from '@aztec/foundation/abi'; export * from '@aztec/foundation/aztec-address'; export * from '@aztec/foundation/fields'; diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 9a5c5247cb9..5422eea4f00 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -35,7 +35,13 @@ import { getContractClassFromArtifact, } from '@aztec/circuits.js'; import { computeNoteHashNonce, siloNullifier } from '@aztec/circuits.js/hash'; -import { type ContractArtifact, type DecodedReturn, FunctionSelector, encodeArguments } from '@aztec/foundation/abi'; +import { + type ContractArtifact, + type DecodedReturn, + EventSelector, + FunctionSelector, + encodeArguments, +} from '@aztec/foundation/abi'; import { type Fq, Fr, type Point } from '@aztec/foundation/fields'; import { SerialQueue } from '@aztec/foundation/fifo'; import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log'; @@ -853,7 +859,7 @@ export class PXEService implements PXE { if (visibleEvent.payload === undefined) { return undefined; } - if (!FunctionSelector.fromField(visibleEvent.payload.eventTypeId).equals(eventMetadata.functionSelector)) { + if (!EventSelector.fromField(visibleEvent.payload.eventTypeId).equals(eventMetadata.eventSelector)) { return undefined; } if (visibleEvent.payload.event.items.length !== eventMetadata.fieldNames.length) { From 52ce25d1abcc5a8cff7ec360acf23806cb317b57 Mon Sep 17 00:00:00 2001 From: Gregorio Juliana Date: Wed, 19 Jun 2024 10:15:02 +0200 Subject: [PATCH 20/25] chore: Fix noir-projects dockerfile for CircleCI (#7093) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Broken after https://github.com/AztecProtocol/aztec-packages/pull/6985 --------- Co-authored-by: Nicolás Venturo --- build_manifest.yml | 9 +++++++++ noir-projects/Dockerfile | 25 ++++++----------------- noir-projects/Dockerfile.test | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 noir-projects/Dockerfile.test diff --git a/build_manifest.yml b/build_manifest.yml index 0824765b52b..b26e4e84d96 100644 --- a/build_manifest.yml +++ b/build_manifest.yml @@ -71,6 +71,15 @@ noir-projects: - noir - avm-transpiler +# Compiles all aztec noir projects using nargo and the avm-transpiler, then tests them using the TXE. +noir-projects-tests: + buildDir: noir-projects + dockerfile: Dockerfile.test + dependencies: + - noir + - avm-transpiler + - yarn-project + # Uses nargo to compile all the noir test programs, used to test bb and bb.js. noir-compile-acir-tests: buildDir: noir/noir-repo/test_programs diff --git a/noir-projects/Dockerfile b/noir-projects/Dockerfile index b8abf566f84..dc2ecf46362 100644 --- a/noir-projects/Dockerfile +++ b/noir-projects/Dockerfile @@ -1,6 +1,5 @@ FROM aztecprotocol/noir as noir FROM aztecprotocol/avm-transpiler as transpiler -FROM aztecprotocol/yarn-project AS yarn-project FROM ubuntu:lunar AS builder RUN apt-get update && apt-get install -y parallel nodejs npm @@ -14,25 +13,13 @@ ENV PATH="/usr/src/avm-transpiler/target/release:${PATH}" # Copy in noir projects WORKDIR /usr/src/noir-projects COPY . . - - # Build -WORKDIR /usr/src/noir-projects -RUN cd noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings - -RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ - # Wait for TXE to initialize - sleep 5 && \ - cd /usr/src/noir-projects/noir-contracts && \ - ./bootstrap.sh && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \ - kill $(cat /tmp/txe.pid) - -RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ - # Wait for TXE to initialize - sleep 5 && \ - cd /usr/src/noir-projects/aztec-nr && \ - nargo test --silence-warnings --oracle-resolver http://localhost:8080 - +WORKDIR /usr/src/noir-projects/noir-contracts +RUN ./bootstrap.sh +WORKDIR /usr/src/noir-projects/noir-protocol-circuits +RUN ./bootstrap.sh +WORKDIR /usr/src/noir-projects/aztec-nr +RUN nargo compile --silence-warnings FROM scratch COPY --from=builder /usr/src/noir-projects /usr/src/noir-projects \ No newline at end of file diff --git a/noir-projects/Dockerfile.test b/noir-projects/Dockerfile.test new file mode 100644 index 00000000000..40edcbaaf35 --- /dev/null +++ b/noir-projects/Dockerfile.test @@ -0,0 +1,38 @@ +FROM aztecprotocol/noir as noir +FROM aztecprotocol/avm-transpiler as transpiler +FROM aztecprotocol/yarn-project as yarn-project + +RUN apt-get update && apt-get install -y parallel + +# Copy in nargo +COPY --from=noir /usr/src/noir/noir-repo/target/release/nargo /usr/src/noir/noir-repo/target/release/nargo +ENV PATH="/usr/src/noir/noir-repo/target/release:${PATH}" +# Copy in transpiler +COPY --from=transpiler /usr/src/avm-transpiler/target/release/avm-transpiler /usr/src/avm-transpiler/target/release/avm-transpiler +ENV PATH="/usr/src/avm-transpiler/target/release:${PATH}" + +# All built files are ignored so we have to repeat the txe build here. +# It is fast (compared to the tests) and we're moving to earthly, so we don't bother with something more sophisticated. +WORKDIR /usr/src/yarn-project +RUN yarn workspaces focus @aztec/txe +RUN cd ./txe && yarn build + +# Copy in noir projects +WORKDIR /usr/src/noir-projects +COPY . . + +# Build & test +RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings + +RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd ./noir-contracts && \ + ./bootstrap.sh && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \ + kill $(cat /tmp/txe.pid) + +RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \ + # Wait for TXE to initialize + sleep 5 && \ + cd ./aztec-nr && \ + nargo test --silence-warnings --oracle-resolver http://localhost:8080 \ No newline at end of file From a0b9c4b4383f448549c04567cd9c9264ce4240dc Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:02:29 +0200 Subject: [PATCH 21/25] test: Create workflow for full AVM tests (#7051) Resolves #6643 --- .github/workflows/vm_full_tests.yml | 60 +++++++++++++++++++ barretenberg/cpp/Earthfile | 16 +++++ .../barretenberg/vm/avm_trace/avm_common.hpp | 5 +- .../barretenberg/vm/avm_trace/avm_trace.hpp | 2 +- .../barretenberg/vm/tests/helpers.test.hpp | 5 +- .../end-to-end/src/e2e_prover/full.test.ts | 2 + 6 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/vm_full_tests.yml diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml new file mode 100644 index 00000000000..1e912a05438 --- /dev/null +++ b/.github/workflows/vm_full_tests.yml @@ -0,0 +1,60 @@ +name: AVM Full Tests + +on: + schedule: + - cron: "15 4 * * 1-5" # Monday to Friday at 4:15 AM UTC + workflow_dispatch: + inputs: + username: + description: "Username (optional)" + required: false + action: + description: "Default to 'start'" + required: false + default: "start" + +concurrency: + # force parallelism in master + group: avm-full-tests-${{ github.ref }} + cancel-in-progress: true + +env: + DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}" + RUN_ID: ${{ github.run_id }} + RUN_ATTEMPT: ${{ github.run_attempt }} + USERNAME: ${{ github.event.pull_request.user.login || github.actor }} + GITHUB_TOKEN: ${{ github.token }} + GH_SELF_HOSTED_RUNNER_TOKEN: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }} + GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} + # kludge until we move away from runners + WAIT_FOR_RUNNERS: false + +jobs: + setup: + uses: ./.github/workflows/setup-runner.yml + with: + username: ${{ github.event.pull_request.user.login || github.actor }} + runner_type: builder-x86 + secrets: inherit + + # barretenberg (prover) native and AVM (public VM) tests + # only ran on x86 for resource reasons (memory intensive) + avm-full-tests: + needs: [setup] + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + # Only allow one memory-hunger prover test to use this runner + - uses: ./.github/ci-setup-action + with: + # must be globally unique for build x runner + concurrency_key: avm-full-tests-x86 + - name: "AVM Full Tests" + working-directory: ./barretenberg/cpp/ + timeout-minutes: 90 + # limit our parallelism to half our cores + run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 831eb535d83..555b05e9b9b 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -247,6 +247,22 @@ test: END RUN cd build && GTEST_COLOR=1 ctest -j$(nproc) --output-on-failure +vm-full-test: + ARG hardware_concurrency="" + # prefetch + BUILD +test-binaries + BUILD +preset-release-assert-test + BUILD ./srs_db/+build # prefetch + FROM +source + COPY --dir +test-binaries/build build + FROM +preset-release-assert-test + COPY --dir ./srs_db/+build/. srs_db + # limit hardware concurrency, if provided + IF [ "$HARDWARE_CONCURRENCY" != "" ] + ENV HARDWARE_CONCURRENCY=$hardware_concurrency + END + RUN cd build && GTEST_COLOR=1 AVM_ENABLE_FULL_PROVING=1 ctest -j4 --test-dir src/barretenberg/vm --output-on-failure + build: BUILD +preset-wasm BUILD +preset-wasm-threads diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp index 40dde3ae6e9..1ff41a277cd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp @@ -15,9 +15,8 @@ namespace bb::avm_trace { using Flavor = bb::AvmFlavor; using FF = Flavor::FF; -} // namespace bb::avm_trace - -namespace bb::avm_trace { +// To toggle all relevant unit tests with proving, set the env variable "AVM_ENABLE_FULL_PROVING". +static const bool ENABLE_PROVING = std::getenv("AVM_ENABLE_FULL_PROVING") != nullptr; // There are 4 public input columns, 1 for context inputs, and 3 for emitting side effects using VmPublicInputs = std::tuple, // Input: Kernel context inputs diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp index 9c9b157b48f..b0d86f4c5da 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp @@ -33,7 +33,7 @@ class AvmTraceBuilder { ExecutionHints execution_hints = {}, uint32_t side_effect_counter = 0); - std::vector finalize(uint32_t min_trace_size = 0, bool range_check_required = false); + std::vector finalize(uint32_t min_trace_size = 0, bool range_check_required = ENABLE_PROVING); void reset(); uint32_t getPc() const { return pc; } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp index 6c8aa4fd068..cd7c010b94b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp @@ -21,16 +21,13 @@ using ThreeOpParam = std::array; using ThreeOpParamRow = std::tuple; using VmPublicInputs = bb::avm_trace::VmPublicInputs; -// To toggle all relevant unit tests with proving, set the env variable "AVM_TESTS_ENABLE_PROVING". -static const bool ENABLE_PROVING = std::getenv("AVM_TESTS_ENABLE_PROVING") != nullptr; - // If the test is expecting a relation to fail, then use validate_trace_check_circuit. // Otherwise, use validate_trace with a single argument. If the proving needs to be // enabled all the time in a given test, use validate_trace with setting with_proof = true. void validate_trace_check_circuit(std::vector&& trace, VmPublicInputs public_inputs = {}); void validate_trace(std::vector&& trace, VmPublicInputs const& public_inputs = {}, - bool with_proof = ENABLE_PROVING); + bool with_proof = bb::avm_trace::ENABLE_PROVING); void mutate_ic_in_trace(std::vector& trace, std::function&& selectRow, FF const& newValue, diff --git a/yarn-project/end-to-end/src/e2e_prover/full.test.ts b/yarn-project/end-to-end/src/e2e_prover/full.test.ts index cbcb387292c..bbc1c8b7404 100644 --- a/yarn-project/end-to-end/src/e2e_prover/full.test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/full.test.ts @@ -7,6 +7,8 @@ const TIMEOUT = 1_800_000; // This makes AVM proving throw if there's a failure. process.env.AVM_PROVING_STRICT = '1'; +// Enable proving the full lookup tables (no truncation). +process.env.AVM_ENABLE_FULL_PROVING = '1'; describe('full_prover', () => { const t = new FullProverTest('full_prover', 2); From ef8554268c175e6349474883c6072e3979fe45c0 Mon Sep 17 00:00:00 2001 From: guipublic <47281315+guipublic@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:54:38 +0200 Subject: [PATCH 22/25] chore: reads the return data (#6669) Add reads to return_data to properly constrain the return_data wires. --------- Co-authored-by: ledwards2225 --- .../dsl/acir_format/acir_integration.test.cpp | 28 ++- .../acir_format/acir_to_constraint_buf.cpp | 16 +- .../dsl/acir_format/block_constraint.cpp | 236 +++++++++++------- .../dsl/acir_format/block_constraint.hpp | 18 ++ 4 files changed, 202 insertions(+), 96 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp index bac815ed4ef..2842056f848 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp @@ -36,7 +36,7 @@ class AcirIntegrationTest : public ::testing::Test { } acir_format::AcirProgramStack get_program_stack_data_from_test_file(const std::string& test_program_name, - bool honk_recursion) + bool honk_recursion = false) { std::string base_path = "../../acir_tests/acir_tests/" + test_program_name + "/target"; std::string bytecode_path = base_path + "/program.json"; @@ -45,7 +45,8 @@ class AcirIntegrationTest : public ::testing::Test { return acir_format::get_acir_program_stack(bytecode_path, witness_path, honk_recursion); } - acir_format::AcirProgram get_program_data_from_test_file(const std::string& test_program_name, bool honk_recursion) + acir_format::AcirProgram get_program_data_from_test_file(const std::string& test_program_name, + bool honk_recursion = false) { auto program_stack = get_program_stack_data_from_test_file(test_program_name, honk_recursion); ASSERT(program_stack.size() == 1); // Otherwise this method will not return full stack data @@ -428,6 +429,29 @@ INSTANTIATE_TEST_SUITE_P(AcirTests, AcirIntegrationFoldingTest, testing::Values("fold_basic", "fold_basic_nested_call")); +/** + *@brief A basic test of a circuit generated in noir that makes use of the databus + * + */ +TEST_F(AcirIntegrationTest, DISABLED_Databus) +{ + using Flavor = MegaFlavor; + using Builder = Flavor::CircuitBuilder; + + std::string test_name = "databus"; + info("Test: ", test_name); + acir_format::AcirProgram acir_program = get_program_data_from_test_file(test_name); + + // Construct a bberg circuit from the acir representation + Builder builder = acir_format::create_circuit(acir_program.constraints, 0, acir_program.witness); + + // This prints a summary of the types of gates in the circuit + builder.blocks.summarize(); + + // Construct and verify Honk proof + EXPECT_TRUE(prove_and_verify_honk(builder)); +} + /** * @brief Ensure that adding gates post-facto to a circuit generated from acir still results in a valid circuit * @details This is a pattern required by e.g. ClientIvc which appends recursive verifiers to acir-generated circuits diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp index 09029ada3a1..e949fa13305 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp @@ -484,14 +484,11 @@ BlockConstraint handle_memory_init(Program::Opcode::MemoryInit const& mem_init) }); } - // Databus is only supported for Goblin, non Goblin builders will treat call_data and return_data as normal - // array. - if (IsMegaBuilder) { - if (std::holds_alternative(mem_init.block_type.value)) { - block.type = BlockType::CallData; - } else if (std::holds_alternative(mem_init.block_type.value)) { - block.type = BlockType::ReturnData; - } + // Databus is only supported for Goblin, non Goblin builders will treat call_data and return_data as normal array. + if (std::holds_alternative(mem_init.block_type.value)) { + block.type = BlockType::CallData; + } else if (std::holds_alternative(mem_init.block_type.value)) { + block.type = BlockType::ReturnData; } return block; @@ -557,7 +554,8 @@ AcirFormat circuit_serde_to_acir_format(Program::Circuit const& circuit, bool ho gate.value); } for (const auto& [block_id, block] : block_id_to_block_constraint) { - if (!block.first.trace.empty()) { + // Note: the trace will always be empty for ReturnData since it cannot be explicitly read from in noir + if (!block.first.trace.empty() || block.first.type == BlockType::ReturnData) { af.block_constraints.push_back(block.first); af.original_opcode_indices.block_constraints.push_back(block.second); } diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp index bb094b3392b..1ba27ff530d 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp @@ -24,13 +24,17 @@ template stdlib::field_t poly_to_field_ct(const poly return x; } -template -void create_block_constraints(Builder& builder, const BlockConstraint& constraint, bool has_valid_witness_assignments) +/** + * @brief Create block constraints; Specialization for Ultra arithmetization + * @details Ultra does not support DataBus operations so calldata/returndata are treated as ROM ops + * + */ +template <> +void create_block_constraints(UltraCircuitBuilder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments) { - using field_ct = stdlib::field_t; - using rom_table_ct = stdlib::rom_table; - using ram_table_ct = stdlib::ram_table; - using databus_ct = stdlib::databus; + using field_ct = bb::stdlib::field_t; std::vector init; for (auto i : constraint.init) { @@ -39,86 +43,50 @@ void create_block_constraints(Builder& builder, const BlockConstraint& constrain } switch (constraint.type) { + // Note: CallData/ReturnData not supported by Ultra; interpreted as ROM ops instead + case BlockType::CallData: + case BlockType::ReturnData: case BlockType::ROM: { - rom_table_ct table(init); - for (auto& op : constraint.trace) { - ASSERT(op.access_type == 0); - field_ct value = poly_to_field_ct(op.value, builder); - field_ct index = poly_to_field_ct(op.index, builder); - // For a ROM table, constant read should be optimized out: - // The rom_table won't work with a constant read because the table may not be initialized - ASSERT(op.index.q_l != 0); - // We create a new witness w to avoid issues with non-valid witness assignements: - // if witness are not assigned, then w will be zero and table[w] will work - fr w_value = 0; - if (has_valid_witness_assignments) { - // If witness are assigned, we use the correct value for w - w_value = index.get_value(); - } - field_ct w = field_ct::from_witness(&builder, w_value); - value.assert_equal(table[w]); - w.assert_equal(index); - } + process_ROM_operations(builder, constraint, has_valid_witness_assignments, init); } break; case BlockType::RAM: { - ram_table_ct table(init); - for (auto& op : constraint.trace) { - field_ct value = poly_to_field_ct(op.value, builder); - field_ct index = poly_to_field_ct(op.index, builder); - - // We create a new witness w to avoid issues with non-valid witness assignements. - // If witness are not assigned, then index will be zero and table[index] won't hit bounds check. - fr index_value = has_valid_witness_assignments ? index.get_value() : 0; - // Create new witness and ensure equal to index. - field_ct::from_witness(&builder, index_value).assert_equal(index); - - if (op.access_type == 0) { - value.assert_equal(table.read(index)); - } else { - ASSERT(op.access_type == 1); - table.write(index, value); - } - } + process_RAM_operations(builder, constraint, has_valid_witness_assignments, init); + } break; + default: + ASSERT(false); + break; + } +} + +/** + * @brief Create block constraints; Specialization for Mega arithmetization + * + */ +template <> +void create_block_constraints(MegaCircuitBuilder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments) +{ + using field_ct = stdlib::field_t; + + std::vector init; + for (auto i : constraint.init) { + field_ct value = poly_to_field_ct(i, builder); + init.push_back(value); + } + + switch (constraint.type) { + case BlockType::ROM: { + process_ROM_operations(builder, constraint, has_valid_witness_assignments, init); + } break; + case BlockType::RAM: { + process_RAM_operations(builder, constraint, has_valid_witness_assignments, init); } break; case BlockType::CallData: { - if constexpr (IsMegaBuilder) { - databus_ct databus; - // Populate the calldata in the databus - databus.calldata.set_values(init); - for (const auto& op : constraint.trace) { - ASSERT(op.access_type == 0); - field_ct value = poly_to_field_ct(op.value, builder); - field_ct index = poly_to_field_ct(op.index, builder); - fr w_value = 0; - if (has_valid_witness_assignments) { - // If witness are assigned, we use the correct value for w - w_value = index.get_value(); - } - field_ct w = field_ct::from_witness(&builder, w_value); - value.assert_equal(databus.calldata[w]); - w.assert_equal(index); - } - } + process_call_data_operations(builder, constraint, has_valid_witness_assignments, init); } break; case BlockType::ReturnData: { - if constexpr (IsMegaBuilder) { - databus_ct databus; - // Populate the returndata in the databus - databus.return_data.set_values(init); - for (const auto& op : constraint.trace) { - ASSERT(op.access_type == 0); - field_ct value = poly_to_field_ct(op.value, builder); - field_ct index = poly_to_field_ct(op.index, builder); - fr w_value = 0; - if (has_valid_witness_assignments) { - // If witness are assigned, we use the correct value for w - w_value = index.get_value(); - } - field_ct w = field_ct::from_witness(&builder, w_value); - value.assert_equal(databus.return_data[w]); - w.assert_equal(index); - } - } + process_return_data_operations(constraint, init); } break; default: ASSERT(false); @@ -126,11 +94,109 @@ void create_block_constraints(Builder& builder, const BlockConstraint& constrain } } -template void create_block_constraints(UltraCircuitBuilder& builder, - const BlockConstraint& constraint, - bool has_valid_witness_assignments); -template void create_block_constraints(MegaCircuitBuilder& builder, - const BlockConstraint& constraint, - bool has_valid_witness_assignments); +template +void process_ROM_operations(Builder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments, + std::vector>& init) +{ + using field_ct = stdlib::field_t; + using rom_table_ct = stdlib::rom_table; + + rom_table_ct table(init); + for (auto& op : constraint.trace) { + ASSERT(op.access_type == 0); + field_ct value = poly_to_field_ct(op.value, builder); + field_ct index = poly_to_field_ct(op.index, builder); + // For a ROM table, constant read should be optimized out: + // The rom_table won't work with a constant read because the table may not be initialized + ASSERT(op.index.q_l != 0); + // We create a new witness w to avoid issues with non-valid witness assignements: + // if witness are not assigned, then w will be zero and table[w] will work + fr w_value = 0; + if (has_valid_witness_assignments) { + // If witness are assigned, we use the correct value for w + w_value = index.get_value(); + } + field_ct w = field_ct::from_witness(&builder, w_value); + value.assert_equal(table[w]); + w.assert_equal(index); + } +} + +template +void process_RAM_operations(Builder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments, + std::vector>& init) +{ + using field_ct = stdlib::field_t; + using ram_table_ct = stdlib::ram_table; + + ram_table_ct table(init); + for (auto& op : constraint.trace) { + field_ct value = poly_to_field_ct(op.value, builder); + field_ct index = poly_to_field_ct(op.index, builder); + + // We create a new witness w to avoid issues with non-valid witness assignements. + // If witness are not assigned, then index will be zero and table[index] won't hit bounds check. + fr index_value = has_valid_witness_assignments ? index.get_value() : 0; + // Create new witness and ensure equal to index. + field_ct::from_witness(&builder, index_value).assert_equal(index); + + if (op.access_type == 0) { + value.assert_equal(table.read(index)); + } else { + ASSERT(op.access_type == 1); + table.write(index, value); + } + } +} + +template +void process_call_data_operations(Builder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments, + std::vector>& init) +{ + using field_ct = stdlib::field_t; + using databus_ct = stdlib::databus; + + databus_ct databus; + // Populate the calldata in the databus + databus.calldata.set_values(init); + for (const auto& op : constraint.trace) { + ASSERT(op.access_type == 0); + field_ct value = poly_to_field_ct(op.value, builder); + field_ct index = poly_to_field_ct(op.index, builder); + fr w_value = 0; + if (has_valid_witness_assignments) { + // If witness are assigned, we use the correct value for w + w_value = index.get_value(); + } + field_ct w = field_ct::from_witness(&builder, w_value); + value.assert_equal(databus.calldata[w]); + w.assert_equal(index); + } +} + +template +void process_return_data_operations(const BlockConstraint& constraint, std::vector>& init) +{ + using databus_ct = stdlib::databus; + + databus_ct databus; + // Populate the returndata in the databus + databus.return_data.set_values(init); + // For each entry of the return data, explicitly assert equality with the initialization value. This implicitly + // creates the return data read gates that are required to connect witness values in the main wires to witness + // values in the databus return data column. + size_t c = 0; + for (const auto& value : init) { + value.assert_equal(databus.return_data[c]); + c++; + } + ASSERT(constraint.trace.size() == 0); +} } // namespace acir_format \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.hpp index 5f21ed8716a..8a0da27058b 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.hpp @@ -29,6 +29,24 @@ void create_block_constraints(Builder& builder, const BlockConstraint& constraint, bool has_valid_witness_assignments = true); +template +void process_ROM_operations(Builder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments, + std::vector>& init); +template +void process_RAM_operations(Builder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments, + std::vector>& init); +template +void process_call_data_operations(Builder& builder, + const BlockConstraint& constraint, + bool has_valid_witness_assignments, + std::vector>& init); +template +void process_return_data_operations(const BlockConstraint& constraint, std::vector>& init); + template inline void read(B& buf, MemOp& mem_op) { using serialize::read; From c30dc3856cec038d8c53af34cf82e08b0cb456aa Mon Sep 17 00:00:00 2001 From: ledwards2225 <98505400+ledwards2225@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:03:24 -0700 Subject: [PATCH 23/25] chore: Remove unneeded public input folding (#7094) The public inputs are contained in the wire polynomials and are thus folded with the polynomials. We do not need to fold the circuit `public_inputs` separately. For good measure I also added a simply PG test that folds instances with different numbers of PI, which was previously only tested (I believe) in more complex tests such as ClientIvc. --- .../protogalaxy/protogalaxy.test.cpp | 33 +++++++++++++++++++ .../protogalaxy/protogalaxy_prover_impl.hpp | 16 --------- .../protogalaxy/protogalaxy_verifier.cpp | 14 +------- .../protogalaxy_recursive_verifier.cpp | 15 --------- .../ultra_honk/ultra_verifier.cpp | 2 +- 5 files changed, 35 insertions(+), 45 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp index e8cf235f4aa..6c717c1d126 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp @@ -310,6 +310,34 @@ template class ProtoGalaxyTests : public testing::Test { } } + /** + * @brief Testing one valid round of folding followed by the decider. + * @brief For additional robustness we give one of the circuits more public inputs than the other + * + */ + static void test_full_protogalaxy_simple() + { + // Construct a first circuit with some public inputs + Builder builder1; + construct_circuit(builder1); + bb::MockCircuits::add_arithmetic_gates_with_public_inputs(builder1, /*num_gates=*/4); + + // Construct a second circuit with no public inputs + Builder builder2; + construct_circuit(builder2); + + // Construct the prover/verifier instances for each + TupleOfInstances instances; + construct_prover_and_verifier_instance(instances, builder1); + construct_prover_and_verifier_instance(instances, builder2); + + // Perform prover and verifier folding + auto [prover_accumulator, verifier_accumulator] = fold_and_verify(get<0>(instances), get<1>(instances)); + check_accumulator_target_sum_manual(prover_accumulator, true); + + decide_and_verify(prover_accumulator, verifier_accumulator, true); + } + /** * @brief Testing two valid rounds of folding followed by the decider. * @@ -489,6 +517,11 @@ TYPED_TEST(ProtoGalaxyTests, CombineAlpha) TestFixture::test_combine_alpha(); } +TYPED_TEST(ProtoGalaxyTests, FullProtogalaxySimple) +{ + TestFixture::test_full_protogalaxy_simple(); +} + TYPED_TEST(ProtoGalaxyTests, FullProtogalaxyTest) { TestFixture::test_full_protogalaxy(); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp index 02fbb08ff15..f38ff10b3e1 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp @@ -104,22 +104,6 @@ std::shared_ptr ProtoGalaxyProver_proving_key.public_inputs) { - el *= lagranges[0]; - size_t inst = 0; - for (size_t inst_idx = 1; inst_idx < ProverInstances::NUM; inst_idx++) { - auto& instance = instances[inst_idx]; - // TODO(https://github.com/AztecProtocol/barretenberg/issues/830) - if (instance->proving_key.num_public_inputs >= next_accumulator->proving_key.num_public_inputs) { - el += instance->proving_key.public_inputs[el_idx] * lagranges[inst]; - inst++; - }; - } - el_idx++; - } - // Evaluate the combined batching α_i univariate at challenge to obtain next α_i and send it to the // verifier, where i ∈ {0,...,NUM_SUBRELATIONS - 1} auto& folded_alphas = next_accumulator->alphas; diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index a16bacd6e3d..9ffce227620 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -115,19 +115,7 @@ std::shared_ptr ProtoGalaxyVerifier_verification_key->num_public_inputs = accumulator->verification_key->num_public_inputs; next_accumulator->public_inputs = std::vector(static_cast(next_accumulator->verification_key->num_public_inputs), 0); - size_t public_input_idx = 0; - for (auto& public_input : next_accumulator->public_inputs) { - size_t inst = 0; - for (auto& instance : instances) { - // TODO(https://github.com/AztecProtocol/barretenberg/issues/830) - if (instance->verification_key->num_public_inputs >= - next_accumulator->verification_key->num_public_inputs) { - public_input += instance->public_inputs[public_input_idx] * lagranges[inst]; - inst++; - } - } - public_input_idx++; - } + next_accumulator->is_accumulator = true; // Compute next folding parameters diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp index b605840a125..daedb38fd71 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp @@ -177,21 +177,6 @@ std::shared_ptr ProtoGalaxyRecursiveVerifi // Compute ϕ fold_commitments(lagranges, instances, next_accumulator); - next_accumulator->public_inputs = - std::vector(static_cast(next_accumulator->verification_key->num_public_inputs), 0); - size_t public_input_idx = 0; - for (auto& public_input : next_accumulator->public_inputs) { - size_t inst = 0; - for (auto& instance : instances) { - if (instance->verification_key->num_public_inputs >= - next_accumulator->verification_key->num_public_inputs) { - public_input += instance->public_inputs[public_input_idx] * lagranges[inst]; - inst++; - }; - } - public_input_idx++; - } - size_t alpha_idx = 0; for (auto& alpha : next_accumulator->alphas) { alpha = FF(0); diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp index 60e5afd118b..039591d2ba4 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp @@ -49,7 +49,7 @@ template bool UltraVerifier_::verify_proof(const HonkP transcript = std::make_shared(proof); VerifierCommitments commitments{ key }; OinkVerifier oink_verifier{ key, transcript }; - auto [relation_parameters, witness_commitments, _, alphas] = oink_verifier.verify(); + auto [relation_parameters, witness_commitments, public_inputs, alphas] = oink_verifier.verify(); // Copy the witness_commitments over to the VerifierCommitments for (auto [wit_comm_1, wit_comm_2] : zip_view(commitments.get_witness(), witness_commitments.get_all())) { From f9ac0fca40a9d7273ec2adddbfbe961f86595f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Wed, 19 Jun 2024 17:16:22 +0100 Subject: [PATCH 24/25] feat!: make note_getter return BoundedVec instead of an Option array (#7050) `note_getter` was collapsing all returned notes at the beginning of the options array, which allowed us to iterate over `options.limit` instead of `len()`, but this was quite tricky to realize and harder to explain and realize was correct. This new interface avoids this issue entirely, though it does require for the user to be familiar with usage of `BoundedVec` and the fact that Noir loops must be compile-time bounded. This slightly reduces gate counts since we no longer have all of the `_is_some` booleans, but the big win will be once we begin setting `limit` properly. Also, once this is merged, we can use the `utils::colapse` function from #7016 inside `note_getter` for further gate count reductions. --- docs/docs/migration_notes.md | 28 ++++++++++++++++ .../aztec-nr/aztec/src/note/note_getter.nr | 31 +++++++++++------- .../aztec/src/note/note_getter/test.nr | 21 +++++++++--- .../aztec/src/state_vars/private_immutable.nr | 2 +- .../aztec/src/state_vars/private_mutable.nr | 2 +- .../aztec/src/state_vars/private_set.nr | 8 ++--- .../src/easy_private_uint.nr | 6 ++-- .../aztec-nr/value-note/src/balance_utils.nr | 14 ++++---- .../aztec-nr/value-note/src/utils.nr | 6 ++-- .../benchmarking_contract/src/main.nr | 2 +- .../contracts/card_game_contract/src/cards.nr | 29 +++++++++++------ .../contracts/card_game_contract/src/main.nr | 5 ++- .../contracts/child_contract/src/main.nr | 2 +- .../contracts/counter_contract/src/main.nr | 4 +-- .../delegated_on_contract/src/main.nr | 2 +- .../contracts/delegator_contract/src/main.nr | 2 +- .../docs_example_contract/src/main.nr | 8 ++--- .../inclusion_proofs_contract/src/main.nr | 15 ++++----- .../contracts/parent_contract/src/main.nr | 4 +-- .../pending_note_hashes_contract/src/main.nr | 26 ++++++++------- .../static_child_contract/src/main.nr | 2 +- .../contracts/test_contract/src/main.nr | 22 ++++++------- .../token_blacklist_contract/src/main.nr | 2 +- .../src/types/balances_map.nr | 19 ++++++----- .../contracts/token_contract/src/main.nr | 10 +++--- .../token_contract/src/types/balances_map.nr | 19 ++++++----- .../end-to-end/src/e2e_card_game.test.ts | 32 +++++++++---------- .../end-to-end/src/e2e_note_getter.test.ts | 28 ++++++++-------- 28 files changed, 201 insertions(+), 150 deletions(-) diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index 4beb7e9fc14..ea8ee634133 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -12,6 +12,34 @@ Aztec is in full-speed development. Literally every version breaks compatibility Earlier we had just one function - `transfer()` which used authwits to handle the case where a contract/user wants to transfer funds on behalf of another user. To reduce circuit sizes and proof times, we are breaking up `transfer` and introducing a dedicated `transferFrom()` function like in the ERC20 standard. +### [Aztec.nr] `note_getter` returns `BoundedVec` + +The `get_notes` and `view_notes` function no longer return an array of options (i.e. `[Option, N_NOTES]`) but instead a `BoundedVec`. This better conveys the useful property the old array had of having all notes collapsed at the beginning of the array, which allows for powerful optimizations and gate count reduction when setting the `options.limit` value. + +A `BoundedVec` has a `max_len()`, which equals the number of elements it can hold, and a `len()`, which equals the number of elements it currently holds. Since `len()` is typically not knwon at compile time, iterating over a `BoundedVec` looks slightly different than iterating over an array of options: + +```diff +- let option_notes = get_notes(options); +- for i in 0..option_notes.len() { +- if option_notes[i].is_some() { +- let note = option_notes[i].unwrap_unchecked(); +- } +- } ++ let notes = get_notes(options); ++ for i in 0..notes.max_len() { ++ if i < notes.len() { ++ let note = notes.get_unchecked(i); ++ } ++ } +``` + +To further reduce gate count, you can iterate over `options.limit` instead of `max_len()`, since `options.limit` is guaranteed to be larger or equal to `len()`, and smaller or equal to `max_len()`: + +```diff +- for i in 0..notes.max_len() { ++ for i in 0..options.limit { +``` + ### [Aztec.nr] `options.limit` has to be constant The `limit` parameter in `NoteGetterOptions` and `NoteViewerOptions` is now required to be a compile-time constant. This allows performing loops over this value, which leads to reduced circuit gate counts when setting a `limit` value. diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter.nr index cef9498d6c8..53648875124 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter.nr @@ -104,7 +104,7 @@ pub fn get_notes( context: &mut PrivateContext, storage_slot: Field, options: NoteGetterOptions -) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where Note: NoteInterface { +) -> BoundedVec where Note: NoteInterface { let opt_notes = get_notes_internal(storage_slot, options); constrain_get_notes_internal(context, storage_slot, opt_notes, options) @@ -115,8 +115,8 @@ fn constrain_get_notes_internal( storage_slot: Field, opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], options: NoteGetterOptions -) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where Note: NoteInterface { - let mut returned_notes = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; +) -> BoundedVec where Note: NoteInterface { + let mut returned_notes = BoundedVec::new(); // The filter is applied first to avoid pushing note read requests for notes we're not interested in. Note that // while the filter function can technically mutate the contents of the notes (as opposed to simply removing some), @@ -126,7 +126,6 @@ fn constrain_get_notes_internal( let filter_args = options.filter_args; let filtered_notes = filter_fn(opt_notes, filter_args); - let mut num_notes = 0; let mut prev_fields = [0; N]; for i in 0..filtered_notes.len() { let opt_note = filtered_notes[i]; @@ -151,14 +150,12 @@ fn constrain_get_notes_internal( // resulting in a smaller circuit and faster proving times. // We write at returned_notes[num_notes] because num_notes is only advanced when we have a value in // filtered_notes. - returned_notes[num_notes] = Option::some(note); - num_notes += 1; + returned_notes.push(note); }; } - assert(num_notes <= options.limit, "Got more notes than limit."); - - assert(num_notes != 0, "Cannot return zero notes"); + assert(returned_notes.len() <= options.limit, "Got more notes than limit."); + assert(returned_notes.len() != 0, "Cannot return zero notes"); returned_notes } @@ -223,12 +220,13 @@ unconstrained fn get_notes_internal( unconstrained pub fn view_notes( storage_slot: Field, options: NoteViewerOptions -) -> [Option; MAX_NOTES_PER_PAGE] where Note: NoteInterface { +) -> BoundedVec where Note: NoteInterface { let (num_selects, select_by_indexes, select_by_offsets, select_by_lengths, select_values, select_comparators, sort_by_indexes, sort_by_offsets, sort_by_lengths, sort_order) = flatten_options(options.selects, options.sorts); let placeholder_opt_notes = [Option::none(); MAX_NOTES_PER_PAGE]; let placeholder_fields = [0; VIEW_NOTE_ORACLE_RETURN_LENGTH]; let placeholder_note_length = [0; N]; - oracle::notes::get_notes( + + let notes_array = oracle::notes::get_notes( storage_slot, num_selects, select_by_indexes, @@ -246,7 +244,16 @@ unconstrained pub fn view_notes( placeholder_opt_notes, placeholder_fields, placeholder_note_length - ) + ); + + let mut notes = BoundedVec::new(); + for i in 0..notes_array.len() { + if notes_array[i].is_some() { + notes.push(notes_array[i].unwrap_unchecked()); + } + } + + notes } unconstrained fn flatten_options( diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr index 9ee0738312e..42d28e25a05 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr @@ -21,6 +21,19 @@ fn build_valid_note(value: Field) -> MockNote { MockNote::new(value).contract_address(cheatcodes::get_contract_address()).storage_slot(storage_slot).build() } +fn assert_equivalent_vec_and_array(vec: BoundedVec, arr: [Option; N]) where T: Eq { + let mut count = 0; + + for i in 0..N { + if arr[i].is_some() { + assert_eq(arr[i].unwrap(), vec.get(count)); + count += 1; + } + } + + assert_eq(count, vec.len()); +} + #[test] fn processes_single_note() { let mut env = setup(); @@ -32,7 +45,7 @@ fn processes_single_note() { let options = NoteGetterOptions::new(); let returned = constrain_get_notes_internal(&mut context, storage_slot, notes_to_constrain, options); - assert_eq(returned, notes_to_constrain); + assert_equivalent_vec_and_array(returned, notes_to_constrain); assert_eq(context.note_hash_read_requests.len(), 1); } @@ -48,7 +61,7 @@ fn processes_many_notes() { let options = NoteGetterOptions::new(); let returned = constrain_get_notes_internal(&mut context, storage_slot, notes_to_constrain, options); - assert_eq(returned, notes_to_constrain); + assert_equivalent_vec_and_array(returned, notes_to_constrain); assert_eq(context.note_hash_read_requests.len(), 2); } @@ -78,7 +91,7 @@ fn collapses_notes_at_the_beginning_of_the_array() { expected[5] = Option::some(build_valid_note(5)); expected[6] = Option::some(build_valid_note(6)); - assert_eq(returned, expected); + assert_equivalent_vec_and_array(returned, expected); } #[test(should_fail_with="Cannot return zero notes")] @@ -137,7 +150,7 @@ fn applies_filter_before_constraining() { let mut expected = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; expected[0] = Option::some(build_valid_note(42)); - assert_eq(returned, expected); + assert_equivalent_vec_and_array(returned, expected); assert_eq(context.note_hash_read_requests.len(), 1); } diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr index e6c01bd3212..0c310180181 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr @@ -76,7 +76,7 @@ impl PrivateImmutable { // docs:start:view_note unconstrained pub fn view_note(self) -> Note where Note: NoteInterface { let mut options = NoteViewerOptions::new(); - view_notes(self.storage_slot, options.set_limit(1))[0].unwrap() + view_notes(self.storage_slot, options.set_limit(1)).get(0) } // docs:end:view_note } diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr index 1a66e07692c..56b752b6cef 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr @@ -118,7 +118,7 @@ impl PrivateMutable { // docs:start:view_note unconstrained pub fn view_note(self) -> Note where Note: NoteInterface { let mut options = NoteViewerOptions::new(); - view_notes(self.storage_slot, options.set_limit(1))[0].unwrap() + view_notes(self.storage_slot, options.set_limit(1)).get(0) } // docs:end:view_note } diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr index 07a2552be26..1e9125d9bb7 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr @@ -58,10 +58,8 @@ impl PrivateSet { pub fn get_notes( self, options: NoteGetterOptions - ) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where Note: NoteInterface { - let storage_slot = self.storage_slot; - let opt_notes = get_notes(self.context, storage_slot, options); - opt_notes + ) -> BoundedVec where Note: NoteInterface { + get_notes(self.context, self.storage_slot, options) } // docs:end:get_notes } @@ -71,7 +69,7 @@ impl PrivateSet { unconstrained pub fn view_notes( self, options: NoteViewerOptions - ) -> [Option; MAX_NOTES_PER_PAGE] where Note: NoteInterface { + ) -> BoundedVec where Note: NoteInterface { view_notes(self.storage_slot, options) } // docs:end:view_notes diff --git a/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr b/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr index 0f7103ac9ff..ff23dd0e159 100644 --- a/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr +++ b/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr @@ -41,13 +41,13 @@ impl EasyPrivateUint<&mut PrivateContext> { // docs:start:get_notes let options = NoteGetterOptions::with_filter(filter_notes_min_sum, subtrahend as Field); - let maybe_notes = self.set.get_notes(options); + let notes = self.set.get_notes(options); // docs:end:get_notes let mut minuend: u64 = 0; for i in 0..options.limit { - if maybe_notes[i].is_some() { - let note = maybe_notes[i].unwrap_unchecked(); + if i < notes.len() { + let note = notes.get_unchecked(i); // Removes the note from the owner's set of notes. // docs:start:remove diff --git a/noir-projects/aztec-nr/value-note/src/balance_utils.nr b/noir-projects/aztec-nr/value-note/src/balance_utils.nr index 35b35d7e2dd..0f4a6715f18 100644 --- a/noir-projects/aztec-nr/value-note/src/balance_utils.nr +++ b/noir-projects/aztec-nr/value-note/src/balance_utils.nr @@ -12,16 +12,16 @@ unconstrained pub fn get_balance_with_offset(set: PrivateSet Field { let options = create_note_getter_options_for_decreasing_balance(max_amount); - let opt_notes = balance.get_notes(options); + let notes = balance.get_notes(options); let mut decremented = 0; for i in 0..options.limit { - if opt_notes[i].is_some() { - let note = opt_notes[i].unwrap_unchecked(); + if i < notes.len() { + let note = notes.get_unchecked(i); decremented += destroy_note(balance, note); } diff --git a/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr b/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr index a5a27fa3f57..7e2dde51083 100644 --- a/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/benchmarking_contract/src/main.nr @@ -31,7 +31,7 @@ contract Benchmarking { let owner_notes = storage.notes.at(owner); let mut getter_options = NoteGetterOptions::new(); let notes = owner_notes.get_notes(getter_options.set_limit(1).set_offset(index)); - let note = notes[0].unwrap_unchecked(); + let note = notes.get_unchecked(0); owner_notes.remove(note); increment(owner_notes, note.value, owner, outgoing_viewer); } diff --git a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr index 01d06077fb7..e8ae03dd953 100644 --- a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr +++ b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr @@ -123,12 +123,17 @@ impl Deck<&mut PrivateContext> { pub fn get_cards(&mut self, cards: [Card; N]) -> [CardNote; N] { let options = NoteGetterOptions::with_filter(filter_cards, cards); - let maybe_notes = self.set.get_notes(options); + let notes = self.set.get_notes(options); + + // This array will hold the notes that correspond to each of the requested cards. It begins empty (with all the + // options being none) and we gradually fill it up as we find the matching notes. let mut found_cards = [Option::none(); N]; + for i in 0..options.limit { - if maybe_notes[i].is_some() { - let card_note = CardNote::from_note(maybe_notes[i].unwrap_unchecked()); + if i < notes.len() { + let card_note = CardNote::from_note(notes.get_unchecked(i)); + // For each note that we read, we search for a matching card that we have not already marked as found. for j in 0..cards.len() { if found_cards[j].is_none() & (cards[j].strength == card_note.card.strength) @@ -139,6 +144,7 @@ impl Deck<&mut PrivateContext> { } } + // And then we assert that we did indeed find all cards, since found_cards and cards have the same length. found_cards.map( |card_note: Option| { assert(card_note.is_some(), "Card not found"); @@ -156,16 +162,19 @@ impl Deck<&mut PrivateContext> { } impl Deck { - unconstrained pub fn view_cards(self, offset: u32) -> [Option; MAX_NOTES_PER_PAGE] { + unconstrained pub fn view_cards(self, offset: u32) -> BoundedVec { let mut options = NoteViewerOptions::new(); - let opt_notes = self.set.view_notes(options.set_offset(offset)); - let mut opt_cards = [Option::none(); MAX_NOTES_PER_PAGE]; - - for i in 0..opt_notes.len() { - opt_cards[i] = opt_notes[i].map(|note: ValueNote| Card::from_field(note.value)); + let notes = self.set.view_notes(options.set_offset(offset)); + + // TODO: ideally we'd do let cards = notes.map(|note| Cards::from_field(note.value)); + // see https://github.com/noir-lang/noir/pull/5250 + let mut cards = BoundedVec::new(); + cards.len = notes.len(); + for i in 0..notes.len() { + cards.storage[i] = Card::from_field(notes.get_unchecked(i).value); } - opt_cards + cards } } diff --git a/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr b/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr index bfb982eef57..df8318028a1 100644 --- a/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/card_game_contract/src/main.nr @@ -117,13 +117,12 @@ contract CardGame { game_storage.write(game_data); } - unconstrained fn view_collection_cards(owner: AztecAddress, offset: u32) -> pub [Option; MAX_NOTES_PER_PAGE] { + unconstrained fn view_collection_cards(owner: AztecAddress, offset: u32) -> pub BoundedVec { let collection = storage.collections.at(owner); - collection.view_cards(offset) } - unconstrained fn view_game_cards(game: u32, player: AztecAddress, offset: u32) -> pub [Option; MAX_NOTES_PER_PAGE] { + unconstrained fn view_game_cards(game: u32, player: AztecAddress, offset: u32) -> pub BoundedVec { let game_deck = storage.game_decks.at(game as Field).at(player); game_deck.view_cards(offset) diff --git a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr index 6a34f458cce..ab9483cce2a 100644 --- a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr @@ -65,7 +65,7 @@ contract Child { let mut options = NoteGetterOptions::new(); options = options.select(ValueNote::properties().value, amount, Option::none()).set_limit(1); let notes = storage.a_map_with_private_values.at(owner).get_notes(options); - notes[0].unwrap_unchecked().value + notes.get_unchecked(0).value } // Increments `current_value` by `new_value` diff --git a/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr b/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr index e296d211aab..b843313be4b 100644 --- a/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr @@ -59,7 +59,7 @@ contract Counter { let counter_slot = Counter::storage().counters.slot; let owner_slot = derive_storage_slot_in_map(counter_slot, owner); let mut options = NoteViewerOptions::new(); - let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(owner_slot, options); - assert(opt_notes[0].unwrap().value == 5); + let notes: BoundedVec = view_notes(owner_slot, options); + assert(notes.get(0).value == 5); } } diff --git a/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr b/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr index 7b7a30fb200..da7a24ce09b 100644 --- a/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/delegated_on_contract/src/main.nr @@ -35,7 +35,7 @@ contract DelegatedOn { let mut options = NoteGetterOptions::new(); options = options.select(ValueNote::properties().value, amount, Option::none()).set_limit(1); let notes = storage.a_map_with_private_values.at(owner).get_notes(options); - notes[0].unwrap_unchecked().value + notes.get_unchecked(0).value } unconstrained fn view_public_value() -> pub Field { diff --git a/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr b/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr index b2ee7e2f556..8cb753c23e9 100644 --- a/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/delegator_contract/src/main.nr @@ -35,7 +35,7 @@ contract Delegator { let mut options = NoteGetterOptions::new(); options = options.select(ValueNote::properties().value, amount, Option::none()).set_limit(1); let notes = storage.a_map_with_private_values.at(owner).get_notes(options); - notes[0].unwrap_unchecked().value + notes.get_unchecked(0).value } unconstrained fn view_public_value() -> pub Field { diff --git a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr index b56307349b3..9653946054c 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr @@ -211,17 +211,15 @@ contract DocsExample { } // docs:start:state_vars-NoteGetterOptionsComparatorExampleNoir - unconstrained fn read_note(amount: Field, comparator: u8) -> pub [Option; 10] { + unconstrained fn read_note(amount: Field, comparator: u8) -> pub BoundedVec { let mut options = NoteViewerOptions::new(); - let notes = storage.set.view_notes( + storage.set.view_notes( options.select( CardNote::properties().points, amount, Option::some(comparator) ) - ); - - notes + ) } // docs:end:state_vars-NoteGetterOptionsComparatorExampleNoir diff --git a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr index 0e0fe7e2ddd..372b11fbd5b 100644 --- a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr @@ -55,8 +55,7 @@ contract InclusionProofs { if (nullified) { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let notes = private_values.get_notes(options); - let maybe_note = notes[0]; + let note = private_values.get_notes(options).get_unchecked(0); // docs:end:get_note_from_pxe // 2) Prove the note inclusion @@ -66,7 +65,7 @@ contract InclusionProofs { context.get_header() }; // docs:start:prove_note_inclusion - header.prove_note_inclusion(maybe_note.unwrap_unchecked()); + header.prove_note_inclusion(note); // docs:end:prove_note_inclusion } @@ -107,8 +106,7 @@ contract InclusionProofs { if (fail_case) { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let notes = private_values.get_notes(options); - let maybe_note = notes[0]; + let note = private_values.get_notes(options).get_unchecked(0); let header = if (use_block_number) { context.get_header_at(block_number) @@ -116,7 +114,7 @@ contract InclusionProofs { context.get_header() }; // docs:start:prove_note_not_nullified - header.prove_note_not_nullified(maybe_note.unwrap_unchecked(), &mut context); + header.prove_note_not_nullified(note, &mut context); // docs:end:prove_note_not_nullified } @@ -134,8 +132,7 @@ contract InclusionProofs { if (nullified) { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let notes = private_values.get_notes(options); - let note = notes[0].unwrap(); + let note = private_values.get_notes(options).get(0); // 2) Prove the note validity let header = if (use_block_number) { @@ -155,7 +152,7 @@ contract InclusionProofs { let mut options = NoteGetterOptions::new(); options = options.set_limit(1); let notes = private_values.get_notes(options); - let note = notes[0].unwrap(); + let note = notes.get(0); private_values.remove(note); } diff --git a/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr b/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr index e6901b1a319..b8789b55e6f 100644 --- a/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/parent_contract/src/main.nr @@ -274,8 +274,8 @@ contract Parent { let counter_slot = Child::storage().a_map_with_private_values.slot; let owner_slot = derive_storage_slot_in_map(counter_slot, owner); let mut options = NoteViewerOptions::new(); - let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(owner_slot, options); - let note_value = opt_notes[0].unwrap().value; + let notes: BoundedVec = view_notes(owner_slot, options); + let note_value = notes.get(0).value; assert(note_value == value_to_set); assert(note_value == result); // Get value from child through parent diff --git a/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr b/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr index 0fb30e0d728..6f5076d4ddf 100644 --- a/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr @@ -40,11 +40,11 @@ contract PendingNoteHashes { let options = NoteGetterOptions::with_filter(filter_notes_min_sum, amount); // get note inserted above - let maybe_notes = owner_balance.get_notes(options); + let notes = owner_balance.get_notes(options); - let note0 = maybe_notes[0].unwrap(); + let note0 = notes.get(0); assert(note.value == note0.value); - assert(maybe_notes[1].is_none()); + assert(notes.len() == 1); owner_balance.remove(note0); @@ -58,10 +58,13 @@ contract PendingNoteHashes { let options = NoteGetterOptions::with_filter(filter_notes_min_sum, amount); // get note (note inserted at bottom of function shouldn't exist yet) - let maybe_notes = owner_balance.get_notes(options); + let notes = owner_balance.get_notes(options); - assert(maybe_notes[0].is_none()); - assert(maybe_notes[1].is_none()); + // TODO https://github.com/AztecProtocol/aztec-packages/issues/7059: clean this test up - we won't actually hit + // this assert because the same one exists in get_notes (we always return at least one note), so all lines after + // this one are effectively dead code. We should find a different way to test what this function attempts to + // test. + assert(notes.len() == 0); let header = context.get_header(); let owner_npk_m_hash = header.get_npk_m_hash(&mut context, owner); @@ -139,7 +142,7 @@ contract PendingNoteHashes { let mut options = NoteGetterOptions::new(); options = options.set_limit(1); - let note = owner_balance.get_notes(options)[0].unwrap(); + let note = owner_balance.get_notes(options).get(0); assert(expected_value == note.value); @@ -154,10 +157,11 @@ contract PendingNoteHashes { let owner_balance = storage.balances.at(owner); let options = NoteGetterOptions::new(); - let maybe_notes = owner_balance.get_notes(options); + let notes = owner_balance.get_notes(options); - assert(maybe_notes[0].is_none()); - assert(maybe_notes[1].is_none()); + // TODO https://github.com/AztecProtocol/aztec-packages/issues/7059: review what this test aimed to test, as + // it's now superfluous: get_notes never returns 0 notes. + assert(notes.len() == 0); } // Test pending note hashes with note insertion done in a nested call @@ -384,7 +388,7 @@ contract PendingNoteHashes { let notes = owner_balance.get_notes(NoteGetterOptions::new()); for i in 0..max_notes_per_call() { - let note = notes[i].unwrap(); + let note = notes.get(i); owner_balance.remove(note); } } diff --git a/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr index 89c31eb8482..9ed71ce290e 100644 --- a/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr @@ -73,7 +73,7 @@ contract StaticChild { Option::none() ).set_limit(1); let notes = storage.a_private_value.get_notes(options); - notes[0].unwrap_unchecked().value + notes.get_unchecked(0).value } // Increments `current_value` by `new_value` diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index 79046b74aa0..0ec38297670 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -111,9 +111,9 @@ contract Test { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); + let notes: BoundedVec = get_notes(&mut context, storage_slot, options); - opt_notes[0].unwrap().value + notes.get(0).value } #[aztec(private)] @@ -127,9 +127,9 @@ contract Test { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); + let notes: BoundedVec = get_notes(&mut context, storage_slot, options); - [opt_notes[0].unwrap().value, opt_notes[1].unwrap().value] + [notes.get(0).value, notes.get(1).value] } unconstrained fn call_view_notes(storage_slot: Field, active_or_nullified: bool) -> pub Field { @@ -142,9 +142,9 @@ contract Test { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(storage_slot, options); + let notes: BoundedVec = view_notes(storage_slot, options); - opt_notes[0].unwrap().value + notes.get(0).value } unconstrained fn call_view_notes_many(storage_slot: Field, active_or_nullified: bool) -> pub [Field; 2] { @@ -157,9 +157,9 @@ contract Test { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(storage_slot, options); + let notes: BoundedVec = view_notes(storage_slot, options); - [opt_notes[0].unwrap().value, opt_notes[1].unwrap().value] + [notes.get(0).value, notes.get(1).value] } #[aztec(private)] @@ -169,9 +169,9 @@ contract Test { ); let options = NoteGetterOptions::new(); - let opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); + let notes: BoundedVec = get_notes(&mut context, storage_slot, options); - let note = opt_notes[0].unwrap(); + let note = notes.get(0); destroy_note(&mut context, note); } @@ -475,7 +475,7 @@ contract Test { let mut options = NoteGetterOptions::new(); options = options.select(TestNote::properties().value, secret_hash, Option::none()).set_limit(1); let notes = notes_set.get_notes(options); - let note = notes[0].unwrap_unchecked(); + let note = notes.get_unchecked(0); notes_set.remove(note); } diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr index fd4590e5b6a..defab65772e 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr @@ -173,7 +173,7 @@ contract TokenBlacklist { Option::none() ).set_limit(1); let notes = pending_shields.get_notes(options); - let note = notes[0].unwrap_unchecked(); + let note = notes.get_unchecked(0); // Remove the note from the pending shields set pending_shields.remove(note); diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr index 56b63bc7590..a5436a93d95 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr @@ -39,16 +39,15 @@ impl BalancesMap { let mut balance = U128::from_integer(0); // docs:start:view_notes let mut options = NoteViewerOptions::new(); - let opt_notes = self.map.at(owner).view_notes(options.set_offset(offset)); + let notes = self.map.at(owner).view_notes(options.set_offset(offset)); // docs:end:view_notes - let len = opt_notes.len(); - for i in 0..len { - if opt_notes[i].is_some() { - balance = balance + opt_notes[i].unwrap_unchecked().get_amount(); + for i in 0..options.limit { + if i < notes.len() { + balance = balance + notes.get_unchecked(i).get_amount(); } } - if (opt_notes[len - 1].is_some()) { - balance = balance + self.balance_of_with_offset(owner, offset + opt_notes.len() as u32); + if (notes.len() == options.limit) { + balance = balance + self.balance_of_with_offset(owner, offset + options.limit); } balance @@ -84,13 +83,13 @@ impl BalancesMap { ) -> OuterNoteEmission where T: NoteInterface + OwnedNote { // docs:start:get_notes let options = NoteGetterOptions::with_filter(filter_notes_min_sum, subtrahend); - let maybe_notes = self.map.at(owner).get_notes(options); + let notes = self.map.at(owner).get_notes(options); // docs:end:get_notes let mut minuend: U128 = U128::from_integer(0); for i in 0..options.limit { - if maybe_notes[i].is_some() { - let note = maybe_notes[i].unwrap_unchecked(); + if i < notes.len() { + let note = notes.get_unchecked(i); // Removes the note from the owner's set of notes. // This will call the the `compute_nullifer` function of the `token_note` diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr index fca6ed10b8f..b263abeff01 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr @@ -281,7 +281,7 @@ contract Token { Option::none() ).set_limit(1); let notes = pending_shields.get_notes(options); - let note = notes[0].unwrap_unchecked(); + let note = notes.get_unchecked(0); // Remove the note from the pending shields set pending_shields.remove(note); @@ -457,13 +457,13 @@ contract Token { let balances_slot = Token::storage().balances.slot; let recipient_slot = derive_storage_slot_in_map(balances_slot, recipient); let mut options = NoteViewerOptions::new(); - let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(recipient_slot, options); - assert(opt_notes[0].unwrap().amount.to_field() == transfer_amount); + let notes: BoundedVec = view_notes(recipient_slot, options); + assert(notes.get(0).amount.to_field() == transfer_amount); let owner_slot = derive_storage_slot_in_map(balances_slot, owner); let mut options = NoteViewerOptions::new(); - let opt_notes: [Option; MAX_NOTES_PER_PAGE] = view_notes(owner_slot, options); - assert(opt_notes[0].unwrap().amount.to_field() == mint_amount - transfer_amount); + let notes: BoundedVec = view_notes(owner_slot, options); + assert(notes.get(0).amount.to_field() == mint_amount - transfer_amount); } } // docs:end:token_all \ No newline at end of file diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr index cada57a7497..a13206360c3 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr @@ -42,16 +42,15 @@ impl BalancesMap { let mut balance = U128::from_integer(0); // docs:start:view_notes let mut options = NoteViewerOptions::new(); - let opt_notes = self.map.at(owner).view_notes(options.set_offset(offset)); + let notes = self.map.at(owner).view_notes(options.set_offset(offset)); // docs:end:view_notes - let len = opt_notes.len(); - for i in 0..len { - if opt_notes[i].is_some() { - balance = balance + opt_notes[i].unwrap_unchecked().get_amount(); + for i in 0..options.limit { + if i < notes.len() { + balance = balance + notes.get_unchecked(i).get_amount(); } } - if (opt_notes[len - 1].is_some()) { - balance = balance + self.balance_of_with_offset(owner, offset + opt_notes.len() as u32); + if (notes.len() == options.limit) { + balance = balance + self.balance_of_with_offset(owner, offset + options.limit); } balance @@ -87,13 +86,13 @@ impl BalancesMap { ) -> OuterNoteEmission where T: NoteInterface + OwnedNote { // docs:start:get_notes let options = NoteGetterOptions::with_filter(filter_notes_min_sum, subtrahend); - let maybe_notes = self.map.at(owner).get_notes(options); + let notes = self.map.at(owner).get_notes(options); // docs:end:get_notes let mut minuend: U128 = U128::from_integer(0); for i in 0..options.limit { - if maybe_notes[i].is_some() { - let note = maybe_notes[i].unwrap_unchecked(); + if i < notes.len() { + let note = notes.get_unchecked(i); // Removes the note from the owner's set of notes. // This will call the the `compute_nullifer` function of the `token_note` diff --git a/yarn-project/end-to-end/src/e2e_card_game.test.ts b/yarn-project/end-to-end/src/e2e_card_game.test.ts index ef9fa465666..24629f1e8f7 100644 --- a/yarn-project/end-to-end/src/e2e_card_game.test.ts +++ b/yarn-project/end-to-end/src/e2e_card_game.test.ts @@ -44,13 +44,13 @@ interface Game { current_round: bigint; } -interface NoirOption { - _is_some: boolean; - _value: T; +interface NoirBoundedVec { + storage: T[]; + len: bigint; } -function unwrapOptions(options: NoirOption[]): T[] { - return options.filter((option: any) => option._is_some).map((option: any) => option._value); +function boundedVecToArray(boundedVec: NoirBoundedVec): T[] { + return boundedVec.storage.slice(0, Number(boundedVec.len)); } // Game settings. @@ -149,7 +149,7 @@ describe('e2e_card_game', () => { // docs:end:send_tx const collection = await contract.methods.view_collection_cards(firstPlayer, 0).simulate({ from: firstPlayer }); const expected = getPackedCards(0, seed); - expect(unwrapOptions(collection)).toMatchObject(expected); + expect(boundedVecToArray(collection)).toMatchObject(expected); }); describe('game join', () => { @@ -161,7 +161,7 @@ describe('e2e_card_game', () => { contract.methods.buy_pack(seed).send().wait(), contractAsSecondPlayer.methods.buy_pack(seed).send().wait(), ]); - firstPlayerCollection = unwrapOptions( + firstPlayerCollection = boundedVecToArray( await contract.methods.view_collection_cards(firstPlayer, 0).simulate({ from: firstPlayer }), ); }); @@ -180,8 +180,8 @@ describe('e2e_card_game', () => { ).rejects.toThrow(`Assertion failed: Cannot return zero notes`); const collection = await contract.methods.view_collection_cards(firstPlayer, 0).simulate({ from: firstPlayer }); - expect(unwrapOptions(collection)).toHaveLength(1); - expect(unwrapOptions(collection)).toMatchObject([firstPlayerCollection[1]]); + expect(boundedVecToArray(collection)).toHaveLength(1); + expect(boundedVecToArray(collection)).toMatchObject([firstPlayerCollection[1]]); expect((await contract.methods.view_game(GAME_ID).simulate({ from: firstPlayer })) as Game).toMatchObject({ players: [ @@ -204,10 +204,10 @@ describe('e2e_card_game', () => { }); it('should start games', async () => { - const secondPlayerCollection = unwrapOptions( + const secondPlayerCollection = boundedVecToArray( (await contract.methods .view_collection_cards(secondPlayer, 0) - .simulate({ from: secondPlayer })) as NoirOption[], + .simulate({ from: secondPlayer })) as NoirBoundedVec, ); await Promise.all([ @@ -257,15 +257,15 @@ describe('e2e_card_game', () => { contractAsThirdPlayer.methods.buy_pack(seed).send().wait(), ]); - firstPlayerCollection = unwrapOptions( + firstPlayerCollection = boundedVecToArray( await contract.methods.view_collection_cards(firstPlayer, 0).simulate({ from: firstPlayer }), ); - secondPlayerCollection = unwrapOptions( + secondPlayerCollection = boundedVecToArray( await contract.methods.view_collection_cards(secondPlayer, 0).simulate({ from: secondPlayer }), ); - thirdPlayerCOllection = unwrapOptions( + thirdPlayerCOllection = boundedVecToArray( await contract.methods.view_collection_cards(thirdPlayer, 0).simulate({ from: thirdPlayer }), ); }); @@ -319,8 +319,8 @@ describe('e2e_card_game', () => { await contractFor(winner).methods.claim_cards(GAME_ID, game.rounds_cards.map(cardToField)).send().wait(); - const winnerCollection = unwrapOptions( - (await contract.methods.view_collection_cards(winner, 0).simulate({ from: winner })) as NoirOption[], + const winnerCollection = boundedVecToArray( + (await contract.methods.view_collection_cards(winner, 0).simulate({ from: winner })) as NoirBoundedVec, ); const winnerGameDeck = [winnerCollection[0], winnerCollection[3]]; diff --git a/yarn-project/end-to-end/src/e2e_note_getter.test.ts b/yarn-project/end-to-end/src/e2e_note_getter.test.ts index c26ecffe30d..be87db5bd48 100644 --- a/yarn-project/end-to-end/src/e2e_note_getter.test.ts +++ b/yarn-project/end-to-end/src/e2e_note_getter.test.ts @@ -3,18 +3,18 @@ import { DocsExampleContract, TestContract } from '@aztec/noir-contracts.js'; import { setup } from './fixtures/utils.js'; -interface NoirOption { - _is_some: boolean; - _value: T; +interface NoirBoundedVec { + storage: T[]; + len: bigint; +} + +function boundedVecToArray(boundedVec: NoirBoundedVec): T[] { + return boundedVec.storage.slice(0, Number(boundedVec.len)); } const sortFunc = (a: any, b: any) => a.points > b.points ? 1 : a.points < b.points ? -1 : a.randomness > b.randomness ? 1 : -1; -function unwrapOptions(options: NoirOption[]): T[] { - return options.filter((option: any) => option._is_some).map((option: any) => option._value); -} - describe('e2e_note_getter', () => { let wallet: Wallet; let teardown: () => Promise; @@ -60,7 +60,7 @@ describe('e2e_note_getter', () => { ]); expect( - unwrapOptions(returnEq) + boundedVecToArray(returnEq) .map(({ points, randomness }: any) => ({ points, randomness })) .sort(sortFunc), ).toStrictEqual( @@ -71,7 +71,7 @@ describe('e2e_note_getter', () => { ); expect( - unwrapOptions(returnNeq) + boundedVecToArray(returnNeq) .map(({ points, randomness }: any) => ({ points, randomness })) .sort(sortFunc), ).toStrictEqual( @@ -89,7 +89,7 @@ describe('e2e_note_getter', () => { ); expect( - unwrapOptions(returnLt) + boundedVecToArray(returnLt) .map(({ points, randomness }: any) => ({ points, randomness })) .sort(sortFunc), ).toStrictEqual( @@ -103,7 +103,7 @@ describe('e2e_note_getter', () => { ); expect( - unwrapOptions(returnGt) + boundedVecToArray(returnGt) .map(({ points, randomness }: any) => ({ points, randomness })) .sort(sortFunc), ).toStrictEqual( @@ -116,7 +116,7 @@ describe('e2e_note_getter', () => { ); expect( - unwrapOptions(returnLte) + boundedVecToArray(returnLte) .map(({ points, randomness }: any) => ({ points, randomness })) .sort(sortFunc), ).toStrictEqual( @@ -132,7 +132,7 @@ describe('e2e_note_getter', () => { ); expect( - unwrapOptions(returnGte) + boundedVecToArray(returnGte) .map(({ points, randomness }: any) => ({ points, randomness })) .sort(sortFunc), ).toStrictEqual( @@ -179,7 +179,7 @@ describe('e2e_note_getter', () => { async function assertNoReturnValue(storageSlot: number, activeOrNullified: boolean) { await expect(contract.methods.call_view_notes(storageSlot, activeOrNullified).simulate()).rejects.toThrow( - 'is_some', + 'index < self.len', // from BoundedVec::get ); await expect(contract.methods.call_get_notes(storageSlot, activeOrNullified).prove()).rejects.toThrow( `Assertion failed: Cannot return zero notes`, From e37809bdcdcf76f89f68403ee75aaf6d32c79a94 Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:22:24 +0200 Subject: [PATCH 25/25] fix: Fix bug for a unit test in full proving mode repated to MSM (#7104) --- .../cpp/src/barretenberg/vm/tests/avm_execution.test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp index f05eb875f45..dd5839c603a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_execution.test.cpp @@ -1473,8 +1473,9 @@ TEST_F(AvmExecutionTests, msmOpCode) EXPECT_EQ(returndata, expected_output); - validate_trace(std::move(trace)); + validate_trace(std::move(trace), public_inputs); } + // Positive test for Kernel Input opcodes TEST_F(AvmExecutionTests, kernelInputOpcodes) {