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

Backend/Utxo: support native segwit #211

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

aarani
Copy link
Contributor

@aarani aarani commented Apr 17, 2023

No description provided.

@aarani aarani force-pushed the nativeSegwit branch 4 times, most recently from 8e19812 to fd88ef4 Compare April 17, 2023 13:12
@knocte
Copy link
Member

knocte commented Apr 17, 2023

One last thing, can we do this in a soft-launch fashion? put a setting in Config.fs that is for now as =false, so geewallet behaves in same way as before. Then whenever we set it to =true, this new behaviour starts happening (so maybe we set it as true in lightning branch).

@aarani
Copy link
Contributor Author

aarani commented Apr 17, 2023

One last thing, can we do this in a soft-launch fashion? put a setting in Config.fs that is for now as =false, so geewallet behaves in same way as before. Then whenever we set it to =true, this new behaviour starts happening (so maybe we set it as true in lightning branch).

Done

@knocte
Copy link
Member

knocte commented Oct 19, 2023

Title's scope should be Backend/Utxo:, not just Backend.

@aarani aarani force-pushed the nativeSegwit branch 2 times, most recently from e93a7d2 to 7754684 Compare October 19, 2023 10:12
@aarani aarani changed the title Migrate to native segwit Backend/Utxo: support native segwit Oct 19, 2023
@knocte
Copy link
Member

knocte commented Oct 19, 2023

CI is red

@knocte
Copy link
Member

knocte commented Oct 20, 2023

@aarani after you finish with the --console task, can you please add a commit to this PR that does the following:

  1. Make UseNativeSegwit default to true if you pass certain parameter to ./configure.sh (e.g. --native-segwit), which in turn would make msbuild/xbuild/dotnet build with DefineConstants+=NATIVE_SEGWIT .
  2. Make CI have additional steps that build with this constant turned on, and publish the result in the beta channel (as opposed to the stable channel). See 37f9c20 for context.

@knocte
Copy link
Member

knocte commented Oct 20, 2023

Make CI have additional steps that build with this constant turned on...

Just to make sure you understand the above, take in account that I want the build to publish 2 snaps: one for the stable channel and one for the beta one.

scripts/configure.fsx Outdated Show resolved Hide resolved
scripts/make.fsx Outdated Show resolved Hide resolved
@Mersho Mersho force-pushed the nativeSegwit branch 2 times, most recently from d17f7b6 to 02b80aa Compare November 14, 2023 10:27
@@ -576,6 +576,7 @@ jobs:
- name: Upload snap package to Snap Store
env:
SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }}
OVERRIDE_SNAP_VERSION: 0.7.2.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aarani harcoding a version number? are you serious????

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mersho Mersho force-pushed the nativeSegwit branch 5 times, most recently from 7c9b030 to f344e9e Compare November 16, 2023 15:21
scripts/snap_release.fsx Outdated Show resolved Hide resolved
@knocte
Copy link
Member

knocte commented Nov 20, 2023

@Mersho what value is the 2nd commit adding in this PR? Why is it separated from the 3rd commit?

@knocte
Copy link
Member

knocte commented Nov 20, 2023

And why the scope of the last commit is completely wrong??????

@knocte knocte force-pushed the nativeSegwit branch 2 times, most recently from 1eca859 to 3995f62 Compare November 22, 2023 06:09
aarani and others added 2 commits January 19, 2024 14:49
Previously, native segwit was not widly supported so it was
necessary to do segwit over P2SH, these days native segwit is
supported by most wallets and with it's lower fee is the
recommended choice. Lightning protocol is even dropping support
for using P2SH shutdown scripts [1].

This commit adds support for native segwit (P2WPKH) while
keeping the support for spending funds in users's old P2SH
wallets.

[1] lightning/bolts@8f2104e
This commit aims to create beta snap packages to allow testing
experimental features like native segwit.

This commit also updates Fsdk inside our scripts because the
`GatherOrGetDefaultPrefix` function in the previous version
did not allow additional arguments beside --prefix.

A flag called --auto was also added for bypassing the
"press any key" in bump.fsx.

