Skip to content

Commit

Permalink
Merge branch 'main' into damian/5848-disable-client-types-verifymembe…
Browse files Browse the repository at this point in the history
…rship-rpc
  • Loading branch information
damiannolan committed Feb 20, 2024
2 parents e46a5c8 + 94a4597 commit f0bf53f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/slack-notify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This re-usable workflow file will trigger a Slack notification on the channel configure via the Webhook URL.
# It currently comments a number of fields, but you can add or remove them as you see fit.
#
# To configure a Slack Webhook URL, follow the instructions here: https://api.slack.com/messaging/webhooks
on:
workflow_call:

jobs:
slack-notify:
runs-on: ubuntu-latest
steps:
- uses: 8398a7/action-slack@v3
with:
status: 'failure'
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
2 changes: 1 addition & 1 deletion modules/core/02-client/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (k Keeper) VerifyMembership(c context.Context, req *types.QueryVerifyMember
}

if clientStatus := k.GetClientStatus(ctx, clientState, req.ClientId); clientStatus != exported.Active {
return nil, status.Errorf(codes.FailedPrecondition, errorsmod.Wrapf(types.ErrClientNotActive, "cannot verify membership using client (%s) with status %s", req.ClientId, clientStatus).Error())
return nil, status.Error(codes.FailedPrecondition, errorsmod.Wrapf(types.ErrClientNotActive, "cannot verify membership using client (%s) with status %s", req.ClientId, clientStatus).Error())
}

if err := clientState.VerifyMembership(cachedCtx, k.ClientStore(cachedCtx, req.ClientId), k.cdc, req.ProofHeight, req.TimeDelay, req.BlockDelay, req.Proof, req.MerklePath, req.Value); err != nil {
Expand Down
10 changes: 5 additions & 5 deletions testing/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func (chain *TestChain) CurrentTMClientHeader() *ibctm.Header {
// be used to sign over the proposed header.
func CommitHeader(proposedHeader cmttypes.Header, valSet *cmttypes.ValidatorSet, signers map[string]cmttypes.PrivValidator) (*cmtproto.SignedHeader, error) {
hhash := proposedHeader.Hash()
blockID := MakeBlockID(hhash, 3, tmhash.Sum([]byte("part_set")))
blockID := MakeBlockID(hhash, 3, unusedHash)
voteSet := cmttypes.NewVoteSet(proposedHeader.ChainID, proposedHeader.Height, 1, cmtproto.PrecommitType, valSet)

// MakeExtCommit expects a signer array in the same order as the validator array.
Expand Down Expand Up @@ -512,13 +512,13 @@ func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64,
Time: timestamp,
LastBlockID: MakeBlockID(make([]byte, tmhash.Size), 10_000, make([]byte, tmhash.Size)),
LastCommitHash: chain.App.LastCommitID().Hash,
DataHash: tmhash.Sum([]byte("data_hash")),
DataHash: unusedHash,
ValidatorsHash: cmtValSet.Hash(),
NextValidatorsHash: nextVals.Hash(),
ConsensusHash: tmhash.Sum([]byte("consensus_hash")),
ConsensusHash: unusedHash,
AppHash: chain.ProposedHeader.AppHash,
LastResultsHash: tmhash.Sum([]byte("last_results_hash")),
EvidenceHash: tmhash.Sum([]byte("evidence_hash")),
LastResultsHash: unusedHash,
EvidenceHash: unusedHash,
ProposerAddress: cmtValSet.Proposer.Address, //nolint:staticcheck
}

Expand Down
4 changes: 4 additions & 0 deletions testing/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/cometbft/cometbft/crypto/tmhash"

ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"
Expand Down Expand Up @@ -67,4 +69,6 @@ var (
MockRecvCanaryCapabilityName = mock.MockRecvCanaryCapabilityName

prefix = commitmenttypes.NewMerklePrefix([]byte("ibc"))
// unusedHash is a placeholder hash used for testing.
unusedHash = tmhash.Sum([]byte{0x00})
)

0 comments on commit f0bf53f

Please sign in to comment.