2 Commits

Author SHA1 Message Date
Alexey
bf5581f764 changeTreeHeight script 2021-02-26 12:14:43 +03:00
Alexey
0cabd318cd pre production config 2021-02-26 11:17:13 +03:00
11 changed files with 19 additions and 10 deletions

View File

@@ -15,8 +15,9 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: yarn install
- run: cargo install zkutil
- run: yarn install
- run: yarn changeTreeHeight 2
- run: yarn circuit
- run: yarn test
- run: yarn lint

View File

@@ -87,5 +87,5 @@ function nthZero(n) {
if (n == 9) return 209436188287252095316293336871467217491997565239632454977424802439169726471;
}
var CHUNK_TREE_HEIGHT = 2
var CHUNK_TREE_HEIGHT = 8
component main = BatchTreeUpdate(20, CHUNK_TREE_HEIGHT, nthZero(CHUNK_TREE_HEIGHT))

View File

@@ -17,7 +17,7 @@ contract TornadoTrees {
ITornadoTreesV1 public immutable tornadoTreesV1;
// make sure CHUNK_TREE_HEIGHT has the same value in BatchTreeUpdate.circom
uint256 public constant CHUNK_TREE_HEIGHT = 2;
uint256 public constant CHUNK_TREE_HEIGHT = 8;
uint256 public constant CHUNK_SIZE = 2**CHUNK_TREE_HEIGHT;
uint256 public constant ITEM_SIZE = 32 + 20 + 4;
uint256 public constant BYTES_SIZE = 32 + 32 + 4 + CHUNK_SIZE * ITEM_SIZE;

View File

@@ -3,7 +3,7 @@
pragma solidity ^0.6.0;
contract Pack {
uint256 public constant CHUNK_TREE_HEIGHT = 7;
uint256 public constant CHUNK_TREE_HEIGHT = 8;
uint256 public constant CHUNK_SIZE = 2**CHUNK_TREE_HEIGHT;
uint256 public constant ITEM_SIZE = 32 + 20 + 4;
uint256 public constant BYTES_SIZE = CHUNK_SIZE * ITEM_SIZE;

View File

@@ -1,6 +1,6 @@
{
"name": "tornado-trees",
"version": "0.0.5",
"version": "0.0.6",
"main": "src/index.js",
"repository": "https://github.com/tornadocash/tornado-trees.git",
"author": "Tornadocash team <hello@tornado.cash>",
@@ -16,6 +16,7 @@
"prettier:check": "prettier --check . --config .prettierrc",
"prettier:fix": "prettier --write . --config .prettierrc",
"lint": "yarn eslint && yarn prettier:check",
"changeTreeHeight": "scripts/changeTreeHeight.sh",
"circuit:batchTreeUpdate": "scripts/buildCircuit.sh BatchTreeUpdate",
"circuit:batchTreeUpdateLarge": "scripts/buildCircuit.sh BatchTreeUpdate large",
"circuit:batchTreeUpdateWitness": "scripts/buildWitness.sh BatchTreeUpdate",

7
scripts/changeTreeHeight.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
case $(sed --help 2>&1) in
*GNU*) sed_i () { xargs sed -i "$@"; };;
*) sed_i () { xargs sed -i '' "$@"; };;
esac
grep -l --exclude-dir={.git,node_modules,artifacts} -r "CHUNK_TREE_HEIGHT = [0-9]" . | sed_i "s/CHUNK_TREE_HEIGHT = [0-9]/CHUNK_TREE_HEIGHT = ${1}/g"

View File

@@ -15,7 +15,7 @@ const instances = [
]
const blocks = ['0xaaaaaaaa', '0xbbbbbbbb', '0xcccccccc', '0xdddddddd']
const CHUNK_TREE_HEIGHT = 2
const CHUNK_TREE_HEIGHT = 8
const levels = 20
const nonRandomBN = (nonce = 0) =>

View File

@@ -15,7 +15,7 @@ const instances = [
]
const blocks = ['0xaaaaaaaa', '0xbbbbbbbb', '0xcccccccc', '0xdddddddd']
const CHUNK_TREE_HEIGHT = 2
const CHUNK_TREE_HEIGHT = 8
const levels = 20
const nonRandomBN = (nonce = 0) =>

View File

@@ -13,7 +13,7 @@ const hashes = [
'0x57f7b90a3cb4ea6860e6dd5fa44ac4f53ebe6ae3948af577a01ef51738313246',
]
const CHUNK_TREE_HEIGHT = 7
const CHUNK_TREE_HEIGHT = 8
describe.skip('Pack', () => {
it('should work', async () => {
const Pack = await ethers.getContractFactory('Pack')

View File

@@ -4,7 +4,7 @@ const { poseidonHash2, randomBN } = require('../src/utils')
const { batchTreeUpdate, prove } = require('../src/index')
const levels = 20
const CHUNK_TREE_HEIGHT = 2
const CHUNK_TREE_HEIGHT = 8
describe('Snark', () => {
it('should work', async () => {
const tree = new MerkleTree(levels, [], { hashFunction: poseidonHash2 })

View File

@@ -17,7 +17,7 @@ async function register(note, tornadoTrees, from) {
}
const levels = 20
const CHUNK_TREE_HEIGHT = 2
const CHUNK_TREE_HEIGHT = 8
const instances = [
'0x1111000000000000000000000000000000001111',