Skip to content

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

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

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

Copy link
Copy Markdown
Contributor

Hi @Dusk1e,

Thank you for your interest in contributing to Arc Node, and apologies for the delay in getting back to this PR.

We're closing out the pull request backlog that predates our current contribution policy. This PR is being closed because it does not reference a GitHub issue. All PRs must reference an existing issue using the format Closes: #XXX, and the author must be assigned to that issue before the PR is opened.

This is not a judgement on the change itself. If you'd still like to land it:

  1. Open an issue describing the problem, or find the existing one
  2. Comment on the issue requesting assignment, and wait for maintainer approval
  3. Open a fresh PR once you have been assigned

Please see CONTRIBUTING.md for details. Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants