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

feat: Integrate ICS Provider #1938

Merged
merged 52 commits into from
Jan 17, 2023
Merged

feat: Integrate ICS Provider #1938

merged 52 commits into from
Jan 17, 2023

Conversation

glnro
Copy link
Contributor

@glnro glnro commented Dec 5, 2022

This PR fulfills the minimum requirement #1909 for integrating ICS into Gaia as a provider chain.

Outstanding Issues

@codecov
Copy link

codecov bot commented Dec 5, 2022

Codecov Report

Merging #1938 (90977e3) into main (c446c23) will increase coverage by 1.24%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1938      +/-   ##
==========================================
+ Coverage   79.20%   80.44%   +1.24%     
==========================================
  Files          23       23              
  Lines        1577     1616      +39     
==========================================
+ Hits         1249     1300      +51     
+ Misses        274      262      -12     
  Partials       54       54              
Impacted Files Coverage Δ
app/app.go 75.67% <100.00%> (+3.32%) ⬆️
app/keepers/keepers.go 98.92% <100.00%> (+1.71%) ⬆️
app/keepers/keys.go 86.20% <100.00%> (ø)
app/modules.go 100.00% <100.00%> (ø)
x/globalfee/module.go 88.67% <0.00%> (+3.77%) ⬆️

@yaruwangway
Copy link
Contributor

Hi, can you fix lint


// if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, appKeepers.keys); err != nil {
// tmos.Exit(err.Error())
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

why comment out this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was temporarily removed due to a previous version conflict...bringing it back in

tests/e2e/go.mod Outdated

replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.12-0.20221116140330-9c145c827001
github.com/cosmos/ibc-go/v3 => github.com/informalsystems/ibc-go/v3 v3.4.1-0.20221202165607-3dc5ba251371
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we okay with using our branch of ibc-go?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a really good question. IIRC our changes are just testing related, so it's possible that we could use mainline 3.4 here without breaking anything in the actual code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah just reverted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jtremback @mpoke We actually need to keep the dependency for informalsystems/ibc-go as otherwise GaiaApp will be incompatible and unable to implement e2eutil.ProviderApp. This is because ICS's e2e ProviderApp must implement the following which is not available if we use IBC v3.4.1

import ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"

func (appKeepers *AppKeepers) GetStakingKeeper() ibcclienttypes.StakingKeeper {  
  return appKeepers.StakingKeeper  
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Does our fork of ibc-go change anything besides the testing framework?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will have a concrete update by Monday, discussed a possible solution for the release here.

tests/e2e/go.mod Outdated
@@ -144,3 +144,11 @@ require (
nhooyr.io/websocket v1.8.6 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace (
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.12-0.20221116140330-9c145c827001
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this contain the ICS changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@glnro
Copy link
Contributor Author

glnro commented Jan 4, 2023

@glnro the reason TestAppStateDeterminism is currently failing is due to the way the cosmos sdk simulation package sets up the test, details below:

TestAppStateDeterminism uses SimulateFromSeed. This function takes in an AppStateFn, which accepts the gaia app's SimulationManager.

Firstly, simulationModules() is missing an entry for the provider module. This means the SimulationManager mentioned above is initialized without the provider module. This causes downstream problems when the AppStateFn called in TestAppStateDeterminism, eventually calls AppStateRandomizedFn, which calls simManager.GenerateGenesisStates(simState) on the sim manager. I believe adding an entry to simulationModules() (within this repo) fixes the issue.

Next, the default genesis state created in AppStateRandomizedFn, uses the ModuleBasics global var. I believe we need to add an entry for the ICS provider's app module basic here. This change would lie in cosmos sdk.

When making the above two changes, the TestAppStateDeterminism did not pass, but it at least gave me an error that was different than before, and seemingly unrelated to ICS:

--- FAIL: TestAppStateDeterminism (1.11s)
panic: invalid height: 2; expected: 1 [recovered]
	panic: invalid height: 2; expected: 1 [recovered]
	panic: invalid height: 2; expected: 1

Hope this can at least help point us in right direction toward fixing the issue.

I'm not sure we should be using Simapp long term anyway, but making the change locally in the SDK I was able to get the tests to pass. @alexanderbez Not sure what the SDK would advise moving forward. We have plans to remove references to simapp in the future, but they've been deprioritized in favor of integrating ICS.

Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

LGTM. Just some nits.

Comment on lines 46 to 48
// send tokens from bank module to source address
// test helper
// helper.seedAccount(sourceAddress, amount)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove comment code.


func TestCCVTestSuite(t *testing.T) {
ccvSuite := e2e.NewCCVTestSuite[*app.GaiaApp, *appConsumer.App](
// Pass in ibctesting.AppIniters for gaia (provider) and consumer.
Copy link
Contributor

Choose a reason for hiding this comment

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

@mpoke mpoke removed the request for review from okwme January 16, 2023 18:13
Copy link
Contributor

@sainoe sainoe left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarcloud
Copy link

sonarcloud bot commented Jan 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@glnro glnro merged commit e665d82 into main Jan 17, 2023
@glnro glnro deleted the glnro/ics-v45 branch January 17, 2023 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants