Skip to content

chore: Rename env vars [component] [setting]#1998

Open
sergerad wants to merge 7 commits intonextfrom
sergerad-env-var-naming
Open

chore: Rename env vars [component] [setting]#1998
sergerad wants to merge 7 commits intonextfrom
sergerad-env-var-naming

Conversation

@sergerad
Copy link
Copy Markdown
Collaborator

@sergerad sergerad commented Apr 24, 2026

Closes #1456.

  • Enforce MIDEN_NODE_[component]_[setting] naming convention for all env vars (except universal ones like MIDEN_NODE_DATA_DIRECTORY and MIDEN_NODE_ENABLE_OTEL)
  • Add missing MIDEN_NODE_ prefix to env vars that lacked it
  • Split shared store URL env vars into separate listen/connect vars
  • Move env var consts to their respective command modules
  • Remove redundant component prefixes from const identifiers now that they are local
Old New
MIDEN_NODE_STORE_RPC_URL MIDEN_NODE_RPC_STORE_URL (RPC connect) / MIDEN_NODE_STORE_RPC_URL (store listen)
MIDEN_NODE_STORE_NTX_BUILDER_URL MIDEN_NODE_NTX_BUILDER_STORE_URL (NTX builder connect) / MIDEN_NODE_STORE_NTX_BUILDER_URL (store listen)
MIDEN_NODE_STORE_BLOCK_PRODUCER_URL MIDEN_NODE_BLOCK_PRODUCER_STORE_URL (block producer connect) / MIDEN_NODE_STORE_BLOCK_PRODUCER_URL (store listen)
MIDEN_NODE_VALIDATOR_BLOCK_PRODUCER_URL MIDEN_NODE_BLOCK_PRODUCER_VALIDATOR_URL
MIDEN_NODE_BATCH_PROVER_URL MIDEN_NODE_BLOCK_PRODUCER_BATCH_PROVER_URL
MIDEN_NODE_BLOCK_PROVER_URL MIDEN_NODE_STORE_BLOCK_PROVER_URL
MIDEN_NODE_NTX_PROVER_URL MIDEN_NODE_NTX_BUILDER_NTX_PROVER_URL
MIDEN_MAX_TXS_PER_BATCH MIDEN_NODE_BLOCK_PRODUCER_MAX_TXS_PER_BATCH
MIDEN_MAX_BATCHES_PER_BLOCK MIDEN_NODE_BLOCK_PRODUCER_MAX_BATCHES_PER_BLOCK
MIDEN_NODE_MEMPOOL_TX_CAPACITY MIDEN_NODE_BLOCK_PRODUCER_MEMPOOL_TX_CAPACITY
MIDEN_NTX_DATA_STORE_SCRIPT_CACHE_SIZE MIDEN_NODE_NTX_BUILDER_SCRIPT_CACHE_SIZE
MIDEN_NODE_NTX_DATA_DIRECTORY MIDEN_NODE_DATA_DIRECTORY
MIDEN_NTX_MAX_CYCLES MIDEN_NODE_NTX_BUILDER_MAX_CYCLES
MIDEN_GENESIS_CONFIG_FILE MIDEN_NODE_VALIDATOR_GENESIS_CONFIG_FILE

@sergerad sergerad changed the title Rename env vars [component] [setting] chore: Rename env vars [component] [setting] Apr 24, 2026
@sergerad sergerad added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Apr 24, 2026
@sergerad sergerad force-pushed the sergerad-env-var-naming branch from b3b85c1 to 5a66c6e Compare April 24, 2026 04:13
@bobbinth
Copy link
Copy Markdown
Contributor

Should we also tackle #1431 as a part of this PR?

@sergerad
Copy link
Copy Markdown
Collaborator Author

Should we also tackle #1431 as a part of this PR?

I would do it separately. I'm thinking of making a few more changes here - moving the env vars to more specific modules so there will be a few more diffs.

Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

I would like to see a conf implementation as well.

This could be a follow-up PR, or even a PoC PR on top of this one.

Primarily what I'm hoping for is that we don't need const for these things at all except for the prefixless exceptions you listed. We previously had the const because they got used multiple times (due to bundled mode), but now they can just be strings in the actual derive macro which is much easier to understand imo.

I'm approving because I think this is an improvement over the status quo, but I think we can do better potentially.

Comment thread bin/node/.env
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

tbh I still don't understand why we want this file to exist?

The only source of truth is miden-node --help.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For an easy copy paste into infra repo. Just a bit less manual and error prone this way. Still not ideal though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify env var names for node URLs

3 participants