Skip to content

Commit 34744bd

Browse files
committed
refactoring + traceinspector
Signed-off-by: Angelo De Caro <[email protected]>
1 parent 306516e commit 34744bd

File tree

18 files changed

+597
-143
lines changed

18 files changed

+597
-143
lines changed

docs/benchmark/dlognogh/dlognogh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Example results have been produced on an Apple M1 Max and can be consulted [here
117117
This is a test that runs multiple instances of the above benchmark in parallel.
118118
This allows the analyst to understand if shared data structures are actual bottlenecks.
119119

120-
It uses a custom-made runner whose documentation can be found [here](../../../token/core/common/benchmark/runner.md).
120+
It uses a custom-made runner whose documentation can be found [here](../../../token/services/benchmark/runner.md).
121121

122122
```shell
123123
go test ./token/core/zkatdlog/nogh/v1/transfer -test.run=TestParallelBenchmarkSender -test.v -test.benchmem -test.timeout 0 -bits="32" -curves="BN254" -num_inputs="2" -num_outputs="2" -workers="1,10" -duration="10s" | tee bench.txt

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require (
3535
go.uber.org/dig v1.18.0
3636
go.uber.org/zap v1.27.0
3737
golang.org/x/crypto v0.45.0
38-
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
38+
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39
3939
golang.org/x/sync v0.18.0
4040
google.golang.org/protobuf v1.36.10
4141
gopkg.in/yaml.v2 v2.4.0
@@ -282,14 +282,14 @@ require (
282282
go.uber.org/multierr v1.11.0 // indirect
283283
go.yaml.in/yaml/v3 v3.0.4 // indirect
284284
golang.org/x/arch v0.11.0 // indirect
285-
golang.org/x/mod v0.29.0 // indirect
285+
golang.org/x/mod v0.30.0 // indirect
286286
golang.org/x/net v0.47.0 // indirect
287287
golang.org/x/oauth2 v0.30.0 // indirect
288288
golang.org/x/sys v0.38.0 // indirect
289-
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect
289+
golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54 // indirect
290290
golang.org/x/text v0.31.0 // indirect
291291
golang.org/x/time v0.8.0 // indirect
292-
golang.org/x/tools v0.38.0 // indirect
292+
golang.org/x/tools v0.39.0 // indirect
293293
gonum.org/v1/gonum v0.16.0 // indirect
294294
google.golang.org/api v0.215.0 // indirect
295295
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,8 +1702,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
17021702
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
17031703
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
17041704
golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
1705-
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
1706-
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
1705+
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39 h1:DHNhtq3sNNzrvduZZIiFyXWOL9IWaDPHqTnLJp+rCBY=
1706+
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=
17071707
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
17081708
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
17091709
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
@@ -1750,8 +1750,8 @@ golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
17501750
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
17511751
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
17521752
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
1753-
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
1754-
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
1753+
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
1754+
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
17551755
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
17561756
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
17571757
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1975,8 +1975,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19751975
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
19761976
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
19771977
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
1978-
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 h1:LvzTn0GQhWuvKH/kVRS3R3bVAsdQWI7hvfLHGgh9+lU=
1979-
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE=
1978+
golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54 h1:E2/AqCUMZGgd73TQkxUMcMla25GB9i/5HOdLr+uH7Vo=
1979+
golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ=
19801980
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
19811981
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
19821982
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -2095,8 +2095,8 @@ golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
20952095
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
20962096
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
20972097
golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
2098-
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
2099-
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
2098+
golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
2099+
golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=
21002100
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
21012101
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
21022102
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

token/core/zkatdlog/nogh/v1/issue/issuer_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import (
1111
"testing"
1212

1313
math "github.com/IBM/mathlib"
14-
"github.com/hyperledger-labs/fabric-token-sdk/token/core/common/benchmark"
1514
math2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/common/crypto/math"
1615
issue2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/issue"
1716
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/issue/mock"
1817
v1 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/setup"
1918
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/token"
19+
benchmark2 "github.com/hyperledger-labs/fabric-token-sdk/token/services/benchmark"
2020
"github.com/stretchr/testify/assert"
2121
"github.com/stretchr/testify/require"
2222
)
@@ -45,12 +45,12 @@ func TestIssuer(t *testing.T) {
4545
}
4646

4747
func BenchmarkIssuer(b *testing.B) {
48-
bits, err := benchmark.Bits(32, 64)
48+
bits, err := benchmark2.Bits(32, 64)
4949
require.NoError(b, err)
50-
curves := benchmark.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
51-
outputs, err := benchmark.NumOutputs(1, 2, 3)
50+
curves := benchmark2.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
51+
outputs, err := benchmark2.NumOutputs(1, 2, 3)
5252
require.NoError(b, err)
53-
testCases := benchmark.GenerateCases(bits, curves, nil, outputs, nil)
53+
testCases := benchmark2.GenerateCases(bits, curves, nil, outputs, nil)
5454

5555
for _, tc := range testCases {
5656
b.Run(tc.Name, func(b *testing.B) {
@@ -76,12 +76,12 @@ func BenchmarkIssuer(b *testing.B) {
7676
}
7777

7878
func BenchmarkProofVerificationIssuer(b *testing.B) {
79-
bits, err := benchmark.Bits(32, 64)
79+
bits, err := benchmark2.Bits(32, 64)
8080
require.NoError(b, err)
81-
curves := benchmark.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
82-
outputs, err := benchmark.NumOutputs(1, 2, 3)
81+
curves := benchmark2.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
82+
outputs, err := benchmark2.NumOutputs(1, 2, 3)
8383
require.NoError(b, err)
84-
testCases := benchmark.GenerateCases(bits, curves, nil, outputs, nil)
84+
testCases := benchmark2.GenerateCases(bits, curves, nil, outputs, nil)
8585

8686
for _, tc := range testCases {
8787
b.Run(tc.Name, func(b *testing.B) {
@@ -158,7 +158,7 @@ type benchmarkIssuerEnv struct {
158158
IssuerEnvs []*issuerEnv
159159
}
160160

161-
func newBenchmarkIssuerEnv(b *testing.B, n int, benchmarkCase *benchmark.Case) *benchmarkIssuerEnv {
161+
func newBenchmarkIssuerEnv(b *testing.B, n int, benchmarkCase *benchmark2.Case) *benchmarkIssuerEnv {
162162
b.Helper()
163163
envs := make([]*issuerEnv, n)
164164
pp := setup(b, benchmarkCase.Bits, benchmarkCase.CurveID)
@@ -168,7 +168,7 @@ func newBenchmarkIssuerEnv(b *testing.B, n int, benchmarkCase *benchmark.Case) *
168168
return &benchmarkIssuerEnv{IssuerEnvs: envs}
169169
}
170170

171-
func newBenchmarkIssuerProofVerificationEnv(b *testing.B, n int, benchmarkCase *benchmark.Case) *benchmarkIssuerEnv {
171+
func newBenchmarkIssuerProofVerificationEnv(b *testing.B, n int, benchmarkCase *benchmark2.Case) *benchmarkIssuerEnv {
172172
b.Helper()
173173
envs := make([]*issuerEnv, n)
174174
pp := setup(b, benchmarkCase.Bits, benchmarkCase.CurveID)

token/core/zkatdlog/nogh/v1/transfer/sender_test.go

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ import (
1212
"runtime"
1313
"strconv"
1414
"testing"
15+
"time"
1516

1617
math "github.com/IBM/mathlib"
1718
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
18-
"github.com/hyperledger-labs/fabric-token-sdk/token/core/common/benchmark"
1919
math2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/common/crypto/math"
2020
v1 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/setup"
2121
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/token"
2222
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/transfer"
2323
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/transfer/mock"
2424
"github.com/hyperledger-labs/fabric-token-sdk/token/driver"
25+
benchmark2 "github.com/hyperledger-labs/fabric-token-sdk/token/services/benchmark"
2526
token2 "github.com/hyperledger-labs/fabric-token-sdk/token/token"
2627
"github.com/stretchr/testify/assert"
2728
"github.com/stretchr/testify/require"
@@ -65,14 +66,14 @@ func TestSender(t *testing.T) {
6566
// BenchmarkSender benchmarks transfer action generation and serialization.
6667
// This includes the proof generation as well.
6768
func BenchmarkSender(b *testing.B) {
68-
bits, err := benchmark.Bits(32, 64)
69+
bits, err := benchmark2.Bits(32, 64)
6970
require.NoError(b, err)
70-
curves := benchmark.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
71-
inputs, err := benchmark.NumInputs(1, 2, 3)
71+
curves := benchmark2.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
72+
inputs, err := benchmark2.NumInputs(1, 2, 3)
7273
require.NoError(b, err)
73-
outputs, err := benchmark.NumOutputs(1, 2, 3)
74+
outputs, err := benchmark2.NumOutputs(1, 2, 3)
7475
require.NoError(b, err)
75-
testCases := benchmark.GenerateCases(bits, curves, inputs, outputs, []int{1})
76+
testCases := benchmark2.GenerateCases(bits, curves, inputs, outputs, []int{1})
7677

7778
for _, tc := range testCases {
7879
b.Run(tc.Name, func(b *testing.B) {
@@ -100,37 +101,39 @@ func BenchmarkSender(b *testing.B) {
100101

101102
// TestParallelBenchmarkSender benchmarks transfer action generation and serialization when multiple go routines are doing the same thing.
102103
func TestParallelBenchmarkSender(t *testing.T) {
103-
bits, err := benchmark.Bits(32)
104+
bits, err := benchmark2.Bits(32)
104105
require.NoError(t, err)
105-
curves := benchmark.Curves(math.BN254)
106-
inputs, err := benchmark.NumInputs(2)
106+
curves := benchmark2.Curves(math.BN254)
107+
inputs, err := benchmark2.NumInputs(2)
107108
require.NoError(t, err)
108-
outputs, err := benchmark.NumOutputs(2)
109+
outputs, err := benchmark2.NumOutputs(2)
109110
require.NoError(t, err)
110-
workers, err := benchmark.Workers(runtime.NumCPU())
111+
workers, err := benchmark2.Workers(runtime.NumCPU())
111112
require.NoError(t, err)
112-
testCases := benchmark.GenerateCases(bits, curves, inputs, outputs, workers)
113+
testCases := benchmark2.GenerateCases(bits, curves, inputs, outputs, workers)
113114

114115
for _, tc := range testCases {
115116
t.Run(tc.Name, func(t *testing.T) {
116-
r := benchmark.RunBenchmark(
117+
r := benchmark2.RunBenchmark(
117118
tc.BenchmarkCase.Workers,
118-
benchmark.Duration(),
119+
benchmark2.Duration(),
120+
3*time.Second,
119121
func() *benchmarkSenderEnv {
120122
env, err := newBenchmarkSenderEnv(1, tc.BenchmarkCase)
121123
require.NoError(t, err)
122124
return env
123125
},
124-
func(env *benchmarkSenderEnv) {
126+
func(env *benchmarkSenderEnv) error {
125127
transfer, _, err := env.SenderEnvs[0].sender.GenerateZKTransfer(
126128
t.Context(),
127129
env.SenderEnvs[0].outvalues,
128130
env.SenderEnvs[0].owners,
129131
)
130-
require.NoError(t, err)
131-
assert.NotNil(t, transfer)
132+
if err != nil {
133+
return err
134+
}
132135
_, err = transfer.Serialize()
133-
require.NoError(t, err)
136+
return err
134137
},
135138
)
136139
r.Print()
@@ -140,14 +143,14 @@ func TestParallelBenchmarkSender(t *testing.T) {
140143

141144
// BenchmarkVerificationSenderProof benchmarks transfer action deserialization and proof verification.
142145
func BenchmarkVerificationSenderProof(b *testing.B) {
143-
bits, err := benchmark.Bits(32, 64)
146+
bits, err := benchmark2.Bits(32, 64)
144147
require.NoError(b, err)
145-
curves := benchmark.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
146-
inputs, err := benchmark.NumInputs(1, 2, 3)
148+
curves := benchmark2.Curves(math.BN254, math.BLS12_381_BBS_GURVY, math2.BLS12_381_BBS_GURVY_FAST_RNG)
149+
inputs, err := benchmark2.NumInputs(1, 2, 3)
147150
require.NoError(b, err)
148-
outputs, err := benchmark.NumOutputs(1, 2, 3)
151+
outputs, err := benchmark2.NumOutputs(1, 2, 3)
149152
require.NoError(b, err)
150-
testCases := benchmark.GenerateCases(bits, curves, inputs, outputs, []int{1})
153+
testCases := benchmark2.GenerateCases(bits, curves, inputs, outputs, []int{1})
151154

152155
for _, tc := range testCases {
153156
b.Run(tc.Name, func(b *testing.B) {
@@ -182,44 +185,45 @@ func BenchmarkVerificationSenderProof(b *testing.B) {
182185

183186
// TestParallelBenchmarkVerificationSenderProof benchmarks transfer action deserialization and proof verification when multiple go routines are doing the same thing.
184187
func TestParallelBenchmarkVerificationSenderProof(t *testing.T) {
185-
bits, err := benchmark.Bits(32)
188+
bits, err := benchmark2.Bits(32)
186189
require.NoError(t, err)
187-
curves := benchmark.Curves(math.BN254)
188-
inputs, err := benchmark.NumInputs(2)
190+
curves := benchmark2.Curves(math.BN254)
191+
inputs, err := benchmark2.NumInputs(2)
189192
require.NoError(t, err)
190-
outputs, err := benchmark.NumOutputs(2)
193+
outputs, err := benchmark2.NumOutputs(2)
191194
require.NoError(t, err)
192-
workers, err := benchmark.Workers(runtime.NumCPU())
195+
workers, err := benchmark2.Workers(runtime.NumCPU())
193196
require.NoError(t, err)
194-
testCases := benchmark.GenerateCases(bits, curves, inputs, outputs, workers)
197+
testCases := benchmark2.GenerateCases(bits, curves, inputs, outputs, workers)
195198

196199
for _, tc := range testCases {
197200
t.Run(tc.Name, func(t *testing.T) {
198-
r := benchmark.RunBenchmark(
201+
r := benchmark2.RunBenchmark(
199202
tc.BenchmarkCase.Workers,
200-
benchmark.Duration(),
203+
benchmark2.Duration(),
204+
3*time.Second,
201205
func() *benchmarkSenderEnv {
202206
env, err := newBenchmarkSenderProofVerificationEnv(t.Context(), 1, tc.BenchmarkCase)
203207
require.NoError(t, err)
204208
return env
205209
},
206-
func(env *benchmarkSenderEnv) {
210+
func(env *benchmarkSenderEnv) error {
207211
// deserialize action
208212
ta := &transfer.Action{}
209-
require.NoError(t, ta.Deserialize(env.SenderEnvs[0].transferRaw))
213+
if err := ta.Deserialize(env.SenderEnvs[0].transferRaw); err != nil {
214+
return err
215+
}
210216
inputTokens := make([]*math.G1, len(ta.Inputs))
211217
for j, in := range ta.Inputs {
212218
inputTokens[j] = in.Token.Data
213219
}
214220

215221
// instantiate the verifier and verify
216-
require.NoError(t,
217-
transfer.NewVerifier(
218-
inputTokens,
219-
ta.GetOutputCommitments(),
220-
env.SenderEnvs[0].sender.PublicParams,
221-
).Verify(ta.GetProof()),
222-
)
222+
return transfer.NewVerifier(
223+
inputTokens,
224+
ta.GetOutputCommitments(),
225+
env.SenderEnvs[0].sender.PublicParams,
226+
).Verify(ta.GetProof())
223227
},
224228
)
225229
r.Print()
@@ -329,7 +333,7 @@ type benchmarkSenderEnv struct {
329333
SenderEnvs []*senderEnv
330334
}
331335

332-
func newBenchmarkSenderEnv(n int, benchmarkCase *benchmark.Case) (*benchmarkSenderEnv, error) {
336+
func newBenchmarkSenderEnv(n int, benchmarkCase *benchmark2.Case) (*benchmarkSenderEnv, error) {
333337
envs := make([]*senderEnv, n)
334338
pp, err := setup(benchmarkCase.Bits, benchmarkCase.CurveID)
335339
if err != nil {
@@ -344,7 +348,7 @@ func newBenchmarkSenderEnv(n int, benchmarkCase *benchmark.Case) (*benchmarkSend
344348
return &benchmarkSenderEnv{SenderEnvs: envs}, nil
345349
}
346350

347-
func newBenchmarkSenderProofVerificationEnv(ctx context.Context, n int, benchmarkCase *benchmark.Case) (*benchmarkSenderEnv, error) {
351+
func newBenchmarkSenderProofVerificationEnv(ctx context.Context, n int, benchmarkCase *benchmark2.Case) (*benchmarkSenderEnv, error) {
348352
envs := make([]*senderEnv, n)
349353
pp, err := setup(benchmarkCase.Bits, benchmarkCase.CurveID)
350354
if err != nil {

0 commit comments

Comments
 (0)