Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions bidengine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
// Config represents the configuration parameters for the bid engine.
// It controls pricing, deposits, timeouts and provider capabilities and attributes
type Config struct {
PricingStrategy BidPricingStrategy
Deposit sdk.Coin
BidTimeout time.Duration
Attributes atttypes.Attributes
MaxGroupVolumes int
PricingStrategy BidPricingStrategy
Deposit sdk.Coin
BidTimeout time.Duration
Attributes atttypes.Attributes
MaxGroupVolumes int
ReclamationWindow *time.Duration
}
1 change: 1 addition & 0 deletions bidengine/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ loop:
Amount: o.cfg.Deposit,
Sources: deposit.Sources{deposit.SourceBalance},
}, offer)
msg.ReclamationWindow = o.cfg.ReclamationWindow
bidch = runner.Do(func() runner.Result {
return runner.NewResult(o.session.Client().Tx().BroadcastMsgs(ctx, []sdk.Msg{msg}, aclient.WithResultCodeAsError()))
})
Expand Down
3 changes: 2 additions & 1 deletion cluster/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ func (dm *deploymentManager) checkLeaseActive(ctx context.Context) error {
return err
}

if lease.GetLease().State != mv1.LeaseActive {
leaseState := lease.GetLease().State
if leaseState != mv1.LeaseActive && leaseState != mv1.LeaseReclaiming {
dm.log.Error("lease not active, not deploying")
return fmt.Errorf("%w: %s", ErrLeaseInactive, dm.deployment.LeaseID())
}
Expand Down
7 changes: 7 additions & 0 deletions cluster/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ loop:
case *mtypes.EventLeaseClosed:
_ = s.bus.Publish(event.LeaseRemoveFundsMonitor{LeaseID: ev.ID})
s.teardownLease(ev.ID)
case *mtypes.EventLeaseReclaimStarted:
s.log.Info("lease reclamation started",
"lease", ev.ID,
"reason", ev.Reason,
"deadline", ev.Deadline)
// Workloads continue running during the reclamation window.
// Teardown occurs when EventLeaseClosed is received after the window elapses.
}
case ch := <-s.statusch:
ch <- &apclient.ClusterStatus{
Expand Down
5 changes: 5 additions & 0 deletions cmd/provider-services/cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ func addRunFlags(cmd *cobra.Command) error {
return err
}

cmd.Flags().Duration(FlagReclamationWindow, 0, "reclamation window duration to offer in bids (e.g. 24h, 720h). 0 means no reclamation offered")
if err := viper.BindPFlag(FlagReclamationWindow, cmd.Flags().Lookup(FlagReclamationWindow)); err != nil {
return err
}

cmd.Flags().Duration(FlagManifestTimeout, 5*time.Minute, "time after which bids are cancelled if no manifest is received")
if err := viper.BindPFlag(FlagManifestTimeout, cmd.Flags().Lookup(FlagManifestTimeout)); err != nil {
return err
Expand Down
6 changes: 6 additions & 0 deletions cmd/provider-services/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const (
FlagAuthPem = "auth-pem"
FlagDeploymentRuntimeClass = "deployment-runtime-class"
FlagBidTimeout = "bid-timeout"
FlagReclamationWindow = "reclamation-window"
FlagManifestTimeout = "manifest-timeout"
FlagMetricsListener = "metrics-listener"
FlagWithdrawalPeriod = "withdrawal-period"
Expand Down Expand Up @@ -480,6 +481,7 @@ func doRunCmd(ctx context.Context, cmd *cobra.Command, _ []string) error {
blockedHostnames := viper.GetStringSlice(FlagDeploymentBlockedHostnames)
deploymentRuntimeClass := viper.GetString(FlagDeploymentRuntimeClass)
bidTimeout := viper.GetDuration(FlagBidTimeout)
reclamationWindow := viper.GetDuration(FlagReclamationWindow)
manifestTimeout := viper.GetDuration(FlagManifestTimeout)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
metricsListener := viper.GetString(FlagMetricsListener)
providerConfig := viper.GetString(FlagProviderConfig)
Expand Down Expand Up @@ -655,6 +657,10 @@ func doRunCmd(ctx context.Context, cmd *cobra.Command, _ []string) error {
config.DeploymentIngressDomain = deploymentIngressDomain
config.BidTimeout = bidTimeout
config.ManifestTimeout = manifestTimeout

if reclamationWindow > 0 {
config.ReclamationWindow = &reclamationWindow
}
config.MonitorMaxRetries = monitorMaxRetries
config.MonitorRetryPeriod = monitorRetryPeriod
config.MonitorRetryPeriodJitter = monitorRetryPeriodJitter
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Config struct {
MaxGroupVolumes int
RPCQueryTimeout time.Duration
CachedResultMaxAge time.Duration
ReclamationWindow *time.Duration
cluster.Config
}

Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/akash-network/provider

go 1.25.5
go 1.26.2

require (
cosmossdk.io/errors v1.0.2
Expand All @@ -10,7 +10,7 @@ require (
github.com/blang/semver/v4 v4.0.0
github.com/boz/go-lifecycle v0.1.1
github.com/cometbft/cometbft v0.38.21
github.com/cosmos/cosmos-sdk v0.53.5
github.com/cosmos/cosmos-sdk v0.53.6
github.com/desertbit/timer v1.0.1
github.com/fsnotify/fsnotify v1.9.0
github.com/go-acme/lego/v4 v4.26.0
Expand All @@ -31,7 +31,7 @@ require (
github.com/rakyll/statik v0.1.7
github.com/rook/rook v1.14.12
github.com/rook/rook/pkg/apis v0.0.0-20231204200402-5287527732f7
github.com/rs/zerolog v1.34.0
github.com/rs/zerolog v1.35.0
github.com/shopspring/decimal v1.4.0
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
Expand All @@ -51,11 +51,11 @@ require (
k8s.io/client-go v0.34.1
k8s.io/code-generator v0.34.1
k8s.io/kubectl v0.33.3
pkg.akt.dev/go v0.2.7
pkg.akt.dev/go v0.2.10
pkg.akt.dev/go/cli v0.2.2
pkg.akt.dev/go/sdl v0.2.0
pkg.akt.dev/node v1.2.2
pkg.akt.dev/node/v2 v2.0.0
pkg.akt.dev/node/v2 v2.1.0-rc10
sigs.k8s.io/gateway-api v1.4.1
sigs.k8s.io/kind v0.30.0
sigs.k8s.io/structured-merge-diff/v6 v6.3.0
Expand All @@ -72,7 +72,7 @@ replace (
// use cosmos fork of keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

github.com/bytedance/sonic => github.com/bytedance/sonic v1.14.2
github.com/bytedance/sonic => github.com/bytedance/sonic v1.15.0

// use akash fork of cometbft
github.com/cometbft/cometbft => github.com/akash-network/cometbft v0.38.21-akash.1
Expand Down Expand Up @@ -179,7 +179,7 @@ require (
github.com/cosmos/iavl v1.2.6 // indirect
github.com/cosmos/ibc-go/v10 v10.5.0 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.16.0 // indirect
github.com/cosmos/ledger-cosmos-go v1.0.0 // indirect
github.com/cosmos/rosetta v0.50.12 // indirect
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/danieljoos/wincred v1.2.2 // indirect
Expand Down Expand Up @@ -269,7 +269,7 @@ require (
github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 // indirect
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.6.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/knadh/koanf/maps v0.1.2 // indirect
github.com/knadh/koanf/parsers/yaml v0.1.0 // indirect
github.com/knadh/koanf/providers/env v1.0.0 // indirect
Expand Down Expand Up @@ -344,26 +344,26 @@ require (
github.com/zondax/golem v0.27.0 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v1.0.1 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
Comment thread
chalabi2 marked this conversation as resolved.
go.step.sm/crypto v0.45.1 // indirect
go.uber.org/mock v0.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.17.0 // indirect
golang.org/x/arch v0.24.0 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
golang.org/x/mod v0.31.0 // indirect
golang.org/x/oauth2 v0.34.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/term v0.39.0 // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/time v0.14.0 // indirect
Expand Down
Loading
Loading