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: update the slashing and evidence modules to work with ICS #15908

Merged
merged 12 commits into from
Apr 25, 2023

Conversation

sainoe
Copy link
Contributor

@sainoe sainoe commented Apr 21, 2023

Description

The ICS consumer module doesn't store validators' pubkeys in the slashing module making the slashing and evidence modules either panicing or no-oping when these keys aren't stored see:

if _, err := k.GetPubkey(ctx, addr); err != nil {

if _, err := k.slashingKeeper.GetPubkey(ctx, consAddr.Bytes()); err != nil {

This PR removes these two checks in order to work with ICS.

Note that this line was previously added to the evidence module by #13122 for the same reason.


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
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation 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 ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions

This comment has been minimized.

// constraints and ignore evidence that cannot be handled.
return
}

Copy link
Member

Choose a reason for hiding this comment

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

If we do not panic l75, can we at least log something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree!

Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we move the validator and pubkey check above this and we can short-circuit everything else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we can replicate this no-op in the slashing infractions.go ?

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as duplicate.

This comment was marked as off-topic.

yarn.lock Outdated Show resolved Hide resolved
@github-actions github-actions bot added the C:orm label Apr 21, 2023
@julienrbrt julienrbrt added the backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release label Apr 21, 2023
@faddat
Copy link
Contributor

faddat commented Apr 24, 2023

There's a really disturbing pattern of behavior coming out of informal systems, where they just gank stuff from us.

They do not answer our questions in any forum, they are not helpful, and they are holding the hub back.

@faddat

This comment was marked as off-topic.

@faddat
Copy link
Contributor

faddat commented Apr 25, 2023

Btw this PR is fine.

There may be more needed.

It is certainly a result of notionals work.

That should be recognized so I don't need to prove it because this is very tedious.

#15856 informal told us it was not needed.

@vuong177
Copy link

We have same change in this https://github.com/notional-labs/cosmos-sdk/tree/sdkv47-ics

@@ -18,9 +18,6 @@ func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr cryptotypes.Addre

// fetch the validator public key
consAddr := sdk.ConsAddress(addr)
if _, err := k.GetPubkey(ctx, addr); err != nil {

This comment was marked as off-topic.

@julienrbrt
Copy link
Member

Could you add a changelog?

@julienrbrt julienrbrt added the S: DO NOT MERGE Status: DO NOT MERGE label Apr 25, 2023
@julienrbrt
Copy link
Member

Just adding a flag because we want to add an extra commit here.

@julienrbrt julienrbrt added S: DO NOT MERGE Status: DO NOT MERGE and removed S: DO NOT MERGE Status: DO NOT MERGE C:orm labels Apr 25, 2023
Co-authored-by: Jacob Gadikian <faddat@users.noreply.github.com>
@julienrbrt julienrbrt removed the S: DO NOT MERGE Status: DO NOT MERGE label Apr 25, 2023
@julienrbrt julienrbrt added this pull request to the merge queue Apr 25, 2023
Merged via the queue into main with commit 97e4978 Apr 25, 2023
@julienrbrt julienrbrt deleted the sainoe/ics-changes branch April 25, 2023 16:37
mergify bot pushed a commit that referenced this pull request Apr 25, 2023
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Jacob Gadikian <faddat@users.noreply.github.com>
(cherry picked from commit 97e4978)

# Conflicts:
#	CHANGELOG.md
#	x/evidence/keeper/infraction.go
roy-dydx pushed a commit to dydxprotocol/cosmos-sdk that referenced this pull request Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release C:x/evidence C:x/slashing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants