Fix protobuf generated code. (#8545)

* Revert "update protos (#8515)"

This reverts commit f094fd204a.

It appears that #8515 may have been generated with an out-of-date version of
either buf or the gogo plugin. using the latest versions (buf 1.4.0 and gogo
1.3.2) reverts those changes.

* Add a script to re-generate protos with the latest tools.

This script is just a wrapper for the Make rule, but it runs the build inside a
container with the latest versions of buf and gogo installed. This reduces the
chance that an out-of-date ambient installation on a developer machine will get
us outdated output.
This commit is contained in:
M. J. Fromberger
2022-05-13 12:08:21 -07:00
committed by GitHub
parent c29d1b34fd
commit 7da9746a57
23 changed files with 184 additions and 644 deletions

23
scripts/proto-gen.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
#
# Update the generated code for protocol buffers in the Tendermint repository.
# This must be run from inside a Tendermint working directory.
#
set -euo pipefail
# Work from the root of the repository.
cd "$(git rev-parse --show-toplevel)"
# Run inside Docker to install the correct versions of the required tools
# without polluting the local system.
docker run --rm -i -v "$PWD":/w --workdir=/w golang:1.18-alpine sh <<"EOF"
apk add curl git make
readonly buf_release='https://github.com/bufbuild/buf/releases/latest/download'
readonly OS="$(uname -s)" ARCH="$(uname -m)"
curl -sSL "${buf_release}/buf-${OS}-${ARCH}.tar.gz" \
| tar -xzf - -C /usr/local --strip-components=1
go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest
make proto-gen
EOF