-
Notifications
You must be signed in to change notification settings - Fork 637
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
Upgrade to cosmos sdk v0.46.0-rc1, against main #1443
Conversation
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.5 to 2.2.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v2.1.5...v2.2.0) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…ctions/setup-go-2.2.0 build(deps): bump actions/setup-go from 2.1.5 to 2.2.0
* deps: upgrade of SDK to 0.46 and tendermint to 0.35 * some changes from review comments * some review comments * refactor: simplify IBC redundant relay check in given restructure of SDK v0.46 (cosmos#1288) * refactor: simplify ibc redundancy check used as sdk middleware Instead of having the function checkRedundancy check if the call is on CheckTx or SimulateTx, only call the function on CheckTx or SimulateTx * add godoc * more review comments. * another review comment * remove tests since legacy REST endpoints have been removed in SDK 0.46 * chore: update sdk to v0.46.0-beta2 * refactor: ics27 indicator tests of deterministic error codes and message responses (cosmos#1349) * begin refactoring ack_test * fix test due to delayed block execution * refactor: switch ics27 response creation to use new SDK version, update tests * fix import * review comment Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * review comment. * pass nil context Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * review comment Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> * remove unused import * remove unused import * fix for race condition in tests * remove replace directive to make it build in pre-monterrey mac OS X Co-authored-by: Carlos Rodriguez <crodveg@gmail.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: billy rennekamp <billy.rennekamp@gmail.com>
…into sdk-master
…into sdk-master
…into sdk-master
Codecov Report
@@ Coverage Diff @@
## main #1443 +/- ##
==========================================
- Coverage 80.36% 80.02% -0.35%
==========================================
Files 166 165 -1
Lines 12105 12064 -41
==========================================
- Hits 9728 9654 -74
- Misses 1920 1952 +32
- Partials 457 458 +1
|
@@ -63,7 +63,7 @@ func TestAddGenesisAccountCmd(t *testing.T) { | |||
require.NoError(t, err) | |||
|
|||
serverCtx := server.NewContext(viper.New(), cfg, logger) | |||
clientCtx := client.Context{}.WithJSONCodec(appCodec).WithHomeDir(home) | |||
clientCtx := client.Context{}.WithCodec(appCodec).WithHomeDir(home) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this consistently because the WithJSONCodec is deprecated.
@@ -25,13 +26,15 @@ func TestRandomizedGenState(t *testing.T) { | |||
s := rand.NewSource(1) | |||
r := rand.New(s) | |||
|
|||
initialStake := math.NewInt(1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was done because of the new cosmos sdk math library
@@ -5,7 +5,7 @@ import ( | |||
|
|||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | |||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | |||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" | |||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a teeny bit hacky:
The proper way could be to fully refactor all use of governance, but it is my belief that this works.
@@ -367,7 +367,7 @@ func (suite *InterchainAccountsTestSuite) TestChanOpenConfirm() { | |||
|
|||
// use chainA (controller) for ChanOpenConfirm | |||
msg := channeltypes.NewMsgChannelOpenConfirm(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, proofAck, proofHeight, icatypes.ModuleName) | |||
handler := suite.chainA.GetSimApp().MsgServiceRouter().Handler(msg) | |||
handler := suite.chainA.GetSimApp().BaseApp.MsgServiceRouter().Handler(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post-sdk-middleware changes + unchanges, this seems to be the correct way to summon the MsgServiceRouter.
@@ -4,8 +4,9 @@ import ( | |||
"fmt" | |||
"strings" | |||
|
|||
baseapp "github.com/cosmos/cosmos-sdk/baseapp" | |||
"github.com/cosmos/cosmos-sdk/baseapp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't name baseapp import, because it's already named baseapp by default.
differentResponses := tmprotostate.ABCIResponses{ | ||
DeliverTxs: []*abcitypes.ResponseDeliverTx{ | ||
&differentDeliverTx, | ||
// The safety of including ABCI error codes in the acknowledgement rests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am concerned that I have complicated this test versus what is in main.
@@ -130,7 +150,7 @@ func (suite *InterchainAccountsTestSuite) TestChanOpenInit() { | |||
|
|||
// use chainB (host) for ChanOpenInit | |||
msg := channeltypes.NewMsgChannelOpenInit(path.EndpointB.ChannelConfig.PortID, icatypes.Version, channeltypes.ORDERED, []string{path.EndpointB.ConnectionID}, path.EndpointA.ChannelConfig.PortID, icatypes.ModuleName) | |||
handler := suite.chainB.GetSimApp().MsgServiceRouter().Handler(msg) | |||
handler := suite.chainB.GetSimApp().MsgServiceRouter.Handler(msg) | |||
_, err := handler(suite.chainB.GetContext(), msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This differs from one of my earlier tests and looks cleaner. I will try and modify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know why this doesn't work the same as:
NumValidators: 4, | ||
BondDenom: sdk.DefaultBondDenom, | ||
MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), | ||
AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), | ||
StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), | ||
BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), | ||
PruningStrategy: storetypes.PruningOptionNothing, | ||
PruningStrategy: "nothing", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this wanted a string, so I gave it a string.
@@ -126,134 +130,12 @@ func (s *IntegrationTestSuite) TearDownSuite() { | |||
s.network.Cleanup() | |||
} | |||
|
|||
// TestLegacyRestErrMessages creates two IBC txs, one that fails, one that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove this because we no longer need to accommodate legacy rest
// - succeed using gRPC | ||
// In practice, we call this function on IBC txs. | ||
func (s *IntegrationTestSuite) testQueryIBCTx(txRes sdk.TxResponse, cmd *cobra.Command, args []string) { | ||
val := s.network.Validators[0] | ||
|
||
errMsg := "this transaction cannot be displayed via legacy REST endpoints, because it does not support" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with this, there's no longer a need to support legacy rest.
|
||
// initTendermintConfig helps to override default Tendermint Config values. | ||
// return tmcfg.DefaultConfig if no custom configuration is required for the application. | ||
func initTendermintConfig() *tmcfg.Config { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this wasn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was
This reverts commit d423a86.
s.Require().NoError(err) | ||
|
||
acc2pubkey, err := account2.GetPubKey() | ||
s.Require().NoError(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added these because the getpubkey() method now returns error
Hi @faddat. Thanks a lot for opening all these PRs! I wanted to give you an overview of our planning and timelines to work on the upgrade to SDK 0.46 and its release. We are in the final stages of fee middleware (ICS-29) and we have decided to release this feature first as ibc-go v.4.0.0 with SDK 0.45. After several discussions we have been recommended to make a release of fee middleware that is compatible with SDK 0.45.x. Therefore the official release of ibc-go with SDK 0.46 will come afterwards (most likely as v5.0.0). In the meantime we will work on the upgrade in this branch and if we haven't cut v5.0.0 by the time Cosmos Hub is going to release rho, then we have agreed with the Cosmos Hub team that they will use the upgrade branch. It's a bit hacky, but it's the only solution we found to be able to satisfy all parties. For that reason, for now we don't want to bring all changes from main into the upgrade branch, because we want to keep it strictly with only the changes required for the upgrade to 0.46, nothing else. Once we cut v4.0.0, then we can start thinking about bringing main to the upgrade branch in preparation for v5.0.0, but for now maybe we should just hold our horses a bit. :) I expect that we cut v4.0.0 next month, so if we continue doing work on the upgrade to SDK 0.46 in parallel in the meantime, then v5.0.0 could follow soon after. Next week we are going to open a new PR to upgrade this branch to 0.46-rc1. And you PRs we will again be extremely useful. I hope this sheds a bit of light about our plans and I hope that you don't mind if, after reviewing your PRs, we end up deciding closing some if we think that's the best approach for our workflow and timeline. Again, thanks a lot for your work; it is very much appreciated. |
Thanks IBC-go team. |
closing because tm 35 -> 34 |
Description
This is a version of #1413 that changes only 69 files, by targeting main. Along the way to making this, I frequently merged in upstream changes like:
git merge upstream/main
because that way the scope of the review is limited, and it is more usable. If it didn't reflect changes in the main branch, it really wouldn't be highly suited to use, for example on the cosmos hub.main
branch's ci folder.git checkout upstream/main -- .github
There are two routes to merging this, one is outlined here, and one is in these PR's, which will give the same result, if they are merged into @crodriguezvega's branch in the following sequence.
#1439 - fumpts @crodriguezvega's v0.46 branch so it will more closely match #1412, reducing the scope of a review.
#1412 - bring @crodriguezvega's v0.46 branch current with main, save for changes made in the past day or two.
#1413 - identical to this PR. The other two above are to make reviewing this one easier.
In both cases, this unblocks work across cosmos using cosmos sdk v0.46.0-rc1.
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes