Skip to content

Commit dc5366d

Browse files
authored
Reduce public params, release crates (#20)
* add noise estimation * add pub param dedup * fix noise estimates * add better paramset * Make backwards compatible * Fix CI and server * Prepare for spiral-server crate * update lock * Deps * Do prerelease * Update dependency * Fix version * Deps * More fixes * Bump ver * Prepare for release
1 parent 537c01a commit dc5366d

File tree

28 files changed

+846
-400
lines changed

28 files changed

+846
-400
lines changed

e2e-tests/main.ts

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,58 @@ const { spawn } = require('child_process');
55

66
process.removeAllListeners('warning');
77

8-
function spawnChildProcess(): Promise<ChildProcess> {
8+
function spawnChildProcess(
9+
port: string,
10+
paramsFilename: string
11+
): Promise<ChildProcess> {
912
let seen = '';
1013
return new Promise(resolve => {
11-
const child = spawn(process.argv[2]);
14+
const child = spawn(process.argv[2], [
15+
port,
16+
process.argv[3] + '/' + paramsFilename
17+
]);
1218
process.on('exit', function () {
1319
child.kill();
1420
});
1521
child.stdout.on('data', chunk => {
22+
// process.stdout.write(chunk);
1623
seen += chunk;
17-
if (seen.includes('Listening')) {
24+
if (seen.includes('Listening on ' + port)) {
1825
resolve(child);
1926
}
2027
});
28+
child.stderr.on('data', chunk => {
29+
console.log(chunk.toString());
30+
});
2131
});
2232
}
2333

24-
async function main() {
25-
const child = await spawnChildProcess();
34+
const paramsFilenames = ['v0.json', 'v1.json'];
35+
36+
async function runTests(port: string, paramsFilename: string) {
37+
const child = await spawnChildProcess(port, paramsFilename);
38+
await new Promise(resolve => setTimeout(resolve, 1000));
2639

27-
await simple();
40+
await simple(port);
2841

29-
console.log('Tests completed successfully.');
42+
const promise: Promise<void> = new Promise(resolve => {
43+
child.on('exit', () => {
44+
resolve();
45+
});
46+
});
3047

3148
child.kill();
49+
50+
await promise;
51+
}
52+
53+
async function main() {
54+
let portStart = 8008;
55+
for (const paramsFilename of paramsFilenames) {
56+
await runTests('' + portStart++, paramsFilename);
57+
console.log('Completed tests for ' + paramsFilename);
58+
}
59+
console.log('All tests completed successfully.');
3260
}
3361

3462
main();

e2e-tests/params/v0.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"n": 4,
3+
"nu_1": 9,
4+
"nu_2": 5,
5+
"p": 256,
6+
"q2_bits": 20,
7+
"t_gsw": 8,
8+
"t_conv": 4,
9+
"t_exp_left": 8,
10+
"t_exp_right": 56,
11+
"instances": 1,
12+
"db_item_size": 32768
13+
}

e2e-tests/params/v1.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"n": 2,
3+
"nu_1": 9,
4+
"nu_2": 5,
5+
"p": 256,
6+
"q2_bits": 22,
7+
"t_gsw": 7,
8+
"t_conv": 3,
9+
"t_exp_left": 5,
10+
"t_exp_right": 5,
11+
"instances": 4,
12+
"db_item_size": 32768,
13+
"version": 1
14+
}

e2e-tests/tests/simple.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import type { Bucket } from '@blyss/sdk';
22
const blyss = require('@blyss/sdk/node');
33

4-
export default async function main() {
4+
export default async function main(port: string) {
55
const bucket: Bucket = await blyss.Bucket.initializeLocal(
6-
'http://localhost:8008'
6+
'http://localhost:' + port
77
);
88

9+
console.log(bucket.metadata);
10+
911
await bucket.write({
1012
Ohio: 'Columbus',
1113
California: 'Sacramento'

js/bridge/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/blyss-rs/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/blyss-rs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ hex = "0.4.3"
1919
reqwest = { version = "0.11.16", default-features = false, features = ["multipart", "rustls-tls"] }
2020
serde = { version = "1.0.159", features = ["derive"] }
2121
serde_json = "1.0.95"
22-
spiral-rs = { version = "0.2.0" }
22+
spiral-rs = { version = "0.2.1-alpha.2" }
2323
thiserror = "1.0.40"
2424
tokio = { version = "1", features = ["macros"] }
2525
ruint = { version = "1.2.0", features = ["serde", "num-bigint", "ark-ff"] }

lib/blyss-rs/src/bin/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub async fn main() {
55
// Fetches a proof for the "0x06eaa1..." identity commitment, at index 700000
66
let proof = private_fetch_merkle_proof(
77
"0x06eaa1912c3c31b6c2063e397faaba5ad43052812d5051c9b731c5618fe02c6d",
8-
"https://blyss-hints.s3.us-east-2.amazonaws.com/lookup-cfg.json",
8+
"https://blyss-hints.s3.us-east-2.amazonaws.com/lookup-cfg-alt.json",
99
)
1010
.await;
1111
println!("{:?}", proof);

0 commit comments

Comments
 (0)