fix(scripts): parse the registration id without ggrep - #391
Open
Dusk1e wants to merge 1 commit into
Open
Conversation
The registration id is parsed with `ggrep -oP`. ggrep is Homebrew's GNU grep, which is not in the README's install list and does not exist on Linux, so the command is not found on a machine set up from the docs. It fails quietly instead of stopping: `export VAR=$(...)` reports the status of export rather than of the substitution, so `set -e` does not fire. The script carries on with an empty REGISTRATION_ID through configureController, activateValidator and updateVotingPower, then exits 0. Parse with POSIX sed and stop with a message when no id comes back.
Dusk1e
requested review from
ZhiyuCircle,
ancazamfir,
romac and
sergio-mena
as code owners
September 12, 2026 15:51
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.
register-validator.shreads the registration id out of the forge output withggrep -oP.ggrepis Homebrew's GNU grep: it isn't in thebrew installline in the README, and on Linux it doesn't exist at all, so on a machine set up from the docs the command isn't found.It doesn't stop there either.
export VAR=$(...)returns the status ofexportrather than of the substitution, soset -enever fires. The script carries on with an emptyREGISTRATION_IDthroughconfigureController(),activateValidator()andupdateVotingPower(), and exits 0:With the change the id parses normally, and when it genuinely can't be read the script prints the output it got and exits 1 instead of carrying on.
The replacement is POSIX sed against the same
_registrationId: uint256 <n>line forge prints under== Return ==, so it matches what-oP ... \Kmatched, andtail -1is unchanged.exportstays because the Solidity script reads the value throughvm.envUint.