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

Fix valset mismatch when updating client #474

Merged
merged 2 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Relayer

* [\#474](https://github.com/cosmos/relayer/pull/474) Fix validator set mismatch when updating IBC client.
* [\#456](https://github.com/cosmos/relayer/pull/456) Fix bug which incorrectly set the timeout on a transfer.
* [\#455](https://github.com/cosmos/relayer/pull/455) Set default client parameter to allow governance to update the client if expiry or misbehaviour freezing occurs.

Expand Down
6 changes: 4 additions & 2 deletions relayer/ibc-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ func (c *Chain) InjectTrustedFields(dst *Chain, header *tmclient.Header) (*tmcli
// inject TrustedHeight as latest height stored on counterparty client
h.TrustedHeight = cs.GetLatestHeight().(clienttypes.Height)

// query TrustedValidators at Trusted Height from srcChain
trustedHeader, err := c.GetLightSignedHeaderAtHeight(int64(h.TrustedHeight.RevisionHeight))
// NOTE: We need to get validators from the source chain at height: trustedHeight+1
// since the last trusted validators for a header at height h is the NextValidators
// at h+1 committed to in header h by NextValidatorsHash
trustedHeader, err := c.GetLightSignedHeaderAtHeight(int64(h.TrustedHeight.RevisionHeight) + 1)
if err != nil {
return nil, fmt.Errorf(
"failed to get trusted header, please ensure header at the height %d has not been pruned by the connected node: %w",
Expand Down