-
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
feat: update ICS misbehaviour to work with all IBC client implementations #1128
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
73f8078
define msg to submit misbehaviour to provider
sainoe 0b6fd43
wip: get byzantine validators in misbehavioiur handling
sainoe 16d940d
add tx handler
sainoe 4750f1f
format HandleConsumerMisbehaviour
sainoe 2e5f8af
add tx handler
sainoe b076fd4
add debugging stuff
sainoe 457fe20
Add misbehaviour handler
sainoe ae522e1
create message for consumer double voting evidence
sainoe b52daff
add DRAFT double vote handler
sainoe 8eea677
Add cli cmd for submit consumer double voting
sainoe 81dd6ba
Add double-vote handler
sainoe 0cb86c9
add last update
sainoe b6cf938
fix jailing
sainoe 1444690
pass first jailing integration test
sainoe 9c31932
format tests
sainoe 42204e1
doc
sainoe 806a005
save
sainoe 2c796cd
update e2e tests'
sainoe 7310e42
fix typo and improve docs
sainoe 3114807
remove unwanted changes
sainoe fffeb07
fix hermes config with assigned key
sainoe 61d8012
revert unwanted changes
sainoe a11ee29
revert local setup
sainoe e79af1e
remove log file
sainoe 0a6cd87
typo
sainoe 9ad0721
update doc
sainoe e0de36d
update ICS misbehaviour test
sainoe 1b718be
update ICS misbehaviour test
sainoe 4357efa
revert mixed commits
sainoe 2be79d7
update ICS misbehaviour test
sainoe e734e53
update ICS misbehaviour test
sainoe 865e43b
Add test for MsgSubmitConsumerMisbehaviour parsing
sainoe 6874b00
fix linter
sainoe 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
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,92 @@ | ||
package main | ||
|
||
import ( | ||
"bufio" | ||
"fmt" | ||
"log" | ||
"os/exec" | ||
"time" | ||
) | ||
|
||
type forkConsumerChainAction struct { | ||
consumerChain chainID | ||
providerChain chainID | ||
validator validatorID | ||
relayerConfig string | ||
} | ||
|
||
func (tr TestRun) forkConsumerChain(action forkConsumerChainAction, verbose bool) { | ||
valCfg := tr.validatorConfigs[action.validator] | ||
|
||
//#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. | ||
configureNodeCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", | ||
"/testnet-scripts/fork-consumer.sh", tr.chainConfigs[action.consumerChain].binaryName, | ||
string(action.validator), string(action.consumerChain), | ||
tr.chainConfigs[action.consumerChain].ipPrefix, | ||
tr.chainConfigs[action.providerChain].ipPrefix, | ||
valCfg.mnemonic, | ||
action.relayerConfig, | ||
) | ||
|
||
if verbose { | ||
fmt.Println("forkConsumerChain - reconfigure node cmd:", configureNodeCmd.String()) | ||
} | ||
|
||
cmdReader, err := configureNodeCmd.StdoutPipe() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
configureNodeCmd.Stderr = configureNodeCmd.Stdout | ||
|
||
if err := configureNodeCmd.Start(); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
scanner := bufio.NewScanner(cmdReader) | ||
|
||
for scanner.Scan() { | ||
out := scanner.Text() | ||
if verbose { | ||
fmt.Println("fork consumer validator : " + out) | ||
} | ||
if out == done { | ||
break | ||
} | ||
} | ||
if err := scanner.Err(); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
time.Sleep(5 * time.Second) | ||
} | ||
|
||
type updateLightClientAction struct { | ||
hostChain chainID | ||
relayerConfig string | ||
clientID string | ||
} | ||
|
||
func (tr TestRun) updateLightClient( | ||
action updateLightClientAction, | ||
verbose bool, | ||
) { | ||
// hermes clear packets ibc0 transfer channel-13 | ||
//#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. | ||
cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", | ||
"--config", action.relayerConfig, | ||
"update", | ||
"client", | ||
"--client", action.clientID, | ||
"--host-chain", string(action.hostChain), | ||
) | ||
if verbose { | ||
log.Println("updateLightClientAction cmd:", cmd.String()) | ||
} | ||
|
||
bz, err := cmd.CombinedOutput() | ||
if err != nil { | ||
log.Fatal(err, "\n", string(bz)) | ||
} | ||
|
||
tr.waitBlocks(action.hostChain, 5, 30*time.Second) | ||
} |
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
Oops, something went wrong.
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.
Could you add a comment here why we need ICS from that repo instead of from the informal systems one?