Skip to content

fix(scripts): make arc-check.sh report unavailable data instead of "ok" - #364

Open
yzwooyi wants to merge 1 commit into
circlefin:mainfrom
yzwooyi:fix/arc-check-misleading-output
Open

fix(scripts): make arc-check.sh report unavailable data instead of "ok"#364
yzwooyi wants to merge 1 commit into
circlefin:mainfrom
yzwooyi:fix/arc-check-misleading-output

Conversation

@yzwooyi

@yzwooyi yzwooyi commented Sep 6, 2026

Copy link
Copy Markdown

Closes: #363

scripts/arc-check.sh reported four failure modes as healthy, or aborted the report. This PR fixes them; when every height is reachable and the node is a validator, the output wording is unchanged.

# Before After
1 --el node without admin namespace → Connected: 0 peers, then jq: Cannot iterate over null, exit 5, Proposal History never runs WARN: admin_peers unavailable: Method not found (is the admin namespace enabled?), report continues; transport failure also warns instead of die
2 Unreachable /proposal-monitor heights silently skipped but counted → All 50 proposals decided successfully: yes Proposal data unavailable for N/M heights (not counted); verdicts use only fetched heights
3 Non-validator node → red never selected as proposer yellow not in validator set (expected for non-validator nodes); red verdict kept for in-set validators with 0 proposals; a node that did propose is always ok regardless of key decoding
4 Progress bar emits # at 0 % (two on macOS, seq 1 0 counts down) and . at 100 % printf '%*s' N '' | tr padding, total == 0 guarded

Testing

  • New scripts/test_arc_check.sh: inline python http.server mock of the CL endpoints (/health, /status, /network-state, /proposal-monitor) and the EL JSON-RPC (admin_peers), shapes taken from crates/malachite-app/src/rpc/types.rs / handlers.rs. Scenarios: admin namespace disabled, missing heights, node not in validator set, node in set with own proposals, bar padding.
  • Against main: PASS: 5 FAIL: 8 (cases 1–3 fail as expected). With this PR: PASS: 13 FAIL: 0.
  • bash -n scripts/arc-check.sh clean. Run on macOS 27.0 with the stock /bin/bash 3.2.57, jq 1.7.1, python 3.11.15; the test only needs bash, jq, curl, python3.

- --el: warn and continue when admin_peers is unavailable or the EL
  endpoint is unreachable, instead of printing "Connected: 0 peers"
  and aborting the report on a jq iterate-null error
- proposal history: count heights whose /proposal-monitor lookup failed
  and exclude them from the verdicts instead of counting them as ok
- nodes not in the validator set no longer get the red
  "never selected as proposer" verdict
- progress bar: replace seq-based padding (off by one at 0%/100%,
  two chars on BSD seq) with printf padding; guard total == 0
- add scripts/test_arc_check.sh with an inline mock of the CL/EL RPCs
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.

bug(scripts): arc-check.sh reports unreachable data as healthy and aborts on nodes without the admin namespace

1 participant