Migrate sat_per_byte to sat_per_vbyte for LND requests

Per LND v0.21.0 release notes, the sat_per_byte option will be removed
in v0.22 across CloseChannel, OpenChannel, SendCoins, SendMany, and
walletrpc.BumpFee. LND already treats sat_per_byte as sat/vbyte
internally, so this is a pure rename with no value conversion. Updates
both the wire-format strings sent to LND and the matching TypeScript
identifiers across the close-channel, open-channel, send-coins, and
bump-fee paths.
This commit is contained in:
saubyk 2026-05-05 18:13:08 -07:00 committed by Suheb
parent 890db72ab6
commit 6e48241d85
18 changed files with 34 additions and 25 deletions

View file

@ -140,7 +140,7 @@ export const postChannel = (req, res, next) => {
options.form.target_conf = trans_type_value;
}
else if (trans_type === '2') {
options.form.sat_per_byte = trans_type_value;
options.form.sat_per_vbyte = trans_type_value;
}
if (commitment_type) {
options.form.commitment_type = commitment_type;
@ -171,8 +171,8 @@ export const closeChannel = (req, res, next) => {
if (req.query.target_conf) {
options.url = options.url + '&target_conf=' + req.query.target_conf;
}
if (req.query.sat_per_byte) {
options.url = options.url + '&sat_per_byte=' + req.query.sat_per_byte;
if (req.query.sat_per_vbyte) {
options.url = options.url + '&sat_per_vbyte=' + req.query.sat_per_vbyte;
}
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Closing Channel Options URL', data: options.url });
request.delete(options);

View file

@ -30,7 +30,7 @@ export const postTransactions = (req, res, next) => {
options.form = {
amount: amount,
addr: address,
sat_per_byte: fees,
sat_per_vbyte: fees,
target_conf: blocks
};
if (sendAll) {

View file

@ -120,7 +120,7 @@ export const getUTXOs = (req, res, next) => {
});
};
export const bumpFee = (req, res, next) => {
const { txid, outputIndex, targetConf, satPerByte } = req.body;
const { txid, outputIndex, targetConf, satPerVByte } = req.body;
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Wallet', msg: 'Bumping Fee..' });
options = common.getOptions(req);
if (options.error) {
@ -135,8 +135,8 @@ export const bumpFee = (req, res, next) => {
if (targetConf) {
options.form.target_conf = targetConf;
}
else if (satPerByte) {
options.form.sat_per_byte = satPerByte;
else if (satPerVByte) {
options.form.sat_per_vbyte = satPerVByte;
}
options.form = JSON.stringify(options.form);
request.post(options).then((body) => {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
(()=>{"use strict";var e,b={},h={};function r(e){var f=h[e];if(void 0!==f)return f.exports;var t=h[e]={id:e,loaded:!1,exports:{}};return b[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=b,e=[],r.O=(f,t,i,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,o]=e[n],s=!0,d=0;d<t.length;d++)(!1&o||a>=o)&&Object.keys(r.O).every(v=>r.O[v](t[d]))?t.splice(d--,1):(s=!1,o<a&&(a=o));if(s){e.splice(n--,1);var u=i();void 0!==u&&(f=u)}}return f}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,i,o]},r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>e+"."+{17:"6019ad086792cc08",190:"2c3aaa03801c7b66",193:"b6974b544ca80922",853:"8e8db9dc1adcdad0"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="RTLApp:";r.l=(t,i,o,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==o)for(var d=document.getElementsByTagName("script"),u=0;u<d.length;u++){var l=d[u];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==f+o){a=l;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",f+o),a.src=r.tu(t)),e[t]=[i];var c=(m,v)=>{a.onerror=a.onload=null,clearTimeout(p);var g=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),g&&g.forEach(_=>_(v)),m)return m(v)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,o)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)o.push(n[2]);else if(121!=i){var a=new Promise((l,c)=>n=e[i]=[l,c]);o.push(n[2]=a);var s=r.p+r.u(i),d=new Error;r.l(s,l=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=l&&("load"===l.type?"missing":l.type),p=l&&l.target&&l.target.src;d.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",d.name="ChunkLoadError",d.type=c,d.request=p,n[1](d)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var f=(i,o)=>{var d,u,[n,a,s]=o,l=0;if(n.some(p=>0!==e[p])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(s)var c=s(r)}for(i&&i(o);l<n.length;l++)r.o(e,u=n[l])&&e[u]&&e[u][0](),e[u]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();
(()=>{"use strict";var e,b={},h={};function r(e){var f=h[e];if(void 0!==f)return f.exports;var t=h[e]={id:e,loaded:!1,exports:{}};return b[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=b,e=[],r.O=(f,t,i,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,o]=e[n],s=!0,l=0;l<t.length;l++)(!1&o||a>=o)&&Object.keys(r.O).every(v=>r.O[v](t[l]))?t.splice(l--,1):(s=!1,o<a&&(a=o));if(s){e.splice(n--,1);var d=i();void 0!==d&&(f=d)}}return f}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,i,o]},r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>e+"."+{17:"6019ad086792cc08",190:"496d0a0b94483d54",193:"b6974b544ca80922",853:"8e8db9dc1adcdad0"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="RTLApp:";r.l=(t,i,o,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==o)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==f+o){a=u;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",f+o),a.src=r.tu(t)),e[t]=[i];var c=(m,v)=>{a.onerror=a.onload=null,clearTimeout(p);var g=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),g&&g.forEach(_=>_(v)),m)return m(v)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,o)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)o.push(n[2]);else if(121!=i){var a=new Promise((u,c)=>n=e[i]=[u,c]);o.push(n[2]=a);var s=r.p+r.u(i),l=new Error;r.l(s,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;l.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",l.name="ChunkLoadError",l.type=c,l.request=p,n[1](l)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var f=(i,o)=>{var l,d,[n,a,s]=o,u=0;if(n.some(p=>0!==e[p])){for(l in a)r.o(a,l)&&(r.m[l]=a[l]);if(s)var c=s(r)}for(i&&i(o);u<n.length;u++)r.o(e,d=n[u])&&e[d]&&e[d][0](),e[d]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();

View file

@ -120,6 +120,15 @@ this release should add its entry under the appropriate section below.
## Code Health
- **LND: migrate `sat_per_byte` to `sat_per_vbyte` in node requests**
([#1592](https://github.com/Ride-The-Lightning/RTL/pull/1592)).
LND's v0.21.0 release notes deprecate the `sat_per_byte` field, with removal planned in
v0.22 across `CloseChannel`, `OpenChannel`, `SendCoins`, `SendMany` and
`walletrpc.BumpFee`. LND already interprets the old field as sat/vbyte internally, so
this is a pure wire-format rename with no value conversion. The close-channel,
open-channel, send-coins and bump-fee request paths (and their matching TypeScript
identifiers) now send `sat_per_vbyte`, keeping RTL compatible ahead of the removal.
- **Batch dependency update resolving all 20 open Dependabot security PRs**
([#1633](https://github.com/Ride-The-Lightning/RTL/pull/1633)).
Dependabot had 20 open security-alert PRs against `master` (#1583#1617). Rather than

View file

@ -139,7 +139,7 @@ export const postChannel = (req, res, next) => {
if (trans_type === '1') {
options.form.target_conf = trans_type_value;
} else if (trans_type === '2') {
options.form.sat_per_byte = trans_type_value;
options.form.sat_per_vbyte = trans_type_value;
}
if (commitment_type) {
options.form.commitment_type = commitment_type;
@ -167,7 +167,7 @@ export const closeChannel = (req, res, next) => {
const channelpoint = req.params.channelPoint?.replace(':', '/');
options.url = req.session.selectedNode.settings.lnServerUrl + '/v1/channels/' + channelpoint + '?force=' + req.query.force;
if (req.query.target_conf) { options.url = options.url + '&target_conf=' + req.query.target_conf; }
if (req.query.sat_per_byte) { options.url = options.url + '&sat_per_byte=' + req.query.sat_per_byte; }
if (req.query.sat_per_vbyte) { options.url = options.url + '&sat_per_vbyte=' + req.query.sat_per_vbyte; }
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Closing Channel Options URL', data: options.url });
request.delete(options);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Close Requested' });

View file

@ -28,7 +28,7 @@ export const postTransactions = (req, res, next) => {
options.form = {
amount: amount,
addr: address,
sat_per_byte: fees,
sat_per_vbyte: fees,
target_conf: blocks
};
if (sendAll) { options.form.send_all = sendAll; }

View file

@ -110,7 +110,7 @@ export const getUTXOs = (req, res, next) => {
};
export const bumpFee = (req, res, next) => {
const { txid, outputIndex, targetConf, satPerByte } = req.body;
const { txid, outputIndex, targetConf, satPerVByte } = req.body;
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Wallet', msg: 'Bumping Fee..' });
options = common.getOptions(req);
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
@ -122,8 +122,8 @@ export const bumpFee = (req, res, next) => {
};
if (targetConf) {
options.form.target_conf = targetConf;
} else if (satPerByte) {
options.form.sat_per_byte = satPerByte;
} else if (satPerVByte) {
options.form.sat_per_vbyte = satPerVByte;
}
options.form = JSON.stringify(options.form);
request.post(options).then((body) => {

View file

@ -71,7 +71,7 @@ export class CloseChannelComponent implements OnInit, OnDestroy {
closeChannelParams.targetConf = this.blocks;
}
if (this.fees) {
closeChannelParams.satPerByte = this.fees;
closeChannelParams.satPerVByte = this.fees;
}
this.store.dispatch(closeChannel({ payload: closeChannelParams }));
this.dialogRef.close(false);

View file

@ -345,8 +345,8 @@ export class LNDEffects implements OnDestroy {
if (action.payload.targetConf) {
reqUrl = reqUrl + '&target_conf=' + action.payload.targetConf;
}
if (action.payload.satPerByte) {
reqUrl = reqUrl + '&sat_per_byte=' + action.payload.satPerByte;
if (action.payload.satPerVByte) {
reqUrl = reqUrl + '&sat_per_vbyte=' + action.payload.satPerVByte;
}
return this.httpClient.delete(reqUrl).pipe(
map((postRes: any) => {

View file

@ -534,7 +534,7 @@ export interface CloseChannel {
channelPoint: string;
forcibly: boolean;
targetConf?: number;
satPerByte?: number;
satPerVByte?: number;
}
export interface FetchInvoices {

View file

@ -171,14 +171,14 @@ export class DataService implements OnDestroy {
}));
}
bumpFee(txid: string, outputIndex: number, targetConf: number | null, satPerByte: number | null) {
bumpFee(txid: string, outputIndex: number, targetConf: number | null, satPerVByte: number | null) {
return this.lnImplementationUpdated.pipe(first(), mergeMap((updatedLnImplementation) => {
const bumpFeeBody: any = { txid: txid, outputIndex: outputIndex };
if (targetConf) {
bumpFeeBody.targetConf = targetConf;
}
if (satPerByte) {
bumpFeeBody.satPerByte = satPerByte;
if (satPerVByte) {
bumpFeeBody.satPerVByte = satPerVByte;
}
this.store.dispatch(openSpinner({ payload: UI_MESSAGES.BUMP_FEE }));
return this.httpClient.post(this.APIUrl + '/' + updatedLnImplementation + API_END_POINTS.WALLET_API + '/bumpfee', bumpFeeBody).pipe(

View file

@ -98,7 +98,7 @@ export class mockDataService {
return of(mockResponseData.verifyMessage);
};
bumpFee(txid: string, outputIndex: number, targetConf: number, satPerByte: number) {
bumpFee(txid: string, outputIndex: number, targetConf: number, satPerVByte: number) {
return of(mockResponseData.bumpFee);
};