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

refactor: clean up flags and configs #146

Merged
merged 18 commits into from
Sep 27, 2024
Merged

refactor: clean up flags and configs #146

merged 18 commits into from
Sep 27, 2024

Conversation

samlaf
Copy link
Collaborator

@samlaf samlaf commented Sep 22, 2024

We had a single global flags file that defined flags for every subsystem. It was very hard to know which flag is needed for which, and hard to maintain. Broke it down by moving flags/configs to each respective subsystem package. There's still a lot more cleanup to do, but I feel this is good enough to be reviewed and merged, and iterated on. Hard to get everything write at once.

What I like:

  • modular: each package defines its own config/flags
  • cleanup surfaced some other dependency problems which were hidden. I think this kind of modular approach will force us to think more structurally and find the right abstractions. still a wip though.

What I don't like:

  • the way I'm dealing with flags that are defined in 2 packages (for eg maxBlobLength is needed in memstore and verifier config) is kind of ugly (currently memstore reads config from verifier flag)
  • e2e test setup is now more ugly and has some repeated hardcoded constants. This is because we removed the indirection from global-flags (which we were using in e2e test setup) to configs. Now each config needs to be properly setup in the default e2e test setup... perhaps we should introduce one more level of indirection (op does this) with flags -> CLIconfig -> config (instead of the current flags -> config). This would allow the e2e tests to be setup with CLIconfigs (these are more easily human understandable, as opposed to the configs that are currently needed)

@samlaf samlaf marked this pull request as draft September 22, 2024 01:44
@samlaf samlaf marked this pull request as ready for review September 23, 2024 04:45
Copy link
Collaborator

@epociask epociask left a comment

Choose a reason for hiding this comment

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

LGTM - just a few knits

@@ -53,15 +59,15 @@ func TestConfig(useMemory bool) *Cfg {
}

func createRedisConfig(eigendaCfg server.Config) server.CLIConfig {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Knit - is eigendaCfg overly verbose?

},
&cli.DurationFlag{
Name: StatusQueryTimeoutFlagName,
Usage: "Duration to wait for a blob to finalize after being sent for dispersal. Default is 30 minutes.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Knit - hasn't this value been changed given the recent decrease in bridging frequency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a good question. Do right now bridging frequency is:

  • preprod: 1 min
  • testnet: 10 min (still lol... but guessing they'll change it to 3 min also eventually..?)
  • mainnet: 3 min

Finalization itself requires waiting for 24 minutes though. So not even sure how 30 minutes was enough.
Feel like the msg in this flag should also reflect whether the WaitForFinalization flag is true or false?

&cli.StringFlag{
Name: BucketFlagName,
Usage: "bucket name for S3 storage",
EnvVars: withEnvPrefix(envPrefix, "BUCKET"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Knit - we explicitly set value in some locations but not all

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@samlaf samlaf merged commit 2600bad into main Sep 27, 2024
7 checks passed
@samlaf samlaf deleted the clean-flags branch September 27, 2024 21:53
samlaf added a commit to Layr-Labs/optimism that referenced this pull request Sep 29, 2024
samlaf added a commit to Layr-Labs/optimism that referenced this pull request Sep 29, 2024
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.

2 participants