Skip to content

Refactor sync checks #84

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

Merged
merged 3 commits into from
Apr 16, 2025
Merged

Refactor sync checks #84

merged 3 commits into from
Apr 16, 2025

Conversation

buffrr
Copy link
Member

@buffrr buffrr commented Apr 16, 2025

This PR introduces a few improvements to sync checks.

  1. If spaces tip > the rpc endpoint's tip, it waits for the node to sync. This can happen if a user starts spaces but the Bitcoin node is still syncing.
  2. Add progress to getserverinfo and getwalletinfo.
  3. Add --bitcoin-rpc-light option to indicate that we're connecting a light-ish style node.
  4. A few other clean ups

@buffrr buffrr marked this pull request as draft April 16, 2025 16:52
@buffrr buffrr marked this pull request as ready for review April 16, 2025 21:48
@buffrr buffrr merged commit b4ce419 into spacesprotocol:main Apr 16, 2025
1 check passed
@randomlogin
Copy link
Contributor

randomlogin commented Apr 22, 2025

Pulled the new version, got the following problems:

  1. Apparently waiting for a bitcoin node to sync does not cover all possible cases (process exits after the error message).
$ spaced --block-index --chain testnet4 --bitcoin-rpc-user test --bitcoin-rpc-password test 
[2025-04-22T12:29:16Z ERROR spaced] Could not retrieve activation block at height 50000: RPC: -28:Loading block index…
  1. Cannot run on testnet4 properly (I had used completely the same command to start spaced before I pulled the new version and it worked):
$ spaced --block-index --chain testnet4 --bitcoin-rpc-user test --bitcoin-rpc-password test 
[2025-04-22T12:27:18Z INFO  spaces_client::rpc] Listening at 127.0.0.1:7224
[2025-04-22T12:27:18Z INFO  spaces_client::rpc] Listening at [::1]:7224
[2025-04-22T12:27:18Z INFO  spaces_client::sync] Start block=00000000248a42f7934cced05782fc38ffd085f325ab3a06629347280efcd288 height=78804
[2025-04-22T12:27:18Z WARN  spaces_client::source] Invalid chain from connected rpc node - expected test, got testnet4
[2025-04-22T12:27:19Z WARN  spaces_client::source] Invalid chain from connected rpc node - expected test, got testnet4
[2025-04-22T12:27:20Z WARN  spaces_client::source] Invalid chain from connected rpc node - expected test, got testnet4
[2025-04-22T12:27:21Z WARN  spaces_client::source] Invalid chain from connected rpc node - expected test, got testnet4
[2025-04-22T12:27:22Z WARN  spaces_client::source] Invalid chain from connected rpc node - expected test, got testnet4

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.

2 participants