Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
avive committed Oct 25, 2018
1 parent 3cdead8 commit c156b25
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions internal/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import (
n= 25 total time = 2356.15s (29 minutes)
*/
*/
func TestBigNip(t *testing.T) {

x := make([]byte, 32)
_, err := rand.Read(x)
assert.NoError(t, err)

// with n=25 and 16GB ram:
// Map size: 67108863 entries ~20GB - runtime: 1034.77s
const n = 25
// Map size: 67108863 entries ~20GB in ram w map - runtime: 1034.77s
const n = 16

p, err := NewProver(x, n)
assert.NoError(t, err)
Expand All @@ -43,7 +43,7 @@ func TestBigNip(t *testing.T) {
res := v.Verify(c, proof)
assert.True(t, res, "failed to verify proof")

p.DeleteStore()
// p.DeleteStore()
})
}

Expand Down
6 changes: 3 additions & 3 deletions internal/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (p *SMProver) GetNonInteractiveProof() (Proof, error) {

func (p *SMProver) ComputeDag(callback shared.ProofCreatedFunc) {

N := math.Pow(2,float64(p.n+1)) - 1
N := math.Pow(2, float64(p.n+1)) - 1
fmt.Printf("Computing DAG(%d). Total nodes: %d\n", p.n, uint64(N))

rootLabel, err := p.computeDag(shared.RootIdentifier)
Expand Down Expand Up @@ -292,9 +292,9 @@ func (p *SMProver) computeLeafLabel(leafId Identifier) (shared.Label, error) {
// store it
p.writeLabel(leafId, label)

if bs.GetValue() % 100000 == 0 {
if bs.GetValue()%100000 == 0 {
i := bs.GetValue()
N := math.Pow(2,float64(p.n))
N := math.Pow(2, float64(p.n))
r := 100 * float64(i) / N

if r > 100 {
Expand Down
16 changes: 8 additions & 8 deletions internal/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (d *KVFileStore) init() error {

// create buffer with default buf size
// tood: compare pref w/o buffers
d.bw = bufio.NewWriterSize(f, 4096 * 100000)
d.bw = bufio.NewWriterSize(f, 4096)

return nil
}
Expand Down Expand Up @@ -148,14 +148,14 @@ func (d *KVFileStore) Write(id Identifier, l shared.Label) error {
//

/* no need to calc index or to WriteAt because writes are sequential
idx, err := d.calcFileIndex(id)
if err != nil {
return err
}
//fmt.Printf("Writing %d bytes in offset %d\n", len(l[:]), idx)
_, err = d.file.WriteAt(l[:], int64(idx))
idx, err := d.calcFileIndex(id)
if err != nil {
return err
}
//fmt.Printf("Writing %d bytes in offset %d\n", len(l[:]), idx)
_, err = d.file.WriteAt(l[:], int64(idx))
return err
*/
}

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func Playground() {

// with n=25 and 16GB ram:
// Map size: 67108863 entries ~20GB - runtime: 1034.77s
const n = 25
const n = 20

p, err := internal.NewProver(x, n)

Expand Down

0 comments on commit c156b25

Please sign in to comment.