Repository navigation
fix(Makefile): prevent NUM_VALIDATORS from evaluating to two tokens - #339
Ocheretovich wants to merge 1 commit into
Conversation
This is advisory review only.\n\nI independently re-ran the old and new Makefile expressions against the three relevant manifest states, plus a missing-file control:\n\n| manifest | old expression | this PR |\n|---|---:|---:|\n| missing file | The revised shell conditional treats a positive count as authoritative and falls back only for an empty/zero/non-numeric result.\n\nThe shell syntax is POSIX-compatible ( |
|
Hi @Ocheretovich, 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 This is not a judgement on the change itself. If you'd still like to land it:
Please see CONTRIBUTING.md for details. Thanks again for taking the time to contribute. |
Fixed a bug in NUM_VALIDATORS: when the manifest had no [nodes.validator...] entries, grep -c returned 0 but exited with status 1, which triggered the || echo 5 fallback resulting in the variable evaluating to "0 5" instead of a single number. The check is now explicit: fall back to 5 only when grep's count is missing or zero, otherwise use the actual count.
I tested the old and new logic against three cases missing manifest, manifest with zero validators, and manifest with 3 validators. The first and third cases behave identically either way, but the middle one exposes the bug: the old logic returned "0\n5" (two values instead of one) when the manifest existed but had no validator entries, while the fix correctly returns 5.