Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c1fe6c1
Saving progress
Effi-S Feb 16, 2026
811645b
Using Issuer ZKP proof generation process
Effi-S Feb 16, 2026
d373be5
Started implementing node API
Effi-S Feb 18, 2026
7ea0216
Added BenchAPI
Effi-S Feb 18, 2026
76c3051
Added GRPC
Effi-S Feb 18, 2026
9c0a81d
Added client-server bench
Effi-S Feb 18, 2026
244d88a
Added missing license header
Effi-S Feb 18, 2026
7f86639
lint
Effi-S Feb 18, 2026
8920ae0
uint fix
Effi-S Feb 18, 2026
2d4af81
uint fgosec ix
Effi-S Feb 18, 2026
7733e37
gesec issue resolution
Effi-S Feb 18, 2026
f0c7bbf
Added some Unit tests
Effi-S Feb 18, 2026
0b99416
assert -> require
Effi-S Feb 18, 2026
33ddb73
Removed Unused numInputs
Effi-S Feb 19, 2026
f9f2325
Refactoring
Effi-S Feb 19, 2026
3934ad5
refactoring
Effi-S Feb 19, 2026
5eefe8f
Removed unused out
Effi-S Feb 19, 2026
10b67c2
Added viewPool
Effi-S Feb 22, 2026
e11e297
linter
Effi-S Feb 22, 2026
b450304
lint
Effi-S Feb 22, 2026
58fa76b
Added Proof Pre Compute
Effi-S Feb 22, 2026
fcca244
Added Over the wire proofs
Effi-S Feb 22, 2026
e04334c
Cleanups - more explicit proof generation
Effi-S Feb 23, 2026
9532b1b
refactoring and todos
Effi-S Feb 23, 2026
2c4d64a
Cleared up duplicate puParams
Effi-S Feb 23, 2026
65175fa
Forcing explicit proof generation
Effi-S Feb 23, 2026
f21f7db
Add benhmark deepdive docs
AkramBitar Feb 25, 2026
2a8cabf
Added Benchmark Transfer Service Benchmark
Effi-S Feb 25, 2026
805067d
Added Benchmark Transfer Service Benchmark API GRPc and server-client…
Effi-S Feb 25, 2026
cbaa714
Separated ZK and Service
Effi-S Feb 25, 2026
9f629da
Minor edits
Effi-S Feb 26, 2026
592f6b9
minor-missing-license
Effi-S Feb 26, 2026
8ff8c39
Added combined plots
Effi-S Mar 2, 2026
521e1c7
Validator Once
Effi-S Mar 3, 2026
4f8d822
Making Params on the fly
Effi-S Mar 3, 2026
e15267c
Added printout + benchRegression
Effi-S Mar 3, 2026
894a31a
minor edits
Effi-S Mar 4, 2026
d8a09df
Minor additions to plotting
Effi-S Mar 5, 2026
7387b78
Simplified plotting
Effi-S Mar 8, 2026
0c56d47
minor plotting latency fix
Effi-S Mar 9, 2026
805178a
minor edits
Effi-S Mar 9, 2026
b3ce1d4
lint
Effi-S Mar 9, 2026
bf80912
mnr edits
Effi-S Mar 9, 2026
b1591b6
mnr
Effi-S Mar 9, 2026
efc808e
AWS Setup md
Effi-S Mar 26, 2026
012b2b3
Merge branch 'main' into bench-fcs-zkp
Effi-S Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions cmd/benchmarking/api_bench_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Copyright IBM Corp All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/
package benchmarking

import (
"path"
"testing"

"github.com/hyperledger-labs/fabric-smart-client/integration/benchmark/node"
viewregistry "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/view"
"github.com/stretchr/testify/require"
)

func BenchmarkAPI(b *testing.B) {
testdataPath := b.TempDir()
nodeConfPath := path.Join(testdataPath, "fsc", "nodes", "test-node.0")

err := node.GenerateConfig(testdataPath)
require.NoError(b, err)

n, err := node.SetupNode(nodeConfPath, node.NamedFactory{
Name: "zkp",
Factory: &TokenTxVerifyViewFactory{},
})
require.NoError(b, err)
defer n.Stop()

vm, err := viewregistry.GetManager(n)
require.NoError(b, err)

params := &TokenTxVerifyParams{}
proof, err := GenerateProofData(params)
require.NoError(b, err)
params.Proof, err = proof.ToWire()
require.NoError(b, err)

wl := node.Workload{
Name: "zkp",
Factory: &TokenTxVerifyViewFactory{},
Params: params,
}

b.ResetTimer()
node.RunAPIBenchmark(b, vm, wl)
}
51 changes: 51 additions & 0 deletions cmd/benchmarking/api_grpc_bench_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
Copyright IBM Corp All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/

