mimblewimble / grin

Minimal implementation of the Mimblewimble protocol.
https://grin.mw/
Apache License 2.0
5.04k stars 990 forks source link

Archive node not transferable between Linux and Windows #3701

Open Anynomouss opened 2 years ago

Anynomouss commented 2 years ago

Not sure if I should mark this as a bug or desirable feature, feel free to reclassify. When running running grin on Windows using a copy of the chain-state from a Linux machine (recent dump made by Hendi), I get the following error in the log file:

20220318 21:18:06.651 WARN grin::cmd::server - Starting GRIN in UI mode...
20220318 21:18:06.651 INFO grin_servers::grin::server - Starting server, genesis block: 40adad0aec27
20220318 21:18:06.663 ERROR grin_util::logger - 
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Chain(Error { inner: LmdbErr(Error::Code(112, 'There is not enough space on the disk.
'))

Store Error: LmdbErr(Error::Code(112, 'There is not enough space on the disk.
')), reason: LMDB error: There is not enough space on the disk.
  })': src/bin\cmd\server.rs:65   0: <unknown>

What I think the bug or undesired behavior is about is that a LMDB file, links to src/bin\cmd\server.rs:65. It might be preferred that this link does not exist within the LMDB but in the grin-server.toml so it can be edited or that an command exist to rescan chain data or import chain data for running an archive node.

Anynomouss commented 2 years ago

This issue appears to to be limited to my PC (even though the PC indicated plenty of space was left) and was fixed by choosing another drive to store the chain data. Thx to @deevope for narrowing down the issue, archive node now up and running.

Anynomouss commented 2 years ago

I made a mistake, I initially copied in the old chain data directory, not the new one. So after copying the block data from a Linux archive node in the new chain-data directory I got the same error. Changed log level to "Trace", see below, will continue tomorrow with debugging.

20220321 22:12:25.036 INFO grin_util::logger - log4rs is initialized, file level: Trace, stdout level: Warn, min. level: Trace 20220321 22:12:25.037 INFO grin - Using configuration file at C:\Users\nazon\.grin\main\grin-server.toml 20220321 22:12:25.037 INFO grin - This is Grin version 5.1.2 (git v5.1.2), built for x86_64-pc-windows-msvc by rustc 1.59.0 (9d1b2106e 2022-02-23). 20220321 22:12:25.037 DEBUG grin - Built with profile "release", features "". 20220321 22:12:25.037 INFO grin - Chain: Mainnet 20220321 22:12:25.037 INFO grin - Accept Fee Base: 500000 20220321 22:12:25.037 INFO grin - Future Time Limit: 300 20220321 22:12:25.037 INFO grin - Feature: NRD kernel enabled: false 20220321 22:12:25.037 WARN grin::cmd::server - Starting GRIN in UI mode... 20220321 22:12:25.037 INFO grin_servers::grin::server - Starting server, genesis block: 40adad0aec27 20220321 22:12:25.046 DEBUG grin_store::lmdb - DB Mapsize for D:\Grin_Chain_data\chain_data/lmdb is 549755813888 20220321 22:12:25.047 DEBUG grin_store::leaf_set - bitmap 195976 pos (320000 bytes) 20220321 22:12:26.701 DEBUG grin_store::prune_list - bitmap 531001 pos (783284 bytes), shift_cache 531001, leaf_shift_cache 531001 20220321 22:12:26.702 DEBUG grin_store::leaf_set - bitmap 195976 pos (320000 bytes) 20220321 22:12:28.355 DEBUG grin_store::prune_list - bitmap 531001 pos (783284 bytes), shift_cache 531001, leaf_shift_cache 531001 20220321 22:12:28.379 DEBUG grin_chain::txhashset::bitmap_accumulator - applied 5485 chunks from idx 0 to idx 5484 (23ms) 20220321 22:12:28.423 DEBUG grin_chain::txhashset::txhashset - attempting to open kernel PMMR using ProtocolVersion(2) - FAIL (verify failed) 20220321 22:12:28.456 DEBUG grin_chain::txhashset::txhashset - attempting to open kernel PMMR using ProtocolVersion(1) - SUCCESS 20220321 22:12:28.456 TRACE grin_store::lmdb - DB map size: 549755813888 20220321 22:12:28.456 TRACE grin_store::lmdb - Space used: 7646851072 20220321 22:12:28.456 TRACE grin_store::lmdb - Space remaining: 542108962816 20220321 22:12:28.456 TRACE grin_store::lmdb - Percent used: 0.0139 Percent threshold: 0.9000 20220321 22:12:28.456 TRACE grin_store::lmdb - Resize threshold not met (percent-based) 20220321 22:12:28.457 DEBUG grin_chain::txhashset::txhashset - init_head: header PMMR: current head 0002d0d918fd at pos 3290919 20220321 22:12:28.457 DEBUG grin_chain::txhashset::txhashset - init_head: header PMMR: resetting to 0002d0d918fd at pos 3290919 (height 1645464) 20220321 22:12:28.457 DEBUG grin_chain::txhashset::txhashset - Rewind header extension to 0002d0d918fd at 1645464 from 0002d0d918fd at 1645464 20220321 22:12:28.485 TRACE grin_chain::txhashset::txhashset - Starting new txhashset extension. 20220321 22:12:28.487 DEBUG grin_chain::txhashset::txhashset - Rewind header extension to 0002d0d918fd at 1645464 from 0002d0d918fd at 1645464 20220321 22:12:28.487 DEBUG grin_chain::txhashset::txhashset - Rewind extension to 0002d0d918fd at 1645464 from 0002d0d918fd at 1645464 20220321 22:12:28.488 DEBUG grin_chain::txhashset::bitmap_accumulator - applied 1 chunks from idx 5484 to idx 5484 (1ms) 20220321 22:12:28.488 DEBUG grin_chain::types - validate roots: 0002d0d918fd at 1645464, 8254fbaab19c vs. 8254fbaab19c (original: a2b61f98eb5a, merged: 8254fbaab19c) 20220321 22:12:28.489 DEBUG grin_chain::chain - init: rewinding and validating before we start... 0002d0d918fd at 1645464 20220321 22:12:28.490 TRACE grin_chain::txhashset::txhashset - Committing txhashset extension. sizes (11231724, 11231724, 6818490) 20220321 22:12:28.619 TRACE grin_chain::txhashset::txhashset - TxHashSet extension done. 20220321 22:12:28.619 TRACE grin_store::lmdb - DB map size: 549755813888 20220321 22:12:28.619 TRACE grin_store::lmdb - Space used: 7646851072 20220321 22:12:28.619 TRACE grin_store::lmdb - Space remaining: 542108962816 20220321 22:12:28.619 TRACE grin_store::lmdb - Percent used: 0.0139 Percent threshold: 0.9000 20220321 22:12:28.619 TRACE grin_store::lmdb - Resize threshold not met (percent-based) 20220321 22:12:28.992 DEBUG grin_chain::txhashset::txhashset - init_output_pos_index: removed 0 stale index entries 20220321 22:12:29.188 DEBUG grin_chain::txhashset::txhashset - init_output_pos_index: 195976 utxos 20220321 22:12:29.320 DEBUG grin_chain::txhashset::txhashset - init_output_pos_index: 0 utxos with missing index entries 20220321 22:12:29.321 DEBUG grin_chain::chain - head: 1901428121742375 @ 1645464 [0002d0d918fd] 20220321 22:12:29.321 DEBUG grin_chain::chain - header_head: 1901428121742375 @ 1645464 [0002d0d918fd] 20220321 22:12:29.321 DEBUG grin_servers::grin::server - Capabilities: HEADER_HIST | TXHASHSET_HIST | PEER_LIST | TX_KERNEL_HASH | PIBD_HIST | BLOCK_HIST 20220321 22:12:29.339 ERROR grin_util::logger - thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: P2P(Store(LmdbErr(Error::Code(112, 'There is not enough space on the disk. '))))': src/bin\cmd\server.rs:65 0: <unknown> 1: <unknown> 2: <unknown> 3: <unknown> 4: <unknown> 5: <unknown> 6: <unknown> 7: <unknown> 8: <unknown> 9: <unknown> 10: <unknown> 11: <unknown> 12: <unknown> 13: <unknown> 14: <unknown> 15: <unknown> 16: <unknown> 17: <unknown> 18: BaseThreadInitThunk 19: RtlUserThreadStart

Anynomouss commented 2 years ago

See above, tried running with 5.1.1, now also resulting in Panic. The space remaining, is this supposed to be my HD? Because, it reports Space remaining: 542108962816 (assuming these are bits, that would be 64 GB), but in reality I have 500 GB space left. My guess is there is some kind of problem or conversion issue, e.g. reported space is in bytes and not bits, so a factor 8 of (still would actually fit on my HD), or some other problem with asking the system how much space is left.