Skip to content

Commit

Permalink
update some go dependencies to avoid vulnerabilities and improve READ…
Browse files Browse the repository at this point in the history
…ME (#7)
  • Loading branch information
lightning-li authored Feb 16, 2023
1 parent c2b19bd commit 342db8a
Show file tree
Hide file tree
Showing 3 changed files with 655 additions and 167 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ where `/server/docker_data/` is directory in the host machine which is used to p
The `keygen` service is for generating zk related keys which are used to generate and verify zk proof. The `BatchCreateUserOpsCounts` constant variable in utils package represent how many users can be created in one batch.
The larger the `BatchCreateUserOpsCounts` is, the longer it will take to generate zk-related keys and generate zk proof.

We choose `512` as the `BatchCreateUserOpsCounts` variable. It will take about 3 hours to generate zk-related keys, and 55 seconds to generate zk proof for one batch in a 128GB memory and 32 core virtual machine.
We choose `864` as the `BatchCreateUserOpsCounts` variable. It will take about 6 hours to generate zk-related keys, and 105 seconds to generate zk proof for one batch in a 128GB memory and 32 core virtual machine.

Run the following commands to start `keygen` service:
```
Expand All @@ -40,15 +40,15 @@ cd src/keygen; go run main.go
After `keygen` service finishes running, there will be several key files generated in the current directory, like the following:
```shell
Total 26G
-rw-rw-r-- 1 ec2-user ec2-user 69M 12月 26 07:49 zkpor512.ccs.ct.save
-rw-rw-r-- 1 ec2-user ec2-user 16G 12月 26 07:51 zkpor512.ccs.save
-rw-rw-r-- 1 ec2-user ec2-user 1.8G 12月 26 07:51 zkpor512.pk.A.save
-rw-rw-r-- 1 ec2-user ec2-user 1.6G 12月 26 07:51 zkpor512.pk.B1.save
-rw-rw-r-- 1 ec2-user ec2-user 3.2G 12月 26 07:51 zkpor512.pk.B2.save
-rw-rw-r-- 1 ec2-user ec2-user 59M 12月 26 07:51 zkpor512.pk.E.save
-rw-rw-r-- 1 ec2-user ec2-user 1.9G 12月 26 07:52 zkpor512.pk.K.save
-rw-rw-r-- 1 ec2-user ec2-user 708 12月 26 07:52 zkpor512.vk.save
-rw-rw-r-- 1 ec2-user ec2-user 2.1G 12月 26 07:52 zkpor512.pk.Z.save
-rw-rw-r-- 1 ec2-user ec2-user 69M 12月 26 07:49 zkpor864.ccs.ct.save
-rw-rw-r-- 1 ec2-user ec2-user 16G 12月 26 07:51 zkpor864.ccs.save
-rw-rw-r-- 1 ec2-user ec2-user 1.8G 12月 26 07:51 zkpor864.pk.A.save
-rw-rw-r-- 1 ec2-user ec2-user 1.6G 12月 26 07:51 zkpor864.pk.B1.save
-rw-rw-r-- 1 ec2-user ec2-user 3.2G 12月 26 07:51 zkpor864.pk.B2.save
-rw-rw-r-- 1 ec2-user ec2-user 59M 12月 26 07:51 zkpor864.pk.E.save
-rw-rw-r-- 1 ec2-user ec2-user 1.9G 12月 26 07:52 zkpor864.pk.K.save
-rw-rw-r-- 1 ec2-user ec2-user 708 12月 26 07:52 zkpor864.vk.save
-rw-rw-r-- 1 ec2-user ec2-user 2.1G 12月 26 07:52 zkpor864.pk.Z.save
```

### Generate witness
Expand Down Expand Up @@ -103,7 +103,7 @@ The `prover` service is used to generate zk proof and supports running in parall
"Host": "127.0.0.1:6379",
"Type": "node"
},
"ZkKeyName": "/server/zkmerkle-proof-of-solvency/src/keygen/zkpor512"
"ZkKeyName": "/server/zkmerkle-proof-of-solvency/src/keygen/zkpor864"
}
```

Expand Down Expand Up @@ -249,6 +249,6 @@ Compare the account tree root in the output log with the account tree root by `w

#### check postgresql table consistency

Suppose the number of users is `accountsNum`, and `batchNumber` is 512, so the number of rows in `witness` and `proof` table is: `(accountNum + 512 - 1) / 512`. And the number of rows in `userproof` table equals to `accountsNum`.
Suppose the number of users is `accountsNum`, and `batchNumber` is 864, so the number of rows in `witness` and `proof` table is: `(accountNum + 864 - 1) / 864`. And the number of rows in `userproof` table equals to `accountsNum`.

When all services run finished, Check that the number of rows in table is as expected.
34 changes: 15 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ require (
github.com/go-redis/redis/v8 v8.11.5
github.com/gocarina/gocsv v0.0.0-20230123225133-763e25b40669
github.com/shopspring/decimal v1.3.1
github.com/stretchr/testify v1.8.0
github.com/zeromicro/go-zero v1.4.2
gorm.io/driver/postgres v1.4.5
gorm.io/gorm v1.24.2
github.com/stretchr/testify v1.8.1
github.com/zeromicro/go-zero v1.4.4
gorm.io/driver/postgres v1.4.7
gorm.io/gorm v1.24.5
)

require (
Expand All @@ -30,7 +30,7 @@ require (
github.com/aws/smithy-go v1.13.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/ethereum/go-ethereum v1.10.26 // indirect
Expand All @@ -41,24 +41,19 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20221011183528-d4900dc688bf // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.13.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.12.0 // indirect
github.com/jackc/pgx/v4 v4.17.2 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.2.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.4 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/openzipkin/zipkin-go v0.4.0 // indirect
github.com/panjf2000/ants/v2 v2.5.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
Expand All @@ -73,16 +68,17 @@ require (
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.11.0 // indirect
go.opentelemetry.io/otel/sdk v1.11.0 // indirect
go.opentelemetry.io/otel/trace v1.11.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/automaxprocs v1.5.1 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220602131408-e326c6e8e9c8 // indirect
golang.org/x/crypto v0.4.0 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 342db8a

Please sign in to comment.