Skip to content

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented Jan 21, 2025

Why are these changes needed?

Decoupling v1 and v2 dispersal ports and integrating v2 port to the existing socket registration format (i.e. <host>:<dispersalPort>;<retrievalPort>;<v2DispersalPort>)

TODO: reachability check for v2 dispersal port

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim force-pushed the node-v2-sockets branch 6 times, most recently from d2c1485 to a2c8896 Compare January 21, 2025 20:03

v2DispersalPort := ctx.GlobalString(flags.V2DispersalPortFlag.Name)
if v2DispersalPort == "" {
if v2Enabled {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making v2 dispersal port required if v2 is enabled

@@ -218,7 +224,7 @@ var (
Required: false,
EnvVar: common.PrefixEnvVar(EnvVarPrefix, "ENABLE_GNARK_BUNDLE_ENCODING"),
}
EnableV2Flag = cli.BoolFlag{
EnableV2Flag = cli.BoolTFlag{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaulting this to true

logger.Fatalf("Could not start tcp listener: %v", err)
}

opt := grpc.MaxRecvMsgSize(config.GRPCMsgSizeLimitV2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reducing msg size for v2 dispersal requests

@ian-shim ian-shim marked this pull request as ready for review January 21, 2025 20:17
s = strings.Split(s[0], ":")
if len(s) != 2 {
err = fmt.Errorf("invalid socket address format: %s", socket)
if len(s) == 3 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if len > 3 or < 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the error throws in L63

Comment on lines +32 to +34
DispersalPort string
RetrievalPort string
V2DispersalPort string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to instead use int types for ports? We just need to change the flag type from string to int to support this. I've made this change in a few places and everything compiles and runs just fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that should have been the way to go, but I'm hesitant to change the flags from string to int because I'm not sure how every operator is configuring the values and if changing the type will be backward compatible

@ian-shim ian-shim merged commit 0f22447 into Layr-Labs:master Jan 23, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants