Skip to content

Commit

Permalink
Fix valset mismatch when updating client (#474)
Browse files Browse the repository at this point in the history
* trusted height + 1

* add changelog
  • Loading branch information
colin-axner committed Mar 26, 2021
1 parent f754f18 commit 8f2bf21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 8f2bf21

Please sign in to comment.