Skip to content

Commit 25b2df7

Browse files
committed
multi: add flag plumbing for skipping proof courier ping check
Adds support for setting a flag to skip the preliminary proof courier ping check in the asset send process. The flag can be set via both the command line and RPC. This commit only adds the plumbing to populate the flag; it does not yet read or act on its value.
1 parent bc64994 commit 25b2df7

File tree

6 files changed

+435
-385
lines changed

6 files changed

+435
-385
lines changed

cmd/commands/assets.go

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,32 @@ var assetsCommands = []cli.Command{
3838
}
3939

4040
var (
41-
assetTypeName = "type"
42-
assetTagName = "name"
43-
assetSupplyName = "supply"
44-
assetMetaBytesName = "meta_bytes"
45-
assetMetaFilePathName = "meta_file_path"
46-
assetMetaTypeName = "meta_type"
47-
assetDecimalDisplayName = "decimal_display"
48-
assetNewGroupedAssetName = "new_grouped_asset"
49-
assetGroupedAssetName = "grouped_asset"
50-
assetShowWitnessName = "show_witness"
51-
assetShowSpentName = "show_spent"
52-
assetShowLeasedName = "show_leased"
53-
assetIncludeLeasedName = "include_leased"
54-
assetShowUnconfMintsName = "show_unconfirmed_mints"
55-
assetGroupKeyName = "group_key"
56-
assetGroupAnchorName = "group_anchor"
57-
anchorTxidName = "anchor_txid"
58-
batchKeyName = "batch_key"
59-
groupByGroupName = "by_group"
60-
assetIDName = "asset_id"
61-
shortResponseName = "short"
62-
universeCommitmentsName = "universe_commitments"
63-
feeRateName = "sat_per_vbyte"
64-
assetAmountName = "amount"
65-
burnOverrideConfirmationName = "override_confirmation_destroy_assets"
41+
assetTypeName = "type"
42+
assetTagName = "name"
43+
assetSupplyName = "supply"
44+
assetMetaBytesName = "meta_bytes"
45+
assetMetaFilePathName = "meta_file_path"
46+
assetMetaTypeName = "meta_type"
47+
assetDecimalDisplayName = "decimal_display"
48+
assetNewGroupedAssetName = "new_grouped_asset"
49+
assetGroupedAssetName = "grouped_asset"
50+
assetShowWitnessName = "show_witness"
51+
assetShowSpentName = "show_spent"
52+
assetShowLeasedName = "show_leased"
53+
assetIncludeLeasedName = "include_leased"
54+
assetShowUnconfMintsName = "show_unconfirmed_mints"
55+
assetGroupKeyName = "group_key"
56+
assetGroupAnchorName = "group_anchor"
57+
anchorTxidName = "anchor_txid"
58+
batchKeyName = "batch_key"
59+
groupByGroupName = "by_group"
60+
assetIDName = "asset_id"
61+
shortResponseName = "short"
62+
universeCommitmentsName = "universe_commitments"
63+
feeRateName = "sat_per_vbyte"
64+
skipProofCourierPingCheckName = "skip-proof-courier-ping-check"
65+
assetAmountName = "amount"
66+
burnOverrideConfirmationName = "override_confirmation_destroy_assets"
6667
)
6768

6869
var mintAssetCommand = cli.Command{
@@ -824,6 +825,10 @@ var sendAssetsCommand = cli.Command{
824825
Usage: "if set, the fee rate in sat/vB to use for " +
825826
"the anchor transaction",
826827
},
828+
cli.BoolFlag{
829+
Name: skipProofCourierPingCheckName,
830+
Usage: "if set, skip the proof courier ping check",
831+
},
827832
// TODO(roasbeef): add arg for file name to write sender proof
828833
// blob
829834
},
@@ -848,6 +853,9 @@ func sendAssets(ctx *cli.Context) error {
848853
resp, err := client.SendAsset(ctxc, &taprpc.SendAssetRequest{
849854
TapAddrs: addrs,
850855
FeeRate: feeRate,
856+
SkipProofCourierPingCheck: ctx.Bool(
857+
skipProofCourierPingCheckName,
858+
),
851859
})
852860
if err != nil {
853861
return fmt.Errorf("unable to send assets: %w", err)

rpcserver.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3375,7 +3375,10 @@ func (r *rpcServer) SendAsset(ctx context.Context,
33753375
}
33763376

33773377
resp, err := r.cfg.ChainPorter.RequestShipment(
3378-
tapfreighter.NewAddressParcel(feeRate, req.Label, tapAddrs...),
3378+
tapfreighter.NewAddressParcel(
3379+
feeRate, req.Label, req.SkipProofCourierPingCheck,
3380+
tapAddrs...,
3381+
),
33793382
)
33803383
if err != nil {
33813384
return nil, err

tapfreighter/parcel.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ type AddressParcel struct {
140140

141141
// label is an optional user provided transfer label.
142142
label string
143+
144+
// skipProofCourierPingCheck bool is a flag that indicates whether the
145+
// proof courier ping check should be skipped. This is useful for
146+
// testing purposes or to force transfer attempts even if the
147+
// proof courier is not immediately reachable.
148+
skipProofCourierPingCheck bool
143149
}
144150

145151
// A compile-time assertion to ensure AddressParcel implements the parcel
@@ -148,16 +154,18 @@ var _ Parcel = (*AddressParcel)(nil)
148154

149155
// NewAddressParcel creates a new AddressParcel.
150156
func NewAddressParcel(feeRate *chainfee.SatPerKWeight, label string,
157+
skipProofCourierPingCheck bool,
151158
destAddrs ...*address.Tap) *AddressParcel {
152159

153160
return &AddressParcel{
154161
parcelKit: &parcelKit{
155162
respChan: make(chan *OutboundParcel, 1),
156163
errChan: make(chan error, 1),
157164
},
158-
destAddrs: destAddrs,
159-
transferFeeRate: feeRate,
160-
label: label,
165+
destAddrs: destAddrs,
166+
transferFeeRate: feeRate,
167+
label: label,
168+
skipProofCourierPingCheck: skipProofCourierPingCheck,
161169
}
162170
}
163171

@@ -168,8 +176,9 @@ func (p *AddressParcel) pkg() *sendPackage {
168176

169177
// Initialize a package with the destination address.
170178
return &sendPackage{
171-
Parcel: p,
172-
Label: p.label,
179+
Parcel: p,
180+
Label: p.label,
181+
SkipProofCourierPingCheck: p.skipProofCourierPingCheck,
173182
}
174183
}
175184

@@ -483,6 +492,12 @@ type sendPackage struct {
483492
// Note is a user provided description for this transfer. This is
484493
// currently only used by asset burn transfers.
485494
Note string
495+
496+
// SkipProofCourierPingCheck bool is a flag that indicates whether the
497+
// proof courier ping check should be skipped. This is useful for
498+
// testing purposes or to force transfer attempts even if the
499+
// proof courier is not immediately reachable.
500+
SkipProofCourierPingCheck bool
486501
}
487502

488503
// ConvertToTransfer prepares the finished send data for storing to the database

0 commit comments

Comments
 (0)