Skip to content

Commit

Permalink
update upgrade docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Mar 11, 2024
1 parent 8d17e2d commit eb51c89
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Dockerfile-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ WORKDIR /go/delivery/zeta-node
RUN mkdir -p $GOPATH/bin/old
RUN mkdir -p $GOPATH/bin/new

ARG OLD_VERSION=v13.0.0
ENV NEW_VERSION=v14
ARG OLD_VERSION=v14.0.0
ENV NEW_VERSION=v15

# Build new release from the current source
COPY go.mod /go/delivery/zeta-node/
Expand Down
8 changes: 4 additions & 4 deletions x/crosschain/keeper/cctx_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ func (k Keeper) ProcessZEVMDeposit(ctx sdk.Context, cctx *types.CrossChainTx) {
cctx.OutboundTxParams = append(cctx.OutboundTxParams, revertTxParams)

// we create a new cached context, and we don't commit the previous one with EVM deposit
tmpCtx, commit := ctx.CacheContext()
tmpCtxRevert, commitRevert := ctx.CacheContext()
err = func() error {
err := k.PayGasAndUpdateCctx(
tmpCtx,
tmpCtxRevert,
senderChain.ChainId,
cctx,
cctx.InboundTxParams.Amount,
Expand All @@ -239,13 +239,13 @@ func (k Keeper) ProcessZEVMDeposit(ctx sdk.Context, cctx *types.CrossChainTx) {
return err
}
// Update nonce using senderchain id as this is a revert tx and would go back to the original sender
return k.UpdateNonce(tmpCtx, senderChain.ChainId, cctx)
return k.UpdateNonce(tmpCtxRevert, senderChain.ChainId, cctx)
}()
if err != nil {
cctx.CctxStatus.ChangeStatus(types.CctxStatus_Aborted, fmt.Sprintf("deposit revert message: %s err : %s", revertMessage, err.Error()))
return
}
commit()
commitRevert()
cctx.CctxStatus.ChangeStatus(types.CctxStatus_PendingRevert, revertMessage)
return
}
Expand Down
6 changes: 4 additions & 2 deletions x/crosschain/migrations/v6/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ type crosschainKeeper interface {
// MigrateStore migrates the x/crosschain module state from the consensus version 4 to 5
// It resets the aborted zeta amount to use the inbound tx amount instead in situations where the outbound cctx is never created.
func MigrateStore(ctx sdk.Context, crosschainKeeper crosschainKeeper) error {
cctxListV14 := GetV14CCTX(ctx, crosschainKeeper)
tmpctx, commit := ctx.CacheContext()
cctxListV14 := GetV14CCTX(tmpctx, crosschainKeeper)
for _, cctx := range cctxListV14 {
OutBoundParamsV15 := make([]*types.OutboundTxParams, len(cctx.OutboundTxParams))
for j, outBoundParams := range cctx.OutboundTxParams {
Expand Down Expand Up @@ -69,8 +70,9 @@ func MigrateStore(ctx sdk.Context, crosschainKeeper crosschainKeeper) error {
RelayedMessage: cctx.RelayedMessage,
EventIndex: 1, // We don't have this information in the old version
}
crosschainKeeper.SetCrossChainTx(ctx, cctxV15)
crosschainKeeper.SetCrossChainTx(tmpctx, cctxV15)
}
commit()
return nil
}

Expand Down

0 comments on commit eb51c89

Please sign in to comment.