docs(sparta): .env.example is missing five variables the code requires - #624
Open
boleklebovski wants to merge 1 commit into
Open
docs(sparta): .env.example is missing five variables the code requires#624boleklebovski wants to merge 1 commit into
.env.example is missing five variables the code requires#624boleklebovski wants to merge 1 commit into
Conversation
Five required variables were missing and two documented ones are never read, including the funder key used to build the cast command. Signed-off-by: boleklebovski <160799963+boleklebovski@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tooling/sparta/src/.env.examplehas drifted from the code in both directions.Read by the code but not documented:
FUNDER_ADDRESS_PRIVATE_KEYservices/validator-service.ts:121FUNDER_AMOUNTservices/validator-service.ts:121L1_CHAIN_IDservices/validator-service.ts:121,services/ethereum.tsWITHDRAWER_PRIVATE_KEYAZTEC_NODE_URLDocumented but never read:
ETHEREUM_CHAIN_IDandETHEREUM_VALUE. Note the first is a near-miss forL1_CHAIN_ID— someone setting up from the example would naturally setETHEREUM_CHAIN_ID=1337and never learn that the code looks for a different name.The consequence is concrete.
fundValidatorbuilds a shell command by interpolation:With those three variables unset — which is exactly what you get by following
.env.example— the bot runsand the
/fundcommand fails with a foundry parse error rather than a message telling the operator what is missing.Fix
Document the five missing variables, drop the two that nothing reads, and group the funding ones so their purpose is obvious.
.env.exampleonly.After this change every
process.env.*key the sparta source reads appears in the example, with the single exception ofNODE_ENV, which is a standard runtime variable rather than app configuration.Not included
Guarding
fundValidatorso it fails fast with a clear error (and keepsundefinedout of a command line that carries a private key) would be the natural follow-up, but that changes behaviour, so I left it out of a documentation fix. Happy to send it separately if you want it.Note on overlap
Open PR #551 deletes this file as part of a 54-file restructure. It has been open since May 2025, was last updated in June 2025, and currently reports
mergeable_state: dirty. This change targets the file as it exists onmaintoday; if the restructure is still the plan, say so and I will close this in favour of folding the variables into it.