-
Notifications
You must be signed in to change notification settings - Fork 36
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: add challenge v2 api to avoid piece hash http header too large #1189
Conversation
a099851
to
e8a5845
Compare
e8a5845
to
0e63696
Compare
modular/gater/admin_handler.go
Outdated
@@ -377,6 +378,169 @@ func (g *GateModular) getChallengeInfoHandler(w http.ResponseWriter, r *http.Req | |||
log.CtxDebug(reqCtx.Context(), "succeed to get challenge info") | |||
} | |||
|
|||
// getChallengeInfoV2Handler handles get challenge piece info request. Current only greenfield | |||
// validator can challenge piece is store correctly. The challenge piece info includes: |
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.
Currently, only greenfield validator can challenge piece whether is stored correctly.
is better.
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.
Fixed.
modular/gater/admin_handler.go
Outdated
// validator can challenge piece is store correctly. The challenge piece info includes: | ||
// the challenged piece data, all piece hashes and the integrity hash. The challenger | ||
// can verify the info whether are correct by comparing with the greenfield info. | ||
// The difference between the v2 interface and the old interface is the format of the returned results, |
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.
Maybe the old interface(v1)
is better.
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.
Fixed.
0e63696
to
0108ba3
Compare
0108ba3
to
61b9d1f
Compare
61b9d1f
to
cb28003
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
Description
Add challenge v2 API to avoid piece hash HTTP header too large.
Rationale
Components such as nginx can disconnect because the response header is too large, and users receive a 502 HTTP status code.
Example
N/A.
Changes
Notable changes: