-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix(middleware): proper handling of handler status codes in log/metrics middlewares #200
Conversation
server/middleware.go
Outdated
// we assume that every route will set the status header | ||
recordDur(w.Header().Get("status"), string(mode), string(versionByte)) | ||
return fmt.Errorf("metrics middleware: error parsing version byte: %w", err) | ||
// Some routes don't have a version byte, such as /put simple commitments. |
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.
why would /put simple commitments not have a version byte but OP /put would?
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.
Good catch.... I was totally wrong here. I updated to: 096003c
Realized our version bytes are hardcoded for all the PUT routes.. bit ugly how I did some of the routing now I'm realizing. But let me know what you think of these changes. You'll have to change this when you get the v2 changes in.
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.
Oh also for reference it seems like its the keccak commitments that don't have a version byte:
eigenda-proxy/server/routing.go
Line 66 in 096003c
// we don't use version_byte for keccak commitments, because not expecting keccak commitments to change, |
2561326
to
8bd4b41
Compare
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.
LGTM
Fixes Issue
Fixes #186
Changes proposed
Screenshots (Optional)
Note to reviewers