This document describes how to benchmark the Token Validation Service at the node level using the Fabric Smart Client (FSC) framework.
The Token Validation Service benchmarks measure the performance of token request validation (including transfers, issues, and auditing) through different architectural layers:
These benchmarks complement the core driver benchmarks by testing the complete validation service layer including FSC integration, network communication, and node orchestration.
The Token Validation Service benchmarks serve several critical purposes:
The token-sdk comes pre-equipped with test data containing cryptographic parameters and sample token transfers located at:
token/core/zkatdlog/nogh/v1/validator/regression/testdata/
This directory includes:
32-BLS12_381_BBS_GURVY/params.txt)transfers_i2_o2/Note: The test data is already included in the repository. You only need to regenerate it if you want to create custom test cases with different parameters or token configurations. To regenerate test data on demand:
cd token/core/zkatdlog/nogh/v1/validator
go test -run TestRegression -v
The test data is required by all benchmark types (Local, API, gRPC, and Distributed).
Tests token validation directly in-process without any network or API overhead. This establishes the performance baseline.
cd cmd/token_validation_service
GOGC=10000 go test -run ^$ -bench=BenchmarkLocalTokenValidation -benchtime=30s -count=5 -cpu=1,4,8,16,32,64
Parameters:
GOGC=10000: Reduces garbage collection frequency for more stable measurements-benchtime=30s: Run each benchmark for 30 seconds-count=5: Repeat each benchmark 5 times for statistical significance-cpu=1,4,8,16,32,64: Test with different numbers of parallel goroutinesTests token validation through FSC’s View API on a single node. Measures API overhead compared to direct validation.
cd cmd/token_validation_service
GC=10000 go test -bench=BenchmarkAPI -benchtime=30s
What it does:
Tests token validation through gRPC client-server architecture on localhost. Measures network serialization overhead.
cd cmd/token_validation_service
GOGC=10000 go test -bench=BenchmarkAPIGRPC -benchtime=30s -count=5 -cpu=32 -numConn=1,2,4,8
Parameters:
-numConn=1,2,4,8: Test with different numbers of gRPC client connectionsWhat it does:
To setup AWS EC2 nodes See: AWS Benchmark 2 Machines
For realistic deployment testing with separate client and server machines:
Architecture:
Setup:
known_hosts (If not already connected)cd cmd/token_validation_service
GOGC=10000 go run ./server/
Wait until you see the output:
Running fscnode test-node
[Note: We set GOGC to 10K but you don’t have to]
Rsync for this:
```bash
cd cmd/token_validation_servicersync -avz
Note: Make sure full path and server name are correct
4. Replace the IP (or full name DNS can resolve) to the Server IP in the client out folder:
```bash
sed 's#127.0.0.1#123.456.789#g' ./out/testdata/fsc/nodes/test-node.0/client-config.yaml -i
c-workloads=token-validation-service -cpu=1,2,4,8,16,32,48,64 -numConn=1,2,4,8 2>&1 | tee out.txt &
This setup is ideal for:
python -m venv .venv
source .venv/bin/activate
pip install streamlit pandas
Place the results in .txt files in a folder called bench.
Run:
streamlit run cmd/benchmarking/plotly_plot_node.py
They both already have each-others SSH Keys, so I don’t need to do it again.
On dectrust2, Server Runs:
cd cmd/token_validation_service
GOGC=10000 go run ./server/
I wait to see:
Running fscnode test-node
On dectrust1:
cd ~/effi/panurus/cmd/token_validation_service
rsync -avz root@dectrust2.vpc.cloud9.ibm.com:/root/effi/panurus/cmd/token_validation_service/out/ ./out
sed 's#127.0.0.1#dectrust1.vpc.cloud9.ibm.com#g' ./out/testdata/fsc/nodes/test-node.0/client-config.yaml -i
GOGC=10000 nohup go run ./client/ -benchtime=30s -count=5 -workloads=zkp -cpu=1,2,4,8,16,32 -numConn=1,2,4,8 2>&1 | tee example-2node.txt &
I also run gRPC benchmark without the 2 node setup:
GOGC=10000 go test -bench=BenchmarkAPIGRPC -benchtime=30s -count=5 -cpu=32 -numConn=1,2,4,8 | tee example-grpc.txt
I now move the outputs to bench folder and run the visualisation:
mv example-2node.txt bench
mv example-grpc.txt
(Optional) I setup python venv:
python -m venv .venv
source .venv/bin/activate
pip install streamlit pandas
Now I can run the visualisation:
streamlit run cmd/benchmarking/plotly_plot_node.py
Each benchmark reports:
BenchmarkLocalTokenValidation/out-tokens=2in-tokens=2-32 1000 30000000 ns/op 33333 TPS
Interpretation:
-cpu=32)