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

bitcoind behaviour may cause the corruption of spaces.db #45

Open
Ximik opened this issue Nov 26, 2024 · 0 comments
Open

bitcoind behaviour may cause the corruption of spaces.db #45

Ximik opened this issue Nov 26, 2024 · 0 comments
Milestone

Comments

@Ximik
Copy link
Contributor

Ximik commented Nov 26, 2024

It is hard to reproduce when using the spaces under normal circumstances, but one can reproduce it quite consistently using regtest.

Run bitcoin with some small rpcworkqueue param (for me 5 works the best), run spaces, create a wallet and generate some blocks.

bitcoind -regtest -datadir=bitcoin-regtest/ -rpcworkqueue=5
cargo run --bin spaced -- --chain regtest --bitcoin-rpc-user test --bitcoin-rpc-password test
cargo run --bin space-cli -- --chain regtest createwallet
bitcoin/build/src/bitcoin-cli -regtest -rpcuser=test -rpcpassword=test generatetoaddress 100 bcrt1pmmtxcltp7yq7w0d9sh3gk4xalx43q3tzhrxxyy0lmvul7rhj8hcqm8wc8y

You should have a error as following (generate more blocks if you don't)

ERROR spaced] Protocol sync error: RPC error: Transport: HTTP status server error (503 Service Unavailable) for url (http://127.0.0.1:18443/)

Also sometimes you can also have stack overflow error, but I couldn't reproduce it more than 2 times

thread '<unknown>' has overflowed its stack
fatal runtime error: stack overflow
Aborted

Now repeat it till it breaks

cargo run --bin spaced -- --chain regtest --bitcoin-rpc-user test --bitcoin-rpc-password test
cargo run --bin space-cli -- --chain regtest loadwallet
bitcoin/build/src/bitcoin-cli -regtest -rpcuser=test -rpcpassword=test generatetoaddress 100 bcrt1pmmtxcltp7yq7w0d9sh3gk4xalx43q3tzhrxxyy0lmvul7rhj8hcqm8wc8y

After few repeats you will have a bincode error when trying to load the wallet.

This also sometimes happens with the default rpcworkqueue param and for testnet4 (at least).

@buffrr buffrr added this to the v0.0.6 milestone Dec 4, 2024
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

No branches or pull requests

2 participants