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

Channel refactor #24

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
1600b52
Fix build warnings
canndrew Mar 4, 2021
5ca24f5
DotNetLightning.Kiss fork
knocte Nov 4, 2020
70f9932
Mono-hop unidirectional payments
canndrew Nov 12, 2020
898f470
Implement revocation (#11)
canndrew Nov 12, 2020
1779487
Re-add txout shuffling work-around (#13)
canndrew Nov 24, 2020
ceb40f0
Exclude macaroons tests on CI
canndrew Nov 26, 2020
f2bde1f
Move and export fee mismatch calculation function
canndrew Nov 23, 2020
0e0a928
Actually apply update fee messages
canndrew Nov 25, 2020
863a828
Remove pre-channel states
canndrew Nov 26, 2020
1c16fd0
Remove unused channel states
canndrew Nov 30, 2020
ce73f19
Make ChannelState.{Commitments,ChannelId} not return Option
canndrew Nov 30, 2020
0f84d6a
Remove LocalParams.NodeId
canndrew Dec 1, 2020
74daf7c
De-duplicate minimum depth field
canndrew Dec 1, 2020
c22658f
Don't carry ChannelHandshakeLimits through the lifetime of the channel
canndrew Dec 1, 2020
a2d1690
Refactor shutdown scripts
canndrew Dec 1, 2020
0238601
Remove unused types from ChannelTypes
canndrew Mar 4, 2021
30c93d2
Format Channel and ChannelTypes modules
canndrew Mar 4, 2021
7b29ced
Move Commitments into the Channel type
canndrew Dec 2, 2020
40f0896
Make ChannelId a method, rather than a field of Commitments
canndrew Dec 2, 2020
7343c6e
Inline channel state data types
canndrew Dec 2, 2020
16d2b92
Remove LastSent field from channel states
canndrew Dec 4, 2020
e65c609
Remove NodeId from RemoteParams
canndrew Dec 4, 2020
eab2ecc
Remove ChannelPubKeys from Params types
canndrew Dec 4, 2020
46de6d8
Remove WaitForFundingConfirmedData.LastSent field
canndrew Dec 4, 2020
ab6e3ff
Remove InitialFeeRatePerKw from channel states
canndrew Dec 4, 2020
e6068eb
Remove ChannelWaitingForAcceptChannel.FundingTxFeeRatePerKw
canndrew Dec 4, 2020
6050037
Remove WaitForFundingLockedData.OurMessage field
canndrew Dec 4, 2020
7960ce1
Remove NormalData.Buried field
canndrew Dec 4, 2020
e0d87d3
Remove TheirMessage field from WaitForFundingLockedData
canndrew Dec 7, 2020
d12aaab
Merge WeSentFundingLockedMsg and FundingConfirmed events
canndrew Dec 7, 2020
76b1bc1
Remove WaitingForRevocation.Sent field
canndrew Dec 7, 2020
1f1439d
Remove WaitingForRevocation.SentAfterLocalCommitmentIndex field
canndrew Dec 7, 2020
26a1cc3
Remove WaitingForRevocation.ReSignASAP field
canndrew Dec 7, 2020
c9d7b7d
Remove Commitments.Changes type
canndrew Dec 7, 2020
f7973b7
Move RemoteNextCommitInfo into the channel state
canndrew Dec 7, 2020
6c86efd
Remote WaitingForRevocation type
canndrew Dec 7, 2020
49b6267
Replace Deferred field of WaitForFundingConfirmedData
canndrew Dec 7, 2020
96bfb6f
Remove ChannelAnnoucement field from NormalData
canndrew Dec 8, 2020
e4aefdc
Remove NormalData.ChannelUpdate field
canndrew Dec 8, 2020
b6d1b1a
Merge WaitForFunding{Locked,Confirmed} states into Normal
canndrew Dec 8, 2020
0be3202
Remove nextCommitments from AcceptedShutdownWhileWeHaveUnsignedOutgoi…
canndrew Dec 8, 2020
73528af
Remove ChannelState.Shutdown
canndrew Dec 8, 2020
c034eaf
Record remote's ShutdownScriptPubKey from open/accept channel msgs
canndrew Dec 8, 2020
b838d7a
Replace ShutdownMsg fields with ShutdownScriptPubKey in channel states
canndrew Dec 8, 2020
61decff
De-duplicate shutdown scripts
canndrew Dec 10, 2020
17ae887
Remove unused fields from ClosingData
canndrew Dec 10, 2020
15954c1
Change type of NegotiatingData.ClosingTxProposed
canndrew Dec 10, 2020
0fcb3d5
Change type (again) of NegotiatingData.ClosingTxPerformed
canndrew Dec 10, 2020
c14b96a
Remove MaybeBestUnpublishedTx from NegotiatingData
canndrew Dec 10, 2020
848c042
Remove ClosingTxProposed type
canndrew Dec 18, 2020
57e883f
Track previous fee proposed by remote peer during fee negotiation
canndrew Dec 18, 2020
e2a7c52
Move RemoteNextCommitInfoOpt into Channel
canndrew Dec 18, 2020
f8a0257
Move ShortChannelIdOpt out of NormalData into Channel
canndrew Dec 18, 2020
d8122b8
Remove RemoteCommit.TxId field
canndrew Dec 18, 2020
ab6e741
Remove handleMutualClose function
canndrew Dec 18, 2020
55abb06
Remove claimCurrentLocalCommitTxOutputs
canndrew Dec 18, 2020
f5b5d86
Add ChannelFlags type
canndrew Jan 29, 2021
f30e156
Remove ChannelState
canndrew Jan 29, 2021
77124c0
Move some channel fields into new StaticChannelConfig type
canndrew Mar 1, 2021
5a6e865
Move FeeEstimator into ChannelOptions
canndrew Mar 5, 2021
e63efad
Remove redundant arg from New{In,Out}Bound methods
canndrew Mar 5, 2021
f1b4c8d
Factor reestablishment-creation into a method
canndrew Mar 5, 2021
5deabf5
Turn ApplyFundingLocked into a method
canndrew Mar 8, 2021
c223cac
Make ApplyFundingConfirmedOnBC into a method
canndrew Mar 8, 2021
ef72404
Make MonoHopUnidirectionalPayment into a method
canndrew Mar 8, 2021
5877ca9
Make ApplyMonoHopUnidirectionalPayment into a method
canndrew Mar 8, 2021
ac98708
Make AddHTLC into a method
canndrew Mar 8, 2021
d4eee17
Make ApplyUpdateAddHTLC into a method
canndrew Mar 8, 2021
340dfa5
Make FulfillHTLC into a method
canndrew Mar 8, 2021
39c2b3d
Make ApplyUpdateFulfillHTLC into a method
canndrew Mar 8, 2021
954aaa7
Make FailHTLC into a method
canndrew Mar 8, 2021
fdda59e
Make FailMalformedHTLC into a method
canndrew Mar 8, 2021
443d0be
Make ApplyUpdateFailHTLC into a method
canndrew Mar 8, 2021
be5f878
Make ApplyUpdateFailMalformedHTLC into a method
canndrew Mar 8, 2021
37f250d
Make UpdateFee into a method
canndrew Mar 8, 2021
60a7e1e
Make ApplyUpdateFee into a method
canndrew Mar 8, 2021
0cfc4c4
Make SignCommitment into a method:w
canndrew Mar 8, 2021
aff4793
Make ApplyCommitmentSigned into a method
canndrew Mar 8, 2021
7e3ab70
Make ApplyRevokeAndACK into a method
canndrew Mar 8, 2021
73f7bb2
Make Close into a method
canndrew Mar 8, 2021
3707836
Make RemoteShutdown into a method
canndrew Mar 8, 2021
ac94534
Make ApplyClosingSigned into a method
canndrew Mar 8, 2021
b28e6e4
Remove Channel{Operation,Event}
canndrew Mar 8, 2021
5cf724e
Remove ChannelWaitingForFundingSigned.LastSent field
canndrew Mar 10, 2021
c66bbd9
Remove ChannelWaitingForFundingCreated.TemporaryFailure field
canndrew Mar 10, 2021
7455ad9
Expand/Remove ChannelWaitingForFundingTx.LastReceived field
canndrew Mar 10, 2021
abe0b52
Remove WhichInput field from tx types
canndrew Mar 10, 2021
1cfe465
Seperate incoming and outgoing htlcs in CommitmentSpec
canndrew Mar 11, 2021
0c426de
Move StaticChannelConfig into new SavedChannelState type
canndrew Mar 18, 2021
ca0347d
Move RemotePerCommitmentSecrets into SavedChannelState
canndrew Mar 18, 2021
52820b5
Move ShortChannelId into SavedChannelState
canndrew Mar 18, 2021
531b80b
Move {Local,Remote}Commit into SavedChannelState
canndrew Mar 18, 2021
d767f6a
Move proposed local changes out of LocalChanges
canndrew Mar 26, 2021
7adabdf
Move proposed remote changes out of RemoteChanges
canndrew Mar 26, 2021
c9352d1
move Local,RemoteChanges into SavedChannelState
canndrew Mar 26, 2021
a972770
Remove DomainUtils/Type.fs and its interface definitions
canndrew Jun 16, 2021
7d756a7
Add SpendableBalanceFromParts function
canndrew Jun 16, 2021
f1d43cb
SpendableBalance: enable when funding not locked
canndrew Jun 17, 2021
b59e519
Make SignCommitment not return an Option
canndrew Jun 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
dotnet run --project tests/DotNetLightning.Core.Tests
- name: Run other tests
run: |
dotnet test
dotnet test --filter FullyQualifiedName\!~Macaroons

build_with_fsharp_from_mono:
runs-on: ubuntu-18.04
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/publish_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,5 @@ jobs:
- name: Upload nuget packages (Portability)
if: startsWith(matrix.os, 'ubuntu')
run: |
dotnet pack ./src/DotNetLightning.Core -p:Configuration=Release --version-suffix date`date +%Y%m%d-%H%M`-git-`echo $GITHUB_SHA | head -c 7` -p:Portability=True
dotnet nuget push ./src/DotNetLightning.Core/bin/Release/DotNetLightning.1*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

- name: Upload nuget packages (native)
run: |
bash -c "dotnet pack ./src/DotNetLightning.Core -p:Configuration=Release --version-suffix date$(date +%Y%m%d-%H%M).git-$(git rev-parse --short=7 HEAD)-${{ matrix.RID }}"
bash -c "dotnet nuget push ./src/DotNetLightning.Core/bin/Release/DotNetLightning.Core.1*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json"
dotnet pack ./src/DotNetLightning.Core -p:Configuration=Release --version-suffix date`date +%Y%m%d-%H%M`-git-`echo $GITHUB_SHA | head -c 7` -p:BouncyCastle=True
dotnet nuget push ./src/DotNetLightning.Core/bin/Release/DotNetLightning.Kiss.1*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
28 changes: 12 additions & 16 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
MIT License
AGPL License

Copyright (c) 2020 Joe Miyamoto <joemphilips@gmail.com>
Copyright (c) 2020 Node Effect Ltd <andres@nodeffect.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ The main entry point is `DotNetLightning.Core`.

## Installation

The package is compiled and published with two variants

* [`DotNetLightning`](https://www.nuget.org/packages/DotNetLightning/)
* This does not use native bindings for cryptographic operations.
* This is the one you want to use if you run your code everywhere, but possibly slower than below.
* [`DotNetLightning.Core`](https://www.nuget.org/packages/DotNetLightning.Core/)
* This uses a pre-compiled `libsodium` for cryptographic operations.
* It only supports `windows`, `mac` and `linux` environments.
* This is what you want if you need performance and the environments above are the only ones you are planning to support.

run `dotnet add package` with the one you want.
The package is compiled and published in nuget:

* [`DotNetLightning.Kiss`](https://www.nuget.org/packages/DotNetLightning.Kiss/)

It does not use native bindings for cryptographic operations.

Currently it is in alpha, so you probably want to install a latest version by specifying it with `--version`.
The version is prefixed with git commit hash and date. Please take a look at the nuget page.

Expand Down
Loading