Commit Graph

917 Commits

Author SHA1 Message Date
M. J. Fromberger
7fa34c63af Set a cap on the length of subscription queries. (#8349)
A manual backport of #7263.

As a safety measure, don't allow a query string to be unreasonably long. The
query filter is not especially efficient, so a query that needs more than basic
detail should filter coarsely in the subscriber and refine on the client side.

This affects Subscribe and TxSearch queries.
2022-04-14 08:15:18 -07:00
Sam Kleinman
efddab0734 rpc: avoid leaking threads (#8329) 2022-04-13 13:28:03 -04:00
dependabot[bot]
c9c570e151 build(deps): Bump google.golang.org/grpc from 1.42.0 to 1.43.0 (#7454)
* build(deps): Bump google.golang.org/grpc from 1.42.0 to 1.43.0

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2021-12-15 08:08:27 -08:00
Thane Thomson
12e3419f2b rpc: Add experimental config params to allow for subscription buffer size control (tm v0.34.x) (#7230)
A workaround for #6729. Add parameters to control buffer sizes for
event subscription RPC clients. On some networks, buffering causes
clients to be dropped and/or events to be lost.

For additional context, see the discussion on #7188.

- Add experimental_subscription_buffer_size config parameter
- Add experimental_websocket_write_buffer_size config parameter
- Add experimental_close_on_slow_client config parameter

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2021-11-09 12:35:45 -08:00
dependabot[bot]
d0031b0503 build(deps): Bump github.com/go-kit/kit from 0.10.0 to 0.12.0 (#7213)
* build(deps): Bump github.com/go-kit/kit from 0.10.0 to 0.12.0

Bumps [github.com/go-kit/kit](https://github.com/go-kit/kit) from 0.10.0 to 0.12.0.
- [Release notes](https://github.com/go-kit/kit/releases)
- [Commits](https://github.com/go-kit/kit/compare/v0.10.0...v0.12.0)

---
updated-dependencies:
- dependency-name: github.com/go-kit/kit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* add nolint

* fix lint

* fix build

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: tycho garen <garen@tychoish.com>
2021-11-08 14:39:00 -05:00
Sam Kleinman
4ef140f6ca lint: cleanup pending lint errors (#7237) 2021-11-04 08:08:55 -04:00
mergify[bot]
0366c2b688 rpc: log update (backport #6825) (#6826) 2021-08-14 09:54:02 -04: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
Callum Waters
2c2f511f24 light: correctly handle contexts (backport -> v0.34.x) (#6685) 2021-07-09 14:30:33 +02:00
Callum Waters
7869f5ec1d light/evidence: handle FLA backport (#6331) 2021-04-08 09:49:25 -07:00
mergify[bot]
b7a4d5e7ba fix: jsonrpc url parsing and dial function (#6264) (#6288)
This PR fixes how the jsonrpc parses the URL, and how the dial function connects to the RPC.

Closes: https://github.com/tendermint/tendermint/issues/6260

(cherry picked from commit 9ecfcc93a6)

Co-authored-by: Frojdi Dymylja <33157909+fdymylja@users.noreply.github.com>
2021-03-29 11:05:03 +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]
4e25703d58 rpc/jsonrpc/server: return an error in WriteRPCResponseHTTP(Error) (bp #6204) (#6230)
* rpc/jsonrpc/server: return an error in WriteRPCResponseHTTP(Error) (#6204)

instead of panicking
Closes #5529

(cherry picked from commit 00b9524168)

# Conflicts:
#	CHANGELOG_PENDING.md
#	rpc/jsonrpc/server/http_json_handler.go
#	rpc/jsonrpc/server/http_server.go
#	rpc/jsonrpc/server/http_server_test.go
#	rpc/jsonrpc/server/http_uri_handler.go

* resolve conflicts

* fix linting

* fix conflict

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
2021-03-17 14:55:05 +00:00
mergify[bot]
1b5697a41d mempool/rpc: log grooming (bp #6201) (#6203) 2021-03-04 09:04:13 -05:00
mergify[bot]
a047a4a70f logs: cleanup (#6198)
Co-authored-by: Marko <marbar3778@yahoo.com>
2021-03-04 10:42:19 +00:00
mergify[bot]
52b1d90f56 rpc/jsonrpc: Unmarshal RPCRequest correctly (bp #6191) (#6193)
* rpc/jsonrpc: Unmarshal RPCRequest correctly (#6191)

i.e. without double pointer. With double pointer, it was possible to
submit `null` value, which will crash the server.

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x189ddc0]

goroutine 1 [running]:
github.com/tendermint/tendermint/rpc/jsonrpc/types.(*RPCRequest).UnmarshalJSON(0xc0000147e0, 0xc00029f201, 0x4, 0x1ff, 0x883baa0, 0xc0000147e0)
        /Users/anton/go/src/github.com/tendermint/tendermint/rpc/jsonrpc/types/types.go:70 +0x100
encoding/json.(*decodeState).literalStore(0xc000216bb0, 0xc00029f201, 0x4, 0x1ff, 0x1998800, 0xc0000147e0, 0x199, 0xc000231700, 0x10e0a5e, 0x197)
        /usr/local/Cellar/go/1.16/libexec/src/encoding/json/decode.go:860 +0x30ce
encoding/json.(*decodeState).value(0xc000216bb0, 0x1998800, 0xc0000147e0, 0x199, 0x1998800, 0xc0000147e0)
        /usr/local/Cellar/go/1.16/libexec/src/encoding/json/decode.go:384 +0x40c
encoding/json.(*decodeState).array(0xc000216bb0, 0x18df040, 0xc0001be540, 0x16, 0xc000216bd8, 0x10e405b)
        /usr/local/Cellar/go/1.16/libexec/src/encoding/json/decode.go:558 +0x365
encoding/json.(*decodeState).value(0xc000216bb0, 0x18df040, 0xc0001be540, 0x16, 0x16, 0x6e)
        /usr/local/Cellar/go/1.16/libexec/src/encoding/json/decode.go:360 +0x22f
encoding/json.(*decodeState).unmarshal(0xc000216bb0, 0x18df040, 0xc0001be540, 0xc000216bd8, 0x0)
        /usr/local/Cellar/go/1.16/libexec/src/encoding/json/decode.go:180 +0x2c9
encoding/json.Unmarshal(0xc00029f200, 0x6, 0x200, 0x18df040, 0xc0001be540, 0x0, 0x0)
        /usr/local/Cellar/go/1.16/libexec/src/encoding/json/decode.go:107 +0x15d
```

(cherry picked from commit fe4e97afe0)

# Conflicts:
#	CHANGELOG_PENDING.md

* fix conflict

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
2021-03-02 14:46:48 +04:00
Callum Waters
b021ad5b7a test: don't use foo-bar.net in TestHTTPClientMakeHTTPDialer (#5997) (#6047)
This test relied on connecting to the external site `foo-bar.net`, and (predictably) the site went down and broke all of our CI runs. This changes it to use local HTTP servers instead.

Co-authored-by: Erik Grinaker <erik@interchain.berlin>
2021-02-04 13:11:07 +04:00
Marko
54338a52fa proto: bump gogoproto (1.3.2) (#5886)
- bump gogoproto (1.3.2)
- regenerate proto files

Closes: #XXX
2021-01-19 12:41:35 +01:00
Aleksandr Bezobchuk
53463b3fef rpc: fix content-type header 2020-11-16 10:54:34 -05:00
Callum Waters
9d354c842e evidence: structs can independently form abci evidence (#5610) 2020-11-05 10:38:42 +01:00
Marko
9379bc92fd fix lint failures with 1.31 (#5489) 2020-10-22 13:36:08 +02:00
Anton Kaliaev
55ff694aa6 light/rpc: fix ABCIQuery (#5375)
Closes #5106
2020-10-22 12:17:53 +02:00
Marko
09982ae407 backport block size fixes (#5492)
* mempool: length prefix txs when getting them from mempool (#5483)

* correctly calculate evidence data size (#5482)

* block: use commit sig size instead of vote size (#5490)

* tx: reduce function to one parameter (#5493)
2020-10-13 18:07:54 +02:00
Erik Grinaker
58b4deca86 blockstore: fix race conditions when loading data (#5382)
Fixes #5377 and comments in #4588 (review).
2020-09-23 10:13:43 +04: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
Callum Waters
ed002cea7e evidence: introduction of LightClientAttackEvidence and refactor of evidence lifecycle (#5361)
evidence: modify evidence types (#5342)

light: detect light client attacks (#5344)

evidence: refactor evidence pool (#5345)

abci: application evidence prepared by evidence pool (#5354)
2020-09-22 10:22:54 +02:00
Thane Thomson
309e29c245 rpc: revert JSON-RPC/WebSocket response batching (#5378)
Revert the JSON-RPC/WebSocket response serialization format to the
standard way (i.e. a single RPC response per WebSocket text message) to
avoid breaking clients.

Serialization format changes will be discussed in an upcoming ADR.

Closes: #5373
2020-09-22 10:47:43 +04:00
Erik Grinaker
531fa07ad2 rpc: fix test data races (#5363)
Fixes a couple of test data races. `testing.T` is not concurrency-safe and should not be used in goroutines at all.
2020-09-16 08:48:28 +00:00
Erik Grinaker
817646a88e rpc: fix openapi spec syntax error (#5358)
Broke in #5356.
2020-09-15 08:58:58 +00:00
Anton Kaliaev
8aac1d1333 docs: document max entries for /blockchain RPC (#5356)
Closes #5339
2020-09-15 07:55:27 +00:00
Marko
56911ee352 state: define interface for state store (#5348)
## Description

Make an interface for the state store. 

Closes: #5213
2020-09-15 07:45:48 +00:00
Marko
0ed8dba991 lint: enable errcheck (#5336)
## Description

Enable errcheck linter throughout the codebase

Closes: #5059
2020-09-07 15:03:18 +00:00
Marko
b8d08b9ef4 lint: add errchecks (#5316)
## Description

Work towards enabling errcheck

ref #5059
2020-09-04 11:58:03 +00:00
Anton Kaliaev
59ec3d91e4 rpc/jsonrpc/server: ws server optimizations (#5312)
* docs: goleveldb is much more stable now

Refs https://github.com/syndtr/goleveldb/issues/226#issuecomment-682495490

* rpc/core/events: make sure WS client receives every event

previously, if the write buffer was full, the response would've been
lost without any trace (log msg, etc.)

* rpc/jsonrpc/server: set defaultWSWriteChanCapacity to 1

Refs #3905
Closes #3829

setting write buffer capacity to 1 makes transactions count per block
more stable and also reduces the pauses length by 20s.

before: https://github.com/tendermint/tendermint/issues/3905#issuecomment-681854328 net.Read - 20s
after: net.Read - 0.66s

* rpc/jsonrpc/server: buffer writes and avoid io.ReadAll during read
2020-09-04 10:58:47 +04:00
Marko
e0140e4beb evidence: remove ConflictingHeaders type (#5317)
## Description

Remove ConflictingHeaders & compositeEvidence types


Ref #5288
2020-09-01 16:34:37 +00:00
Marko
b6a5f7b126 rpc: add private & unconditional to /dial_peer (#5293)
## Description

Allow dialing of private and unconditional peers through the RPC

Closes: #1705
2020-09-01 12:43:23 +00:00
Anton Kaliaev
43c3e4265b config: rename prof_laddr to pprof_laddr and move it to rpc (#5315)
* config: rename prof_laddr to pprof_laddr and move it to rpc

also, remove `/unsafe_start_cpu_profiler`, `/unsafe_stop_cpu_profiler`
and `/unsafe_write_heap_profile` in favor of pprof server functionality.

Closes #5303

* update changelog

* log start
2020-09-01 11:54:21 +04:00
Marko
5df55f289c docs: updates to various sections (#5285)
## Description

Updates to various sections of docs. 
Fix docs deployment

Closes: #XXX
2020-08-26 13:59:26 +00:00
Marko
9b4f1a8081 docs: rename swagger to openapi (#5263)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-08-21 11:40:28 +02:00
Marko
b74427fa82 swagger: update (#5257) 2020-08-18 15:03:01 +02:00
Marko
4a38bd216e docs: cleanup (#5252) 2020-08-18 12:07:13 +02:00
Marko
42e4e8b58e lint: add markdown linter (#5254) 2020-08-17 16:40:50 +02:00
Marko
9e98c74e3c crypto: API modifications (#5236)
## Description

This PR aims to make the crypto.PubKey interface more intuitive. 

Changes: 

- `VerfiyBytes` -> `VerifySignature`

Before `Bytes()` was amino encoded, now since it is the byte representation should we get rid of it entirely?

EDIT: decided to keep `Bytes()` as it is useful if you are using the interface instead of the concrete key

Closes: #XXX
2020-08-13 12:29:16 +00:00
Erik Grinaker
cc247c091b genesis: add support for arbitrary initial height (#5191)
Adds a genesis parameter `initial_height` which specifies the initial block height, as well as ABCI `RequestInitChain.InitialHeight` to pass it to the ABCI application, and `State.InitialHeight` to keep track of the initial height throughout the code. Fixes #2543, based on [RFC-002](https://github.com/tendermint/spec/pull/119). Spec changes in https://github.com/tendermint/spec/pull/135.
2020-08-11 17:03:28 +00:00
Callum Waters
bfcf45a461 evidence: remove validator index verification (#5225) 2020-08-11 15:32:32 +02:00
Callum Waters
312c4f8fe1 evidence: change evidence time to block time (#5219)
adds blockstore interface to evidence and adds fix to byzantine test
2020-08-11 14:39:07 +02:00
Marko
2d167aefcf ci: freeze golangci action version (#5196)
## Description

This PR updates golang-ci to latest and stops looking at master for the action. 

Closes: #XXX
2020-08-03 07:57:06 +00:00
Anton Kaliaev
db345066a8 rpc/client/http: log error (#5182)
Closes #3410
2020-07-31 09:36:14 +00:00
Anton Kaliaev
2b97e03cf6 docs: document canonical field (#5166)
Closes #2769

Spec PR: https://github.com/tendermint/spec/pull/125
2020-07-30 09:07:03 +00:00
Anton Kaliaev
4ab7b7d7ca docs: add more details on Vote struct from /consensus_state (#5164)
Closes #2743
2020-07-29 10:20:39 +00:00