Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(images): Add support for LND v0.17.4-beta and Eclair v0.10.0 #846

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ With Polar you can:

Supported Network Node Versions:

- [LND](https://github.com/lightningnetwork/lnd) - 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
- [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
- [Core Lightning](https://github.com/ElementsProject/lightning) - v23.05.2, v23.02.2, v22.11, v0.12.0, v0.11.2, v0.10.2
- [Eclair](https://github.com/ACINQ/eclair/) - v0.9.0, v0.8.0, v0.7.0, v0.6.2, v0.5.0
- [Eclair](https://github.com/ACINQ/eclair/) - v0.10.0, v0.9.0, v0.8.0, v0.7.0, v0.6.2, v0.5.0
- [Bitcoin Core](https://github.com/bitcoin/bitcoin) - v26.0, v25.0, v24.0, v23.0, v22.0, v0.21.1
- [Taproot Assets](https://github.com/lightninglabs/taproot-assets) - v0.3.0

Expand Down
2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Replace `<version>` with the desired bitcoind version (ex: `0.18.1`)

### Tags

- `0.17.4-beta` ([lnd/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/lnd/Dockerfile))
- `0.17.3-beta` ([lnd/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/lnd/Dockerfile))
- `0.17.2-beta` ([lnd/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/lnd/Dockerfile))
- `0.17.1-beta` ([lnd/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/lnd/Dockerfile))
Expand Down Expand Up @@ -134,6 +135,7 @@ Replace `<version>` with the desired c-lightning version (ex: `0.8.0`).

### Tags

- `0.10.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))
- `0.9.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))
- `0.8.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))
- `0.7.0` ([eclair/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/eclair/Dockerfile))
Expand Down
10 changes: 6 additions & 4 deletions docker/nodes.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"version": 56,
"version": 57,
"images": {
"LND": {
"latest": "0.17.3-beta",
"latest": "0.17.4-beta",
"versions": [
"0.17.4-beta",
"0.17.3-beta",
"0.17.2-beta",
"0.17.1-beta",
Expand All @@ -17,6 +18,7 @@
"0.13.1-beta"
],
"compatibility": {
"0.17.4-beta": "26.0",
"0.17.3-beta": "26.0",
"0.17.2-beta": "26.0",
"0.17.1-beta": "26.0",
Expand All @@ -35,8 +37,8 @@
"versions": ["23.05.2", "23.02.2", "22.11", "0.12.0", "0.11.2", "0.10.2"]
},
"eclair": {
"latest": "0.9.0",
"versions": ["0.9.0", "0.8.0", "0.7.0", "0.6.2", "0.5.0"]
"latest": "0.10.0",
"versions": ["0.10.0", "0.9.0", "0.8.0", "0.7.0", "0.6.2", "0.5.0"]
},
"bitcoind": {
"latest": "26.0",
Expand Down
19 changes: 12 additions & 7 deletions src/lib/lightning/eclair/eclairService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('EclairService', () => {
});

it('should get a list of channels for v0.7.0', async () => {
node.version = '0.7.0';
const node7 = { ...node, version: '0.7.0' };
const chanResponse: ELN.ChannelResponse = {
nodeId: 'abcdef',
channelId: '65sdfd7',
Expand Down Expand Up @@ -117,12 +117,12 @@ describe('EclairService', () => {
};
eclairApiMock.httpPost.mockResolvedValue([chanResponse]);
const expected = [expect.objectContaining({ pubkey: 'abcdef' })];
const actual = await eclairService.getChannels(node);
const actual = await eclairService.getChannels(node7);
expect(actual).toEqual(expected);
});

it('should get a list of channels for v0.8.0', async () => {
node.version = '0.8.0';
const node8 = { ...node, version: '0.8.0' };
const chanResponse: ELN.ChannelResponse = {
nodeId: 'abcdef',
channelId: '65sdfd7',
Expand Down Expand Up @@ -171,12 +171,12 @@ describe('EclairService', () => {
};
eclairApiMock.httpPost.mockResolvedValue([chanResponse]);
const expected = [expect.objectContaining({ pubkey: 'abcdef' })];
const actual = await eclairService.getChannels(node);
const actual = await eclairService.getChannels(node8);
expect(actual).toEqual(expected);
});

it('should get a list of channels for >= v0.9.0', async () => {
node.version = '0.9.0';
const node9 = { ...node, version: '0.9.0' };
const chanResponse: ELN.ChannelResponse = {
nodeId: 'abcdef',
channelId: '65sdfd7',
Expand Down Expand Up @@ -225,7 +225,7 @@ describe('EclairService', () => {
};
eclairApiMock.httpPost.mockResolvedValue([chanResponse]);
const expected = [expect.objectContaining({ pubkey: 'abcdef' })];
const actual = await eclairService.getChannels(node);
const actual = await eclairService.getChannels(node9);
expect(actual).toEqual(expected);
});

Expand Down Expand Up @@ -313,7 +313,12 @@ describe('EclairService', () => {
version: defaultRepoState.images.eclair.latest,
},
'open',
{ channelFlags: 0, fundingSatoshis: 100000, nodeId: 'abc' },
{
channelFlags: 0,
fundingSatoshis: 100000,
fundingFeeBudgetSatoshis: 50000,
nodeId: 'abc',
},
);
});

Expand Down
5 changes: 4 additions & 1 deletion src/lib/lightning/eclair/eclairService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,12 @@ class EclairService implements LightningService {
const [toPubKey] = toRpcUrl.split('@');

// open the channel
const capacity = parseInt(amount);
const body: ELN.OpenChannelRequest = {
nodeId: toPubKey,
fundingSatoshis: parseInt(amount),
fundingSatoshis: capacity,
// regtest fee estimation is unusually high so increase the budget to 50% of capacity
fundingFeeBudgetSatoshis: Math.round(capacity * 0.5),
channelFlags: isPrivate ? 0 : 1, // 0 is private, 1 is public: https://acinq.github.io/eclair/#open-2
};
const res = await httpPost<string>(from, 'open', body);
Expand Down
1 change: 1 addition & 0 deletions src/lib/lightning/eclair/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export interface OpenChannelRequest {
fundingSatoshis: number;
pushMsat?: number;
fundingFeerateSatByte?: number;
fundingFeeBudgetSatoshis: number;
channelFlags?: ChannelFlags;
openTimeoutSeconds?: number;
}
Expand Down
10 changes: 6 additions & 4 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,12 @@ export const REPO_STATE_URL =
* are pushed to Docker Hub, this list should be updated along with the /docker/nodes.json file.
*/
export const defaultRepoState: DockerRepoState = {
version: 56,
version: 57,
images: {
LND: {
latest: '0.17.3-beta',
latest: '0.17.4-beta',
versions: [
'0.17.4-beta',
'0.17.3-beta',
'0.17.2-beta',
'0.17.1-beta',
Expand All @@ -274,6 +275,7 @@ export const defaultRepoState: DockerRepoState = {
// not all LND versions are compatible with all bitcoind versions.
// this mapping specifies the highest compatible bitcoind for each LND version
compatibility: {
'0.17.4-beta': '26.0',
'0.17.3-beta': '26.0',
'0.17.2-beta': '26.0',
'0.17.1-beta': '26.0',
Expand All @@ -292,8 +294,8 @@ export const defaultRepoState: DockerRepoState = {
versions: ['23.05.2', '23.02.2', '22.11', '0.12.0', '0.11.2', '0.10.2'],
},
eclair: {
latest: '0.9.0',
versions: ['0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
latest: '0.10.0',
versions: ['0.10.0', '0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
},
bitcoind: {
latest: '26.0',
Expand Down
8 changes: 5 additions & 3 deletions src/utils/tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ export const testRepoState: DockerRepoState = {
version: 49,
images: {
LND: {
latest: '0.17.3-beta',
latest: '0.17.4-beta',
versions: [
'0.17.4-beta',
'0.17.3-beta',
'0.17.2-beta',
'0.17.1-beta',
Expand Down Expand Up @@ -93,6 +94,7 @@ export const testRepoState: DockerRepoState = {
// not all LND versions are compatible with all bitcoind versions.
// this mapping specifies the highest compatible bitcoind for each LND version
compatibility: {
'0.17.4-beta': '26.0',
'0.17.3-beta': '26.0',
'0.17.2-beta': '26.0',
'0.17.1-beta': '26.0',
Expand Down Expand Up @@ -132,8 +134,8 @@ export const testRepoState: DockerRepoState = {
versions: ['23.05.2', '23.02.2', '22.11', '0.12.0', '0.11.2', '0.10.2'],
},
eclair: {
latest: '0.9.0',
versions: ['0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
latest: '0.10.0',
versions: ['0.10.0', '0.9.0', '0.8.0', '0.7.0', '0.6.2', '0.5.0'],
},
bitcoind: {
latest: '26.0',
Expand Down