Skip to content

Commit

Permalink
Merge branch 'main' into dwedul/umber-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyLemon authored Jul 9, 2024
2 parents 8d55a0a + e7dc3c6 commit 5ebda57
Show file tree
Hide file tree
Showing 31 changed files with 1,622 additions and 377 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Features

* Create a script for updating links in the spec docs to proto messages [#2068](https://github.com/provenance-io/provenance/pull/2068).

### Improvements

* Update all the proto links in the spec docs to point to `v1.19.0` versions of the proto files [#2068](https://github.com/provenance-io/provenance/pull/2068).
* Add the (empty) `umber-rc2` upgrade [#2069](https://github.com/provenance-io/provenance/pull/2069).

### Dependencies

- Bump `github.com/hashicorp/go-getter` from 1.7.4 to 1.7.5 ([#2057](https://github.com/provenance-io/provenance/pull/2057))
- Bump `bufbuild/buf-setup-action` from 1.33.0 to 1.34.0 ([#2049](https://github.com/provenance-io/provenance/pull/2049))
- Bump `github.com/cometbft/cometbft` from 0.38.7 to 0.38.9 ([#2061](https://github.com/provenance-io/provenance/pull/2061))

---

Expand Down
6 changes: 5 additions & 1 deletion cmd/provenanced/cmd/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ priv_validator_key_file="config/priv_validator_key.json"
priv_validator_laddr=""
priv_validator_state_file="data/priv_validator_state.json"
proxy_app="tcp://127.0.0.1:26658"
version="0.38.7"
version="0.38.9"
blocksync.version="v0"
consensus.create_empty_blocks=true
consensus.create_empty_blocks_interval="0s"
Expand Down Expand Up @@ -352,6 +352,7 @@ mempool.max_batch_bytes=0
mempool.max_tx_bytes=1048576
mempool.max_txs_bytes=1073741824
mempool.recheck=true
mempool.recheck_timeout="1s"
mempool.size=5000
mempool.type="flood"
mempool.wal_dir=""
Expand Down Expand Up @@ -387,6 +388,7 @@ rpc.laddr="tcp://127.0.0.1:26657"
rpc.max_body_bytes=1000000
rpc.max_header_bytes=1048576
rpc.max_open_connections=900
rpc.max_request_batch_size=10
rpc.max_subscription_clients=100
rpc.max_subscriptions_per_client=5
rpc.pprof_laddr=""
Expand Down Expand Up @@ -521,6 +523,7 @@ func (s *ConfigTestSuite) TestConfigGetMulti() {
`mempool.max_tx_bytes=1048576`,
`mempool.max_txs_bytes=1073741824`,
`mempool.recheck=true`,
`mempool.recheck_timeout="1s"`,
`mempool.size=5000`,
`mempool.type="flood"`,
`mempool.wal_dir=""`,
Expand Down Expand Up @@ -699,6 +702,7 @@ func (s *ConfigTestSuite) TestConfigChanged() {
`mempool.max_tx_bytes=1048576 (same as default)`,
`mempool.max_txs_bytes=1073741824 (same as default)`,
`mempool.recheck=true (same as default)`,
`mempool.recheck_timeout="1s" (same as default)`,
`mempool.size=5000 (same as default)`,
`mempool.type="flood" (same as default)`,
`mempool.wal_dir="" (same as default)`,
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
cosmossdk.io/x/upgrade v0.1.3
github.com/CosmWasm/wasmd v0.51.0
github.com/CosmWasm/wasmvm/v2 v2.0.1
github.com/cometbft/cometbft v0.38.7
github.com/cometbft/cometbft v0.38.9
github.com/cometbft/cometbft-db v0.9.1
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/cosmos-proto v1.0.0-beta.5
Expand Down Expand Up @@ -129,6 +129,7 @@ require (
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk=
github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY=
github.com/cometbft/cometbft v0.38.9 h1:cJBJBG0mPKz+sqelCi/hlfZjadZQGdDNnu6YQ1ZsUHQ=
github.com/cometbft/cometbft v0.38.9/go.mod h1:xOoGZrtUT+A5izWfHSJgl0gYZUE7lu7Z2XIS1vWG/QQ=
github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M=
github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U=
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
Expand Down Expand Up @@ -673,6 +673,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
Expand Down
111 changes: 111 additions & 0 deletions scripts/identify-endpoints.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# This awk script will process a proto file and output information about endpoint request and response message names.
# Example usage: awk -f identify-endpoints.awk <proto file>
# To include debugging information in the output, provide these arguments to the awk command: -v debug='1'
#
# This file must be in the scripts/ directory so that the update-spec-links.sh script can find it.
# This script was designed only with update-spec-links.sh in mind, but exists
# as its own awk script file to help facilitate troubleshooting and maintenence.
#
# Each line of ouptut will have one of these formats:
# rpc:<endpoint>:Request:<proto file>;<request name>=<proto file>
# rpc:<endpoint>:Response:<proto file>;<response name>=<proto file>
# The <proto file> value will be relative to the repo root directory (e.g. it will start with "proto/").
# Note that the output has the <proto file> twice. That makes it so we can find the entry by the start
# of the line and we have exactly what we need to replace it with after the semicolon. It saves us from
# having to also parse that out separately elsewhere.
#
# You can basically think of each line having this format:
# <identifier>;<message info>
# Where <identifier> has the format:
# rpc:<endpoint>:(Request|Response):<proto file>
# And <message info> has the format:
# <response name>=<proto file>
#
# The <identifier> lines are generated in identify-links.awk.
# That script can also output <message info> lines.
# The update-spec-links.sh script will use the output of this script
# to convert <identifier> entries into <message info> entries.
#
# This script is not a complete solution for identifying services and endpoints in proto
# files as it almost certainly does not account for all syntax options. For example,
# this will not handle cases when there are internal comments in rpc lines. It also
# assumes the service's closing brace is on a line of its own all the way to the left.
# I'm sure there are other ways that this does not accurately parse protobuf syntax.
# At the very least, it does allow for the endpoint to be defined with multiple lines.
#
{
if (InService!="") {
# By assuming the proto file passes the linter, we can assume that, if a
# line starts with a closing curly brace, it's the end of the service section.
if (/^}/) {
if (debug!="") { print "DEBUG " FNR ": End of service section."; };
InService="";
next;
};

if (RpcLine!="") {
# If a previous line started an rpc definition, but didn't yet have all of it,
# append this line to what we previously had (effectively changing the newline into a space).
if (debug!="") { print "DEBUG " FNR ": rpc line continued: " $0; };
RpcLine=RpcLine " " $0;
} else if (/^[[:space:]]*rpc/) {
# It's an endpoint definition line (or at least the start of it.
if (debug!="") { print "DEBUG " FNR ": rpc line Start: " $0; };
RpcLine=$0;
}

if (RpcLine ~ /rpc[[:space:]]+[^(]+\([^)]+\)[[:space:]]+returns[[:space:]]+\([^)]+\)/) {
# The rpc line should now have evertything we need in here. It'll have a format like this:
# rpc <Endpoint>(<Request>) returns (<Response>)[<other stuff>]
# It's possible that the whitespace in that format is actually multipe spaces.
if (debug!="") { print "DEBUG " FNR ": RpcLine: " RpcLine; };

# Extract the endpoint name by deleting the "rpc" part and leading spacing.
# Then delete everything after (and including) the first opening paren.
Endpoint=RpcLine;
if (debug!="") { print "DEBUG " FNR ": [1/3] Endpoint: " Endpoint; };
sub(/^[[:space:]]*rpc[[:space:]]+/,"",Endpoint);
if (debug!="") { print "DEBUG " FNR ": [2/3] Endpoint: " Endpoint; };
sub(/\(.*$/,"",Endpoint);
if (debug!="") { print "DEBUG " FNR ": [3/3] Endpoint: " Endpoint; };

# Extract the request name by deleting everything before (and including) the first open paren.
# Then delete evertying after (and including) the first closing paren.
Req=RpcLine;
if (debug!="") { print "DEBUG " FNR ": [1/3] Req: " Req; };
sub(/^[^(]+\(/,"",Req);
if (debug!="") { print "DEBUG " FNR ": [2/3] Req: " Req; };
sub(/\).*$/,"",Req);
if (debug!="") { print "DEBUG " FNR ": [3/3] Req: " Req; };

# Extract the response name by deleting everything before (and including) the open paran after the word "returns".
# Then delete everything after (and including) the first closing paren in what's left.
Resp=RpcLine;
if (debug!="") { print "DEBUG " FNR ": [1/3] Resp: " Resp; };
sub(/^.*[[:space:]]returns[[:space:]]+\(/,"",Resp);
if (debug!="") { print "DEBUG " FNR ": [2/3] Resp: " Resp; };
sub(/\).*$/,"",Resp);
if (debug!="") { print "DEBUG " FNR ": [3/3] Resp: " Resp; };

if (FILENAME=="") {
Source="<pipe>";
if (debug!="") { print "DEBUG " FNR ": No FILENAME found. Source: " Source; };
} else {
# We need the source to be relative to the repo root, so strip out the stuff before that.
Source=FILENAME;
if (debug!="") { print "DEBUG " FNR ": [1/2] Source: " Source; };
sub(/^.*\/proto\//,"proto/",Source);
if (debug!="") { print "DEBUG " FNR ": [2/2] Source: " Source; };
}

# Output a line each for the request and response.
print "rpc:" Endpoint ":Request:" Source ";" Req "=" Source;
print "rpc:" Endpoint ":Response:" Source ";" Resp "=" Source;
# We're done with the current RpcLine, go back to waiting for the next one.
RpcLine="";
}
} else if (/^service /) {
if (debug!="") { print "DEBUG " FNR ": Start of service section."; };
InService=$0;
}
}
Loading

0 comments on commit 5ebda57

Please sign in to comment.