Skip to content

fix(scripts): parse the registration id without ggrep - #391

Open
Dusk1e wants to merge 1 commit into
circlefin:mainfrom
Dusk1e:fix/register-validator-ggrep
Open

fix(scripts): parse the registration id without ggrep#391
Dusk1e wants to merge 1 commit into
circlefin:mainfrom
Dusk1e:fix/register-validator-ggrep

Conversation

@Dusk1e

@Dusk1e Dusk1e commented Sep 12, 2026

Copy link
Copy Markdown

register-validator.sh reads the registration id out of the forge output with ggrep -oP. ggrep is Homebrew's GNU grep: it isn't in the brew install line 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 of export rather than of the substitution, so set -e never fires. The script carries on with an empty REGISTRATION_ID through configureController(), activateValidator() and updateVotingPower(), and exits 0:

scripts/register-validator.sh: line 53: ggrep: command not found
Registered validator with registration id:
Updating voting power to 20
$ echo $?
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 ... \K matched, and tail -1 is unchanged. export stays because the Solidity script reads the value through vm.envUint.

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.
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.

1 participant