Skip to content

Conversation

@joshua-kim
Copy link
Contributor

@joshua-kim joshua-kim commented Apr 23, 2025

Why this should be merged

Fixes a bug in rpcchainvm where a arbitrary length http body will hang when attempting to copy the body into protobuf.

How this works

Instead of copying the body into a proto message, wrap the http body in an implementation of io.Reader that streams the message body.

How this was tested

Added a regression test

Need to be documented in RELEASES.md?

Yes

@joshua-kim joshua-kim added the bug Something isn't working label Apr 23, 2025
@joshua-kim joshua-kim self-assigned this Apr 23, 2025
@joshua-kim joshua-kim changed the title fix rpcchainvm bug where body is not copied fix rpcchainvm request/response handling Apr 23, 2025
@joshua-kim joshua-kim force-pushed the rpcchainvm-bug-fix branch 3 times, most recently from ac8fb6d to 11b1ef5 Compare April 24, 2025 00:26
@joshua-kim joshua-kim changed the title fix rpcchainvm request/response handling fix rpcchainvm handling for arbitrary length http body Apr 24, 2025
@joshua-kim joshua-kim marked this pull request as ready for review April 24, 2025 00:27
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Comment on lines 29 to 31
if err != nil {
return 0, err
}
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 think it's fine for us to just return the error here. io.EOF is a special error for both grpc and io.Reader (ref). io.EOF's invariants on io.Reader are particularly confusing though.

Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@StephenButtolph
Copy link
Contributor

Also - linting seems to be failing

joshua-kim and others added 7 commits April 24, 2025 14:20
Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
@joshua-kim joshua-kim enabled auto-merge April 25, 2025 00:14
Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

looks functionally correct to me.

@joshua-kim joshua-kim added this pull request to the merge queue Apr 25, 2025
Merged via the queue into master with commit 3de286b Apr 25, 2025
24 checks passed
@joshua-kim joshua-kim deleted the rpcchainvm-bug-fix branch April 25, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants