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

chore: re-add v1 code #23545

Closed
wants to merge 46 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c4e5bea
Revert "refactor(server)!: continue server v1 removal (#23238)"
aljo242 Jan 21, 2025
0ce19f2
lint
aljo242 Jan 21, 2025
b16dcdd
Revert "refactor: remove v1 commands and begin server removal (#23018)"
aljo242 Jan 21, 2025
5012ef3
Revert "refactor(testutil): Removing testutil integration (#23091)"
aljo242 Jan 21, 2025
2f4b892
add test back
aljo242 Jan 21, 2025
7d6bccd
add test back
aljo242 Jan 21, 2025
fbdca39
Revert "chore: remove simapp v1 (#23009)"
aljo242 Jan 21, 2025
69a38f0
Revert "chore: remove snapshot commands (#23015)"
aljo242 Jan 21, 2025
a5b0dcc
lint fix all
aljo242 Jan 21, 2025
d111ed8
fmt
aljo242 Jan 22, 2025
026a0cd
fmt
aljo242 Jan 22, 2025
e4175fb
fixing simapp
aljo242 Jan 22, 2025
055d17a
fix
aljo242 Jan 22, 2025
3c6cd9a
Merge branch 'main' into chore/return-v1
aljo242 Jan 28, 2025
38fbe9e
ok
aljo242 Jan 28, 2025
54bc3ad
Merge branch 'main' into chore/return-v1
aljo242 Jan 28, 2025
14353f8
Merge branch 'main' into chore/return-v1
aljo242 Jan 29, 2025
0860a63
Merge branch 'main' into chore/return-v1
aljo242 Jan 29, 2025
568b94f
gmt
aljo242 Jan 29, 2025
624f578
Merge branch 'main' into chore/return-v1
aljo242 Jan 29, 2025
999fece
remove
aljo242 Jan 29, 2025
ada295c
fix v2 build
aljo242 Jan 29, 2025
662f69a
Merge branch 'main' into chore/return-v1
aljo242 Jan 30, 2025
8c706f1
tidy
aljo242 Jan 30, 2025
747ae62
revert systest
aljo242 Jan 30, 2025
2f74dfe
rm wf
aljo242 Jan 30, 2025
53399d0
Merge branch 'main' into chore/return-v1
aljo242 Jan 30, 2025
35b4c7c
clean wf
aljo242 Jan 30, 2025
a58622d
DynamicConfig
aljo242 Jan 30, 2025
d1c33cd
Merge branch 'main' into chore/return-v1
aljo242 Jan 31, 2025
fe93279
Update scripts/build/testing.mk
aljo242 Feb 3, 2025
675809a
update
aljo242 Jan 31, 2025
25d154d
set-sims
aljo242 Feb 3, 2025
b5ba740
remove
aljo242 Feb 3, 2025
b230917
revert simapp/v2
aljo242 Feb 3, 2025
f0481aa
revert
aljo242 Feb 3, 2025
892db91
revert
aljo242 Feb 3, 2025
7358f8a
revert
aljo242 Feb 3, 2025
65ae274
upgrade
aljo242 Feb 3, 2025
94dd689
revrt
aljo242 Feb 3, 2025
85e8c46
revrt
aljo242 Feb 3, 2025
f11423c
fix tests
aljo242 Feb 3, 2025
623ac25
Merge branch 'main' into chore/return-v1
aljo242 Feb 3, 2025
0ca55cf
lint
aljo242 Feb 3, 2025
50c2204
Merge branch 'main' into chore/return-v1
aljo242 Feb 3, 2025
e646a96
Update proto/cosmos/base/reflection/v1beta1/reflection.proto
aljo242 Feb 5, 2025
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
Prev Previous commit
Next Next commit
fix
aljo242 committed Jan 22, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 055d17a51fc6d9829cd34defaa2b29ff9a2ad937
2 changes: 1 addition & 1 deletion tests/systemtests/README.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ Or via manual steps
```shell
make build
mkdir -p ./tests/systemtests/binaries
cp ./build/simdv2 ./tests/systemtests/binaries/
cp ./build/simd ./tests/systemtests/binaries/
```

### Manual test run
2 changes: 2 additions & 0 deletions tests/systemtests/auth_test.go
Original file line number Diff line number Diff line change
@@ -476,6 +476,8 @@ func TestAuxSigner(t *testing.T) {
}

func TestTxEncodeandDecodeAndQueries(t *testing.T) {
t.Skip("we need to ensure this works on a v1 server")

// scenario: test tx encode and decode commands

cli := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose)
7 changes: 6 additions & 1 deletion tests/systemtests/cometbft_client_test.go
Original file line number Diff line number Diff line change
@@ -27,7 +27,12 @@ func TestQueryStatus(t *testing.T) {
cli := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose)
systest.Sut.StartChain(t)

resp := cli.CustomQuery("comet", "status")
var resp string
if systest.IsV2() {
resp = cli.CustomQuery("comet", "status")
} else {
resp = cli.CustomQuery("status")
}

// make sure the output has the validator moniker.
assert.Contains(t, resp, "\"moniker\":\"node0\"")
9 changes: 6 additions & 3 deletions tests/systemtests/go.mod
Original file line number Diff line number Diff line change
@@ -9,6 +9,11 @@ require (
github.com/fullstorydev/grpcurl v1.9.2
)

require (
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
)

require (
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.3-20241120201313-68e42a58b301.1 // indirect
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.3-20240130113600-88ef6483f90f.1 // indirect
@@ -34,8 +39,6 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect
@@ -54,7 +57,7 @@ require (
github.com/cosmos/iavl v1.2.2 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/creachadair/tomledit v0.0.26 // indirect
github.com/creachadair/tomledit v0.0.27 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
4 changes: 2 additions & 2 deletions tests/systemtests/go.sum
Original file line number Diff line number Diff line change
@@ -175,8 +175,8 @@ github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5n
github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creachadair/tomledit v0.0.26 h1:MoDdgHIHZ5PctBVsAZDjxdxreWUEa9ObPKTRkk5PPwA=
github.com/creachadair/tomledit v0.0.26/go.mod h1:SJi1OxKpMyR141tq1lzsbPtIg3j8TeVPM/ZftfieD7o=
github.com/creachadair/tomledit v0.0.27 h1:6xOpEnkKmcpT/gmKhabN0JXrqNX065lyje1/mXTSSIE=
github.com/creachadair/tomledit v0.0.27/go.mod h1:v1EWpgCisD3ct1kO8Gq4o4pdgX5JXD0rBI2PJ4UnPoA=
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/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
21 changes: 16 additions & 5 deletions tests/systemtests/group_test.go
Original file line number Diff line number Diff line change
@@ -63,9 +63,15 @@ func TestGroupCommands(t *testing.T) {
rsp = cli.RunAndWait(policyCmd...)
systest.RequireTxSuccess(t, rsp)

groupPoliciesResp := string(systest.GetRequest(t, fmt.Sprintf("%s/cosmos/group/v1/group_policies_by_group/%s", baseurl, groupId)))
policyAddrQuery := fmt.Sprintf("group_policies.#(decision_policy.threshold==%d).address", threshold)

// TODO: remove isV2() check once v2 is integrated with grpc gateway
var groupPoliciesResp, policyAddrQuery string
if systest.IsV2() {
groupPoliciesResp = cli.CustomQuery("q", "group", "group-policies-by-group", groupId)
policyAddrQuery = fmt.Sprintf("group_policies.#(decision_policy.value.threshold==%d).address", threshold)
} else {
groupPoliciesResp = string(systest.GetRequest(t, fmt.Sprintf("%s/cosmos/group/v1/group_policies_by_group/%s", baseurl, groupId)))
policyAddrQuery = fmt.Sprintf("group_policies.#(decision_policy.threshold==%d).address", threshold)
}
require.Equal(t, gjson.Get(groupPoliciesResp, "pagination.total").Int(), int64(threshold))
policyAddr := gjson.Get(groupPoliciesResp, policyAddrQuery).String()
require.NotEmpty(t, policyAddr)
@@ -116,7 +122,12 @@ func TestGroupCommands(t *testing.T) {
systest.RequireTxSuccess(t, rsp)

// query votes
voteResp := string(systest.GetRequest(t, fmt.Sprintf("%s/cosmos/group/v1/vote_by_proposal_voter/%s/%s", baseurl, proposalId, valAddr)))

// TODO: remove isV2() check once v2 is integrated with grpc gateway
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be reverted, grpc gateway works in v2

var voteResp string
if systest.IsV2() {
voteResp = cli.CustomQuery("q", "group", "vote", proposalId, valAddr)
} else {
voteResp = string(systest.GetRequest(t, fmt.Sprintf("%s/cosmos/group/v1/vote_by_proposal_voter/%s/%s", baseurl, proposalId, valAddr)))
}
require.Equal(t, "VOTE_OPTION_YES", gjson.Get(voteResp, "vote.option").String())
}
4 changes: 4 additions & 0 deletions tests/systemtests/mint_test.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be reverted, it should work for both, we need the build tag as well iirc.

Original file line number Diff line number Diff line change
@@ -74,6 +74,10 @@ func TestMintQueries(t *testing.T) {

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
// TODO: remove below check once grpc gateway is implemented in v2
if systest.IsV2() {
return
}
resp := systest.GetRequestWithHeaders(t, tc.url, tc.headers, http.StatusOK)
require.JSONEq(t, tc.expOut, string(resp))
})
24 changes: 20 additions & 4 deletions tests/systemtests/snapshots_test.go
Original file line number Diff line number Diff line change
@@ -26,9 +26,18 @@ func TestSnapshots(t *testing.T) {
// Stop all nodes
systest.Sut.StopChain()

var (
command string
restoreableDirs []string
)
node0Dir := systest.Sut.NodeDir(0)
command := "store"
restoreableDirs := []string{fmt.Sprintf("%s/data/application.db", node0Dir), fmt.Sprintf("%s/data/ss", node0Dir)}
if systest.IsV2() {
command = "store"
restoreableDirs = []string{fmt.Sprintf("%s/data/application.db", node0Dir), fmt.Sprintf("%s/data/ss", node0Dir)}
} else {
command = "snapshots"
restoreableDirs = []string{fmt.Sprintf("%s/data/application.db", node0Dir)}
}

// export snapshot at height 5
res := cli.RunCommandWithArgs(command, "export", "--height=5", fmt.Sprintf("--home=%s", node0Dir), disabledLog)
@@ -59,7 +68,9 @@ func TestSnapshots(t *testing.T) {
// Remove database
err := os.RemoveAll(fmt.Sprintf("%s/data/application.db", node0Dir))
require.NoError(t, err)
require.NoError(t, os.RemoveAll(fmt.Sprintf("%s/data/ss", node0Dir)))
if systest.IsV2() {
require.NoError(t, os.RemoveAll(fmt.Sprintf("%s/data/ss", node0Dir)))
}

res = cli.RunCommandWithArgs(command, "restore", "5", "3", fmt.Sprintf("--home=%s", node0Dir), disabledLog)
for _, dir := range restoreableDirs {
@@ -84,7 +95,12 @@ func TestPrune(t *testing.T) {
node0Dir := systest.Sut.NodeDir(0)

// prune
command := []string{"store", "prune", "--store.keep-recent=1"}
var command []string
if systest.IsV2() {
command = []string{"store", "prune", "--store.keep-recent=1"}
} else {
command = []string{"prune", "everything"}
}
res := cli.RunCommandWithArgs(append(command, fmt.Sprintf("--home=%s", node0Dir), disabledLog)...)
require.Contains(t, res, "successfully pruned the application root multi stores")
}
7 changes: 5 additions & 2 deletions tests/systemtests/staking_test.go
Original file line number Diff line number Diff line change
@@ -42,8 +42,11 @@ func TestStakeUnstake(t *testing.T) {
assert.Equal(t, int64(8999999), cli.QueryBalance(account1Addr, "stake"))

// check validator has been updated
rsp = cli.CustomQuery("q", "comet", "block-results", gjson.Get(rsp, "height").String())

if systest.IsV2() {
rsp = cli.CustomQuery("q", "comet", "block-results", gjson.Get(rsp, "height").String())
} else {
rsp = cli.CustomQuery("q", "block-results", gjson.Get(rsp, "height").String())
}
validatorUpdates := gjson.Get(rsp, "validator_updates").Array()
assert.NotEmpty(t, validatorUpdates)
vpk := gjson.Get(validatorUpdates[0].String(), "pub_key_bytes").String()
7 changes: 4 additions & 3 deletions tests/systemtests/unordered_tx_test.go
Original file line number Diff line number Diff line change
@@ -14,9 +14,10 @@ import (
)

func TestUnorderedTXDuplicate(t *testing.T) {
// TODO: remove once unordered tx handling is working in v2
t.Skip("The unordered tx handling is not wired in v2")

if systest.IsV2() {
t.Skip("The unordered tx handling is not wired in v2")
return
}
// scenario: test unordered tx duplicate
// given a running chain with a tx in the unordered tx pool
// when a new tx with the same hash is broadcasted