Skip to content

Commit

Permalink
feat: exposing nargo version via NodeInfo (#2333)
Browse files Browse the repository at this point in the history
Fixes #2332
  • Loading branch information
benesjan authored Sep 15, 2023
1 parent 38c7979 commit 1c2669c
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions yarn-project/aztec-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -306,6 +307,7 @@ export class AztecRPCServer implements AztecRPC {
chainId,
rollupAddress,
client: this.clientInfo,
nargoVersion: NoirVersion.commit,
};
}

Expand Down
3 changes: 3 additions & 0 deletions yarn-project/aztec-rpc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{
"path": "../key-store"
},
{
"path": "../noir-compiler"
},
{
"path": "../types"
}
Expand Down
8 changes: 7 additions & 1 deletion yarn-project/aztec.js/src/contract/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 0 additions & 6 deletions yarn-project/boxes/private-token/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@
},
{
"path": "../../foundation"
},
{
"path": "../../noir-compiler"
},
{
"path": "../../types"
}
]
}
2 changes: 1 addition & 1 deletion yarn-project/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ Gets information of an Aztec node at the specified URL.

Syntax:

```shel
```shell
aztec-cli get-node-info
```

Expand Down
3 changes: 2 additions & 1 deletion yarn-project/noir-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
3 changes: 3 additions & 0 deletions yarn-project/noir-compiler/src/noir-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as version from './noir-version.json' assert { type: 'json' };

export default version.default;
4 changes: 4 additions & 0 deletions yarn-project/types/src/interfaces/aztec_rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
1 change: 1 addition & 0 deletions yarn-project/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c2669c

Please sign in to comment.