Skip to content

rpc: add chunked rpc interface#6445

Merged
tychoish merged 12 commits intotendermint:masterfrom
tychoish:rpc-genesis-chunks
May 24, 2021
Merged

rpc: add chunked rpc interface#6445
tychoish merged 12 commits intotendermint:masterfrom
tychoish:rpc-genesis-chunks

Conversation

@tychoish
Copy link
Contributor

@tychoish tychoish commented May 10, 2021

I think there may be additional testing that would be useful, and I
think we should also update documentation and specs, maybe, but I'm
not sure the full scope or ordering of that work relative to this PR.

Resolves #6354

@codecov
Copy link

codecov bot commented May 10, 2021

Codecov Report

Merging #6445 (5d9d10b) into master (0781ca3) will decrease coverage by 0.20%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #6445      +/-   ##
==========================================
- Coverage   60.91%   60.71%   -0.21%     
==========================================
  Files         288      289       +1     
  Lines       27070    27156      +86     
==========================================
- Hits        16490    16488       -2     
- Misses       8888     8962      +74     
- Partials     1692     1706      +14     
Impacted Files Coverage Δ
light/rpc/client.go 9.70% <0.00%> (-0.04%) ⬇️
node/node.go 49.76% <0.00%> (-0.16%) ⬇️
rpc/core/env.go 47.05% <0.00%> (-14.48%) ⬇️
rpc/core/net.go 39.34% <0.00%> (-11.72%) ⬇️
rpc/core/routes.go 0.00% <0.00%> (ø)
rpc/core/types/responses.go 33.33% <ø> (ø)
privval/signer_listener_endpoint.go 80.00% <0.00%> (-9.42%) ⬇️
types/tx.go 82.97% <0.00%> (-4.26%) ⬇️
privval/socket_listeners.go 78.72% <0.00%> (-4.26%) ⬇️
privval/signer_endpoint.go 75.75% <0.00%> (-3.04%) ⬇️
... and 15 more

Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

This all looks good to me. I think the first thing you should do is open a PR in the spec repo looking to add this rpc endpoint. Then we can merge this one / add more tests if you feel like some edge cases are missing. After that we can update the docs - which I think is mainly updating the swagger.yml file.

require.NoError(t, err)

decoded := make([]string, 0, first.TotalChunks)
for i := first.ChunkNumber; i < first.TotalChunks+1; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

How big is this test genesis file? Does it even loop more than once?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah we don't loop in the test. On the plus side we don't actually handle the test case differently.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to create a test where there are more than one chunk?

doc := []byte(strings.Join(decoded, ""))

var out types.GenesisDoc
require.NoError(t, tmjson.Unmarshal(doc, &out),
Copy link
Contributor

Choose a reason for hiding this comment

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

Being able to unmarshal basically ensures that the chunked genesis is the same as the one before right? Although technically they could be different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, ensures that that we didn't break the JSON encoding.

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Looks great @tychoish. I just a few comments 👍

@alexanderbez alexanderbez added the C:rpc Component: JSON RPC, gRPC label May 11, 2021
@tychoish
Copy link
Contributor Author

@cmwaters (et al) I added this to the spec: tendermint/spec#299

Copy link
Contributor

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK.

Could you add a changelog and upgrading.md entry.

@alexanderbez
Copy link
Contributor

@tychoish what's stopping this from being merged?

@tychoish tychoish merged commit d913406 into tendermint:master May 24, 2021
@tac0turtle
Copy link
Contributor

@Mergifyio backport release/v0.34.x

@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2021

Command backport release/v0.34.x: failure

No backport have been created

  • Backport to branch release/v0.34.x failed: Branch not found

@tac0turtle
Copy link
Contributor

@Mergifyio backport v0.34.x

mergify bot pushed a commit that referenced this pull request Jul 14, 2021
(cherry picked from commit d913406)

# Conflicts:
#	light/proxy/routes.go
#	node/node.go
#	rpc/core/net.go
#	rpc/core/routes.go
@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2021

Command backport v0.34.x: success

Backports have been created

tac0turtle added a commit that referenced this pull request Jul 14, 2021
* rpc: add chunked rpc interface (#6445)

(cherry picked from commit d913406)

# Conflicts:
#	light/proxy/routes.go
#	node/node.go
#	rpc/core/net.go
#	rpc/core/routes.go

* fix conflicts

Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
@cmwaters
Copy link
Contributor

I don't see the /genesis_chunked endpoint in the RPC documentation (https://docs.tendermint.com/master/rpc/). Is there something we're missing?

@tac0turtle
Copy link
Contributor

tac0turtle commented Jul 14, 2021

nope, it wasn't added in this PR.

will make an issue

iammadab referenced this pull request in dashpay/tenderdash Oct 13, 2021
* rpc: add chunked rpc interface (#6445)

(cherry picked from commit d913406)

* fix conflicts

Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
(cherry picked from commit da9eefd)
williambanfield pushed a commit that referenced this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C:rpc Component: JSON RPC, gRPC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rpc: genesis endpoint

4 participants