This repository was archived by the owner on Mar 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
feat: Instrument VoteExtension status [BLO-792] #41
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bd992c4
add metrics for pre-block latency
nivasan1 04fe495
linting
nivasan1 eb1997d
ABCI method requests + status implementations
nivasan1 cfeffe2
tests
nivasan1 778feca
migrate shared errors to types pkg
nivasan1 7772684
linting
nivasan1 a203f62
add metrics for pre-block latency
nivasan1 4f57d26
linting
nivasan1 c06a4da
migrate shared errors to types pkg
nivasan1 efb04a8
temp
nivasan1 9e4b2b8
testing
nivasan1 0a83173
godoc
nivasan1 288e75b
ignore errors from VEs
nivasan1 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 hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package types | ||
|
||
import ( | ||
"time" | ||
|
||
servicemetrics "github.com/skip-mev/slinky/service/metrics" | ||
) | ||
|
||
// RecordLatencyAndStatus is used by the ABCI handlers to record their e2e latency, and the status of the request | ||
// to their corresponding metrics objects. | ||
func RecordLatencyAndStatus( | ||
metrics servicemetrics.Metrics, latency time.Duration, err error, method servicemetrics.ABCIMethod, | ||
) { | ||
// observe latency | ||
metrics.ObserveABCIMethodLatency(method, latency) | ||
|
||
// increment the number of extend vote requests | ||
var label servicemetrics.Labeller | ||
if err != nil { | ||
label, _ = err.(servicemetrics.Labeller) | ||
} else { | ||
label = servicemetrics.Success{} | ||
} | ||
metrics.AddABCIRequest(method, label) | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package ve | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// PreBlockError is an error that is returned when the pre-block simulation fails. | ||
type PreBlockError struct { | ||
Err error | ||
} | ||
|
||
func (e PreBlockError) Error() string { | ||
return fmt.Sprintf("finalize block error: %s", e.Err.Error()) | ||
} | ||
|
||
func (e PreBlockError) Label() string { | ||
return "PreBlockError" | ||
} | ||
|
||
// Panic is an error that is returned when a panic occurs in the ABCI handler. | ||
type Panic struct { | ||
Err error | ||
} | ||
|
||
func (e Panic) Error() string { | ||
return fmt.Sprintf("panic: %s", e.Err.Error()) | ||
} | ||
|
||
func (e Panic) Label() string { | ||
return "Panic" | ||
} | ||
|
||
// OracleClientError is an error that is returned when the oracle client's response is invalid. | ||
type OracleClientError struct { | ||
Err error | ||
} | ||
|
||
func (e OracleClientError) Error() string { | ||
return fmt.Sprintf("oracle client error: %s", e.Err.Error()) | ||
} | ||
|
||
func (e OracleClientError) Label() string { | ||
return "OracleClientError" | ||
} | ||
|
||
// TransformPricesError is an error that is returned when there is a failure in attempting to transform the prices returned | ||
// from the oracle server to the format expected by the validator set. | ||
type TransformPricesError struct { | ||
Err error | ||
} | ||
|
||
func (e TransformPricesError) Error() string { | ||
return fmt.Sprintf("prices transform error: %s", e.Err.Error()) | ||
} | ||
|
||
func (e TransformPricesError) Label() string { | ||
return "TransformPricesError" | ||
} | ||
|
||
// ValidateVoteExtensionError is an error that is returned when there is a failure in validating a vote extension. | ||
type ValidateVoteExtensionError struct { | ||
Err error | ||
} | ||
|
||
func (e ValidateVoteExtensionError) Error() string { | ||
return fmt.Sprintf("validate vote extension error: %s", e.Err.Error()) | ||
} | ||
|
||
func (e ValidateVoteExtensionError) Label() string { | ||
return "ValidateVoteExtensionError" | ||
} |
Oops, something went wrong.
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 this just be a method on
servicemetrics.Metrics
?