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

chore: Add integration for equivocation with CometMock #1192

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

p-offtermatt
Copy link
Contributor

@p-offtermatt p-offtermatt commented Aug 9, 2023

Description

Closes: #1190

  • Renames the short-happy-path to cometmock-happy-path and adds equivocation steps to it:
    • It is starting to not be significantly shorter as cometmock supports more operations
    • The previous name was confusing as became clear in some discussions
  • Add a separate case for CometMock in equivocation
    • Refactor commonly used functionality that is needed for downtime and equivocation

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • Confirmed the correct type prefix in the PR title
  • Confirmed all author checklist items have been addressed
  • Confirmed that this PR does not change production code

@p-offtermatt p-offtermatt requested a review from a team as a code owner August 9, 2023 13:56
@p-offtermatt p-offtermatt linked an issue Aug 9, 2023 that may be closed by this pull request
@p-offtermatt p-offtermatt changed the title Add support for equivocation Add integration for equivocation with CometMock Aug 9, 2023
@p-offtermatt p-offtermatt changed the title Add integration for equivocation with CometMock chore: Add integration for equivocation with CometMock Aug 9, 2023
Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

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

Approve!

@@ -36,7 +36,7 @@ test-e2e-short:
# run only happy path E2E tests with cometmock
# this set of traces does not test equivocation but it does check downtime
test-e2e-short-cometmock:
go run ./tests/e2e/... --short-happy-path --use-cometmock --use-gorelayer
go run ./tests/e2e/... --cometmock-happy-path --use-cometmock --use-gorelayer
Copy link
Contributor

Choose a reason for hiding this comment

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

I think all of this is great and very exciting.

However a small suggestion, maybe we refactor the main.go flag parsing so that --cometmock-happy-path uses go relayer by default so the flag does not need to be specified.

The flag could just be -cometmock-happy-path --use-cometmock.

This can also be done as part of a larger refactor, I'm just asking for opinions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason why it is not like this is that the gorelayer can be used without cometmock, too.
(just not CometMock without the Gorelayer)
I suggest leaving it as it, in the anticipation that one day CometMock can be used with hermes, too (and it does not seem too bad until then to have it as-is)

Lmk if this sounds convincing to you

Copy link
Contributor

Choose a reason for hiding this comment

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

To me it seems implicit that if you're specifying --cometmock-happy-path, both --use-cometmock and --use-gorelayer would default to true

Copy link
Contributor

@bermuell bermuell Aug 10, 2023

Choose a reason for hiding this comment

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

pls note that PR #1191 is changing the way tests can be selected.
Keeping selection of tests and infra seperated regarding parameters is better from a usablity perspective (full flexibility with reduced set of option).
I'd be in favor in not renaming the 'test case' and rather not having 'cometmock' in the name as it leads to assumptions that infra/test setup is using cometmock which is not the case. Running --short-happy-path --use-cometmock (with or without implicit usage of --use-gorelayer) is clearer IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

assumptions that infra/test setup is using cometmock which is not the case. Running --short-happy-path --use-cometmock (with or without implicit usage of --use-gorelayer) is clearer IMO.

I think this is a good approach to take.

} else { // tr.useCometMock
validatorAddress := tr.GetValidatorAddress(action.chain, action.validator)

method := "cause_double_sign"
Copy link
Contributor

Choose a reason for hiding this comment

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

Sweet!

Copy link
Contributor

@shaspitz shaspitz left a comment

Choose a reason for hiding this comment

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

Great stuff!

@@ -36,7 +36,7 @@ test-e2e-short:
# run only happy path E2E tests with cometmock
# this set of traces does not test equivocation but it does check downtime
test-e2e-short-cometmock:
go run ./tests/e2e/... --short-happy-path --use-cometmock --use-gorelayer
go run ./tests/e2e/... --cometmock-happy-path --use-cometmock --use-gorelayer
Copy link
Contributor

Choose a reason for hiding this comment

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

To me it seems implicit that if you're specifying --cometmock-happy-path, both --use-cometmock and --use-gorelayer would default to true

} else { // tr.useCometMock
validatorAddress := tr.GetValidatorAddress(action.chain, action.validator)

method := "cause_double_sign"
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious where the script lives that actually handles "cause_double_sign"?

Copy link
Contributor

Choose a reason for hiding this comment

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

it's a cometmock RPC method, it does not live here. It's a feature of cometmock

@MSalopek MSalopek merged commit 5cb2ffa into main Aug 10, 2023
12 checks passed
@MSalopek MSalopek deleted the ph/1190-integrate-cometmock-for-equivocation branch August 10, 2023 10:23
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.

Integrate CometMock for equivocation
4 participants