Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove power of 2 g2 points #341

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .env.example.holesky
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ EIGENDA_PROXY_EIGENDA_CONFIRMATION_DEPTH=6
# Directory path to g1.point file
EIGENDA_PROXY_EIGENDA_TARGET_KZG_G1_PATH=resources/g1.point

# Directory path to g2.point.powerOf2 file
EIGENDA_PROXY_EIGENDA_TARGET_KZG_G2_POWER_OF_2_PATH=resources/g2.point.powerOf2

# 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.
EIGENDA_PROXY_EIGENDA_DISABLE_POINT_VERIFICATION_MODE=false

Expand Down
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"ENV_PATH": "../../.env",
"EIGENDA_PROXY_EIGENDA_CERT_VERIFICATION_DISABLED": "true",
"EIGENDA_PROXY_EIGENDA_TARGET_KZG_G1_PATH": "../../resources/g1.point",
"EIGENDA_PROXY_EIGENDA_TARGET_KZG_G2_POWER_OF_2_PATH": "../../resources/g2.point.powerOf2"
},
"program": "cmd/server"
}
Expand Down
3 changes: 3 additions & 0 deletions config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ func init() {
Flags = append(Flags, s3.CLIFlags(common.GlobalPrefix, S3Category)...)
Flags = append(Flags, memstore.CLIFlags(common.GlobalPrefix, MemstoreFlagsCategory)...)
Flags = append(Flags, verify.CLIFlags(common.GlobalPrefix, VerifierCategory)...)

Flags = append(Flags, verify.DeprecatedCLIFlags(common.GlobalPrefix, VerifierCategory)...)
Flags = append(Flags, store.DeprecatedCLIFlags(common.GlobalPrefix, StorageFlagsCategory)...)
}
7 changes: 3 additions & 4 deletions config/proxy_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ func validCfg() ProxyConfig {
},
EdaVerifierConfigV1: verify.Config{
KzgConfig: &kzg.KzgConfig{
G1Path: "path/to/g1",
G2PowerOf2Path: "path/to/g2",
CacheDir: "path/to/cache",
SRSOrder: maxBlobLengthBytes / 32,
G1Path: "path/to/g1",
CacheDir: "path/to/cache",
SRSOrder: maxBlobLengthBytes / 32,
},
VerifyCerts: false,
SvcManagerAddr: "0x1234567890abcdef",
Expand Down
Binary file removed resources/g2.point.powerOf2
Binary file not shown.
14 changes: 7 additions & 7 deletions store/generated_key/memstore/memstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ const (
)

func getDefaultMemStoreTestConfig() *memconfig.SafeConfig {
return memconfig.NewSafeConfig(memconfig.Config{
MaxBlobSizeBytes: 1024 * 1024,
BlobExpiration: 0,
PutLatency: 0,
GetLatency: 0,
})
return memconfig.NewSafeConfig(
memconfig.Config{
MaxBlobSizeBytes: 1024 * 1024,
BlobExpiration: 0,
PutLatency: 0,
GetLatency: 0,
})
}

func getDefaultVerifierTestConfig() *verify.Config {
return &verify.Config{
VerifyCerts: false,
KzgConfig: &kzg.KzgConfig{
G1Path: "../../../resources/g1.point",
G2PowerOf2Path: "../../../resources/g2.point.powerOf2",
CacheDir: "../../../resources/SRSTables",
SRSOrder: 3000,
SRSNumberToLoad: 3000,
Expand Down
1 change: 0 additions & 1 deletion testutils/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ func BuildTestSuiteConfig(testCfg TestConfig) config.AppConfig {
EthConfirmationDepth: 1,
KzgConfig: &kzg.KzgConfig{
G1Path: "../resources/g1.point",
G2PowerOf2Path: "../resources/g2.point.powerOf2",
CacheDir: "../resources/SRSTables",
SRSOrder: 268435456,
SRSNumberToLoad: maxBlobLengthBytes / 32,
Expand Down
15 changes: 3 additions & 12 deletions verify/v1/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ var (
CertVerificationDisabledFlagName = withFlagPrefix("cert-verification-disabled")

// kzg flags
G1PathFlagName = withFlagPrefix("g1-path")
G2PowerOf2PathFlagName = withFlagPrefix("g2-power-of-2-path")
CachePathFlagName = withFlagPrefix("cache-path")
MaxBlobLengthFlagName = withFlagPrefix("max-blob-length")
G1PathFlagName = withFlagPrefix("g1-path")
CachePathFlagName = withFlagPrefix("cache-path")
MaxBlobLengthFlagName = withFlagPrefix("max-blob-length")
)

// we keep the eigenda prefix like eigenda client flags, because we
Expand Down Expand Up @@ -61,13 +60,6 @@ func CLIFlags(envPrefix, category string) []cli.Flag {
Value: "resources/g1.point",
Category: category,
},
&cli.StringFlag{
Name: G2PowerOf2PathFlagName,
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.",
EnvVars: []string{withEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH")},
Value: "resources/g2.point.powerOf2",
Category: category,
},
&cli.StringFlag{
Name: CachePathFlagName,
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.",
Expand Down Expand Up @@ -120,7 +112,6 @@ var MaxBlobLengthBytes uint64
func ReadConfig(ctx *cli.Context, edaClientConfig clients.EigenDAClientConfig) Config {
kzgCfg := &kzg.KzgConfig{
G1Path: ctx.String(G1PathFlagName),
G2PowerOf2Path: ctx.String(G2PowerOf2PathFlagName),
CacheDir: ctx.String(CachePathFlagName),
SRSOrder: SrsOrder,
SRSNumberToLoad: MaxBlobLengthBytes / 32, // # of fr.Elements
Expand Down
43 changes: 31 additions & 12 deletions verify/v1/deprecated_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ var (
DeprecatedEthConfirmationDepthFlagName = withDeprecatedFlagPrefix("eth-confirmation-depth")

// kzg flags
DeprecatedG1PathFlagName = withDeprecatedFlagPrefix("g1-path")
DeprecatedG2TauFlagName = withDeprecatedFlagPrefix("g2-tau-path")
DeprecatedCachePathFlagName = withDeprecatedFlagPrefix("cache-path")
DeprecatedMaxBlobLengthFlagName = withDeprecatedFlagPrefix("max-blob-length")
DeprecatedG1PathFlagName = withDeprecatedFlagPrefix("g1-path")
DeprecatedG2TauFlagName = withDeprecatedFlagPrefix("g2-tau-path")
DeprecatedCachePathFlagName = withDeprecatedFlagPrefix("cache-path")
DeprecatedMaxBlobLengthFlagName = withDeprecatedFlagPrefix("max-blob-length")
DeprecatedG2PowerOf2PathFlagName = withDeprecatedFlagPrefix("g2-power-of-2-path")
)

func withDeprecatedFlagPrefix(s string) string {
Expand All @@ -40,7 +41,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
Usage: "JSON RPC node endpoint for the Ethereum network used for finalizing DA blobs. See available list here: https://docs.eigenlayer.xyz/eigenda/networks/",
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "ETH_RPC")},
Action: func(_ *cli.Context, _ string) error {
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
return fmt.Errorf(
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
DeprecatedEthRPCFlagName, withDeprecatedEnvPrefix(envPrefix, "ETH_RPC"),
eigendaflags.EthRPCURLFlagName, withEnvPrefix(envPrefix, "ETH_RPC"))
},
Expand All @@ -51,7 +53,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
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",
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "SERVICE_MANAGER_ADDR")},
Action: func(_ *cli.Context, _ string) error {
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
return fmt.Errorf(
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
DeprecatedSvcManagerAddrFlagName, withDeprecatedEnvPrefix(envPrefix, "SERVICE_MANAGER_ADDR"),
eigendaflags.SvcManagerAddrFlagName, withEnvPrefix(envPrefix, "SERVICE_MANAGER_ADDR"))
},
Expand Down Expand Up @@ -83,7 +86,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
// of the container
Value: "resources/g1.point",
Action: func(_ *cli.Context, _ string) error {
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
return fmt.Errorf(
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
DeprecatedG1PathFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_KZG_G1_PATH"),
G1PathFlagName, withEnvPrefix(envPrefix, "TARGET_KZG_G1_PATH"))
},
Expand All @@ -98,9 +102,9 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
// of the container
Value: "resources/g2.point.powerOf2",
Action: func(_ *cli.Context, _ string) error {
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
DeprecatedG2TauFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH"),
G2PowerOf2PathFlagName, withEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH"))
return fmt.Errorf(
"flag --%s (env var %s) is deprecated",
DeprecatedG2TauFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_G2_TAU_PATH"))
},
Category: category,
},
Expand All @@ -113,7 +117,8 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
// of the container
Value: "resources/SRSTables/",
Action: func(_ *cli.Context, _ string) error {
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
return fmt.Errorf(
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
DeprecatedCachePathFlagName, withDeprecatedEnvPrefix(envPrefix, "TARGET_CACHE_PATH"),
CachePathFlagName, withEnvPrefix(envPrefix, "TARGET_CACHE_PATH"))
},
Expand All @@ -126,13 +131,27 @@ func DeprecatedCLIFlags(envPrefix, category string) []cli.Flag {
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "MAX_BLOB_LENGTH")},
Value: "16MiB",
Action: func(_ *cli.Context, _ string) error {
return fmt.Errorf("flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
return fmt.Errorf(
"flag --%s (env var %s) is deprecated, use --%s (env var %s) instead",
DeprecatedMaxBlobLengthFlagName, withDeprecatedEnvPrefix(envPrefix, "MAX_BLOB_LENGTH"),
MaxBlobLengthFlagName, withEnvPrefix(envPrefix, "MAX_BLOB_LENGTH"))
},
// we also use this flag for memstore.
// should we duplicate the flag? Or is there a better way to handle this?
Category: category,
},
&cli.StringFlag{
Name: DeprecatedG2PowerOf2PathFlagName,
Usage: "path to g2.point.powerOf2 file.",
EnvVars: []string{withDeprecatedEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH")},
Value: "",
Action: func(_ *cli.Context, _ string) error {
return fmt.Errorf(
"flag --%s (env var %s) is deprecated",
DeprecatedG2PowerOf2PathFlagName,
withDeprecatedEnvPrefix(envPrefix, "TARGET_KZG_G2_POWER_OF_2_PATH"))
},
Category: category,
},
}
}
2 changes: 0 additions & 2 deletions verify/v1/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func TestCommitmentVerification(t *testing.T) {

kzgConfig := &kzg.KzgConfig{
G1Path: "../../resources/g1.point",
G2PowerOf2Path: "../../resources/g2.point.powerOf2",
CacheDir: "../../resources/SRSTables",
SRSOrder: 3000,
SRSNumberToLoad: 3000,
Expand Down Expand Up @@ -70,7 +69,6 @@ func TestCommitmentWithTooLargeBlob(t *testing.T) {

kzgConfig := &kzg.KzgConfig{
G1Path: "../../resources/g1.point",
G2PowerOf2Path: "../../resources/g2.point.powerOf2",
CacheDir: "../../resources/SRSTables",
SRSOrder: 3000,
SRSNumberToLoad: 3000,
Expand Down
Loading