Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport tendermint-v0.34.20 into main #642

Merged
merged 31 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1552e91
rpc: avoid leaking threads (#8329)
tnasu Jun 19, 2023
36637c0
(fixup) Revert the CheckTxSync callback parameter from https://github…
tnasu Jun 19, 2023
7d5b3f9
(fixup) Test the reverted CheckTxSync callback parameter from https:/…
tnasu Jun 19, 2023
8163143
(fixup) Add tests for code coverage: rpc/core/mempool_test.go
tnasu Jun 23, 2023
424fe2d
Set a cap on the length of subscription queries. (#8349)
tnasu Jul 7, 2023
28ffda4
blocksync: validate block before persisting it (backport #8493) (#8495)
tnasu Jul 13, 2023
d6e557b
Update default config docs for PSQL indexer settings. (#8728)
tnasu Jul 7, 2023
b26aa05
cmd: add tool for compaction of goleveldb (backport #8564) (#8674)
tnasu Jul 7, 2023
c27aeef
(fixup) Add compact_test for improving coverage
tnasu Jul 7, 2023
dc74bcd
makefile: change buf to use tools.go ; backport v0.34 (#8852)
tnasu Jul 9, 2023
d475dfa
(fixup) Improve to work for Ostracon with tendermint proto files
tnasu Jul 9, 2023
69da06e
fix: "Lazy" Stringers to defer Sprintf and Hash until logs print (#8845)
tnasu Jul 9, 2023
781018a
makefile: buf setup backport v0.34 (#8863)
tnasu Jul 10, 2023
0d930ac
(fixup) Remove proto.yml since don't work and remove the next version…
tnasu Jul 11, 2023
f9c979e
(fixup) Remove unused import: buf-lint rule: IMPORT_USED
tnasu Jul 11, 2023
c12e289
(fixup) Remove duplicated a rule of `FILE_LOWER_SNAKE_CASE` since BAS…
tnasu Jul 11, 2023
775db7c
(fixup) Use mockery latest v2.31.4 since v2.30.17 doesn't release: ht…
tnasu Jul 11, 2023
d866254
(fixup) Re-generate mocks with mockery-v2.30.18
tnasu Jul 11, 2023
5cef3a8
feat: v0.34.x Prioritized Mempool (#8695)
tnasu Jul 11, 2023
2879cb5
release: prepare v0.34.20-rc0 (#8888)
tnasu Jul 13, 2023
7c66db2
Backport priority mempool fixes from v0.35.x to v0.34.x. (#8962)
tnasu Jul 13, 2023
8effabb
mempool: minor cleanup after backport from v0.35 (#8971)
tnasu Jul 13, 2023
82bccab
mempool: reduce lock contention during CheckTx (backport #8983) (#8985)
tnasu Jul 13, 2023
cddddc8
mempool: release lock during app connection flush (#8986)
tnasu Jul 13, 2023
cc37edc
config: remove obsolete mempool v1 warning (#8987)
tnasu Jul 13, 2023
d3a8f45
mempool: ensure evicted transactions are removed from the cache (back…
tnasu Jul 13, 2023
f549ea8
mempool: ensure async requests are flushed to the server (#9010)
tnasu Jul 13, 2023
20432e4
Upgrade to tendermint/tendermint v0.34.20
tnasu Jul 13, 2023
bfadd2e
Merge branch 'main' into main-v0.34.20
tnasu Jul 14, 2023
294e011
Merge branch 'main' into main-v0.34.20
tnasu Jul 19, 2023
10dec2f
(fixup) Improve libraries to work well
tnasu Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Verify that generated code is up-to-date.
#
# Note that we run these checks regardless whether the input files have
# changed, because generated code can change in response to toolchain updates
# even if no files in the repository are modified.
name: Check generated code
on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
check-mocks:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'

- uses: actions/checkout@v3

- name: "Check generated mocks"
run: |
set -euo pipefail

readonly MOCKERY=2.30.18 # N.B. no leading "v"
curl -sL "https://github.com/vektra/mockery/releases/download/v${MOCKERY}/mockery_${MOCKERY}_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xzf -
make mockery 2>/dev/null

if ! git diff --stat --exit-code ; then
echo ">> ERROR:"
echo ">>"
echo ">> Generated mocks require update (either Mockery or source files may have changed)."
echo ">> Ensure your tools are up-to-date, re-run 'make mockery' and update this PR."
echo ">>"
exit 1
fi

check-proto:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'

- uses: actions/checkout@v3
with:
fetch-depth: 1 # we need a .git directory to run git diff

- name: "Check protobuf generated code"
run: |
set -euo pipefail

# Install buf and gogo tools, so that differences that arise from
# toolchain differences are also caught.
readonly tools="$(mktemp -d)"
export PATH="${PATH}:${tools}/bin"
export GOBIN="${tools}/bin"

go install github.com/bufbuild/buf/cmd/buf
go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest

make proto-gen

if ! git diff --stat --exit-code ; then
echo ">> ERROR:"
echo ">>"
echo ">> Protobuf generated code requires update (either tools or .proto files may have changed)."
echo ">> Ensure your tools are up-to-date, re-run 'make proto-gen' and update this PR."
echo ">>"
exit 1
fi
58 changes: 0 additions & 58 deletions .github/workflows/proto-docker.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/proto-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Protobuf Lint
on:
pull_request:
paths:
- 'proto/**'
push:
paths:
- 'proto/**'

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.5.0
- uses: bufbuild/buf-lint-action@v1
with:
input: 'proto'
22 changes: 0 additions & 22 deletions .github/workflows/proto.yml

This file was deleted.

53 changes: 29 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ VERSION := $(shell git describe --always)
LD_FLAGS = -X github.com/Finschia/ostracon/version.OCCoreSemVer=$(VERSION)
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
HTTPS_GIT := https://github.com/Finschia/ostracon.git
DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf
CGO_ENABLED ?= 0
TARGET_OS ?= $(shell go env GOOS)
TARGET_ARCH ?= $(shell go env GOARCH)
Expand Down Expand Up @@ -77,42 +76,48 @@ mockery:
### Protobuf ###
###############################################################################

containerProtoVer=v0.2
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)

###
# https://github.com/protocolbuffers/protobuf
# https://developers.google.com/protocol-buffers/docs/gotutorial
# Should install
### go install
# go install google.golang.org/protobuf/cmd/protoc-gen-go
### Docker for Protocol Buffer
# https://hub.docker.com/r/bufbuild/buf
check-proto-deps:
ifeq (,$(shell which protoc-gen-gogofaster))
@go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest
endif
.PHONY: check-proto-deps

proto-all: proto-gen proto-lint proto-check-breaking
.PHONY: proto-all
check-proto-format-deps:
ifeq (,$(shell which clang-format))
$(error "clang-format is required for Protobuf formatting. See instructions for your platform on how to install it.")
endif
.PHONY: check-proto-format-deps

proto-gen:
@docker pull -q tendermintdev/docker-build-proto
proto-gen: check-proto-deps
@echo "Generating Protobuf files"
@docker run --rm -v $(shell pwd):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen.sh
@go run github.com/bufbuild/buf/cmd/buf generate
@mv ./proto/ostracon/abci/types.pb.go ./abci/types/
@mv ./proto/ostracon/rpc/grpc/types.pb.go ./rpc/grpc/
@rm -rf ./proto/tendermint
.PHONY: proto-gen

proto-lint:
@$(DOCKER_BUF) lint --error-format=json
# These targets are provided for convenience and are intended for local
# execution only.
proto-lint: check-proto-deps
@echo "Linting Protobuf files"
@go run github.com/bufbuild/buf/cmd/buf lint
.PHONY: proto-lint

proto-format:
proto-format: check-proto-format-deps
@echo "Formatting Protobuf files"
docker run --rm -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;
@find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
.PHONY: proto-format

proto-check-breaking:
@$(DOCKER_BUF) breaking --against .git#branch=main
proto-check-breaking: check-proto-deps
@echo "Checking for breaking changes in Protobuf files against local branch"
@echo "Note: This is only useful if your changes have not yet been committed."
@echo " Otherwise read up on buf's \"breaking\" command usage:"
@echo " https://docs.buf.build/breaking/usage"
@go run github.com/bufbuild/buf/cmd/buf breaking --against ".git"
.PHONY: proto-check-breaking

proto-check-breaking-ci:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main
@go run github.com/bufbuild/buf/cmd/buf breaking --against ".git"#branch=main
.PHONY: proto-check-breaking-ci

###############################################################################
Expand Down
1 change: 1 addition & 0 deletions abci/client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func (cli *grpcClient) finishAsyncCall(req *ocabci.Request, res *ocabci.Response
}

// ----------------------------------------

func (cli *grpcClient) FlushSync() (*types.ResponseFlush, error) {
reqres := cli.FlushAsync(nil)
reqres.Wait()
Expand Down
9 changes: 4 additions & 5 deletions abci/client/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions abci/types/mocks/application.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading