Skip to content

Commit d8bd751

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

File tree

10 files changed

+47
-42
lines changed

10 files changed

+47
-42
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.point.powerOf2 file
31-
EIGENDA_PROXY_EIGENDA_TARGET_KZG_G2_POWER_OF_2_PATH=resources/g2.point.powerOf2
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.point.powerOf2"
1716
},
1817
"program": "cmd/server"
1918
}

config/flags.go

+3
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,7 @@ func init() {
6767
Flags = append(Flags, s3.CLIFlags(common.GlobalPrefix, S3Category)...)
6868
Flags = append(Flags, memstore.CLIFlags(common.GlobalPrefix, MemstoreFlagsCategory)...)
6969
Flags = append(Flags, verify.CLIFlags(common.GlobalPrefix, VerifierCategory)...)
70+
71+
Flags = append(Flags, verify.DeprecatedCLIFlags(common.GlobalPrefix, VerifierCategory)...)
72+
Flags = append(Flags, store.DeprecatedCLIFlags(common.GlobalPrefix, StorageFlagsCategory)...)
7073
}

config/proxy_config_test.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ func validCfg() ProxyConfig {
3434
},
3535
EdaVerifierConfigV1: verify.Config{
3636
KzgConfig: &kzg.KzgConfig{
37-
G1Path: "path/to/g1",
38-
G2PowerOf2Path: "path/to/g2",
39-
CacheDir: "path/to/cache",
40-
SRSOrder: maxBlobLengthBytes / 32,
37+
G1Path: "path/to/g1",
38+
CacheDir: "path/to/cache",
39+
SRSOrder: maxBlobLengthBytes / 32,
4140
},
4241
VerifyCerts: false,
4342
SvcManagerAddr: "0x1234567890abcdef",

resources/g2.point.powerOf2

-1.75 KB
Binary file not shown.

store/generated_key/memstore/memstore_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ const (
2222
)
2323

2424
func getDefaultMemStoreTestConfig() *memconfig.SafeConfig {
25-
return memconfig.NewSafeConfig(memconfig.Config{
26-
MaxBlobSizeBytes: 1024 * 1024,
27-
BlobExpiration: 0,
28-
PutLatency: 0,
29-
GetLatency: 0,
30-
})
25+
return memconfig.NewSafeConfig(
26+
memconfig.Config{
27+
MaxBlobSizeBytes: 1024 * 1024,
28+
BlobExpiration: 0,
29+
PutLatency: 0,
30+
GetLatency: 0,
31+
})
3132
}
3233

3334
func getDefaultVerifierTestConfig() *verify.Config {
3435
return &verify.Config{
3536
VerifyCerts: false,
3637
KzgConfig: &kzg.KzgConfig{
3738
G1Path: "../../../resources/g1.point",
38-
G2PowerOf2Path: "../../../resources/g2.point.powerOf2",
3939
CacheDir: "../../../resources/SRSTables",
4040
SRSOrder: 3000,
4141
SRSNumberToLoad: 3000,

testutils/setup.go

-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ func BuildTestSuiteConfig(testCfg TestConfig) config.AppConfig {
214214
EthConfirmationDepth: 1,
215215
KzgConfig: &kzg.KzgConfig{
216216
G1Path: "../resources/g1.point",
217-
G2PowerOf2Path: "../resources/g2.point.powerOf2",
218217
CacheDir: "../resources/SRSTables",
219218
SRSOrder: 268435456,
220219
SRSNumberToLoad: maxBlobLengthBytes / 32,

verify/v1/cli.go

+3-12
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ var (
2323
CertVerificationDisabledFlagName = withFlagPrefix("cert-verification-disabled")
2424

2525
// kzg flags
26-
G1PathFlagName = withFlagPrefix("g1-path")
27-
G2PowerOf2PathFlagName = withFlagPrefix("g2-power-of-2-path")
28-
CachePathFlagName = withFlagPrefix("cache-path")
29-
MaxBlobLengthFlagName = withFlagPrefix("max-blob-length")
26+
G1PathFlagName = withFlagPrefix("g1-path")
27+
CachePathFlagName = withFlagPrefix("cache-path")
28+
MaxBlobLengthFlagName = withFlagPrefix("max-blob-length")
3029
)
3130

3231
// we keep the eigenda prefix like eigenda client flags, because we
@@ -61,13 +60,6 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
6160
Value: "resources/g1.point",
6261
Category: category,
6362
},
64-
&cli.StringFlag{
65-
Name: G2PowerOf2PathFlagName,
66-
Usage: "path to g2.point.powerOf2 file. This resource is not currently used, but needed because of the shared eigenda KZG library that we use. We will eventually fix this.",
67-
EnvVars: []string{withEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH")},
68-
Value: "resources/g2.point.powerOf2",
69-
Category: category,
70-
},
7163
&cli.StringFlag{
7264
Name: CachePathFlagName,
7365
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.",
@@ -120,7 +112,6 @@ var MaxBlobLengthBytes uint64
120112
func ReadConfig(ctx *cli.Context, edaClientConfig clients.EigenDAClientConfig) Config {
121113
kzgCfg := &kzg.KzgConfig{
122114
G1Path: ctx.String(G1PathFlagName),
123-
G2PowerOf2Path: ctx.String(G2PowerOf2PathFlagName),
124115
CacheDir: ctx.String(CachePathFlagName),
125116
SRSOrder: SrsOrder,
126117
SRSNumberToLoad: MaxBlobLengthBytes / 32, // # of fr.Elements

verify/v1/deprecated_flags.go

+31-12
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ var (
1717
DeprecatedEthConfirmationDepthFlagName = withDeprecatedFlagPrefix("eth-confirmation-depth")
1818

1919
// kzg flags
20-
DeprecatedG1PathFlagName = withDeprecatedFlagPrefix("g1-path")
21-
DeprecatedG2TauFlagName = withDeprecatedFlagPrefix("g2-tau-path")
22-
DeprecatedCachePathFlagName = withDeprecatedFlagPrefix("cache-path")
23-
DeprecatedMaxBlobLengthFlagName = withDeprecatedFlagPrefix("max-blob-length")
20+
DeprecatedG1PathFlagName = withDeprecatedFlagPrefix("g1-path")
21+
DeprecatedG2TauFlagName = withDeprecatedFlagPrefix("g2-tau-path")
22+
DeprecatedCachePathFlagName = withDeprecatedFlagPrefix("cache-path")
23+
DeprecatedMaxBlobLengthFlagName = withDeprecatedFlagPrefix("max-blob-length")
24+
DeprecatedG2PowerOf2PathFlagName = withDeprecatedFlagPrefix("g2-power-of-2-path")
2425
)
2526

2627
func withDeprecatedFlagPrefix(s string) string {
@@ -40,7 +41,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
4041
Usage: "JSON RPC node endpoint for the Ethereum network used for finalizing DA blobs. See available list here: https://docs.eigenlayer.xyz/eigenda/networks/",
4142
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "ETH_RPC")},
4243
Action: func(_ *cli.Context, _ string) error {
43-
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
44+
return fmt.Errorf(
45+
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
4446
DeprecatedEthRPCFlagName, withDeprecatedEnvPrefix(envPrefix, "ETH_RPC"),
4547
eigendaflags.EthRPCURLFlagName, withEnvPrefix(envPrefix, "ETH_RPC"))
4648
},
@@ -51,7 +53,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
5153
Usage: "The deployed EigenDA service manager address. The list can be found here: https://github.com/Layr-Labs/eigenlayer-middleware/?tab=readme-ov-file#current-mainnet-deployment",
5254
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "SERVICE_MANAGER_ADDR")},
5355
Action: func(_ *cli.Context, _ string) error {
54-
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
56+
return fmt.Errorf(
57+
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
5558
DeprecatedSvcManagerAddrFlagName, withDeprecatedEnvPrefix(envPrefix, "SERVICE_MANAGER_ADDR"),
5659
eigendaflags.SvcManagerAddrFlagName, withEnvPrefix(envPrefix, "SERVICE_MANAGER_ADDR"))
5760
},
@@ -83,7 +86,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
8386
// of the container
8487
Value: "resources/g1.point",
8588
Action: func(_ *cli.Context, _ string) error {
86-
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
89+
return fmt.Errorf(
90+
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
8791
DeprecatedG1PathFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_KZG_G1_PATH"),
8892
G1PathFlagName, withEnvPrefix(envPrefix, "TARGET_KZG_G1_PATH"))
8993
},
@@ -98,9 +102,9 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
98102
// of the container
99103
Value: "resources/g2.point.powerOf2",
100104
Action: func(_ *cli.Context, _ string) error {
101-
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
102-
DeprecatedG2TauFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH"),
103-
G2PowerOf2PathFlagName, withEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH"))
105+
return fmt.Errorf(
106+
"flag --%s (env var %s) is deprecated",
107+
DeprecatedG2TauFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH"))
104108
},
105109
Category: category,
106110
},
@@ -113,7 +117,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
113117
// of the container
114118
Value: "resources/SRSTables/",
115119
Action: func(_ *cli.Context, _ string) error {
116-
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
120+
return fmt.Errorf(
121+
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
117122
DeprecatedCachePathFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_CACHE_PATH"),
118123
CachePathFlagName, withEnvPrefix(envPrefix, "TARGET_CACHE_PATH"))
119124
},
@@ -126,13 +131,27 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
126131
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "MAX_BLOB_LENGTH")},
127132
Value: "16MiB",
128133
Action: func(_ *cli.Context, _ string) error {
129-
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
134+
return fmt.Errorf(
135+
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
130136
DeprecatedMaxBlobLengthFlagName, withDeprecatedEnvPrefix(envPrefix, "MAX_BLOB_LENGTH"),
131137
MaxBlobLengthFlagName, withEnvPrefix(envPrefix, "MAX_BLOB_LENGTH"))
132138
},
133139
// we also use this flag for memstore.
134140
// should we duplicate the flag? Or is there a better way to handle this?
135141
Category: category,
136142
},
143+
&cli.StringFlag{
144+
Name: DeprecatedG2PowerOf2PathFlagName,
145+
Usage: "path to g2.point.powerOf2 file.",
146+
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH")},
147+
Value: "",
148+
Action: func(_ *cli.Context, _ string) error {
149+
return fmt.Errorf(
150+
"flag --%s (env var %s) is deprecated",
151+
DeprecatedG2PowerOf2PathFlagName,
152+
withDeprecatedEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH"))
153+
},
154+
Category: category,
155+
},
137156
}
138157
}

verify/v1/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.point.powerOf2",
3635
CacheDir: "../../resources/SRSTables",
3736
SRSOrder: 3000,
3837
SRSNumberToLoad: 3000,
@@ -70,7 +69,6 @@ func TestCommitmentWithTooLargeBlob(t *testing.T) {
7069

7170
kzgConfig := &kzg.KzgConfig{
7271
G1Path: "../../resources/g1.point",
73-
G2PowerOf2Path: "../../resources/g2.point.powerOf2",
7472
CacheDir: "../../resources/SRSTables",
7573
SRSOrder: 3000,
7674
SRSNumberToLoad: 3000,

0 commit comments

Comments
 (0)