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

deps: bump SDK to v0.47.1 #3459

Merged
merged 9 commits into from
Apr 26, 2023
Merged

deps: bump SDK to v0.47.1 #3459

merged 9 commits into from
Apr 26, 2023

Conversation

crodriguezvega
Copy link
Contributor

@crodriguezvega crodriguezvega commented Apr 14, 2023

Description

Waiting on this PR in interchaintest to be merged.

closes: #XXXX

Commit Message / Changelog Entry

deps: bump SDK to v0.47.1

see the guidelines for commit messages. (view raw markdown for examples)


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@crodriguezvega crodriguezvega marked this pull request as draft April 16, 2023 13:41
@crodriguezvega crodriguezvega self-assigned this Apr 17, 2023
@crodriguezvega
Copy link
Contributor Author

I am a bit stuck here... I bump interchaintest to the latest (v7.0.0-20230417164426-9b8f7ae9bf1d) but I still get this error when I do go mod tidy:

github.com/cosmos/ibc-go/e2e/testconfig imports
        github.com/cometbft/cometbft/types imports
        github.com/cometbft/cometbft/crypto/secp256k1 imports
        github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
        github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
        github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
        github.com/btcsuite/btcd v0.22.0-beta (/Users/carlosrodriguez/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 (/Users/carlosrodriguez/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.1)

interchaintest was having the same issue, but in the latest commit that was fixed and it works now. But I am lost why we have this error in ibc-go...

@crodriguezvega
Copy link
Contributor Author

crodriguezvega commented Apr 18, 2023

I think the problem is fixed! Thanks to @misko9 for the solution to the puzzle!

@crodriguezvega crodriguezvega marked this pull request as ready for review April 18, 2023 22:11
@colin-axner
Copy link
Contributor

looks like tests are still failing

@crodriguezvega
Copy link
Contributor Author

looks like tests are still failing

I know :) This is now a different problem.

@chatton
Copy link
Contributor

chatton commented Apr 26, 2023

Looking a bit more into the failures, I attempted running the tests using a simd from main, but with interchain test pointing at sdk 0.47.1 and ran into the same account sequence mismatch error. Looking at the SDK changes I do suspect it has something to do with either CLI args (used by interchain test) or the clientContext which is also used in interchaintest is the BroadcastTx function which calls the sdk BroadcastTx.

@chatton
Copy link
Contributor

chatton commented Apr 26, 2023

After some more debugging with @charleenfei , we managed to figure it out. The problem was because of the changes in this PR.

Specifically

	initNum, initSeq := fc.accountNumber, fc.sequence
-	if initNum == 0 || initSeq == 0 {
+     if initNum == 0 && initSeq == 0 {
		num, seq, err := fc.accountRetriever.GetAccountNumberSequence(clientCtx, from)
		if err != nil {
			return fc, err
		}

-		if initNum == 0 {
-			fc = fc.WithAccountNumber(num)
-		}
+ fc = fc.WithAccountNumber(num)
+ fc = fc.WithSequence(seq)
-
-		if initSeq == 0 {
-			fc = fc.WithSequence(seq)
-		}
	}

In interchain test, we were accidentally not explicitly passing the account sequence when creating the tx Factory. As a result, the || conditional in the above code made it so that we correctly got the sequence.

I will create a follow up PR in interchain test to fix this issue there.

I believe there should be a check in the sdk that ensures if exactly one of the account / account sequence is zero, it should error out.

cdc := Codec()
return clientContext.WithCodec(cdc).WithTxConfig(authtx.NewTxConfig(cdc, []signingtypes.SignMode{signingtypes.SignMode_SIGN_MODE_DIRECT}))
})

broadcaster.ConfigureFactoryOptions(func(factory tx.Factory) tx.Factory {
return factory.WithGas(DefaultGasValue)
return factory.WithGas(DefaultGasValue).WithSequence(seq)
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Comment on lines +39 to +50
// this is a temporary work around to pass the acc sequence correctly.
// TODO: create PR against interchain test to make this the default behaviour.
sdkAdd, err := sdk.AccAddressFromBech32(user.FormattedAddress())
if err != nil {
panic(err)
}

_, seq, err = clientContext.AccountRetriever.GetAccountNumberSequence(clientContext, sdkAdd)
if err != nil {
panic(err)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

this can be removed when this issue is resolved.

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

dope working on debugging the issue @chatton & @charleenfei

@colin-axner
Copy link
Contributor

Fantastic work y'all!

@chatton chatton merged commit 87ac1a9 into main Apr 26, 2023
@chatton chatton deleted the carlos/bump-sdk-v0.47.1 branch April 26, 2023 16:12
mergify bot pushed a commit that referenced this pull request Apr 26, 2023
(cherry picked from commit 87ac1a9)

# Conflicts:
#	e2e/go.mod
#	e2e/go.sum
#	e2e/testsuite/tx.go
#	go.mod
#	go.sum
#	modules/capability/go.mod
#	modules/capability/go.sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants