Skip to content

Commit

Permalink
feat: release (#179)
Browse files Browse the repository at this point in the history
Co-authored-by: viveksharmapoudel <[email protected]>
Co-authored-by: izyak <[email protected]>
Co-authored-by: DeepakBomjan <[email protected]>
  • Loading branch information
4 people authored Nov 23, 2023
1 parent b99442d commit a166816
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Release"
on:
push:
tags:
- 'v*.*.*-alpha.*' # Run release on any tag. Will be marked as draft by default anyway.
- '*' # Run release on any tag. Will be marked as draft by default anyway.

jobs:
goreleaser:
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ builds:
flags:
- -mod=readonly
ldflags:
- -s -w -X github.com/icon-project/ibc-relay/v2/cmd.Version={{ .Tag }}
- -s -w -X github.com/cosmos/relayer/v2/cmd.Version={{ .Tag }}
- id: darwin-arm64
main: ./main.go
binary: rly
Expand All @@ -27,7 +27,7 @@ builds:
flags:
- -mod=readonly
ldflags:
- -s -w -X github.com/icon-project/ibc-relay/v2/cmd.Version={{ .Tag }}
- -s -w -X github.com/cosmos/relayer/v2/cmd.Version={{ .Tag }}
- id: linux-amd64
main: ./main.go
binary: rly
Expand All @@ -41,7 +41,7 @@ builds:
flags:
- -mod=readonly
ldflags:
- -s -w -X github.com/icon-project/ibc-relay/v2/cmd.Version={{ .Tag }}
- -s -w -X github.com/cosmos/relayer/v2/cmd.Version={{ .Tag }}
- id: linux-arm64
main: ./main.go
binary: rly
Expand Down
3 changes: 0 additions & 3 deletions relayer/chains/icon/icon_chain_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,6 @@ loop:
break
}

icp.log.Debug("Verified block ",
zap.Int64("height", int64(processedheight)))