package benchmarking

import (
"path"
"testing"

"github.com/hyperledger-labs/fabric-smart-client/integration/benchmark/node"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/benchmark/flags"
)

var numConn = flags.IntSlice("numConn", []int{1, 2, 4, 8}, "Number of grpc client connections - may be a comma-separated list")

// BenchmarkAPIGRPC exercises the ViewAPI via grpc client.
// The proof is pre-computed and embedded in the workload params so every
// gRPC request carries it.
func BenchmarkAPIGRPC(b *testing.B) {
testdataPath := b.TempDir()
nodeConfPath := path.Join(testdataPath, "fsc", "nodes", "test-node.0")
clientConfPath := path.Join(nodeConfPath, "client-config.yaml")

err := node.GenerateConfig(testdataPath)
require.NoError(b, err)

n, err := node.SetupNode(nodeConfPath, node.NamedFactory{
Name: "zkp",
Factory: &TokenTxVerifyViewFactory{},
})
require.NoError(b, err)
defer n.Stop()

params := &TokenTxVerifyParams{}
proof, err := GenerateProofData(params)
require.NoError(b, err)
params.Proof, err = proof.ToWire()
require.NoError(b, err)

wl := node.Workload{
Name: "zkp",
Factory: &TokenTxVerifyViewFactory{},
Params: params,
}

node.RunAPIGRPCBenchmark(b, wl, clientConfPath, *numConn)
}
70 changes: 70 additions & 0 deletions cmd/benchmarking/client/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
Copyright IBM Corp All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/

package main

import (
"flag"
"fmt"
"path"
"runtime"
"time"

"github.com/hyperledger-labs/fabric-smart-client/integration/benchmark/node"
"github.com/hyperledger-labs/fabric-token-sdk/cmd/benchmarking"
"google.golang.org/grpc/benchmark/flags"
)

var (
numConn = flags.IntSlice("numConn", []int{1, 2}, "Number of grpc client connections - may be a comma-separated list")
numWorker = flags.IntSlice("cpu", []int{1, 2, 4, 8}, "Number of concurrent worker - may be a comma-separated list")
workloadFlag = flags.StringSlice("workloads", []string{"sign"}, "Workloads to execute - may be a comma-separated list")
warmupDur = flag.Duration("warmup", 5*time.Second, "Warmup duration")
duration = flag.Duration("benchtime", 10*time.Second, "Duration for every execution")
count = flag.Int("count", 1, "Number of executions")
)

func main() {
flag.Parse()

runtime.GOMAXPROCS(runtime.NumCPU())

testdataPath := "./out/testdata" // for local debugging you can set testdataPath := "out/testdata"
clientConfPath := path.Join(testdataPath, "fsc", "nodes", "test-node.0", "client-config.yaml")

params := &benchmarking.TokenTxVerifyParams{}
fmt.Println("Pre-computing ZK proof...")
proof, err := benchmarking.GenerateProofData(params)
if err != nil {
panic(fmt.Sprintf("failed to pre-compute proof: %v", err))
}

params.Proof, err = proof.ToWire()
if err != nil {
panic(fmt.Sprintf("failed to marshal proof: %v", err))
}
fmt.Println("Proof ready.")

zkpWorkload := node.Workload{
Name: "zkp",
Factory: &benchmarking.TokenTxVerifyViewFactory{},
Params: params,
}

selected := make([]node.Workload, 0, len(*workloadFlag))
selected = append(selected, zkpWorkload)

node.RunRemoteBenchmarkSuite(node.RemoteBenchmarkConfig{
Workloads: selected,
ClientConfPath: clientConfPath,
ConnCounts: *numConn,
WorkerCounts: *numWorker,
WarmupDur: *warmupDur,
BenchTime: *duration,
Count: *count,
BenchName: "BenchmarkAPIGRPCRemote",
})
}
Loading
Loading