-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: changes to sdk for interchain security #15917
Conversation
effectiveFraction = math.LegacyOneDec() | ||
} | ||
// call the before-slashed hook | ||
k.hooks.BeforeValidatorSlashed(ctx, operatorAddress, effectiveFraction) |
Check warning
Code scanning / gosec
Errors unhandled.
operatorAddress := validator.GetOperator() | ||
|
||
// call the before-modification hook | ||
k.hooks.BeforeValidatorModified(ctx, operatorAddress) |
Check warning
Code scanning / gosec
Errors unhandled.
Thanks for this PR. Due to your previous one, Informal opened a PR with the changes needed for ICS: #15908. |
@@ -61,7 +61,7 @@ type ValidatorSet interface { | |||
StakingTokenSupply(sdk.Context) math.Int // total staking token supply | |||
|
|||
// slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction | |||
Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) math.Int | |||
Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec, Infraction) | |||
SlashWithInfractionReason(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec, Infraction) math.Int |
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.
So, v0.45.x-ics did have a breaking change in Slash, but in v0.47 we decided not to break the API for users, hence the SlashWithInfractionReason
.
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.
@vuong177 hey can you check this out, can we move the slash func for consumer keeper to SlashWithInfractionReason
@@ -16,9 +15,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 { |
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.
See #15908
@@ -367,11 +367,6 @@ func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData | |||
} | |||
} | |||
|
|||
// a chain must initialize with a non-empty validator set |
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.
This was added in v0.46 (so it is normal it isn't on v0.45.x and v0.45.x-ics). Could you please tell us which issues you are facing with it?
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.
I cannot, but @vuong177 can. He is the person who identified this stuff.
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.
so the consumer app doesn't have a valset because it operate on the provider chain valset, so any time consumer app init genesis the valset check will always return an error
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.
I am not that familiar with ICS codebase, but this makes sense.
Have you investigated if the consumer app could recover the panic? I know this isn't ideal, but this is a UX improvement for all but consumer chains.
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 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 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 off-topic.
This comment was marked as off-topic.
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.
As you've just opened the PR, the target branch will need to be main. Could you change that?
This comment was marked as off-topic.
This comment was marked as off-topic.
@julienrbrt yep absoutely. I'm finishing up with that right now. It is... sir this all makes me sad sir. |
Thank you for opening a PR targeting main (#15944). |
Absolutely. Sorry I actually thought that I had closed. No worries. |
Description
This is a review PR that I will leave as draft, and the sdk team is free to close. It has been made to create a record that these are the changes that we are requesting that informal systems review, to provide feedback on the best way to handle or not.
If the SDK team wishes to share their opinion on the matter, here's the relevant PR to interchain security:
Reviews of this work are greatly appreciated. We have been requesting feedback from informal on the matter of weather or not ICS is sdk47 compatible since March 23, 2023. So far, we have gotten the responses NO and YES. We'd like to establish a clear answer, so that work on 47 can proceed smoothly, and we are able to advise would-be consumer chains as to the correct path forward.
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change