Unverified Commit 4800c2be authored by Roman's avatar Roman Committed by GitHub
Browse files

chore(deps): upgrade sdk with min proposer deposit and update e2e (#2245)


* chore(deps): upgrade sdk with min proposer deposit and update e2e

* changelog

* remove extra deposit for e2e

* correct the min deposit var

* fix depositProposal

* bump sdk to correct tag

Co-authored-by: default avatarAdam Tucker <adam@osmosis.team>
parent a54777b5
Showing with 28 additions and 15 deletions
+28 -15
...@@ -40,6 +40,11 @@ All notable changes to this project will be documented in this file. ...@@ -40,6 +40,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v11
#### SDK Upgrades
* [#2245](https://github.com/osmosis-labs/osmosis/pull/2245) Upgrade SDK for to v0.45.0x-osmo-v9.2. Major changes:
* Minimum deposit on proposer at submission time: https://github.com/osmosis-labs/cosmos-sdk/pull/302
## v10.1.1 ## v10.1.1
#### Improvements #### Improvements
......
...@@ -270,8 +270,8 @@ require ( ...@@ -270,8 +270,8 @@ require (
replace ( replace (
// branch: v0.27.0.rc3-osmo, current tag: v0.27.0.rc3-osmo // branch: v0.27.0.rc3-osmo, current tag: v0.27.0.rc3-osmo
github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58 github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58
// Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk v0.45.0x-osmo-v9 // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk v0.45.0x-osmo-v9, tag v0.45.0x-osmo-v9.2
github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220709005907-f37e34d99505 github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220728141005-f09814c9e23f
// Use Osmosis fast iavl // Use Osmosis fast iavl
github.com/cosmos/iavl => github.com/osmosis-labs/iavl v0.17.3-osmo-v7 github.com/cosmos/iavl => github.com/osmosis-labs/iavl v0.17.3-osmo-v7
// use cosmos-compatible protobufs // use cosmos-compatible protobufs
......
...@@ -1034,8 +1034,8 @@ github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1 ...@@ -1034,8 +1034,8 @@ github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1
github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM=
github.com/osmosis-labs/bech32-ibc v0.3.0-rc1 h1:frHKHEdPfzoK2iMF2GeWKudLLzUXz+6GJcdZ/TMcs2k= github.com/osmosis-labs/bech32-ibc v0.3.0-rc1 h1:frHKHEdPfzoK2iMF2GeWKudLLzUXz+6GJcdZ/TMcs2k=
github.com/osmosis-labs/bech32-ibc v0.3.0-rc1/go.mod h1:X5/FZHMPL+B3ufuVyY2/koxVjd4hIwyTLjYP1DZwppQ= github.com/osmosis-labs/bech32-ibc v0.3.0-rc1/go.mod h1:X5/FZHMPL+B3ufuVyY2/koxVjd4hIwyTLjYP1DZwppQ=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220709005907-f37e34d99505 h1:vrTGp5Yty0U3X4718KaZLhdznEeAs6010LEFpJH+z1k= github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220728141005-f09814c9e23f h1:Jw7c9MZXtH3K82Jl4goH3g+6H5mMzRuLNNYs9T69UkA=
github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220709005907-f37e34d99505/go.mod h1:pMiEr6WR7drhXAXK1FOdAKPazWCi7b+WOyWOF4O0OXY= github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220728141005-f09814c9e23f/go.mod h1:pMiEr6WR7drhXAXK1FOdAKPazWCi7b+WOyWOF4O0OXY=
github.com/osmosis-labs/iavl v0.17.3-osmo-v7 h1:6KcADC/WhL7yDmNQxUIJt2XmzNt4FfRmq9gRke45w74= github.com/osmosis-labs/iavl v0.17.3-osmo-v7 h1:6KcADC/WhL7yDmNQxUIJt2XmzNt4FfRmq9gRke45w74=
github.com/osmosis-labs/iavl v0.17.3-osmo-v7/go.mod h1:lJEOIlsd3sVO0JDyXWIXa9/Ur5FBscP26zJx0KxHjto= github.com/osmosis-labs/iavl v0.17.3-osmo-v7/go.mod h1:lJEOIlsd3sVO0JDyXWIXa9/Ur5FBscP26zJx0KxHjto=
github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58 h1:15l3Iss2oCGCeJRi2g3CuCnqmEjpAr3Le7cDnoN/LS0= github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58 h1:15l3Iss2oCGCeJRi2g3CuCnqmEjpAr3Le7cDnoN/LS0=
......
...@@ -14,12 +14,14 @@ import ( ...@@ -14,12 +14,14 @@ import (
"testing" "testing"
"time" "time"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ory/dockertest/v3" "github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker" "github.com/ory/dockertest/v3/docker"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
rpchttp "github.com/tendermint/tendermint/rpc/client/http" rpchttp "github.com/tendermint/tendermint/rpc/client/http"
appparams "github.com/osmosis-labs/osmosis/v10/app/params"
dockerconfig "github.com/osmosis-labs/osmosis/v10/tests/e2e/docker" dockerconfig "github.com/osmosis-labs/osmosis/v10/tests/e2e/docker"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization" "github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/util" "github.com/osmosis-labs/osmosis/v10/tests/e2e/util"
...@@ -66,6 +68,10 @@ const ( ...@@ -66,6 +68,10 @@ const (
propBufferBlocks float32 = 5 propBufferBlocks float32 = 5
// max retries for json unmarshalling // max retries for json unmarshalling
maxRetries = 60 maxRetries = 60
// minimum deposit value for a proposal to enter a voting period.
minDepositValue = 10000000
// minimum deposit value for proposal to be submitted.
initialMinDeposit = minDepositValue / 4
) )
var ( var (
...@@ -507,7 +513,7 @@ func (s *IntegrationTestSuite) upgrade() { ...@@ -507,7 +513,7 @@ func (s *IntegrationTestSuite) upgrade() {
for _, chainConfig := range s.chainConfigs { for _, chainConfig := range s.chainConfigs {
currentHeight := s.getCurrentChainHeight(chainConfig, 0) currentHeight := s.getCurrentChainHeight(chainConfig, 0)
chainConfig.propHeight = currentHeight + int(chainConfig.votingPeriod) + int(propSubmitBlocks) + int(propBufferBlocks) chainConfig.propHeight = currentHeight + int(chainConfig.votingPeriod) + int(propSubmitBlocks) + int(propBufferBlocks)
s.submitUpgradeProposal(chainConfig) s.submitUpgradeProposal(chainConfig, sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(initialMinDeposit)))
s.depositProposal(chainConfig) s.depositProposal(chainConfig)
s.voteProposal(chainConfig) s.voteProposal(chainConfig)
} }
......
...@@ -5,6 +5,9 @@ import ( ...@@ -5,6 +5,9 @@ import (
"strconv" "strconv"
"time" "time"
sdk "github.com/cosmos/cosmos-sdk/types"
appparams "github.com/osmosis-labs/osmosis/v10/app/params"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization" "github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization"
) )
...@@ -19,7 +22,7 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() { ...@@ -19,7 +22,7 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
func (s *IntegrationTestSuite) TestSuperfluidVoting() { func (s *IntegrationTestSuite) TestSuperfluidVoting() {
const walletName = "wallet" const walletName = "wallet"
chainA := s.chainConfigs[0] chainA := s.chainConfigs[0]
s.submitSuperfluidProposal(chainA, "gamm/pool/1") s.submitSuperfluidProposal(chainA, "gamm/pool/1", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(initialMinDeposit)))
s.depositProposal(chainA) s.depositProposal(chainA)
s.voteProposal(chainA) s.voteProposal(chainA)
walletAddr := s.createWallet(chainA, 0, walletName) walletAddr := s.createWallet(chainA, 0, walletName)
...@@ -30,7 +33,7 @@ func (s *IntegrationTestSuite) TestSuperfluidVoting() { ...@@ -30,7 +33,7 @@ func (s *IntegrationTestSuite) TestSuperfluidVoting() {
// superfluid delegate from validator 0 non self-delegation wallet to validator 1 on chain A // superfluid delegate from validator 0 non self-delegation wallet to validator 1 on chain A
s.superfluidDelegate(chainA, chainA.validators[1].operatorAddress, walletName) s.superfluidDelegate(chainA, chainA.validators[1].operatorAddress, walletName)
// create a text prop, deposit and vote yes // create a text prop, deposit and vote yes
s.submitTextProposal(chainA, "superfluid vote overwrite test") s.submitTextProposal(chainA, "superfluid vote overwrite test", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(initialMinDeposit)))
s.depositProposal(chainA) s.depositProposal(chainA)
s.voteProposal(chainA) s.voteProposal(chainA)
// set delegator vote to no // set delegator vote to no
......
...@@ -18,10 +18,9 @@ import ( ...@@ -18,10 +18,9 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/ory/dockertest/v3/docker" "github.com/ory/dockertest/v3/docker"
superfluidtypes "github.com/osmosis-labs/osmosis/v10/x/superfluid/types"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization" "github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/util" "github.com/osmosis-labs/osmosis/v10/tests/e2e/util"
superfluidtypes "github.com/osmosis-labs/osmosis/v10/x/superfluid/types"
) )
func (s *IntegrationTestSuite) ExecTx(chainId string, validatorIndex int, command []string, success string) (bytes.Buffer, bytes.Buffer, error) { func (s *IntegrationTestSuite) ExecTx(chainId string, validatorIndex int, command []string, success string) (bytes.Buffer, bytes.Buffer, error) {
...@@ -144,26 +143,26 @@ func (s *IntegrationTestSuite) sendIBC(srcChain *chainConfig, dstChain *chainCon ...@@ -144,26 +143,26 @@ func (s *IntegrationTestSuite) sendIBC(srcChain *chainConfig, dstChain *chainCon
s.T().Log("successfully sent IBC tokens") s.T().Log("successfully sent IBC tokens")
} }
func (s *IntegrationTestSuite) submitUpgradeProposal(c *chainConfig) { func (s *IntegrationTestSuite) submitUpgradeProposal(c *chainConfig, initialDeposit sdk.Coin) {
upgradeHeightStr := strconv.Itoa(c.propHeight) upgradeHeightStr := strconv.Itoa(c.propHeight)
s.T().Logf("submitting upgrade proposal on %s container: %s", s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID) s.T().Logf("submitting upgrade proposal on %s container: %s", s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID)
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "software-upgrade", upgradeVersion, fmt.Sprintf("--title=\"%s upgrade\"", upgradeVersion), "--description=\"upgrade proposal submission\"", fmt.Sprintf("--upgrade-height=%s", upgradeHeightStr), "--upgrade-info=\"\"", fmt.Sprintf("--chain-id=%s", c.meta.Id), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json"} cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "software-upgrade", upgradeVersion, fmt.Sprintf("--title=\"%s upgrade\"", upgradeVersion), "--description=\"upgrade proposal submission\"", fmt.Sprintf("--upgrade-height=%s", upgradeHeightStr), "--upgrade-info=\"\"", fmt.Sprintf("--chain-id=%s", c.meta.Id), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--deposit=%s", initialDeposit)}
s.ExecTx(c.meta.Id, 0, cmd, "code: 0") s.ExecTx(c.meta.Id, 0, cmd, "code: 0")
s.T().Log("successfully submitted upgrade proposal") s.T().Log("successfully submitted upgrade proposal")
c.latestProposalNumber = c.latestProposalNumber + 1 c.latestProposalNumber = c.latestProposalNumber + 1
} }
func (s *IntegrationTestSuite) submitSuperfluidProposal(c *chainConfig, asset string) { func (s *IntegrationTestSuite) submitSuperfluidProposal(c *chainConfig, asset string, initialDeposit sdk.Coin) {
s.T().Logf("submitting superfluid proposal for asset %s on %s container: %s", asset, s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID) s.T().Logf("submitting superfluid proposal for asset %s on %s container: %s", asset, s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID)
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "set-superfluid-assets-proposal", fmt.Sprintf("--superfluid-assets=%s", asset), fmt.Sprintf("--title=\"%s superfluid asset\"", asset), fmt.Sprintf("--description=\"%s superfluid asset\"", asset), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id)} cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "set-superfluid-assets-proposal", fmt.Sprintf("--superfluid-assets=%s", asset), fmt.Sprintf("--title=\"%s superfluid asset\"", asset), fmt.Sprintf("--description=\"%s superfluid asset\"", asset), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id), fmt.Sprintf("--deposit=%s", initialDeposit)}
s.ExecTx(c.meta.Id, 0, cmd, "code: 0") s.ExecTx(c.meta.Id, 0, cmd, "code: 0")
s.T().Log("successfully submitted superfluid proposal") s.T().Log("successfully submitted superfluid proposal")
c.latestProposalNumber = c.latestProposalNumber + 1 c.latestProposalNumber = c.latestProposalNumber + 1
} }
func (s *IntegrationTestSuite) submitTextProposal(c *chainConfig, text string) { func (s *IntegrationTestSuite) submitTextProposal(c *chainConfig, text string, initialDeposit sdk.Coin) {
s.T().Logf("submitting text proposal on %s container: %s", s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID) s.T().Logf("submitting text proposal on %s container: %s", s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID)
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "--type=text", fmt.Sprintf("--title=\"%s\"", text), "--description=\"test text proposal\"", "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id)} cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "--type=text", fmt.Sprintf("--title=\"%s\"", text), "--description=\"test text proposal\"", "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id), fmt.Sprintf("--deposit=%s", initialDeposit)}
s.ExecTx(c.meta.Id, 0, cmd, "code: 0") s.ExecTx(c.meta.Id, 0, cmd, "code: 0")
s.T().Log("successfully submitted text proposal") s.T().Log("successfully submitted text proposal")
c.latestProposalNumber = c.latestProposalNumber + 1 c.latestProposalNumber = c.latestProposalNumber + 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment