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

Bug: Addresses affected by descendant transactions are not notified on transaction replacement #1028

Open
craigraw opened this issue Apr 15, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@craigraw
Copy link

If you watch https://www.youtube.com/watch?v=pWmgu5eA4y4 to 9m 51s, you will see Sparrow reflects an incorrect state of the wallet. This is caused by the lack of all the correct notifications from Electrs - all addresses affected by the replacement of a transaction (removing it from this wallet) are not notified. The addresses that are not notified relate to child transactions that spend the (now removed) output of the replaced transaction.

I've reproduced the scenario using DEBUG logging in Sparrow, which funded address/0/2 in the Alice wallet with the first transaction, and then spent from /0/2 and /1/0 addresses to create the child transaction to the third (Bob) wallet. On broadcasting the RBF transaction from the first (Evil RBFer) wallet, the Alice wallet was notified of changes to /0/1 and /0/2, but not /1/0.

@craigraw craigraw added the bug Something isn't working label Apr 15, 2024
@romanz
Copy link
Owner

romanz commented Apr 16, 2024

Many thanks for reporting this issue!

@romanz romanz self-assigned this Apr 20, 2024
@romanz
Copy link
Owner

romanz commented Apr 20, 2024

I tried to reproduce the issue on Regtest with Sparrow 1.8.5 (built from source), but it seems to fail to start - with the following exception:

$ ./sparrow --network regtest

> Configure project :
Project : => 'com.sparrowwallet.sparrow' Java module

> Task :run FAILED
Exception in Application start method
Exception in Application stop method
2024-04-20 08:43:29,469 ERROR Exception in thread "main"
java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics@18/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:901)
        at javafx.graphics@18/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
        at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.IllegalArgumentException: No enum constant com.samourai.wallet.constants.SamouraiNetwork.REGTEST
        at java.base/java.lang.Enum.valueOf(Enum.java:274)
        at [email protected]/com.samourai.wallet.constants.SamouraiNetwork.valueOf(SamouraiNetwork.java:11)
        at [email protected]/com.sparrowwallet.sparrow.whirlpool.WhirlpoolServices.getSamouraiNetwork(WhirlpoolServices.java:64)
        at [email protected]/com.sparrowwallet.sparrow.whirlpool.WhirlpoolServices.computeExtLibJConfig(WhirlpoolServices.java:59)
        at [email protected]/com.sparrowwallet.sparrow.whirlpool.WhirlpoolServices.<init>(WhirlpoolServices.java:51)
        at [email protected]/com.sparrowwallet.sparrow.AppServices.<init>(AppServices.java:98)
        at [email protected]/com.sparrowwallet.sparrow.AppServices.initialize(AppServices.java:526)
        at [email protected]/com.sparrowwallet.sparrow.SparrowDesktop.start(SparrowDesktop.java:51)
        at javafx.graphics@18/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
        at javafx.graphics@18/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
        at javafx.graphics@18/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at javafx.graphics@18/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
        at javafx.graphics@18/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at javafx.graphics@18/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at javafx.graphics@18/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316)
        ... 1 common frames omitted

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':run'.
> Process 'command '/usr/lib/jvm/java-19-openjdk-amd64/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s
12 actionable tasks: 2 executed, 10 up-to-date

@craigraw could you please take a look?

@romanz
Copy link
Owner

romanz commented Apr 20, 2024

I'll try to reproduce on testnet.

@craigraw
Copy link
Author

See sparrowwallet/sparrow#1385. You can simply run latest HEAD to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants