From 8c49ead69db3243ac95a630eff3168042c096961 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 16:18:10 +0000 Subject: [PATCH 1/3] WIP --- yarn-project/aztec-rpc/package.json | 1 + .../aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts | 2 ++ yarn-project/aztec.js/src/contract/contract.test.ts | 8 +++++++- yarn-project/noir-compiler/package.json | 3 ++- yarn-project/noir-compiler/src/noir-version.ts | 3 +++ yarn-project/types/src/interfaces/aztec_rpc.ts | 4 ++++ yarn-project/yarn.lock | 1 + 7 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 yarn-project/noir-compiler/src/noir-version.ts diff --git a/yarn-project/aztec-rpc/package.json b/yarn-project/aztec-rpc/package.json index 78f906e82b5..9c477cf34f1 100644 --- a/yarn-project/aztec-rpc/package.json +++ b/yarn-project/aztec-rpc/package.json @@ -35,6 +35,7 @@ "@aztec/circuits.js": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/key-store": "workspace:^", + "@aztec/noir-compiler": "workspace:^", "@aztec/types": "workspace:^", "lodash.omit": "^4.5.0", "lodash.partition": "^4.6.0", diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts index d2dd9501e8c..7cc6f915eb9 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts @@ -20,6 +20,7 @@ import { encodeArguments } from '@aztec/foundation/abi'; import { padArrayEnd } from '@aztec/foundation/collection'; import { Fr, Point } from '@aztec/foundation/fields'; import { DebugLogger, createDebugLogger } from '@aztec/foundation/log'; +import NoirVersion from '@aztec/noir-compiler/noir-version'; import { AuthWitness, AztecNode, @@ -306,6 +307,7 @@ export class AztecRPCServer implements AztecRPC { chainId, rollupAddress, client: this.clientInfo, + nargoVersion: NoirVersion.default.commit, }; } diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts index 411635fbd79..b14a8d57121 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -28,7 +28,13 @@ describe('Contract Class', () => { const mockTxHash = { type: 'TxHash' } as any as TxHash; const mockTxReceipt = { type: 'TxReceipt' } as any as TxReceipt; const mockViewResultValue = 1; - const mockNodeInfo: NodeInfo = { version: 1, chainId: 2, rollupAddress: EthAddress.random(), client: '' }; + const mockNodeInfo: NodeInfo = { + version: 1, + chainId: 2, + rollupAddress: EthAddress.random(), + client: '', + nargoVersion: 'sdlhahf823', + }; const defaultAbi: ContractAbi = { name: 'FooContract', diff --git a/yarn-project/noir-compiler/package.json b/yarn-project/noir-compiler/package.json index d9efa71dc52..d7b01d1fafc 100644 --- a/yarn-project/noir-compiler/package.json +++ b/yarn-project/noir-compiler/package.json @@ -4,7 +4,8 @@ "type": "module", "exports": { ".": "./dest/index.js", - "./cli": "./dest/cli/index.js" + "./cli": "./dest/cli/index.js", + "./noir-version": "./dest/noir-version.js" }, "typedocOptions": { "entryPoints": [ diff --git a/yarn-project/noir-compiler/src/noir-version.ts b/yarn-project/noir-compiler/src/noir-version.ts new file mode 100644 index 00000000000..ced32a2105a --- /dev/null +++ b/yarn-project/noir-compiler/src/noir-version.ts @@ -0,0 +1,3 @@ +import * as version from './noir-version.json' assert { type: 'json' }; + +export default version; diff --git a/yarn-project/types/src/interfaces/aztec_rpc.ts b/yarn-project/types/src/interfaces/aztec_rpc.ts index 9ff597b8d87..4f593a2d99c 100644 --- a/yarn-project/types/src/interfaces/aztec_rpc.ts +++ b/yarn-project/types/src/interfaces/aztec_rpc.ts @@ -52,6 +52,10 @@ export type NodeInfo = { * Identifier of the client software. */ client: string; + /** + * The nargo version compatible with this node. + */ + nargoVersion: string; }; /** Provides up to which block has been synced by different components. */ diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 375e0596fac..eba3982548e 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -156,6 +156,7 @@ __metadata: "@aztec/circuits.js": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/key-store": "workspace:^" + "@aztec/noir-compiler": "workspace:^" "@aztec/types": "workspace:^" "@jest/globals": ^29.5.0 "@rushstack/eslint-patch": ^1.1.4 From a207afa79e5fa7b16f41a318f24d11e4e132d91d Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 16:27:48 +0000 Subject: [PATCH 2/3] WIP --- .../aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts | 2 +- yarn-project/aztec-rpc/tsconfig.json | 3 +++ yarn-project/boxes/private-token/tsconfig.json | 6 ------ yarn-project/noir-compiler/src/noir-version.ts | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts index 7cc6f915eb9..ee0275850d6 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts @@ -307,7 +307,7 @@ export class AztecRPCServer implements AztecRPC { chainId, rollupAddress, client: this.clientInfo, - nargoVersion: NoirVersion.default.commit, + nargoVersion: NoirVersion.commit, }; } diff --git a/yarn-project/aztec-rpc/tsconfig.json b/yarn-project/aztec-rpc/tsconfig.json index 3969b165c61..8f298d5722d 100644 --- a/yarn-project/aztec-rpc/tsconfig.json +++ b/yarn-project/aztec-rpc/tsconfig.json @@ -18,6 +18,9 @@ { "path": "../key-store" }, + { + "path": "../noir-compiler" + }, { "path": "../types" } diff --git a/yarn-project/boxes/private-token/tsconfig.json b/yarn-project/boxes/private-token/tsconfig.json index 5d087f2521d..cc958d6c6f1 100644 --- a/yarn-project/boxes/private-token/tsconfig.json +++ b/yarn-project/boxes/private-token/tsconfig.json @@ -41,12 +41,6 @@ }, { "path": "../../foundation" - }, - { - "path": "../../noir-compiler" - }, - { - "path": "../../types" } ] } diff --git a/yarn-project/noir-compiler/src/noir-version.ts b/yarn-project/noir-compiler/src/noir-version.ts index ced32a2105a..aad45f07eef 100644 --- a/yarn-project/noir-compiler/src/noir-version.ts +++ b/yarn-project/noir-compiler/src/noir-version.ts @@ -1,3 +1,3 @@ import * as version from './noir-version.json' assert { type: 'json' }; -export default version; +export default version.default; From b214096f9df54c49d8a0066c257ba5683fdba845 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 16:52:27 +0000 Subject: [PATCH 3/3] fix --- yarn-project/cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/cli/README.md b/yarn-project/cli/README.md index 87f643a669f..c3dd94eb054 100644 --- a/yarn-project/cli/README.md +++ b/yarn-project/cli/README.md @@ -441,7 +441,7 @@ Gets information of an Aztec node at the specified URL. Syntax: -```shel +```shell aztec-cli get-node-info ```