-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kes expiration fixes #1839
Merged
Merged
Kes expiration fixes #1839
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
02ad224
bump dbsync to 13.6.0.2
Scitz0 bc41248
First cut of changes to KES expiration information fixes on cntools l…
aa8a028
If pool is not registered, don't bother with KES related logic as a p…
4923db4
Clean up kes.start if pool cert is absent
e0b3a67
Changes following Ola's review
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,9 +237,12 @@ kes_rotation_needed="no" | |
if [[ ${CHECK_KES} = true ]]; then | ||
|
||
while IFS= read -r -d '' pool; do | ||
if [[ ! -f "${pool}/${POOL_CURRENT_KES_START}" ]]; then | ||
continue | ||
fi | ||
|
||
unset pool_kes_start | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can remove unset of pool_kes_start as we always overwrite it on line below. |
||
[[ ${CNTOOLS_MODE} = "LOCAL" ]] && getNodeMetrics | ||
[[ (-z ${remaining_kes_periods} || ${remaining_kes_periods} -eq 0) && -f "${pool}/${POOL_CURRENT_KES_START}" ]] && unset remaining_kes_periods && pool_kes_start="$(cat "${pool}/${POOL_CURRENT_KES_START}")" | ||
unset remaining_kes_periods && pool_kes_start="$(cat "${pool}/${POOL_CURRENT_KES_START}")" | ||
|
||
if ! kesExpiration ${pool_kes_start}; then println ERROR "${FG_RED}ERROR${NC}: failure during KES calculation for ${FG_GREEN}$(basename ${pool})${NC}" && waitToProceed && continue; fi | ||
|
||
|
@@ -2801,25 +2804,26 @@ function main { | |
println "$(printf "%-21s : ${FG_LGRAY}%s${NC}" "ID (hex)" "${pool_id}")" | ||
[[ -n ${pool_id_bech32} ]] && println "$(printf "%-21s : ${FG_LGRAY}%s${NC}" "ID (bech32)" "${pool_id_bech32}")" | ||
println "$(printf "%-21s : %s" "Registered" "${pool_registered}")" | ||
unset pool_kes_start | ||
if [[ ${CNTOOLS_MODE} = "LOCAL" ]]; then | ||
getNodeMetrics | ||
else | ||
|
||
if [[ ${pool_registered} = *YES* ]]; then | ||
unset pool_kes_start | ||
unset remaining_kes_periods | ||
[[ -f "${pool}/${POOL_CURRENT_KES_START}" ]] && pool_kes_start="$(cat "${pool}/${POOL_CURRENT_KES_START}")" | ||
fi | ||
if ! kesExpiration ${pool_kes_start}; then | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_RED}%s${NC}%s${FG_GREEN}%s${NC}" "KES expiration date" "ERROR" ": failure during KES calculation for " "$(basename ${pool})")" | ||
else | ||
if [[ ${expiration_time_sec_diff} -lt ${KES_ALERT_PERIOD} ]]; then | ||
if [[ ${expiration_time_sec_diff} -lt 0 ]]; then | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_RED}%s${NC} %s ago" "KES expiration date" "${kes_expiration}" "EXPIRED!" "$(timeLeft ${expiration_time_sec_diff:1})")" | ||
|
||
if ! kesExpiration ${pool_kes_start}; then | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_RED}%s${NC}%s${FG_GREEN}%s${NC}" "KES expiration date" "ERROR" ": failure during KES calculation for " "$(basename ${pool})")" | ||
else | ||
if [[ ${expiration_time_sec_diff} -lt ${KES_ALERT_PERIOD} ]]; then | ||
if [[ ${expiration_time_sec_diff} -lt 0 ]]; then | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_RED}%s${NC} %s ago" "KES expiration date" "${kes_expiration}" "EXPIRED!" "$(timeLeft ${expiration_time_sec_diff:1})")" | ||
else | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_RED}%s${NC} %s until expiration" "KES expiration date" "${kes_expiration}" "ALERT!" "$(timeLeft ${expiration_time_sec_diff})")" | ||
fi | ||
elif [[ ${expiration_time_sec_diff} -lt ${KES_WARNING_PERIOD} ]]; then | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_YELLOW}%s${NC} %s until expiration" "KES expiration date" "${kes_expiration}" "WARNING!" "$(timeLeft ${expiration_time_sec_diff})")" | ||
else | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_RED}%s${NC} %s until expiration" "KES expiration date" "${kes_expiration}" "ALERT!" "$(timeLeft ${expiration_time_sec_diff})")" | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC}" "KES expiration date" "${kes_expiration}")" | ||
fi | ||
elif [[ ${expiration_time_sec_diff} -lt ${KES_WARNING_PERIOD} ]]; then | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_YELLOW}%s${NC} %s until expiration" "KES expiration date" "${kes_expiration}" "WARNING!" "$(timeLeft ${expiration_time_sec_diff})")" | ||
else | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC}" "KES expiration date" "${kes_expiration}")" | ||
fi | ||
fi | ||
done < <(find "${POOL_FOLDER}" -mindepth 1 -maxdepth 1 -type d -print0 | sort -z) | ||
|
@@ -3119,7 +3123,6 @@ function main { | |
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} %%" "Saturation" "${p_live_saturation}")" | ||
fi | ||
|
||
unset pool_kes_start | ||
if [[ -n ${KOIOS_API} ]]; then | ||
[[ ${p_op_cert_counter} != null ]] && kes_counter_str="${FG_LBLUE}${p_op_cert_counter}${FG_LGRAY} - use counter ${FG_LBLUE}$((p_op_cert_counter+1))${FG_LGRAY} for rotation in offline mode.${NC}" || kes_counter_str="${FG_LGRAY}No blocks minted so far with active operational certificate. Use counter ${FG_LBLUE}0${FG_LGRAY} for rotation in offline mode.${NC}" | ||
println "$(printf "%-21s : %s" "KES counter" "${kes_counter_str}")" | ||
|
@@ -3137,9 +3140,12 @@ function main { | |
fi | ||
println "$(printf "%-21s : %s" "KES counter" "${kes_counter_str}")" | ||
getNodeMetrics | ||
else | ||
[[ -f "${POOL_FOLDER}/${pool_name}/${POOL_CURRENT_KES_START}" ]] && pool_kes_start="$(cat "${POOL_FOLDER}/${pool_name}/${POOL_CURRENT_KES_START}")" | ||
fi | ||
|
||
unset pool_kes_start | ||
[[ -f "${POOL_FOLDER}/${pool_name}/${POOL_CURRENT_KES_START}" ]] && pool_kes_start="$(cat "${POOL_FOLDER}/${pool_name}/${POOL_CURRENT_KES_START}")" | ||
unset remaining_kes_periods | ||
|
||
if ! kesExpiration ${pool_kes_start}; then | ||
println "$(printf "%-21s : ${FG_LGRAY}%s${NC} - ${FG_RED}%s${NC}%s${FG_GREEN}%s${NC}" "KES expiration date" "ERROR" ": failure during KES calculation for " "$(basename ${pool})")" | ||
else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should maybe remove recursive flag as we are trying to delete a single file. So no misshaps happen if variables are unset