-
Notifications
You must be signed in to change notification settings - Fork 639
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(simapp): move simapp binary into its own go.mod #6710
feat(simapp): move simapp binary into its own go.mod #6710
Conversation
// SDK module keepers | ||
|
||
// add keepers | ||
app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String()) |
Check warning
Code scanning / CodeQL
Directly using the bech32 constants Warning
// SDK module keepers | ||
|
||
// add keepers | ||
app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String()) |
Check warning
Code scanning / CodeQL
Directly using the bech32 constants Warning
logger, | ||
) | ||
app.StakingKeeper = stakingkeeper.NewKeeper( | ||
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), |
Check warning
Code scanning / CodeQL
Directly using the bech32 constants Warning
logger, | ||
) | ||
app.StakingKeeper = stakingkeeper.NewKeeper( | ||
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), |
Check warning
Code scanning / CodeQL
Directly using the bech32 constants Warning
cosmossdk.io/tools/confix v0.1.1 | ||
cosmossdk.io/x/circuit v0.1.1 | ||
cosmossdk.io/x/evidence v0.1.1 | ||
cosmossdk.io/x/feegrant v0.1.1 |
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.
wahooo!!! 🎉
I will push some changes |
mockModule, | ||
|
||
// IBC light clients | ||
ibctm.NewAppModule(tmLightClientModule), |
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 should add wasm/callbacks to this go.mod? Maybe we can do in a followup?
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.
sounds fine to me!
testing/simapp/genesis_account.go
Outdated
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.
removed any files which had unused logic. We can add back as necessary
I pruned anything that stood out as unused. Now, In a followup, it would be great if we could add wasm/callbacks into the |
app.UpgradeKeeper.SetUpgradeHandler( | ||
upgrades.V5, | ||
upgrades.CreateDefaultUpgradeHandler(app.ModuleManager, app.configurator), | ||
) | ||
|
||
// NOTE: The moduleName arg of v6.CreateUpgradeHandler refers to the auth module ScopedKeeper name to which the channel capability should be migrated from. | ||
// This should be the same string value provided upon instantiation of the ScopedKeeper with app.CapabilityKeeper.ScopeToModule() | ||
// See: https://github.com/cosmos/ibc-go/blob/v6.1.0/testing/simapp/app.go#L310 | ||
app.UpgradeKeeper.SetUpgradeHandler( | ||
upgrades.V6, | ||
upgrades.CreateV6UpgradeHandler( | ||
app.ModuleManager, | ||
app.configurator, | ||
app.appCodec, | ||
app.keys[capabilitytypes.ModuleName], | ||
app.CapabilityKeeper, | ||
ibcmock.ModuleName+icacontrollertypes.SubModuleName, | ||
), | ||
) | ||
|
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.
removed as we don't run these in e2e's any longer
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.
Oh nice! It is much neater now with all the pruning you've done 🙏
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.
Happy to move forward with this and see how we can work things out.
My main concern is around building "release" images and dealing with pinned go modules in the new simapp mod.
mockModule, | ||
|
||
// IBC light clients | ||
ibctm.NewAppModule(tmLightClientModule), |
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.
sounds fine to me!
replace ( | ||
github.com/cosmos/ibc-go/modules/capability => ../modules/capability | ||
github.com/cosmos/ibc-go/v8 => ../ | ||
) |
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'm not sure how this is going to work with compatibility tests. I think this is fine for PR e2e tests etc.
It could become messy if we are building images with the latest of each library etc..
Is the plan to pin these to specific releases when building an actual simapp version image?
e.g. ibc-go-simd:v9.0.0
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 just assumed that was what we were already doing?
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.
with the compatibility tests we are basically just using the regular simd image I believe. Not using the wasm/callbacks binaries.
I think this is what we are actually already doing, it's not ideal but I think until it becomes an actual problem it is okay to leave as is
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.
So they idea will be that we tag a new release of this module with every ibc-go major (and minor?) release?
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 don't think we need to tag or release the simapp go mod via github, but having a docker image built and pushed would be a good idea!
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.
Don't we already do that (we tag the image on release, no)? Maybe I am missing something, but since we use replace in go.mod, I am not sure why this would be any different from what we have today?
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 build and push an image for every tag of ibc-go
ibc-go/.github/workflows/release.yml
Lines 35 to 61 in bce3e9e
publish-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 | |
with: | |
images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
build-args: | | |
IBC_GO_VERSION=${{ github.ref_name }} |
It should be no different, but I think the changes have flagged some concerns about possible compatibility issues (nothing new though you're right)
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.
LGTM! Thanks for doing this cleanup.
I also noticed that the e2e go mod changes with a go mod tidy on this PR, guess some indirect dependencies are no longer required there. I think we can run go mod tidy in the e2e dir and commit the changes.
replace ( | ||
github.com/cosmos/ibc-go/modules/capability => ../modules/capability | ||
github.com/cosmos/ibc-go/v8 => ../ | ||
) |
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.
with the compatibility tests we are basically just using the regular simd image I believe. Not using the wasm/callbacks binaries.
I think this is what we are actually already doing, it's not ideal but I think until it becomes an actual problem it is okay to leave as is
@@ -9,7 +9,7 @@ COMMIT := $(shell git log -1 --format='%H') | |||
LEDGER_ENABLED ?= true | |||
BINDIR ?= $(GOPATH)/bin | |||
BUILDDIR ?= $(CURDIR)/build | |||
SIMAPP = ./testing/simapp | |||
SIMAPP = ./simapp |
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.
love how few changes are needed here!
@@ -17,15 +17,6 @@ import ( | |||
"cosmossdk.io/core/appmodule" |
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.
can we delete this app now?
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 still use it for the integration tests, I guess?
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.
ah, I guess this means we will need to keep it around so we don't have ibc-go importing from the simapp 🤔 ?
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.
Yeah, I think so. It has been trimmed down, but need this still.
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.
Thank you @gjermundgaraba and @colin-axner!
@@ -0,0 +1,47 @@ | |||
# simapp |
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 will go through this document and open a PR if it needs to be updated.
replace ( | ||
github.com/cosmos/ibc-go/modules/capability => ../modules/capability | ||
github.com/cosmos/ibc-go/v8 => ../ | ||
) |
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.
So they idea will be that we tag a new release of this module with every ibc-go major (and minor?) release?
might be the reason from some e2e build failures also |
Quality Gate passed for 'ibc-go'Issues Measures |
Description
closes: #3968
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/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.