Skip to content

Commit

Permalink
[RC1] Update harness tests for Sepolia (#10)
Browse files Browse the repository at this point in the history
* Update harness tests for sepolia

* Update workflow

* rebase to rc1; Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Fix merge conflicts

* Spacing

* Update tests

* Fix merge conflict

* fix merge conflicts

* Update packages for rc

* Add rc1 branch to workflow

* Try setting baseUrl

* Update defaults to use tools constants

* Align core package

* Align core package imports

* Update packages and imports
  • Loading branch information
ytham authored Dec 29, 2023
1 parent 85da511 commit 612395b
Show file tree
Hide file tree
Showing 160 changed files with 2,864 additions and 1,077 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- rc1
pull_request:

jobs:
Expand Down Expand Up @@ -54,11 +55,20 @@ jobs:
working-directory: ./harness
run: npm install

- name: Run Integration Tests
# - name: Run Integration Tests (Goerli)
# working-directory: ./harness
# run: |
# export PROVIDER_URI_GOERLI=${{ secrets.PROVIDER_URI_GOERLI }}
# ANVIL_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
# export PRIVATE_KEY=$ANVIL_PRIVATE_KEY # just needs to be in the correct format, no tx is sent in unit tests
# export PRIVATE_KEY_GOERLI=$ANVIL_PRIVATE_KEY
# npm run test test/integration/goerli.test.ts

- name: Run Integration Tests (Sepolia)
working-directory: ./harness
run: |
export PROVIDER_URI_GOERLI=${{ secrets.PROVIDER_URI_GOERLI }}
export PROVIDER_URI_SEPOLIA=${{ secrets.PROVIDER_URI_SEPOLIA }}
ANVIL_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
export PRIVATE_KEY=$ANVIL_PRIVATE_KEY # just needs to be in the correct format, no tx is sent in unit tests
export PRIVATE_KEY_GOERLI=$ANVIL_PRIVATE_KEY
npm run test
export PRIVATE_KEY_SEPOLIA=$ANVIL_PRIVATE_KEY
npm run test test/integration/sepolia.test.ts
6 changes: 3 additions & 3 deletions circuit/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axiom-crypto/circuit",
"version": "0.1.4-alpha.1",
"version": "0.1.5-rc.0",
"author": "Intrinsic Technologies",
"license": "MIT",
"description": "Client SDK to write custom queries for Axiom, the ZK Coprocessor for Ethereum.",
Expand All @@ -24,10 +24,10 @@
"crypto"
],
"dependencies": {
"@axiom-crypto/core": "2.2.51-alpha.1",
"@axiom-crypto/core": "2.2.51-rc.1",
"@axiom-crypto/halo2-lib-js": "0.2.13-alpha.1",
"@axiom-crypto/halo2-wasm": "0.2.10",
"@axiom-crypto/tools": "0.3.34-alpha.2",
"@axiom-crypto/tools": "0.3.35-rc.1",
"commander": "^11.1.0",
"ethers": "^6.8.1",
"viem": "^1.19.9"
Expand Down
13 changes: 11 additions & 2 deletions circuit/js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions circuit/js/src/cliHandler/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const run = async (path: string, options: { stats: boolean, build: string
const computeResults = circuit.getComputeResults();
const dataQuery = circuit.getDataQuery();
const res = {
sourceChainId: circuit.getChainId(),
computeQuery,
computeResults,
dataQuery,
Expand Down
6 changes: 3 additions & 3 deletions circuit/js/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const COMPUTE_NUM_INSTANCES = USER_COMPUTE_NUM_INSTANCES + SUBQUERY_NUM_I

export const DEFAULT_CIRCUIT_CONFIG = {
k: 14,
numAdvice: 4,
numLookupAdvice: 1,
numInstance: 1,
numAdvice: AxiomV2CircuitConstant.UserAdviceCols,
numLookupAdvice: AxiomV2CircuitConstant.UserLookupAdviceCols,
numInstance: AxiomV2CircuitConstant.UserInstanceCols,
numLookupBits: 13,
numVirtualInstance: 2,
};
4 changes: 4 additions & 0 deletions circuit/js/src/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ export abstract class AxiomBaseCircuitScaffold<T> extends BaseCircuitScaffold {
return this.dataQuery;
}

getChainId() {
return this.chainId;
}

setMock(mock: boolean) {
this.axiom = new Axiom({
providerUri: this.provider,
Expand Down
3 changes: 2 additions & 1 deletion circuit/js/test/unit/encoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ describe("Encoder", () => {
maxOutputs: AxiomV2CircuitConstant.UserMaxOutputs,
isAggregation: false,
}
console.log("DEFAULT_METADATA", DEFAULT_METADATA);
const encoded = encodeAxiomV2CircuitMetadata(DEFAULT_METADATA);
const expected = "0x0001000009000100000004010000010080000000000000000000000000000000";
const expected = "0x0001000009000100000014030000010080000000000000000000000000000000";
expect(encoded).toEqual(expected);
});
});
2 changes: 1 addition & 1 deletion circuit/js/test/unit/scaffold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("Scaffold", () => {
const _artifact = await testCircuit.compile(defaultInputs);
const computeQuery = await testCircuit.run(defaultInputs);

expect(computeQuery.vkey[0]).toEqual("0x0001000009000100000004010000010080000000000000000000000000000000");
expect(computeQuery.vkey[0]).toEqual("0x0001000009000100000014030000010080000000000000000000000000000000");
expect(computeQuery.computeProof.slice(2).slice(0,128)).toEqual(concat([zeroHash, zeroHash]).slice(2));
}, 30000);
});
8 changes: 4 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axiom-crypto/client",
"version": "0.1.4-alpha.1",
"version": "0.1.5-rc.0",
"author": "Intrinsic Technologies",
"license": "MIT",
"description": "Client SDK to write custom queries for Axiom, the ZK Coprocessor for Ethereum.",
Expand All @@ -23,11 +23,11 @@
"crypto"
],
"dependencies": {
"@axiom-crypto/circuit": "0.1.4-alpha.1",
"@axiom-crypto/core": "2.2.51-alpha.1",
"@axiom-crypto/circuit": "0.1.5-rc.1",
"@axiom-crypto/core": "2.2.51-rc.1",
"@axiom-crypto/halo2-lib-js": "0.2.13-alpha.1",
"@axiom-crypto/halo2-wasm": "0.2.10",
"@axiom-crypto/tools": "0.3.34-alpha.2",
"@axiom-crypto/tools": "0.3.35-rc.1",
"commander": "^11.1.0",
"ethers": "^6.8.1",
"viem": "^1.19.9"
Expand Down
55 changes: 15 additions & 40 deletions client/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is an autogenerated file. It should match the version number in package.json.
// Do not modify this file directly.

export const CLIENT_VERSION = "0.1.4-alpha.1";
export const CLIENT_VERSION = "0.1.5-rc.0";
1 change: 1 addition & 0 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "ES2020",
"module": "CommonJS",
"moduleResolution": "node",
Expand Down
2 changes: 2 additions & 0 deletions harness/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PROVIDER_URI_GOERLI=
PROVIDER_URI_SEPOLIA=
8 changes: 5 additions & 3 deletions harness/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axiom-crypto/harness",
"version": "0.1.4",
"version": "0.1.7-rc.0",
"author": "Intrinsic Technologies",
"license": "MIT",
"description": "Circuit harness for axiom-client",
Expand All @@ -9,7 +9,7 @@
"test": "jest"
},
"bin": {
"harness": "./index.js"
"harness": "./cli/index.js"
},
"publishConfig": {
"directory": "dist"
Expand All @@ -23,7 +23,6 @@
"crypto"
],
"dependencies": {
"@axiom-crypto/client": "file:../client/dist",
"@axiom-crypto/core": "^2.2.50",
"@axiom-crypto/halo2-lib-js": "0.2.13-alpha.1",
"@axiom-crypto/halo2-wasm": "0.2.10",
Expand All @@ -42,5 +41,8 @@
"tslib": "^2.6.2",
"tsx": "^4.6.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
"@axiom-crypto/client": "0.1.5-rc.0"
}
}
Loading

0 comments on commit 612395b

Please sign in to comment.