Skip to content
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

Parameterize MaxRequestLength #564

Merged
merged 8 commits into from
Jun 29, 2020
Merged

Conversation

joowon-byun
Copy link
Contributor

@joowon-byun joowon-byun commented Jun 26, 2020

Proposed changes

  • Able to parametrize `MaxRequestLength

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

Further comments

Went through an RPC call test in a running node.

cmd/utils/flags.go Outdated Show resolved Hide resolved
cmd/ken/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ehnuje ehnuje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please check some lines with fmt.Println?

networks/rpc/client.go Outdated Show resolved Hide resolved
@@ -500,6 +500,11 @@ var (
Usage: "Wait time the rw timer waits for message writing",
Value: 15 * time.Second,
}
MaxRequestContentLengthFlag = cli.IntFlag{
Name: "maxRequestContentLength",
Usage: "Max request content length for http, websocket and gRPC",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Usage: "Max request content length for http, websocket and gRPC",
Usage: "Max request content byte length for http, websocket and gRPC",

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "content length" is fine. It will not read content as byte, but string. Indeed, "Content-length" is used as an HTTP header name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to content length in byte. What do you think? :)

cmd/utils/flags.go Outdated Show resolved Hide resolved
common/variables.go Outdated Show resolved Hide resolved
networks/rpc/client.go Outdated Show resolved Hide resolved
Copy link
Contributor

@KimKyungup KimKyungup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM without minor comments.

And check the test result also

@@ -458,6 +458,20 @@ func (c *Client) newMessage(method string, paramsIn ...interface{}) (*jsonrpcMes
return &jsonrpcMessage{Version: "2.0", ID: c.nextID(), Method: method, Params: params}, nil
}

func (c *Client) getMessageSize(method string, args ...interface{}) (int, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you put this function in `networks/rpc/websocket_test.go"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put in client.go because it could be used at some place less. A new RPC call or a new test code in tests package could be expected.

@KimKyungup KimKyungup merged commit f8d0899 into klaytn:dev Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants