ordinals / ord

👁‍🗨 Rare and exotic sats
https://ordinals.com
Creative Commons Zero v1.0 Universal
3.85k stars 1.38k forks source link

`ord env`: RpcError code -4 "Wallet is currently rescanning" in Windows #4057

Open cryptoni9n opened 1 week ago

cryptoni9n commented 1 week ago

I have been able to recreate this issue in many different versioned builds of ord for Windows x86. I am not certain if this is a bug or if I'm just doing something incorrectly, so I'm creating this issue to ask the Window's users of ord to try and recreate this issue.

Steps to replicate:

1) in your Windows installation of ord, run ord env - this is ord's built-in regtest environment that will spin up a bitcoind regtest instance, a test instance of ord, create a wallet and mine a bunch of blocks.

2) it will take a minute or so to finish and display the following when it starts listening:

`ord` server URL:
http://127.0.0.1:9001
Example `bitcoin-cli` command:
bitcoin-cli -datadir=env getblockchaininfo
Example `ord` command:
F:\Bitcoin\ord_repo\ord\target\release\ord.exe --datadir env wallet balance

3) in a new cmd window, try running the test command that is printed above: ord.exe --datadir env wallet balance - it should show this:

{
  "cardinal": 500000000000,
  "ordinal": 0,
  "runes": {},
  "runic": 0,
  "total": 500000000000
}

4) next, try to inscribe to the regtest chain by running something like: ord --datadir env wallet inscribe --fee-rate 3 --postage 600sats --file "F:\Bitcoin\ord_repo\ord\target\release\test.txt"

Please respond with your test results in this thread and detail the version you tested with, and what the response to the command in step 4 was. If you get an error, please continue on to step 5

here is the error that I receive:

error: JSON-RPC error: RPC error response: RpcError { code: -4, message: "Wallet is currently rescanning. Abort existing rescan or wait.", data: None }

Further testing:

5) Try CTRL-C'ing your ord env instance, and then restart it, then try step 3 again. I receive this result:

{
  "cardinal": 0,
  "ordinal": 0,
  "runes": {},
  "runic": 0,
  "total": 0
}

6) Now, try to inscribe a test file by doing step 4 again. I get this error: error: wallet contains no cardinal utxos

Please respond in this issue with your test results and version, and if your results differ from mine

thanks!

cryptoni9n commented 1 day ago

also able to reproduce in 0.21.3. Error with dump below:


F:\Bitcoin\ord_repo\ord\target\release>ord --data-dir env wallet inscribe --fee-rate 5 --file "F:\Bitcoin\ord_repo\ord\target\release\acq 01_sm.avif"
error: JSON-RPC error: RPC error response: RpcError { code: -4, message: "Wallet is currently rescanning. Abort existing rescan or wait.", data: None }
   0: std::backtrace_rs::backtrace::dbghelp64::trace
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
   1: std::backtrace_rs::backtrace::trace_unsynchronized
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2: std::backtrace::Backtrace::create
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\backtrace.rs:331
   3: std::backtrace::Backtrace::capture
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\backtrace.rs:296
   4: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
   5: ord::subcommand::wallet::WalletCommand::run
   6: ord::subcommand::wallet::WalletCommand::run
   7: ord::subcommand::traits::Traits::run
   8: ord::subcommand::wallet::WalletCommand::run
   9: ord::subcommand::Subcommand::run
  10: ord::arguments::Arguments::run
  11: ord::main
  12: __ImageBase
  13: __ImageBase
  14: std::rt::lang_start_internal::closure$2
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\rt.rs:143
  15: std::panicking::try::do_call
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\panicking.rs:554
  16: std::panicking::try
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\panicking.rs:518
  17: std::panic::catch_unwind
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\panic.rs:345
  18: std::rt::lang_start_internal
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14\library/std\src\rt.rs:143
  19: main
  20: invoke_main
             at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  21: __scrt_common_main_seh
             at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  22: BaseThreadInitThunk
  23: RtlUserThreadStart