11 Commits

Author SHA1 Message Date
mergify[bot]
7917485bc7 rpc: Add caching support (backport #9650) (#9666)
* 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 <connect@thanethomson.com>

* linter: Fix false positive

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* 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 <connect@thanethomson.com>

* 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 <connect@thanethomson.com>

* rpc: Add more tests for caching

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update CHANGELOG_PENDING

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* light: Sync routes config with RPC core

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc: Update OpenAPI docs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: jayt106 <jaytseng106@gmail.com>
Co-authored-by: jay tseng <jay.tseng@crypto.com>
Co-authored-by: JayT106 <JayT106@users.noreply.github.com>
(cherry picked from commit 816c6bac00)

# 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 <connect@thanethomson.com>

* Resolve remaining conflicts

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
2022-11-07 06:11:05 -05:00
mergify[bot]
e914fe40ec ci: Fix linter complaint (backport #9645) (#9647)
* ci: Fix linter complaint (#9645)

Fixes a very silly linter complaint that makes absolutely no sense and is blocking the merging of several PRs.

---

#### PR checklist

- [x] Tests written/updated, or no tests needed
- [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [x] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed

(cherry picked from commit 83b7f4ad5b)

# Conflicts:
#	.github/workflows/lint.yml
#	.golangci.yml
#	cmd/tendermint/commands/debug/util.go

* Resolve conflicts

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* ci: Sync golangci-lint config with main

Minus the spelling configuration that restricts spelling to US English
only.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* make format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove usage of deprecated io/ioutil package

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove unused mockBlockStore

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockchain/v2: Remove unused method

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Bulk fix lints

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* lint: Ignore auto-generated query PEG

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
2022-10-29 08:58:18 -04:00
samricotta
dad439f115 Bump linter to 1.47 (#9218)
*bump linter to 1.47

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
2022-08-11 15:53:17 +02:00
mergify[bot]
da9eefd111 rpc: add chunked rpc interface (backport #6445) (#6717)
* rpc: add chunked rpc interface (#6445)

(cherry picked from commit d9134063e7)

# 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>
2021-07-14 09:22:53 +00:00
mergify[bot]
b00cac9368 rpc: index block events to support block event queries (bp #6226) (#6261) 2021-03-22 15:01:25 -04:00
mergify[bot]
b2f01448be e2e: integrate light clients (bp #6196)
integrate light clients (#6196)
fix e2e app test (#6223)
fix light client generator (#6236)
2021-03-18 13:02:05 +01:00
Anton Kaliaev
55ff694aa6 light/rpc: fix ABCIQuery (#5375)
Closes #5106
2020-10-22 12:17:53 +02:00
Anton Kaliaev
85a4be87a7 rpc/client: take context as first param (#5347)
Closes #5145

also applies to light/client
2020-09-23 09:21:57 +04:00
Erik Grinaker
ba3a2dde37 rpc: replace Amino with new JSON encoder (#4968)
Migrates the `rpc` package to use new JSON encoder in #4955. Branched off of that PR.

Tests pass, but I haven't done any manual testing beyond that. This should be handled as part of broader 0.34 testing.
2020-06-08 12:04:05 +00:00
Anton Kaliaev
ce3c9c2341 rpc/core: return an error if page=0 (#4947)
* rpc/core: return an error if `page=0`

Closes #4942

affected endpoints:

- /validators
- /tx_search

* swagger: update doc for /unconfirmed_txs
2020-06-03 16:51:51 +04:00
Marko
c2578e2262 light: rename lite2 to light & remove lite (#4946)
This PR removes lite & renames lite2 to light throughout the repo

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

Closes: #4944
2020-06-03 10:13:42 +00:00