Skip to content

Commit 8a27dfc

Browse files
committed
Remove power of 2 g2 points
Signed-off-by: litt3 <[email protected]>
1 parent 8ca67c3 commit 8a27dfc

File tree

10 files changed

+8
-38
lines changed

10 files changed

+8
-38
lines changed

.env.example.holesky

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ EIGENDA_PROXY_EIGENDA_CONFIRMATION_DEPTH=6
2727
# Directory path to g1.point file
2828
EIGENDA_PROXY_EIGENDA_TARGET_KZG_G1_PATH=resources/g1.point
2929

30-
# Directory path to g2.powerOf2.point file
31-
EIGENDA_PROXY_EIGENDA_TARGET_KZG_G2_POWER_OF_2_PATH=resources/g2.powerOf2.point
32-
3330
# Disable point verification mode. This mode performs IFFT on data before writing and FFT on data after reading. Disabling requires supplying the entire blob for verification against the KZG commitment.
3431
EIGENDA_PROXY_EIGENDA_DISABLE_POINT_VERIFICATION_MODE=false
3532

.vscode/launch.json

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"ENV_PATH": "../../.env",
1414
"EIGENDA_PROXY_EIGENDA_CERT_VERIFICATION_DISABLED": "true",
1515
"EIGENDA_PROXY_EIGENDA_TARGET_KZG_G1_PATH": "../../resources/g1.point",
16-
"EIGENDA_PROXY_EIGENDA_TARGET_KZG_G2_POWER_OF_2_PATH": "../../resources/g2.powerOf2.point",
1716
"EIGENDA_PROXY_EIGENDA_TARGET_KZG_G2_PATH": "../../resources/g2.point",
1817
"EIGENDA_PROXY_EIGENDA_TARGET_KZG_G2_TRAILING_PATH": "../../resources/g2.trailing.point"
1918
},

config/proxy_config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func validCfg() ProxyConfig {
4242
},
4343
KzgConfig: kzg.KzgConfig{
4444
G1Path: "path/to/g1",
45-
G2PowerOf2Path: "path/to/g2",
4645
G2Path: "path/to/g2",
46+
G2TrailingPath: "path/to/trailing/g2",
4747
CacheDir: "path/to/cache",
4848
SRSOrder: maxBlobLengthBytes / 32,
4949
},

resources/g2.powerOf2.point

-3
This file was deleted.

