Skip to content

Comments

rework waitsync flag to use the lightclient await_sync method#2146

Merged
zancas merged 2 commits intozingolabs:stablefrom
Oscar-Pepper:zingocli_noninteractive_sync
Feb 23, 2026
Merged

rework waitsync flag to use the lightclient await_sync method#2146
zancas merged 2 commits intozingolabs:stablefrom
Oscar-Pepper:zingocli_noninteractive_sync

Conversation

@Oscar-Pepper
Copy link
Contributor

No description provided.

@Oscar-Pepper Oscar-Pepper marked this pull request as ready for review February 12, 2026 02:08
@Tomas-M
Copy link
Contributor

Tomas-M commented Feb 14, 2026

I tested this patch on top of current sources.
Compilation produces the warning mentioned below. Furthermore, it looks like the intended behavior (waiting for sync and then executing the command) does not work. I tried zingo-cli --waitsync messages, and it produced empty output (the wallet has indeed some messages). The ouput is only

Launching sync task...
Launching save task...
Save task shutdown successfully.
Zingo CLI quit successfully.

(without this patch, the output also includes messages).

Compilation warning is this:

warning: field `params` is never read
   --> zingo-cli/src/lib.rs:275:5
    |
274 | pub struct ConfigTemplate {
    |            -------------- field in this struct
275 |     params: Vec<String>,
    |     ^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

@Tomas-M
Copy link
Contributor

Tomas-M commented Feb 15, 2026

It seems to me that lightclient.await_sync().await probably doesnt work for waitsync, it does not wait if the sync was not started yet (maybe in another thread, start not completed yet? just a guess)

@Oscar-Pepper
Copy link
Contributor Author

I tested this patch on top of current sources. Compilation produces the warning mentioned below. Furthermore, it looks like the intended behavior (waiting for sync and then executing the command) does not work. I tried zingo-cli --waitsync messages, and it produced empty output (the wallet has indeed some messages). The ouput is only

Launching sync task...
Launching save task...
Save task shutdown successfully.
Zingo CLI quit successfully.

(without this patch, the output also includes messages).

Compilation warning is this:

warning: field `params` is never read
   --> zingo-cli/src/lib.rs:275:5
    |
274 | pub struct ConfigTemplate {
    |            -------------- field in this struct
275 |     params: Vec<String>,
    |     ^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

Ok thanks for the info. My testing has not reproduced these issues but I will try to create a reproduction so we can fix this asap

@Oscar-Pepper
Copy link
Contributor Author

It seems to me that lightclient.await_sync().await probably doesnt work for waitsync, it does not wait if the sync was not started yet (maybe in another thread, start not completed yet? just a guess)

For context, the sync handle is given to the LightClient before the .sync() method exits so when .await_sync() is called the handle must already exist. I will look into what might be happening here, there has been some indication there may be a poll_sync() bug that may cause this altough its not clear to me how this could happen. I will give an update soon

@zancas
Copy link
Member

zancas commented Feb 20, 2026

Moving this to draft until we have a solution in progress.

@zancas zancas marked this pull request as draft February 20, 2026 20:52
@zancas
Copy link
Member

zancas commented Feb 20, 2026

There is now a tracking issue for the observed buggy behavior: #2195

@Oscar-Pepper Oscar-Pepper marked this pull request as ready for review February 22, 2026 02:23
@Oscar-Pepper
Copy link
Contributor Author

I have done alot of testing and this code is working as intended AFAIC. one limitation of waitsync is that if a sync error is hit it will call the command on the state of sync at the time of error. maybe this is the issue @Tomas-M is facing? I have left a comment here #2197 (comment). @Tomas-M if you could provide more info that would be great

@Tomas-M
Copy link
Contributor

Tomas-M commented Feb 22, 2026

I tried to reproduce my problem again.
I cloned zingolib repo, switched to "stable" branch, applied this patch and compiled.
Running "zingo-cli --waitsync messages" works fine.
I am not able to reproduce my problem anymore.
It was maybe some error on my side :(

@zancas
Copy link
Member

zancas commented Feb 23, 2026

This is good to know @Tomas-M . Next time you notice any issue, please use the github issue system.

If we can get a shared test-wallet, and reference specific PRs in the issue that will also accelerate bug-fixes.

@zancas zancas merged commit 453f7d4 into zingolabs:stable Feb 23, 2026
34 checks passed
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.

4 participants