Co-authored-by: Mehrshad <[email protected]>
@knocte knocte merged commit b49f4ca into nblockchain:master Jan 19, 2024
16 checks passed
@knocte
Copy link
Member

knocte commented Jan 30, 2024

@Mersho FYI this PR was not properly tested, because I had to fix a couple of things after I merged it:

Next time you're working with a piece of code that only runs when CI is processing a git tag, please TEST A GIT TAG in your fork.

Thanks

knocte added a commit that referenced this pull request Feb 12, 2024
This change also reduces a bit of primitive obsession (i.e. string
vs BitcoinAddress) to make the code less "stringly-typed" lol.

This should have been done in [1] but was an oversight on my part
when reviewing.

[1] #211
knocte added a commit that referenced this pull request Feb 12, 2024
This change also reduces a bit of primitive obsession (i.e. string
vs BitcoinAddress) to make the code less "stringly-typed" lol.

This should have been done in [1] but was an oversight on my part
when reviewing.

[1] #211
knocte added a commit that referenced this pull request Feb 12, 2024
This change also reduces a bit of primitive obsession (i.e. string
vs BitcoinAddress) to make the code less "stringly-typed" lol.

This should have been done in [1] but was an oversight on my part
when reviewing.

[1] #211
knocte added a commit that referenced this pull request Feb 12, 2024
This change also reduces a bit of primitive obsession (i.e. string
vs BitcoinAddress) to make the code less "stringly-typed" lol.

This should have been done in [1] but was an oversight on my part
when reviewing.

[1] #211
knocte added a commit that referenced this pull request Feb 12, 2024
This change also reduces a bit of primitive obsession (i.e.
string vs BitcoinAddress) to make the code less "stringly-typed"
lol.

This should have been done in [1] but was an oversight on my
part when reviewing.

[1] #211
knocte added a commit that referenced this pull request Feb 12, 2024
This change also reduces a bit of primitive obsession (i.e.
string vs BitcoinAddress) to make the code less "stringly-typed"
lol.

This should have been done in [1] but was an oversight on my
part when reviewing.

[1] #211
knocte added a commit that referenced this pull request Feb 17, 2024
This fixes the following crash when trying to broadcast a signed
transaction from your cold-storage device:

```
unknown origin account
   at GWallet.Backend.UtxoCoin.Account.GetSignedTransactionDetails[T](String rawTransaction, Currency currency) in
/Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Backend/UtxoCoin/UtxoCoinAccount.fs:line 728
   at GWallet.Backend.Account.GetSignedTransactionDetails[T](SignedTransaction`1 signedTransaction) in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Backend/Account.fs:line 793
   at Program.BroadcastPayment() in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 82
   at Program.PerformOperation(UInt32 numActiveAccounts, UInt32 numHotAccounts) in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 398
   at Program.ProgramMainLoop[a]() in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 481
   at Program.NormalStartWithNoParameters() in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 493
```

This change also reduces a bit of primitive obsession (i.e.
string vs BitcoinAddress) to make the code less "stringly-typed"
lol.

This should have been done in [1] but was an oversight on my
part when reviewing.

[1] #211
knocte added a commit that referenced this pull request Feb 19, 2024
This fixes the following crash when trying to broadcast a signed
transaction from your cold-storage device:

```
unknown origin account
   at GWallet.Backend.UtxoCoin.Account.GetSignedTransactionDetails[T](String rawTransaction, Currency currency) in
/Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Backend/UtxoCoin/UtxoCoinAccount.fs:line 728
   at GWallet.Backend.Account.GetSignedTransactionDetails[T](SignedTransaction`1 signedTransaction) in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Backend/Account.fs:line 793
   at Program.BroadcastPayment() in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 82
   at Program.PerformOperation(UInt32 numActiveAccounts, UInt32 numHotAccounts) in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 398
   at Program.ProgramMainLoop[a]() in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 481
   at Program.NormalStartWithNoParameters() in /Users/knocte/Documents/Code/geewalletMASTERclean/src/GWallet.Frontend.Console/Program.fs:line 493
```

This change also reduces a bit of primitive obsession (i.e.
string vs BitcoinAddress) to make the code less "stringly-typed"
lol.

This should have been done in [1] but was an oversight on my
part when reviewing.

[1] #211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants