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

feat: Integrate tendermint Block endpoints into the cli #14659

Merged
merged 66 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7365588
idiot check
cipherzzz Jan 17, 2023
ddc0edd
cleaned up
cipherzzz Jan 17, 2023
38a6468
updated BlockResponse proto and got the BlockSearch working
cipherzzz Jan 20, 2023
bdd2ba7
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Jan 21, 2023
7d0330c
merged latest
cipherzzz Jan 21, 2023
9842706
fixing int overflow? and some proto issues
cipherzzz Jan 21, 2023
252f354
fixing int overflow paging calculation
cipherzzz Jan 22, 2023
639120d
gofumpt
cipherzzz Jan 22, 2023
f492408
added tests
cipherzzz Jan 23, 2023
e04a843
fixed merge
cipherzzz Jan 23, 2023
73aad2d
gofumpt and lint
cipherzzz Jan 23, 2023
2218ef7
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Jan 23, 2023
ad78cde
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Jan 25, 2023
89eb164
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Jan 25, 2023
984b252
fixes per review
cipherzzz Jan 26, 2023
7b1d4b6
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Jan 26, 2023
25091e2
Merge branch 'cipherz/13703-query-block-event' of github.com:cipherzz…
cipherzzz Jan 26, 2023
261ff39
refactor based on pr feedback
cipherzzz Jan 26, 2023
24aea0f
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Jan 26, 2023
1c30838
fix test
cipherzzz Jan 26, 2023
89314ab
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Jan 27, 2023
ff7b290
fix test
cipherzzz Jan 27, 2023
cffd5c2
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Jan 27, 2023
0bdf087
Merge branch 'cipherz/13703-query-block-event' of github.com:cipherzz…
cipherzzz Jan 27, 2023
012164a
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Jan 30, 2023
58c65ba
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Jan 30, 2023
2b21718
Merge branch 'cipherz/13703-query-block-event' of github.com:cipherzz…
cipherzzz Jan 30, 2023
22544c3
moved block query from auth module to tendermint server
cipherzzz Jan 30, 2023
ec412d4
fixes per PR
cipherzzz Jan 31, 2023
1845a21
extracted to method
cipherzzz Jan 31, 2023
85d1b54
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Jan 31, 2023
5488e94
fixes per pr feedback
cipherzzz Jan 31, 2023
5bcad2a
pass query directly to Tendermint
cipherzzz Jan 31, 2023
adae794
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Jan 31, 2023
8288c38
fumpt
cipherzzz Jan 31, 2023
4fbcb12
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Feb 1, 2023
b197b7b
Update client/rpc/block.go
cipherzzz Feb 2, 2023
589de79
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Feb 2, 2023
1833618
Merge branch 'cipherz/13703-query-block-event' of github.com:cipherzz…
cipherzzz Feb 2, 2023
ead688e
fixed merge
cipherzzz Feb 3, 2023
266803e
changes per PR feedback
cipherzzz Feb 3, 2023
63634aa
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Feb 4, 2023
8c4e000
Update client/rpc/block.go
cipherzzz Feb 4, 2023
4c27245
differentiate errors
cipherzzz Feb 4, 2023
8d1ace4
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Feb 4, 2023
e514413
fixed merge
cipherzzz Feb 4, 2023
d8d5136
changes per PR review
cipherzzz Feb 7, 2023
80d4071
fixed merge
cipherzzz Feb 7, 2023
cbff045
fixed test
cipherzzz Feb 7, 2023
763119e
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Feb 9, 2023
4bea8b3
Update types/result.go
cipherzzz Feb 9, 2023
4310491
Update client/rpc/block.go
cipherzzz Feb 9, 2023
bedce2d
Update server/cmt_cmds.go
cipherzzz Feb 9, 2023
01bdbe3
Update server/cmt_cmds.go
cipherzzz Feb 9, 2023
4af5760
Update server/cmt_cmds.go
cipherzzz Feb 9, 2023
fb5857d
Update server/cmt_cmds.go
cipherzzz Feb 9, 2023
1b3eb73
updates per pr feedback
cipherzzz Feb 9, 2023
1e1cf9d
Merge branch 'cipherz/13703-query-block-event' of github.com:cipherzz…
cipherzzz Feb 9, 2023
35669ab
updates per PR feedback
cipherzzz Feb 9, 2023
7b2fb55
Merge branch 'main' into cipherz/13703-query-block-event
JeancarloBarrios Feb 9, 2023
0a34801
Merge branch 'main' into cipherz/13703-query-block-event
cipherzzz Feb 13, 2023
f178e0f
Merge branch 'main' into cipherz/13703-query-block-event
alexanderbez Feb 13, 2023
35f605f
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Feb 14, 2023
12d51da
implemented PR change requests
cipherzzz Feb 14, 2023
1cc27a3
Merge branch 'main' of github.com:cosmos/cosmos-sdk into cipherz/1370…
cipherzzz Feb 14, 2023
39c9179
Merge branch 'cipherz/13703-query-block-event' of github.com:cipherzz…
cipherzzz Feb 14, 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
7,829 changes: 5,775 additions & 2,054 deletions api/cosmos/base/abci/v1beta1/abci.pulsar.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions client/tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type TendermintRPC interface {
Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error)
Status(context.Context) (*coretypes.ResultStatus, error)
Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)
BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error)
cipherzzz marked this conversation as resolved.
Show resolved Hide resolved
BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error)
Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)
Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error)
Expand All @@ -25,4 +26,10 @@ type TendermintRPC interface {
page, perPage *int,
orderBy string,
) (*coretypes.ResultTxSearch, error)
BlockSearch(
ctx context.Context,
query string,
page, perPage *int,
orderBy string,
) (*coretypes.ResultBlockSearch, error)
}
6 changes: 0 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ require (
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/common v0.39.0
github.com/rakyll/statik v0.1.7
github.com/regen-network/gocuke v0.6.2
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
Expand Down Expand Up @@ -77,23 +76,19 @@ require (
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/DataDog/zstd v1.4.5 // indirect
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/alecthomas/participle/v2 v2.0.0-alpha7 // indirect
github.com/aws/aws-sdk-go v1.40.45 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cockroachdb/apd/v3 v3.1.0 // indirect
github.com/cockroachdb/errors v1.8.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect
github.com/cockroachdb/redact v1.0.8 // indirect
github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/cucumber/common/gherkin/go/v22 v22.0.0 // indirect
github.com/cucumber/common/messages/go/v17 v17.1.1 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
Expand All @@ -109,7 +104,6 @@ require (
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.0.0 // indirect
Expand Down
9 changes: 0 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c=
github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA=
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E=
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
Expand Down Expand Up @@ -164,7 +161,6 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH
github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E=
github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw=
github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w=
github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4=
github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM=
Expand Down Expand Up @@ -220,9 +216,7 @@ github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0=
github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg=
github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts=
github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI=
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -329,9 +323,7 @@ github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM=
github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0=
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869 h1:kRpU4zq+Pzh4feET49aEWPOzwQy3U2SsbZEQ7QEcif0=
Expand Down Expand Up @@ -765,7 +757,6 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M=
github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand Down
38 changes: 38 additions & 0 deletions proto/cosmos/base/abci/v1beta1/abci.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ message TxResponse {
repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false];
}

// BlockResponse
message BlockResponse {
cipherzzz marked this conversation as resolved.
Show resolved Hide resolved
option (gogoproto.goproto_getters) = false;
// The block height
int64 height = 1;
string time = 2;
string chain_id = 3;
string last_commit = 4;
string data = 5;
string validators = 6;
string next_validators = 7;
string app = 8;
string consensus = 9;
string results = 10;
string evidence = 11;
string proposer = 12;
}

// ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
message ABCIMessageLog {
option (gogoproto.stringer) = true;
Expand Down Expand Up @@ -156,3 +174,23 @@ message SearchTxsResult {
// List of txs in current page
repeated TxResponse txs = 6;
}

// SearchBlocksResult defines a structure for querying blocks pageable
message SearchBlocksResult {
option (gogoproto.stringer) = true;

// Count of all blocks
uint64 total_count = 1;
// Count of blocks in current page
uint64 count = 2;
// Index of current page, start from 1
uint64 page_number = 3;
// Count of total pages
uint64 page_total = 4;
// Max count blocks per page
uint64 limit = 5;
// List of blocks in current page
repeated BlockResponse blocks = 6;
}


1 change: 1 addition & 0 deletions simapp/simd/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ func TestHomeFlagRegistration(t *testing.T) {

result, err := rootCmd.Flags().GetString(flags.FlagHome)
require.NoError(t, err)
fmt.Println(result, homeDir)
cipherzzz marked this conversation as resolved.
Show resolved Hide resolved
require.Equal(t, result, homeDir)
}
3 changes: 2 additions & 1 deletion simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ func queryCommand() *cobra.Command {
cmd.AddCommand(
authcmd.GetAccountCmd(),
rpc.ValidatorCommand(),
rpc.BlockCommand(),
cipherzzz marked this conversation as resolved.
Show resolved Hide resolved
authcmd.QueryBlockCmd(),
cipherzzz marked this conversation as resolved.
Show resolved Hide resolved
authcmd.QueryTxsByEventsCmd(),
authcmd.QueryBlocksByEventsCmd(),
authcmd.QueryTxCmd(),
)

Expand Down
Loading