Skip to content

Commit db9d13b

Browse files
authored
fix: verifier srs flags paths (#159)
* fix: verifier srs flags paths * style: lint
1 parent eb04a01 commit db9d13b

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ lint:
7373

7474
@golangci-lint run
7575

76+
.PHONY: format
77+
format:
78+
@go fmt ./...
79+
7680
go-gen-mocks:
7781
@echo "generating go mocks..."
7882
@GO111MODULE=on go generate --run "mockgen*" ./...

e2e/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestSuiteConfig(t *testing.T, testCfg *Cfg) server.CLIConfig {
132132
CacheDir: "../resources/SRSTables",
133133
SRSOrder: 268435456,
134134
SRSNumberToLoad: maxBlobLengthBytes / 32,
135-
NumWorker: uint64(runtime.GOMAXPROCS(0)),
135+
NumWorker: uint64(runtime.GOMAXPROCS(0)), // #nosec G115
136136
},
137137
},
138138
MemstoreEnabled: testCfg.UseMemory,

verify/cli.go

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,27 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
8080
Name: G1PathFlagName,
8181
Usage: "Directory path to g1.point file.",
8282
EnvVars: withEnvPrefix(envPrefix, "TARGET_KZG_G1_PATH"),
83-
// TODO: should use absolute path wrt root directory to prevent future errors
84-
// in case we move this file around
85-
Value: "../resources/g1.point",
83+
// we use a relative path so that the path works for both the binary and the docker container
84+
// aka we assume the binary is run from root dir, and that the resources/ dir is copied into the working dir of the container
85+
Value: "resources/g1.point",
8686
Category: category,
8787
},
8888
&cli.StringFlag{
89-
Name: G2TauFlagName,
90-
Usage: "Directory path to g2.point.powerOf2 file.",
91-
EnvVars: withEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH"),
92-
Value: "../resources/g2.point.powerOf2",
89+
Name: G2TauFlagName,
90+
Usage: "Directory path to g2.point.powerOf2 file.",
91+
EnvVars: withEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH"),
92+
// we use a relative path so that the path works for both the binary and the docker container
93+
// aka we assume the binary is run from root dir, and that the resources/ dir is copied into the working dir of the container
94+
Value: "resources/g2.point.powerOf2",
9395
Category: category,
9496
},
9597
&cli.StringFlag{
96-
Name: CachePathFlagName,
97-
Usage: "Directory path to SRS tables for caching.",
98-
EnvVars: withEnvPrefix(envPrefix, "TARGET_CACHE_PATH"),
99-
Value: "../resources/SRSTables/",
98+
Name: CachePathFlagName,
99+
Usage: "Directory path to SRS tables for caching.",
100+
EnvVars: withEnvPrefix(envPrefix, "TARGET_CACHE_PATH"),
101+
// we use a relative path so that the path works for both the binary and the docker container
102+
// aka we assume the binary is run from root dir, and that the resources/ dir is copied into the working dir of the container
103+
Value: "resources/SRSTables/",
100104
Category: category,
101105
},
102106
// TODO: can we use a genericFlag for this, and automatically parse the string into a uint64?

0 commit comments

Comments
 (0)