-
Notifications
You must be signed in to change notification settings - Fork 585
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
Emit event upon setting upgrade consensus state #270
Comments
i think this can be closed, https://github.com/cosmos/ibc-go/blob/main/modules/core/02-client/keeper/client.go#L191-L198 ? if not lmk, not sure if thats the right function in question here |
No, we need the entire consensus state to be emitted when it is being set before a chain upgrades. The event emitted is on the counterparty chain (which didn't upgrade). It is emitting an event for the processing of a message which conveys proof of the counterparty upgrade. Chain A upgrades (setting client/consensus states) |
This issue is a dependency for informalsystems/hermes#1148.
Can confirm that Hermes at the moment can listen & act on begin/end block events (informalsystems/hermes#1793). |
The event function used should something like look like: func EmitUpgradeChainEvent(ctx sdk.Context, height int64) {
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.EventTypeUpgradeChain,
sdk.NewAttribute(types.AttributeKeyPlanHeight, height),
sdk.NewAttribute(types.AttributeKeyUpgradeStore, upgradetypes.StoreKey), // which store to query proof of consensus state from
),
})
} Is any other information needed @adizere? Will relayers know which counterparty clients belong to this chain that is upgrading? |
This looks good at first glance. Is there a way we can actually test this in practice and reproduce the event emission? I'm asking because it's difficult to say a firm yes/no whether further info would be necessary unless we run through the whole exercise end-to-end. Would be glad to use simapp to test this new event, or is there another way? Any instructions would be appreciated!
|
Yes, we can make the changes in a branch and you could build simapp from that branch to test. |
Can we test this using test unit instead of running the whole thing e2e ? |
It's a bit overkill to assert in the tests that the right values are emitted in the events (i.e. you need to loop through a |
Not possible with a unit test yet. I tried taking a stab at it in #1169, but some testing package changes are needed before we can do that. I'd add the event without tests for now. Hermes can test using the event whenever they are ready to do so, if something is off, we can do a patch release (events are non state machine breaking) |
closed by #1741 |
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.44.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.43.0...v1.44.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tomasz Zdybał <[email protected]>
Summary
When we set the upgrade consensus state, we should emit an event so relayers know that they can now upgrade the counterparty client. Unsure if this needs to be backported since I don't know if hermes can listen to events in begin/end blocker without the next tendermint version
For Admin Use
The text was updated successfully, but these errors were encountered: