-
Notifications
You must be signed in to change notification settings - Fork 122
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
fix: fix misbehaviour and equivocation evidence CLI commands #2213
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,7 +156,7 @@ message QueryConsumerGenesisResponse { | |
|
||
message QueryConsumerChainsRequest { | ||
// The phase of the consumer chains returned (optional) | ||
// Registered=1|Initialized=2|Launched=3|Stopped=4|Deleted=5 | ||
// All=0|Registered=1|Initialized=2|Launched=3|Stopped=4|Deleted=5 | ||
ConsumerPhase phase = 1; | ||
// The limit of consumer chains returned (optional) | ||
// default is 100 | ||
|
@@ -182,7 +182,7 @@ message Chain { | |
repeated string allowlist = 7; | ||
// Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. | ||
repeated string denylist = 8; | ||
// The phase the consumer chain (Registered=0|Initialized=1|FailedToLaunch=2|Launched=3|Stopped=4) | ||
// The phase the consumer chain (Registered=1|Initialized=2|Launched=3|Stopped=4|Deleted=5) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phase is a string. This are not the values. Remove the comment or adapt it. |
||
string phase = 9; | ||
// The metadata of the consumer chain | ||
ConsumerMetadata metadata = 10 [(gogoproto.nullable) = false ]; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import ( | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Silent errors. |
||
"cosmossdk.io/math" | ||
|
||
channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" | ||
tendermint "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" | ||
ibctesting "github.com/cosmos/ibc-go/v8/testing" | ||
"github.com/stretchr/testify/require" | ||
|
@@ -220,8 +219,8 @@ func (s *Driver) getStateString() string { | |
state.WriteString("\n") | ||
|
||
state.WriteString("Consumers Chains:\n") | ||
chainIds := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) | ||
state.WriteString(strings.Join(chainIds, ", ")) | ||
// chainIds := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) | ||
// state.WriteString(strings.Join(chainIds, ", ")) | ||
state.WriteString("\n\n") | ||
|
||
for chain := range s.simibcs { | ||
|
@@ -255,24 +254,24 @@ func (s *Driver) getChainStateString(chain ChainId) string { | |
chainInfo.WriteString(fmt.Sprintf(" Running Time: %s\n", runningTime)) | ||
chainInfo.WriteString(fmt.Sprintf(" Last Time entered on chain: %s\n", lastTime)) | ||
|
||
if !s.isProviderChain(chain) { | ||
// Check whether the chain is in the consumer chains on the provider | ||
// if !s.isProviderChain(chain) { | ||
// Check whether the chain is in the consumer chains on the provider | ||
|
||
consumerChainIDs := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) | ||
// consumerChainIDs := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) | ||
|
||
found := false | ||
for _, consumerChainID := range consumerChainIDs { | ||
if consumerChainID == string(chain) { | ||
found = true | ||
} | ||
} | ||
// found := false | ||
// for _, consumerChainID := range consumerChainIDs { | ||
// if consumerChainID == string(chain) { | ||
// found = true | ||
// } | ||
// } | ||
|
||
if found { | ||
chainInfo.WriteString("...is currently a consumer chain") | ||
} else { | ||
chainInfo.WriteString("...is currently not a consumer chain") | ||
} | ||
} | ||
// if found { | ||
// chainInfo.WriteString("...is currently a consumer chain") | ||
// } else { | ||
// chainInfo.WriteString("...is currently not a consumer chain") | ||
// } | ||
// } | ||
|
||
// Build the validator info string | ||
var validatorInfo strings.Builder | ||
|
@@ -366,16 +365,16 @@ func (s *Driver) endAndBeginBlock(chain ChainId, timeAdvancement time.Duration) | |
} | ||
|
||
func (s *Driver) runningConsumerChainIDs() []ChainId { | ||
consumerIDsOnProvider := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) | ||
// consumerIDsOnProvider := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) | ||
|
||
consumersWithIntactChannel := make([]ChainId, 0) | ||
for _, consumerChainID := range consumerIDsOnProvider { | ||
if s.path(ChainId(consumerChainID)).Path.EndpointA.GetChannel().State == channeltypes.CLOSED || | ||
s.path(ChainId(consumerChainID)).Path.EndpointB.GetChannel().State == channeltypes.CLOSED { | ||
continue | ||
} | ||
consumersWithIntactChannel = append(consumersWithIntactChannel, ChainId(consumerChainID)) | ||
} | ||
// for _, consumerChainID := range consumerIDsOnProvider { | ||
// if s.path(ChainId(consumerChainID)).Path.EndpointA.GetChannel().State == channeltypes.CLOSED || | ||
// s.path(ChainId(consumerChainID)).Path.EndpointB.GetChannel().State == channeltypes.CLOSED { | ||
// continue | ||
// } | ||
// consumersWithIntactChannel = append(consumersWithIntactChannel, ChainId(consumerChainID)) | ||
// } | ||
return consumersWithIntactChannel | ||
} | ||
|
||
|
@@ -452,7 +451,8 @@ func (s *Driver) DeliverAcks() { | |
// stopConsumer stops a given consumer chain. | ||
func (s *Driver) stopConsumer(chain ChainId) error { | ||
// stop the consumer chain on the provider | ||
return s.providerKeeper().StopConsumerChain(s.providerCtx(), string(chain), true) | ||
// return s.providerKeeper().StopConsumerChain(s.providerCtx(), string(chain), true) | ||
return nil | ||
} | ||
|
||
// newDriver creates a new Driver object. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Revert change