Skip to content

Commit 3dfb153

Browse files
committed
feat(images): add support for Eclair v0.10.0
1 parent 8fc8923 commit 3dfb153

File tree

8 files changed

+25
-15
lines changed

8 files changed

+25
-15
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Supported Network Node Versions:
3939

4040
- [LND](https://github.com/lightningnetwork/lnd) - v0.17.4, v0.17.3, v0.17.2, v0.17.1, v0.17.0, v0.16.4, v0.16.2, v0.16.1, v0.16.0, v0.15.5, v0.14.3, v0.13.1
4141
- [Core Lightning](https://github.com/ElementsProject/lightning) - v23.05.2, v23.02.2, v22.11, v0.12.0, v0.11.2, v0.10.2
42-
- [Eclair](https://github.com/ACINQ/eclair/) - v0.9.0, v0.8.0, v0.7.0, v0.6.2, v0.5.0
42+
- [Eclair](https://github.com/ACINQ/eclair/) - v0.10.0, v0.9.0, v0.8.0, v0.7.0, v0.6.2, v0.5.0
4343
- [Bitcoin Core](https://github.com/bitcoin/bitcoin) - v26.0, v25.0, v24.0, v23.0, v22.0, v0.21.1
4444
- [Taproot Assets](https://github.com/lightninglabs/taproot-assets) - v0.3.0
4545

docker/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ Replace `<version>` with the desired c-lightning version (ex: `0.8.0`).
135135

136136
### Tags
137137

138+
- `0.10.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))
138139
- `0.9.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))
139140
- `0.8.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))
140141
- `0.7.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))

docker/nodes.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"versions": ["23.05.2", "23.02.2", "22.11", "0.12.0", "0.11.2", "0.10.2"]
3838
},
3939
"eclair": {
40-
"latest": "0.9.0",
41-
"versions": ["0.9.0", "0.8.0", "0.7.0", "0.6.2", "0.5.0"]
40+
"latest": "0.10.0",
41+
"versions": ["0.10.0", "0.9.0", "0.8.0", "0.7.0", "0.6.2", "0.5.0"]
4242
},
4343
"bitcoind": {
4444
"latest": "26.0",

src/lib/lightning/eclair/eclairService.spec.ts

+12-7
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('EclairService', () => {
6868
});
6969

7070
it('should get a list of channels for v0.7.0', async () => {
71-
node.version = '0.7.0';
71+
const node7 = { ...node, version: '0.7.0' };
7272
const chanResponse: ELN.ChannelResponse = {
7373
nodeId: 'abcdef',
7474
channelId: '65sdfd7',
@@ -117,12 +117,12 @@ describe('EclairService', () => {
117117
};
118118
eclairApiMock.httpPost.mockResolvedValue([chanResponse]);
119119
const expected = [expect.objectContaining({ pubkey: 'abcdef' })];
120-
const actual = await eclairService.getChannels(node);
120+
const actual = await eclairService.getChannels(node7);
121121
expect(actual).toEqual(expected);
122122
});
123123

124124
it('should get a list of channels for v0.8.0', async () => {
125-
node.version = '0.8.0';
125+
const node8 = { ...node, version: '0.8.0' };
126126
const chanResponse: ELN.ChannelResponse = {
127127
nodeId: 'abcdef',
128128
channelId: '65sdfd7',
@@ -171,12 +171,12 @@ describe('EclairService', () => {
171171
};
172172
eclairApiMock.httpPost.mockResolvedValue([chanResponse]);
173173
const expected = [expect.objectContaining({ pubkey: 'abcdef' })];
174-
const actual = await eclairService.getChannels(node);
174+
const actual = await eclairService.getChannels(node8);
175175
expect(actual).toEqual(expected);
176176
});
177177

178178
it('should get a list of channels for >= v0.9.0', async () => {
179-
node.version = '0.9.0';
179+
const node9 = { ...node, version: '0.9.0' };
180180
const chanResponse: ELN.ChannelResponse = {
181181
nodeId: 'abcdef',
182182
channelId: '65sdfd7',
@@ -225,7 +225,7 @@ describe('EclairService', () => {
225225
};
226226
eclairApiMock.httpPost.mockResolvedValue([chanResponse]);
227227
const expected = [expect.objectContaining({ pubkey: 'abcdef' })];
228-
const actual = await eclairService.getChannels(node);
228+
const actual = await eclairService.getChannels(node9);
229229
expect(actual).toEqual(expected);
230230
});
231231

@@ -313,7 +313,12 @@ describe('EclairService', () => {
313313
version: defaultRepoState.images.eclair.latest,
314314
},
315315
'open',
316-
{ channelFlags: 0, fundingSatoshis: 100000, nodeId: 'abc' },
316+
{
317+
channelFlags: 0,
318+
fundingSatoshis: 100000,
319+
fundingFeeBudgetSatoshis: 50000,
320+
nodeId: 'abc',
321+
},
317322
);
318323
});
319324

src/lib/lightning/eclair/eclairService.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,12 @@ class EclairService implements LightningService {
148148
const [toPubKey] = toRpcUrl.split('@');
149149

150150
// open the channel
151+
const capacity = parseInt(amount);
151152
const body: ELN.OpenChannelRequest = {
152153
nodeId: toPubKey,
153-
fundingSatoshis: parseInt(amount),
154+
fundingSatoshis: capacity,
155+
// regtest fee estimation is unusually high so increase the budget to 50% of capacity
156+
fundingFeeBudgetSatoshis: Math.round(capacity * 0.5),
154157
channelFlags: isPrivate ? 0 : 1, // 0 is private, 1 is public: https://acinq.github.io/eclair/#open-2
155158
};
156159
const res = await httpPost<string>(from, 'open', body);

src/lib/lightning/eclair/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export interface OpenChannelRequest {
106106
fundingSatoshis: number;
107107
pushMsat?: number;
108108
fundingFeerateSatByte?: number;
109+
fundingFeeBudgetSatoshis: number;
109110
channelFlags?: ChannelFlags;
110111
openTimeoutSeconds?: number;
111112
}

src/utils/constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ export const defaultRepoState: DockerRepoState = {
294294
versions: ['23.05.2', '23.02.2', '22.11', '0.12.0', '0.11.2', '0.10.2'],
295295
},
296296
eclair: {
297-
latest: '0.9.0',
298-
versions: ['0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
297+
latest: '0.10.0',
298+
versions: ['0.10.0', '0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
299299
},
300300
bitcoind: {
301301
latest: '26.0',

src/utils/tests/helpers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ export const testRepoState: DockerRepoState = {
134134
versions: ['23.05.2', '23.02.2', '22.11', '0.12.0', '0.11.2', '0.10.2'],
135135
},
136136
eclair: {
137-
latest: '0.9.0',
138-
versions: ['0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
137+
latest: '0.10.0',
138+
versions: ['0.10.0', '0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
139139
},
140140
bitcoind: {
141141
latest: '26.0',

0 commit comments

Comments
 (0)