forked from near/nearcore
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
State-viewer uses read-only RocksDB (near#6294)
Fix near#5194 Tested by running 1.21, 1.22, 1.23, 1.24 and 1.25 versions in localnet and attempting to dump their state. In my localnet tests state viewer was able to open an instance locked by another process. Don't know if it works in the general case. Running multiple state viewers should be totally safe though if the instance is not locked. Without this change, attempting to dump state can add a column (col49) which makes it impossible to dump state with state-viewer of the corresponding version. With this change, state-viewer panics earlier and state-viewer of the corresponding version remains able to dump state: ``` Tue 14:17:50 ~/code/nearcore-rocksdb18-2 % RUST_BACKTRACE=all ./target/release/neard --home ~/.near/localnet/node0/ view_state dump_state thread 'main' panicked at 'Failed to start Epoch Manager: IOErr(Unexpected length of input)', nearcore/src/runtime/mod.rs:198:18 stack backtrace: 0: rust_begin_unwind at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5 1: core::panicking::panic_fmt at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14 2: core::result::unwrap_failed at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/result.rs:1613:5 3: nearcore::runtime::NightshadeRuntime::new 4: nearcore::runtime::NightshadeRuntime::with_config 5: state_viewer::commands::load_trie_stop_at_height 6: state_viewer::commands::dump_state 7: state_viewer::cli::StateViewerSubCommand::run 8: neard::cli::NeardCmd::parse_and_run note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```
- Loading branch information
Showing
4 changed files
with
28 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters