Skip to content

Commit 71ace95

Browse files
committed
loop: rename autoloop specific parameters
1 parent a168ba3 commit 71ace95

File tree

7 files changed

+196
-191
lines changed

7 files changed

+196
-191
lines changed

cmd/loop/liquidity.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ var setParamsCommand = cli.Command{
225225
"included in suggestions.",
226226
},
227227
cli.BoolFlag{
228-
Name: "autoout",
228+
Name: "autoloop",
229229
Usage: "set to true to enable automated dispatch " +
230-
"of loop out swaps, limited to the budget " +
231-
"set by autobudget",
230+
"of swaps, limited to the budget set by " +
231+
"autobudget",
232232
},
233233
cli.Uint64Flag{
234234
Name: "autobudget",
@@ -338,18 +338,18 @@ func setParams(ctx *cli.Context) error {
338338
flagSet = true
339339
}
340340

341-
if ctx.IsSet("autoout") {
342-
params.AutoLoopOut = ctx.Bool("autoout")
341+
if ctx.IsSet("autoloop") {
342+
params.Autoloop = ctx.Bool("autoloop")
343343
flagSet = true
344344
}
345345

346346
if ctx.IsSet("autobudget") {
347-
params.AutoOutBudgetSat = ctx.Uint64("autobudget")
347+
params.AutoloopBudgetSat = ctx.Uint64("autobudget")
348348
flagSet = true
349349
}
350350

351351
if ctx.IsSet("budgetstart") {
352-
params.AutoOutBudgetStartSec = ctx.Uint64("budgetstart")
352+
params.AutoloopBudgetStartSec = ctx.Uint64("budgetstart")
353353
flagSet = true
354354
}
355355

docs/autoloop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ budget of your choosing.
66
The autoloop functionality is disabled by default, and can be enabled using the
77
following command:
88
```
9-
loop setparams --autoout=true
9+
loop setparams --autoloop=true
1010
```
1111

1212
Swaps that are dispatched by the autolooper can be identified in the output of

loopd/swapclient_server.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ func (s *swapClientServer) GetLiquidityParams(_ context.Context,
581581
SweepFeeRateSatPerVbyte: uint64(satPerByte),
582582
SweepConfTarget: cfg.SweepConfTarget,
583583
FailureBackoffSec: uint64(cfg.FailureBackOff.Seconds()),
584-
AutoLoopOut: cfg.Autoloop,
585-
AutoOutBudgetSat: uint64(cfg.AutoFeeBudget),
584+
Autoloop: cfg.Autoloop,
585+
AutoloopBudgetSat: uint64(cfg.AutoFeeBudget),
586586
AutoMaxInFlight: uint64(cfg.MaxAutoInFlight),
587587
Rules: make(
588588
[]*looprpc.LiquidityRule, 0, len(cfg.ChannelRules),
@@ -594,7 +594,7 @@ func (s *swapClientServer) GetLiquidityParams(_ context.Context,
594594
// Zero golang time is different to a zero unix time, so we only set
595595
// our start date if it is non-zero.
596596
if !cfg.AutoFeeStartDate.IsZero() {
597-
rpcCfg.AutoOutBudgetStartSec = uint64(
597+
rpcCfg.AutoloopBudgetStartSec = uint64(
598598
cfg.AutoFeeStartDate.Unix(),
599599
)
600600
}
@@ -633,8 +633,8 @@ func (s *swapClientServer) SetLiquidityParams(ctx context.Context,
633633
SweepConfTarget: in.Parameters.SweepConfTarget,
634634
FailureBackOff: time.Duration(in.Parameters.FailureBackoffSec) *
635635
time.Second,
636-
Autoloop: in.Parameters.AutoLoopOut,
637-
AutoFeeBudget: btcutil.Amount(in.Parameters.AutoOutBudgetSat),
636+
Autoloop: in.Parameters.Autoloop,
637+
AutoFeeBudget: btcutil.Amount(in.Parameters.AutoloopBudgetSat),
638638
MaxAutoInFlight: int(in.Parameters.AutoMaxInFlight),
639639
ChannelRules: make(
640640
map[lnwire.ShortChannelID]*liquidity.ThresholdRule,
@@ -647,9 +647,9 @@ func (s *swapClientServer) SetLiquidityParams(ctx context.Context,
647647
}
648648

649649
// Zero unix time is different to zero golang time.
650-
if in.Parameters.AutoOutBudgetStartSec != 0 {
650+
if in.Parameters.AutoloopBudgetStartSec != 0 {
651651
params.AutoFeeStartDate = time.Unix(
652-
int64(in.Parameters.AutoOutBudgetStartSec), 0,
652+
int64(in.Parameters.AutoloopBudgetStartSec), 0,
653653
)
654654
}
655655

looprpc/client.pb.go

Lines changed: 164 additions & 164 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

looprpc/client.proto

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -783,25 +783,25 @@ message LiquidityParameters {
783783
uint64 failure_backoff_sec = 9;
784784

785785
/*
786-
Set to true to enable automatic dispatch of loop out swaps. All swaps will
787-
be limited to the fee categories set by these parameters, and total
788-
expenditure will be limited to the auto out budget.
786+
Set to true to enable automatic dispatch of swaps. All swaps will be limited
787+
to the fee categories set by these parameters, and total expenditure will
788+
be limited to the autoloop budget.
789789
*/
790-
bool auto_loop_out = 10;
790+
bool autoloop = 10;
791791

792792
/*
793793
The total budget for automatically dispatched swaps since the budget start
794794
time, expressed in satoshis.
795795
*/
796-
uint64 auto_out_budget_sat = 11;
796+
uint64 autoloop_budget_sat = 11;
797797

798798
/*
799-
The start time for auto-out budget, expressed as a unix timestamp in
799+
The start time for autoloop budget, expressed as a unix timestamp in
800800
seconds. If this value is 0, the budget will be applied for all
801801
automatically dispatched swaps. Swaps that were completed before this date
802802
will not be included in budget calculations.
803803
*/
804-
uint64 auto_out_budget_start_sec = 12;
804+
uint64 autoloop_budget_start_sec = 12;
805805

806806
/*
807807
The maximum number of automatically dispatched swaps that we allow to be in

looprpc/client.swagger.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,20 +494,20 @@
494494
"format": "uint64",
495495
"description": "The amount of time we require pass since a channel was part of a failed\nswap due to off chain payment failure until it will be considered for swap\nsuggestions again, expressed in seconds."
496496
},
497-
"auto_loop_out": {
497+
"autoloop": {
498498
"type": "boolean",
499499
"format": "boolean",
500-
"description": "Set to true to enable automatic dispatch of loop out swaps. All swaps will\nbe limited to the fee categories set by these parameters, and total\nexpenditure will be limited to the auto out budget."
500+
"description": "Set to true to enable automatic dispatch of swaps. All swaps will be limited \nto the fee categories set by these parameters, and total expenditure will \nbe limited to the autoloop budget."
501501
},
502-
"auto_out_budget_sat": {
502+
"autoloop_budget_sat": {
503503
"type": "string",
504504
"format": "uint64",
505505
"description": "The total budget for automatically dispatched swaps since the budget start\ntime, expressed in satoshis."
506506
},
507-
"auto_out_budget_start_sec": {
507+
"autoloop_budget_start_sec": {
508508
"type": "string",
509509
"format": "uint64",
510-
"description": "The start time for auto-out budget, expressed as a unix timestamp in\nseconds. If this value is 0, the budget will be applied for all\nautomatically dispatched swaps. Swaps that were completed before this date\nwill not be included in budget calculations."
510+
"description": "The start time for autoloop budget, expressed as a unix timestamp in\nseconds. If this value is 0, the budget will be applied for all\nautomatically dispatched swaps. Swaps that were completed before this date\nwill not be included in budget calculations."
511511
},
512512
"auto_max_in_flight": {
513513
"type": "string",

release_notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,10 @@ This file tracks release notes for the loop client.
2020
unlocked. Previous versions would exit with an error.
2121

2222
#### Breaking Changes
23+
* The `AutoOut`, `AutoOutBudgetSat` and `AutoOutBudgetStartSec` fields in the
24+
`LiquidityParameters` message used in the experimental autoloop API have
25+
been renamed to `Autoloop`, `AutoloopBudgetSat` and `AutoloopBudgetStartSec`.
26+
* The `autoout` flag for enabling automatic dispatch of loop out swaps has been
27+
renamed to `autoloop` so that it can cover loop out and loop in.
2328

2429
#### Bug Fixes

0 commit comments

Comments
 (0)