Conversation
WalkthroughThe script Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (2)
plugins/node-checker/run.sh (2)
625-655: 🛠️ Refactor suggestionStrengthen version extraction and comparison in
check_execution_version
The refactored pipeline consolidates extraction and comparison but can be made more robust:
- Use
jq -r '.result'to strip JSON quotes instead ofjq '.result'.- Quote
${EL_RPC_ENDPOINT}to prevent word-splitting.- Replace
sedwithgrep -oE '[0-9]+\.[0-9]+\.[0-9]+'for reliable semver extraction, avoiding fallback to raw JSON.- Ensure
LATEST_VERSIONis non-empty before comparing to prevent false positives.Suggested diff:
- EL_INSTALLED=$(curl -s -X POST ... ${EL_RPC_ENDPOINT} | jq '.result' | sed 's/.*[v\/]\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/') + EL_INSTALLED=$(curl -s -X POST ... "${EL_RPC_ENDPOINT}" \ + | jq -r '.result' \ + | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - LATEST_VERSION=$(curl -s $TAG_URL | jq -r .tag_name | sed 's/.*[v\/]\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/') + LATEST_VERSION=$(curl -s "$TAG_URL" \ + | jq -r .tag_name \ + | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') + if [[ -n "$LATEST_VERSION" && "${EL_INSTALLED#v}" == "${LATEST_VERSION#v}" ]]; then print_check_result "PASS" "Execution client ($EL) version: $EL_INSTALLED (latest)" else print_check_result "WARN" "Execution client ($EL) version: $EL_INSTALLED (latest: $LATEST_VERSION)" ((warning_checks++)) fi
665-695: 🛠️ Refactor suggestionApply consistent semver parsing in
check_consensus_version
Similar improvements should be applied here to mirror the execution-layer fix:
- Quote
"$API_BN_ENDPOINT".- Switch from
sed -ntogrep -oE '[0-9]+\.[0-9]+\.[0-9]+'.- Use
jq -rto drop quotes before parsing.- Validate
LATEST_VERSIONis set before comparing.Example adjustment:
- CL_VERSION=$(curl -s -X GET "${API_BN_ENDPOINT}/eth/v1/node/version" ... | jq -r '.data.version' | sed -n 's/.*v\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p') + CL_VERSION=$(curl -s -X GET "$API_BN_ENDPOINT/eth/v1/node/version" ... \ + | jq -r '.data.version' \ + | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
🧹 Nitpick comments (1)
plugins/node-checker/run.sh (1)
705-735: DRY out validator version logic
check_validator_versionduplicates the same fetch-and-compare steps ascheck_consensus_version. Consider extracting a helper function, e.g.:check_client_version() { local name=$1 endpoint=$2 path=$3 tag_url=$4 ((total_checks++)) version=$(curl -s -X GET "$endpoint" | jq -r "$path" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') latest=$(curl -s "$tag_url" | jq -r .tag_name | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') if [[ -n "$latest" && "${version#v}" == "${latest#v}" ]]; then print_check_result "PASS" "$name version: $version (latest)" else print_check_result "WARN" "$name version: $version (latest: $latest)" ((warning_checks++)) fi }Then call it for execution, consensus, and validator, passing the appropriate parameters.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
plugins/node-checker/run.sh(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: run-lido-csm-staking-node
Summary by CodeRabbit