-
Notifications
You must be signed in to change notification settings - Fork 141
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
Standalone to consumer changeover - recycle existing transfer channel #832
Merged
Merged
Changes from all commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
40f3fdd
on-chain upgrade to consumer chain wip
jstr1121 aa566c9
add preCCV store and use it on democracy staking
jstr1121 dc9768d
add TODOs and one more packet possibility
jstr1121 473e467
status update
jstr1121 c6803f1
Resolve hermes start issue for trusted validator set by changing revi…
jstr1121 15265ad
remove intermediary logs
jstr1121 2806d6f
remove further unused codebase
jstr1121 c3ae9a4
updates for endblocker test, existing test fixes, get last validators
jstr1121 67aa39b
update for slashing sovereign validators for the fault made before co…
jstr1121 09f7b61
resolve comments on github and slack communication
jstr1121 d7b5a7f
Merge branch 'main' of github.com:Stride-Labs/interchain-security int…
jstr1121 8aea5bf
update sovereign app to use v4 ibc from v3 & resolve consumer module …
jstr1121 62da0d2
Update app/sovereign/upgrades/v3/upgrades.go
jstr1121 1cbd9d8
Merge branch 'main' into feature/onchain_upgrade_to_consumer_chain_840
shaspitz d46d6ef
rm sovereign chain and tests. Will be replaced by simapp and integrat…
shaspitz a8e8f4f
duplicate module name
shaspitz 85b7be5
add comment
shaspitz a651abc
small rename
shaspitz 1269163
remove democracy staking changes
shaspitz 68515d9
consumer ccv beginblock, endblock, and initgenesis order shouldn't ma…
shaspitz 48d64f4
add mock calls to compile
shaspitz 95d11e7
adjust tests for new keeper field
shaspitz be3fda8
add registerDemocConsumer method
shaspitz e3a35ce
Merge branch 'main' into feature/onchain_upgrade_to_consumer_chain_840
shaspitz 331f206
split out preCCV flag and initial valset
shaspitz 08bb06b
cleanup consumer module
shaspitz 91d7bee
cleanup
shaspitz 110d710
more cleanup
shaspitz 3584537
temp changes to validators.go
shaspitz 1107280
comment out test
shaspitz fa5a6eb
rm bad code from merge
shaspitz 4b5fd84
comment
shaspitz 00a78ef
Update app.go
shaspitz e09066d
UTs for CRUD
shaspitz 772c09c
UTs for keys
shaspitz 2dc79e4
Merge branch 'main' into feature/onchain_upgrade_to_consumer_chain_840
shaspitz c0847e1
use make for mocks
shaspitz e0e5699
todo
shaspitz a7982de
changeover method and test
shaspitz aa6da31
resolve #783
shaspitz 53dd6ea
comment
shaspitz 3651164
comments
shaspitz 45453b8
add appropriate TODOs, restore changes to main
shaspitz 7fa624b
final nits before non-draft
shaspitz a07e84b
comment on ChangeoverToConsumer
shaspitz 541aeb2
Merge branch 'main' into feature/onchain_upgrade_to_consumer_chain_840
shaspitz 0ce68ce
more clear comment
shaspitz 4f31546
Merge branch 'feature/onchain_upgrade_to_consumer_chain_840' of https…
shaspitz 3652b2a
small comment change
shaspitz 4f2e77e
update InitGenesis comment
shaspitz 6b63b7e
sovereign -> standalone
shaspitz b80fe0f
missed a file
shaspitz 17f020a
builds now
shaspitz f395584
Merge branch 'main' into feature/onchain_upgrade_to_consumer_chain_840
shaspitz 2a76cd1
update comment after debug
shaspitz d091971
ChangeoverIsComplete method
shaspitz 751acb7
small refactors, comments, slash and jail code
shaspitz 8cf1da3
naming refactor
shaspitz 9b50a64
Merge branch 'feature/onchain_upgrade_to_consumer_chain_840' into cha…
shaspitz b032f91
fix last standalone height
shaspitz e0f6bc3
Merge branch 'main' into changeover-staking
shaspitz df86b2a
Update module.go
shaspitz 71af3a1
needed refactors
shaspitz 14f8876
rm unneeded diffs
shaspitz b3156de
two UTs
shaspitz f804281
sanity check integration test
shaspitz edb491f
gofumpt
shaspitz d0640e1
last standalone height -> init genesis height
shaspitz 134e8e6
wiring
shaspitz 21fb417
integration test and refactor to enable it
shaspitz 5b3896b
sanity check
shaspitz c31efc7
Update changeover.go
shaspitz 80a6da2
Merge branch 'main' into changeover-staking
shaspitz e153a37
Use ValidatorUpdateDelay
shaspitz 7cae263
Merge branch 'main' into changeover-staking
shaspitz 0bcc0f2
Merge branch 'main' into changeover-staking
shaspitz cb9a1ec
for loop
shaspitz e78e078
Merge branch 'main' into changeover-staking
shaspitz d514989
Merge branch 'main' into changeover-staking
shaspitz 098d704
Merge branch 'changeover-staking' into recycle-transfer-channel
shaspitz 861c484
fix key name
shaspitz 7f4c49f
Merge branch 'main' into changeover-staking
shaspitz 02b4f75
Update x/ccv/consumer/keeper/changeover.go
shaspitz 0147229
Update x/ccv/consumer/keeper/validators.go
shaspitz 256bbd3
fix test
shaspitz 7a37933
Merge branch 'changeover-staking' into recycle-transfer-channel
shaspitz 1c76219
Merge branch 'main' into recycle-transfer-channel
shaspitz 9f36094
rm dup method
shaspitz 7b48350
Update keys_test.go
shaspitz 95ed1b3
Merge branch 'main' into recycle-transfer-channel
shaspitz 866f79d
Merge branch 'main' into recycle-transfer-channel
shaspitz 692fb65
Merge branch 'main' into recycle-transfer-channel
shaspitz 031283b
Merge branch 'main' into recycle-transfer-channel
shaspitz 09fd740
Merge branch 'main' into recycle-transfer-channel
shaspitz aa68fc5
Merge branch 'main' into recycle-transfer-channel
shaspitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package integration | ||
|
||
import ( | ||
transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" | ||
channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" | ||
) | ||
|
||
func (suite *CCVTestSuite) TestRecycleTransferChannel() { | ||
consumerKeeper := suite.consumerApp.GetConsumerKeeper() | ||
|
||
// Only create a connection between consumer and provider | ||
suite.coordinator.CreateConnections(suite.path) | ||
|
||
// Confirm transfer channel has not been persisted | ||
transChan := consumerKeeper.GetDistributionTransmissionChannel(suite.consumerCtx()) | ||
suite.Require().Empty(transChan) | ||
|
||
// Create transfer channel manually | ||
distrTransferMsg := channeltypes.NewMsgChannelOpenInit( | ||
transfertypes.PortID, | ||
transfertypes.Version, | ||
channeltypes.UNORDERED, | ||
[]string{suite.path.EndpointA.ConnectionID}, | ||
transfertypes.PortID, | ||
"", // signer unused | ||
) | ||
resp, err := consumerKeeper.ChannelOpenInit(suite.consumerCtx(), distrTransferMsg) | ||
suite.Require().NoError(err) | ||
|
||
// Confirm transfer channel still not persisted | ||
transChan = consumerKeeper.GetDistributionTransmissionChannel(suite.consumerCtx()) | ||
suite.Require().Empty(transChan) | ||
|
||
// Setup state s.t. the consumer keeper emulates a consumer that was previously standalone | ||
consumerKeeper.MarkAsPrevStandaloneChain(suite.consumerCtx()) | ||
suite.Require().True(consumerKeeper.IsPrevStandaloneChain(suite.consumerCtx())) | ||
suite.consumerApp.GetConsumerKeeper().SetStandaloneTransferChannelID(suite.consumerCtx(), resp.ChannelId) | ||
|
||
// Now finish setting up CCV channel | ||
suite.ExecuteCCVChannelHandshake(suite.path) | ||
|
||
// Confirm transfer channel is now persisted with expected channel id from open init response | ||
transChan = consumerKeeper.GetDistributionTransmissionChannel(suite.consumerCtx()) | ||
suite.Require().Equal(resp.ChannelId, transChan) | ||
|
||
// Confirm channel exists | ||
found := consumerKeeper.TransferChannelExists(suite.consumerCtx(), transChan) | ||
suite.Require().True(found) | ||
|
||
// Sanity check, only two channels should exist, one transfer and one ccv | ||
channels := suite.consumerApp.GetIBCKeeper().ChannelKeeper.GetAllChannels(suite.consumerCtx()) | ||
suite.Require().Len(channels, 2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 need to dig into how exactly consumer chains using the democracy module or other things will populate standaloneStakingKeeper
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.
What do you mean? That's the staking module with the native token from when the chain was a standalone chain.