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.
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
[CLOB-1043] replicate IsLiquidatable logic on daemon #873
[CLOB-1043] replicate IsLiquidatable logic on daemon #873
Changes from 5 commits
d446a89
d9fa678
7180bd1
6a36196
1d38b49
d12f799
85bb561
1d7facb
577500c
2294683
b90c55b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The results confirm that the metric constant
CheckCollateralizationForSubaccounts
is used in two places within the codebase:protocol/lib/metrics/constants.go
.protocol/daemons/liquidation/client/sub_task_runner.go
within adefer
statement for telemetry purposes.The context provided around the usage in
sub_task_runner.go
indicates that the metric was used to measure the latency of theCheckCollateralizationForSubaccounts
function. Since this function has been removed, the corresponding metric should also be removed or updated to reflect the new logic that replaces the removed function.Given this information, the removal of the
CheckCollateralizationForSubaccounts
function does indeed require attention to the associated metric constant and its usage. The codebase should be updated to ensure that there are no orphaned references or incorrect telemetry measurements.The review should therefore include the following points:
The metric constant
CheckCollateralizationForSubaccounts
inprotocol/lib/metrics/constants.go
should be removed or repurposed if it is no longer relevant.The telemetry measurement in
protocol/daemons/liquidation/client/sub_task_runner.go
should be updated to remove the reference to the removed function or to measure the latency of the new logic that has replaced it.Remove or update the metric constant
CheckCollateralizationForSubaccounts
inprotocol/lib/metrics/constants.go
.Address the reference to
CheckCollateralizationForSubaccounts
inprotocol/daemons/liquidation/client/sub_task_runner.go
to ensure correct telemetry measurement.Analysis chain
The
CheckCollateralizationForSubaccounts
function has been removed. Verify that there are no orphaned references to this function in the codebase and that its removal does not affect any dependent logic.The shell script results indicate that there are references to the
CheckCollateralizationForSubaccounts
function in two files:protocol/lib/metrics/constants.go
andprotocol/daemons/liquidation/client/sub_task_runner.go
. To verify that the removal of this function does not affect any dependent logic, we need to check these files to understand the context in which the function is referenced.Let's start by examining the references in
protocol/lib/metrics/constants.go
to see if it's just a metric constant that needs to be removed or updated. Then we'll checkprotocol/daemons/liquidation/client/sub_task_runner.go
to see how the function was being used and ensure that its removal has been properly handled in the logic of the sub task runner.The results from the shell scripts show that the
CheckCollateralizationForSubaccounts
function is referenced in two places:In
protocol/lib/metrics/constants.go
, it appears to be a string constant namedCheckCollateralizationForSubaccounts
. This is likely used as a key or label for metrics and may need to be removed or updated if it is no longer relevant due to the removal of the function.In
protocol/daemons/liquidation/client/sub_task_runner.go
, the constantmetrics.CheckCollateralizationForSubaccounts
is used, which suggests that the function's removal should also prompt an update to the metrics collection logic in this file.To ensure that the removal of the
CheckCollateralizationForSubaccounts
function is properly handled, we need to verify that:protocol/lib/metrics/constants.go
is either removed or no longer used.protocol/daemons/liquidation/client/sub_task_runner.go
is addressed, meaning that the code has been updated to remove the metric logging or it has been replaced with an alternative logic.Let's proceed with checking the usage of the metric constant in
protocol/lib/metrics/constants.go
and how the reference inprotocol/daemons/liquidation/client/sub_task_runner.go
is handled after the removal of theCheckCollateralizationForSubaccounts
function.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 151
Script:
Length of output: 302
Script:
Length of output: 584