icp.latestBlock = provider.LatestBlock{
Height: uint64(processedheight),
}
Expand Down
8 changes: 4 additions & 4 deletions relayer/chains/icon/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func MptProve(key types.HexInt, proofs [][]byte, hash []byte) ([]byte, error) {

func Base64ToData(encoded string, v interface{}) ([]byte, error) {
if encoded == "" {
return nil, fmt.Errorf("Encoded string is empty ")
return nil, fmt.Errorf("encoded string is empty ")
}

decoded, err := base64.StdEncoding.DecodeString(encoded)
Expand All @@ -63,11 +63,11 @@ func Base64ToData(encoded string, v interface{}) ([]byte, error) {
func HexBytesToProtoUnmarshal(encoded types.HexBytes, v proto.Message) ([]byte, error) {
inputBytes, err := encoded.Value()
if err != nil {
return nil, fmt.Errorf("Error unmarshalling HexByte")
return nil, fmt.Errorf("error unmarshalling HexByte")
}

if bytes.Equal(inputBytes, make([]byte, 0)) {
return nil, fmt.Errorf("Encoded hexbyte is empty ")
return nil, fmt.Errorf("encoded hexbyte is empty ")
}

if err := proto.Unmarshal(inputBytes, v); err != nil {
Expand Down Expand Up @@ -157,7 +157,7 @@ func VerifyBtpProof(decision *types.NetworkTypeSectionDecision, proof [][]byte,
for _, raw_sig := range proof {
sig, err := crypto.ParseSignature(raw_sig)
if err != nil {
return false, err
continue
}
pubkey, err := sig.RecoverPublicKey(decision.Hash())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion relayer/chains/wasm/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func (ap *WasmProvider) QueryClientConsensusState(ctx context.Context, chainHeig
if err != nil {
return nil, err
}
consensusState, err := ap.QueryIBCHandlerContractProcessed(ctx, consensusStateParam)
consensusState, err := ap.QueryIBCHandlerContractNoRetry(ctx, consensusStateParam)
if err != nil {
return nil, err
}
Expand Down
28 changes: 14 additions & 14 deletions relayer/chains/wasm/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,20 +744,20 @@ func (ap *WasmProvider) SendMessagesToMempool(
return err
}

// if msg.Type() == MethodUpdateClient {
// if err := retry.Do(func() error {
// if err := ap.BroadcastTx(cliCtx, txBytes, []provider.RelayerMessage{msg}, asyncCtx, defaultBroadcastWaitTimeout, asyncCallback, true); err != nil {
// if strings.Contains(err.Error(), sdkerrors.ErrWrongSequence.Error()) {
// ap.handleAccountSequenceMismatchError(err)
// }
// }
// return err
// }, retry.Context(ctx), rtyAtt, retry.Delay(time.Millisecond*time.Duration(ap.PCfg.BlockInterval)), rtyErr); err != nil {
// ap.log.Error("Failed to update client", zap.Any("Message", msg))
// return err
// }
// continue
// }
if msg.Type() == MethodUpdateClient {
if err := retry.Do(func() error {
if err := ap.BroadcastTx(cliCtx, txBytes, []provider.RelayerMessage{msg}, asyncCtx, defaultBroadcastWaitTimeout, asyncCallback, true); err != nil {
if strings.Contains(err.Error(), sdkerrors.ErrWrongSequence.Error()) {
ap.handleAccountSequenceMismatchError(err)
}
}
return err
}, retry.Context(ctx), rtyAtt, retry.Delay(time.Millisecond*time.Duration(ap.PCfg.BlockInterval)), rtyErr); err != nil {
ap.log.Error("Failed to update client", zap.Any("Message", msg))
return err
}
continue
}
if err := ap.BroadcastTx(cliCtx, txBytes, []provider.RelayerMessage{msg}, asyncCtx, defaultBroadcastWaitTimeout, asyncCallback, false); err != nil {
if strings.Contains(err.Error(), sdkerrors.ErrWrongSequence.Error()) {
ap.handleAccountSequenceMismatchError(err)
Expand Down
3 changes: 0 additions & 3 deletions relayer/chains/wasm/wasm_chain_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,6 @@ func (ccp *WasmChainProcessor) queryCycle(ctx context.Context, persistence *quer
return err
}

ccp.log.Debug("Verified block ",
zap.Int64("height", lightBlock.Header.Height))

heightUint64 := uint64(i)

ccp.latestBlock = provider.LatestBlock{
Expand Down
14 changes: 6 additions & 8 deletions relayer/processor/message_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,9 @@ func (mp *messageProcessor) sendClientUpdate(
msgs := []provider.RelayerMessage{mp.msgUpdateClient}

callback := func(rtr *provider.RelayerTxResponse, err error) {

mp.log.Debug("Executing callback of sendClientUpdate ",
zap.Any("Transaction Status", rtr.Code),
zap.Any("Response", rtr),
zap.Any("LastClientUpdateHeight", dst.lastClientUpdateHeight))

mp.log.Debug("Executing callback of sendClientUpdate",
zap.Any("response", rtr),
zap.Uint64("last_client_update_height", dst.lastClientUpdateHeight))
if IsBTPLightClient(dst.clientState) {
if src.BTPHeightQueue.Size() == 0 {
return
Expand All @@ -453,20 +450,21 @@ func (mp *messageProcessor) sendClientUpdate(
if err != nil {
return
}
if rtr.Code == 0 {

if rtr != nil && rtr.Code == 0 {
if blockHeightInfo.Height == int64(dst.lastClientUpdateHeight) {
src.BTPHeightQueue.Dequeue()
}
return
}

// this would represent a failure case in that case isProcessing should be false
if blockHeightInfo.Height == int64(dst.lastClientUpdateHeight) {
if blockHeightInfo.RetryCount >= 5 {
// removing btpBLock update
src.BTPHeightQueue.Dequeue()
return
}

src.BTPHeightQueue.ReplaceQueue(zeroIndex, BlockInfoHeight{
Height: int64(dst.lastClientUpdateHeight),
IsProcessing: false,
Expand Down
7 changes: 5 additions & 2 deletions relayer/processor/path_end_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,17 @@ func (pathEnd *pathEndRuntime) shouldSendPacketMessage(message packetIBCMessage,
pathEnd.log.Debug("Waiting to relay packet message until clientState is updated",
zap.Inline(message),
zap.String("event_type", eventType),
zap.String("client_id", pathEnd.clientState.ClientID),
zap.Uint64("client_height", pathEnd.clientState.ConsensusHeight.RevisionHeight),
)
return false
}
if counterparty.BTPHeightQueue.ItemExist(int64(message.info.Height)) {

pathEnd.log.Debug("Waiting to relay packet message until clientState is in queue",
pathEnd.log.Debug("Waiting to relay packet message until clientState is in queue since btp height exist",
zap.Inline(message),
zap.String("event_type", eventType),
zap.String("client_id", pathEnd.clientState.ClientID),
zap.Uint64("client_height", pathEnd.clientState.ConsensusHeight.RevisionHeight),
)
return false
}
Expand Down

0 comments on commit a166816

Please sign in to comment.