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

itest: spend assets after sweeping from force close #825

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

guggero
Copy link
Member

@guggero guggero commented Aug 22, 2024

Depends on lightninglabs/taproot-assets#1103.

Demonstrates the issue in lightninglabs/taproot-assets#1099, and that the fix works.

@jharveyb
Copy link

Locally I observe a different (probably related?) error:

litd_custom_channels_test.go:1429: 
        	Error Trace:	/home/jhb/lightning-terminal/itest/litd_custom_channels_test.go:1429
        	            				/home/jhb/lightning-terminal/itest/test_harness.go:103
        	            				/home/jhb/lightning-terminal/itest/litd_test.go:100
        	Error:      	Received unexpected error:
        	            	rpc error: code = Unknown desc = unable to sign and commit virtual packet: unable to generate Taproot Asset witness data: invalid split commitment proof

AFAICT, the sweep TX by Dave is performing a full-value self-send, which gets broadcast, verified by Dave correctly, and imported into his node. The script key is detected as local and known.

On coin selection, the input is detected as not having a split commitment, but during signing tapd fails on generating a witness. I suspect the sweep output is being stored incorrectly s.t. the split root is set incorrectly, causing the split leaf proof for the send to be invalid.

@jharveyb
Copy link

AFAICT this is the point of failure:

https://github.com/lightninglabs/taproot-assets/blob/e893dee87e9d8f0de53b8ee9e2527add80df6491/vm/vm.go#L314

From debug sesssions it looks like the split proof verify is failing on the new split root.

@Roasbeef
Copy link
Member

AFAICT, the sweep TX by Dave is performing a full-value self-send, which gets broadcast, verified by Dave correctly, and imported into his node. The script key is detected as local and known.

I suspect the sweep output is being stored incorrectly s.t. the split root is set incorrectly, causing the split leaf proof for the send to be invalid.

Isn't this contradictory? If it's a full value send, then there's no split commitment needed, unless the asset created is stored incorrectly, referencing a split in the witness when non is required?

@Roasbeef
Copy link
Member

Pushed a fix for the added assertion. Also have a fix for the underlying issue as well, PR inc there.

@guggero guggero force-pushed the spend-tx-after-fc branch from 0d783fa to 519a9db Compare August 23, 2024 15:45
@guggero guggero marked this pull request as ready for review August 23, 2024 15:46
@Roasbeef Roasbeef force-pushed the spend-tx-after-fc branch 2 times, most recently from f1491b1 to 4e9fec1 Compare August 23, 2024 23:17
@Roasbeef Roasbeef merged commit 79f7297 into 0-19-staging Aug 24, 2024
12 of 13 checks passed
@guggero guggero deleted the spend-tx-after-fc branch August 25, 2024 06:58
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