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

autopilot hashed sender #1038

Merged
merged 21 commits into from
Jan 10, 2024
Merged
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions x/autopilot/keeper/liquidstake.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keeper
import (
"errors"
"fmt"
"time"

errorsmod "cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"
Expand All @@ -15,6 +16,10 @@ import (
stakeibctypes "github.com/Stride-Labs/stride/v16/x/stakeibc/types"
)

const (
LiquidStakeForwardTransferTimeout = (time.Hour * 3)
)

// Attempts to do an autopilot liquid stake (and optional forward)
// The liquid stake is only allowed if the inbound packet came along a trusted channel
func (k Keeper) TryLiquidStaking(
Expand Down Expand Up @@ -136,8 +141,8 @@ func (k Keeper) IBCTransferStToken(
return err
}

// Use the default transfer timeout of 10 minutes
timeoutTimestamp := uint64(ctx.BlockTime().UnixNano()) + transfertypes.DefaultRelativePacketTimeoutTimestamp
// Use a conservative timeout for the transfer
riley-stride marked this conversation as resolved.
Show resolved Hide resolved
timeoutTimestamp := uint64(ctx.BlockTime().UnixNano() + LiquidStakeForwardTransferTimeout.Nanoseconds())

// Submit the transfer from the hashed address
transferMsg := &transfertypes.MsgTransfer{
Expand Down