store/generated_key/memstore/memstore_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ func TestGetSet(t *testing.T) {
4141

4242
kzgConfig := kzg.KzgConfig{
4343
G1Path: "../../../resources/g1.point",
44-
G2PowerOf2Path: "../../../resources/g2.powerOf2.point",
4544
G2Path: "../../../resources/g2.point",
4645
G2TrailingPath: "../../../resources/g2.trailing.point",
4746
CacheDir: "../../../resources/SRSTables",

testutils/env_vars.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ func getKZGEnvVars() []EnvVar {
196196
{verify.G1PathFlagName, "../resources/g1.point"},
197197
{verify.G2PathFlagName, "../resources/g2.point"},
198198
{verify.G2TrailingPathFlagName, "../resources/g2.trailing.point"},
199-
{verify.G2PowerOf2PathFlagName, "../resources/g2.powerOf2.point"},
200-
{verify.ReadG2PointsFlagName, "false"},
199+
{verify.ReadG2PointsFlagName, "true"},
201200
{verify.CachePathFlagName, "../resources/SRSTables"},
202201
}
203202

verify/cli.go

-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ var (
1818
G2PathFlagName = withFlagPrefix("g2-path")
1919
G2TrailingPathFlagName = withFlagPrefix("g2-path-trailing")
2020
ReadG2PointsFlagName = withFlagPrefix("read-g2-points")
21-
G2PowerOf2PathFlagName = withFlagPrefix("g2-power-of-2-path")
2221
CachePathFlagName = withFlagPrefix("cache-path")
2322
)
2423

@@ -75,13 +74,6 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
7574
Value: false,
7675
Category: category,
7776
},
78-
&cli.StringFlag{
79-
Name: G2PowerOf2PathFlagName,
80-
Usage: "path to g2.powerOf2.point file. This resource is not currently used, but needed because of the shared eigenda KZG library that we use. We will eventually fix this.",
81-
EnvVars: []string{withEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH")},
82-
Value: "resources/g2.powerOf2.point",
83-
Category: category,
84-
},
8577
&cli.StringFlag{
8678
Name: CachePathFlagName,
8779
Usage: "path to SRS tables for caching. This resource is not currently used, but needed because of the shared eigenda KZG library that we use. We will eventually fix this.",
@@ -95,7 +87,6 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
9587
func ReadKzgConfig(ctx *cli.Context, maxBlobSizeBytes uint64) kzg.KzgConfig {
9688
return kzg.KzgConfig{
9789
G1Path: ctx.String(G1PathFlagName),
98-
G2PowerOf2Path: ctx.String(G2PowerOf2PathFlagName),
9990
G2Path: ctx.String(G2PathFlagName),
10091
G2TrailingPath: ctx.String(G2TrailingPathFlagName),
10192
LoadG2Points: ctx.Bool(ReadG2PointsFlagName),

verify/deprecated_flags.go

-16
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,6 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
9292
},
9393
Category: category,
9494
},
95-
&cli.StringFlag{
96-
Name: DeprecatedG2TauFlagName,
97-
Usage: "path to g2.point.powerOf2 file.",
98-
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH")},
99-
// we use a relative path so that the path works for both the binary and the docker container
100-
// aka we assume the binary is run from root dir, and that the resources/ dir is copied into the working dir
101-
// of the container
102-
Value: "resources/g2.point.powerOf2",
103-
Action: func(_ *cli.Context, _ string) error {
104-
return fmt.Errorf(
105-
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
106-
DeprecatedG2TauFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH"),
107-
G2PowerOf2PathFlagName, withEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH"))
108-
},
109-
Category: category,
110-
},
11195
&cli.StringFlag{
11296
Name: DeprecatedCachePathFlagName,
11397
Usage: "path to SRS tables for caching.",

verify/verifier.go

+6
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ func NewVerifier(cfg *Config, kzgConfig kzg.KzgConfig, l logging.Logger) (*Verif
7373
log.Warn("Certificate verification against Ethereum state disabled")
7474
}
7575

76+
// It's really ugly, but we must force this value to false here.
77+
// The verifier doesn't initialize its SRS data in a clean way, and will try to read g2 points it doesn't need,
78+
// even though they are missing from the file. It's not always possible to set LoadG2Points with environment
79+
// variables, though, because it might need to be true in other contexts (e.g. initializing a prover)
80+
kzgConfig.LoadG2Points = false
81+
7682
log.Info("Creating blob KZG verifier")
7783
kzgVerifier, err := kzgverifier.NewVerifier(&kzgConfig, encoding.DefaultConfig())
7884
if err != nil {

verify/verify_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ func TestCommitmentVerification(t *testing.T) {
3232

3333
kzgConfig := kzg.KzgConfig{
3434
G1Path: "../resources/g1.point",
35-
G2PowerOf2Path: "../resources/g2.powerOf2.point",
3635
G2Path: "../resources/g2.point",
3736
G2TrailingPath: "../resources/g2.trailing.point",
3837
CacheDir: "../resources/SRSTables",
@@ -71,7 +70,6 @@ func TestCommitmentWithTooLargeBlob(t *testing.T) {
7170

7271
kzgConfig := kzg.KzgConfig{
7372
G1Path: "../resources/g1.point",
74-
G2PowerOf2Path: "../resources/g2.powerOf2.point",
7573
G2Path: "../resources/g2.point",
7674
G2TrailingPath: "../resources/g2.trailing.point",
7775
CacheDir: "../resources/SRSTables",

0 commit comments

Comments
 (0)