Repository navigation
rpc: Add caching support - #9650
Merged
Merged
Conversation
This was referenced Oct 31, 2022
Contributor
|
I went through this and it looks good to me |
thanethomson
marked this pull request as ready for review
October 31, 2022 17:05
Contributor
|
lgtm |
Co-authored-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Allows us to roll this change out in a non-API-breaking way, since this is an additive change. Signed-off-by: Thane Thomson <[email protected]>
Ensure a consistent caching strategy across both JSONRPC- and URI-based requests. This requires a bit of a refactor of the previous caching logic, which is complicated a little by the complex reflection-based approach taken in the Tendermint RPC. Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
thanethomson
force-pushed
the
thane/9442-rpc-cache-control
branch
from
October 31, 2022 19:52
eb1fc9d to
bacaceb
Compare
sergio-mena
approved these changes
Nov 2, 2022
Contributor
There was a problem hiding this comment.
LGTM, thanks @JayT106 and @thanethomson for this!
mergify Bot
pushed a commit
that referenced
this pull request
Nov 3, 2022
* Set cache control in the HTTP-RPC response header * Add a simply cache policy to the RPC routes * add a condition to check the RPC request has default height settings * fix cherry pick error * update pending log * use options struct intead of single parameter * refacor FuncOptions to functional options * add functional options in WebSocket RPC function * revert doc * replace deprecated function call * revise functional options * remove unuse comment * fix revised error * adjust cache-control settings * Update rpc/jsonrpc/server/http_json_handler.go Co-authored-by: Thane Thomson <[email protected]> * linter: Fix false positive Signed-off-by: Thane Thomson <[email protected]> * rpc: Separate cacheable and non-cacheable HTTP response writers Allows us to roll this change out in a non-API-breaking way, since this is an additive change. Signed-off-by: Thane Thomson <[email protected]> * rpc: Ensure consistent caching strategy Ensure a consistent caching strategy across both JSONRPC- and URI-based requests. This requires a bit of a refactor of the previous caching logic, which is complicated a little by the complex reflection-based approach taken in the Tendermint RPC. Signed-off-by: Thane Thomson <[email protected]> * rpc: Add more tests for caching Signed-off-by: Thane Thomson <[email protected]> * Update CHANGELOG_PENDING Signed-off-by: Thane Thomson <[email protected]> * light: Sync routes config with RPC core Signed-off-by: Thane Thomson <[email protected]> * rpc: Update OpenAPI docs Signed-off-by: Thane Thomson <[email protected]> Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: jayt106 <[email protected]> Co-authored-by: jay tseng <[email protected]> Co-authored-by: JayT106 <[email protected]> (cherry picked from commit 816c6ba) # Conflicts: # CHANGELOG_PENDING.md # test/fuzz/tests/rpc_jsonrpc_server_test.go
mergify Bot
pushed a commit
that referenced
this pull request
Nov 3, 2022
* Set cache control in the HTTP-RPC response header * Add a simply cache policy to the RPC routes * add a condition to check the RPC request has default height settings * fix cherry pick error * update pending log * use options struct intead of single parameter * refacor FuncOptions to functional options * add functional options in WebSocket RPC function * revert doc * replace deprecated function call * revise functional options * remove unuse comment * fix revised error * adjust cache-control settings * Update rpc/jsonrpc/server/http_json_handler.go Co-authored-by: Thane Thomson <[email protected]> * linter: Fix false positive Signed-off-by: Thane Thomson <[email protected]> * rpc: Separate cacheable and non-cacheable HTTP response writers Allows us to roll this change out in a non-API-breaking way, since this is an additive change. Signed-off-by: Thane Thomson <[email protected]> * rpc: Ensure consistent caching strategy Ensure a consistent caching strategy across both JSONRPC- and URI-based requests. This requires a bit of a refactor of the previous caching logic, which is complicated a little by the complex reflection-based approach taken in the Tendermint RPC. Signed-off-by: Thane Thomson <[email protected]> * rpc: Add more tests for caching Signed-off-by: Thane Thomson <[email protected]> * Update CHANGELOG_PENDING Signed-off-by: Thane Thomson <[email protected]> * light: Sync routes config with RPC core Signed-off-by: Thane Thomson <[email protected]> * rpc: Update OpenAPI docs Signed-off-by: Thane Thomson <[email protected]> Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: jayt106 <[email protected]> Co-authored-by: jay tseng <[email protected]> Co-authored-by: JayT106 <[email protected]> (cherry picked from commit 816c6ba) # Conflicts: # CHANGELOG_PENDING.md # light/proxy/routes.go # rpc/core/routes.go # rpc/openapi/openapi.yaml # test/fuzz/tests/rpc_jsonrpc_server_test.go
liamsi
pushed a commit
that referenced
this pull request
Nov 5, 2022
* Set cache control in the HTTP-RPC response header * Add a simply cache policy to the RPC routes * add a condition to check the RPC request has default height settings * fix cherry pick error * update pending log * use options struct intead of single parameter * refacor FuncOptions to functional options * add functional options in WebSocket RPC function * revert doc * replace deprecated function call * revise functional options * remove unuse comment * fix revised error * adjust cache-control settings * Update rpc/jsonrpc/server/http_json_handler.go Co-authored-by: Thane Thomson <[email protected]> * linter: Fix false positive Signed-off-by: Thane Thomson <[email protected]> * rpc: Separate cacheable and non-cacheable HTTP response writers Allows us to roll this change out in a non-API-breaking way, since this is an additive change. Signed-off-by: Thane Thomson <[email protected]> * rpc: Ensure consistent caching strategy Ensure a consistent caching strategy across both JSONRPC- and URI-based requests. This requires a bit of a refactor of the previous caching logic, which is complicated a little by the complex reflection-based approach taken in the Tendermint RPC. Signed-off-by: Thane Thomson <[email protected]> * rpc: Add more tests for caching Signed-off-by: Thane Thomson <[email protected]> * Update CHANGELOG_PENDING Signed-off-by: Thane Thomson <[email protected]> * light: Sync routes config with RPC core Signed-off-by: Thane Thomson <[email protected]> * rpc: Update OpenAPI docs Signed-off-by: Thane Thomson <[email protected]> Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: jayt106 <[email protected]> Co-authored-by: jay tseng <[email protected]> Co-authored-by: JayT106 <[email protected]> (cherry picked from commit 816c6ba) # Conflicts: # CHANGELOG_PENDING.md # light/proxy/routes.go # rpc/core/routes.go # rpc/openapi/openapi.yaml # test/fuzz/tests/rpc_jsonrpc_server_test.go
thanethomson
added a commit
that referenced
this pull request
Nov 7, 2022
* rpc: Add caching support (#9650) * Set cache control in the HTTP-RPC response header * Add a simply cache policy to the RPC routes * add a condition to check the RPC request has default height settings * fix cherry pick error * update pending log * use options struct intead of single parameter * refacor FuncOptions to functional options * add functional options in WebSocket RPC function * revert doc * replace deprecated function call * revise functional options * remove unuse comment * fix revised error * adjust cache-control settings * Update rpc/jsonrpc/server/http_json_handler.go Co-authored-by: Thane Thomson <[email protected]> * linter: Fix false positive Signed-off-by: Thane Thomson <[email protected]> * rpc: Separate cacheable and non-cacheable HTTP response writers Allows us to roll this change out in a non-API-breaking way, since this is an additive change. Signed-off-by: Thane Thomson <[email protected]> * rpc: Ensure consistent caching strategy Ensure a consistent caching strategy across both JSONRPC- and URI-based requests. This requires a bit of a refactor of the previous caching logic, which is complicated a little by the complex reflection-based approach taken in the Tendermint RPC. Signed-off-by: Thane Thomson <[email protected]> * rpc: Add more tests for caching Signed-off-by: Thane Thomson <[email protected]> * Update CHANGELOG_PENDING Signed-off-by: Thane Thomson <[email protected]> * light: Sync routes config with RPC core Signed-off-by: Thane Thomson <[email protected]> * rpc: Update OpenAPI docs Signed-off-by: Thane Thomson <[email protected]> Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: jayt106 <[email protected]> Co-authored-by: jay tseng <[email protected]> Co-authored-by: JayT106 <[email protected]> (cherry picked from commit 816c6ba) # Conflicts: # CHANGELOG_PENDING.md # light/proxy/routes.go # rpc/core/routes.go # rpc/openapi/openapi.yaml # test/fuzz/tests/rpc_jsonrpc_server_test.go * Fix conflict in CHANGELOG_PENDING Signed-off-by: Thane Thomson <[email protected]> * Resolve remaining conflicts Signed-off-by: Thane Thomson <[email protected]> Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: Thane Thomson <[email protected]>
adrianbrink
pushed a commit
to heliaxdev/tendermint
that referenced
this pull request
May 23, 2023
* rpc: Add caching support (tendermint#9650) * Set cache control in the HTTP-RPC response header * Add a simply cache policy to the RPC routes * add a condition to check the RPC request has default height settings * fix cherry pick error * update pending log * use options struct intead of single parameter * refacor FuncOptions to functional options * add functional options in WebSocket RPC function * revert doc * replace deprecated function call * revise functional options * remove unuse comment * fix revised error * adjust cache-control settings * Update rpc/jsonrpc/server/http_json_handler.go Co-authored-by: Thane Thomson <[email protected]> * linter: Fix false positive Signed-off-by: Thane Thomson <[email protected]> * rpc: Separate cacheable and non-cacheable HTTP response writers Allows us to roll this change out in a non-API-breaking way, since this is an additive change. Signed-off-by: Thane Thomson <[email protected]> * rpc: Ensure consistent caching strategy Ensure a consistent caching strategy across both JSONRPC- and URI-based requests. This requires a bit of a refactor of the previous caching logic, which is complicated a little by the complex reflection-based approach taken in the Tendermint RPC. Signed-off-by: Thane Thomson <[email protected]> * rpc: Add more tests for caching Signed-off-by: Thane Thomson <[email protected]> * Update CHANGELOG_PENDING Signed-off-by: Thane Thomson <[email protected]> * light: Sync routes config with RPC core Signed-off-by: Thane Thomson <[email protected]> * rpc: Update OpenAPI docs Signed-off-by: Thane Thomson <[email protected]> Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: jayt106 <[email protected]> Co-authored-by: jay tseng <[email protected]> Co-authored-by: JayT106 <[email protected]> (cherry picked from commit 816c6ba) # Conflicts: # CHANGELOG_PENDING.md # test/fuzz/tests/rpc_jsonrpc_server_test.go * Resolve conflicts Signed-off-by: Thane Thomson <[email protected]> * fix check_tx cache problem (tendermint#9690) * Fixed missing package --------- Signed-off-by: Thane Thomson <[email protected]> Co-authored-by: Thane Thomson <[email protected]> Co-authored-by: JayT106 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #9442 and #9549, porting #6265 to
mainin a non-breaking way such that we can backport it to v0.34 and v0.37.This also attempts to ensure a consistent caching strategy across both JSONRPC- and URI-based requests.
PR checklist
CHANGELOG_PENDING.mdupdated, or no changelog entry neededdocs/) and code comments, or nodocumentation updates needed