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

calling Daemon::list_history_txs(_,_, u64::MAX) panic #1495

Open
pythcoiner opened this issue Dec 10, 2024 · 1 comment
Open

calling Daemon::list_history_txs(_,_, u64::MAX) panic #1495

pythcoiner opened this issue Dec 10, 2024 · 1 comment
Labels
Daemon / Liana library This is about lianad or the liana library (not the GUI) Robustness Something could be made les brittle

Comments

@pythcoiner
Copy link
Collaborator

pythcoiner commented Dec 10, 2024

calling list_history_txs(_, _, u64::MAX) panic:

  2024-12-10T03:54:29.496676Z ERROR lianad:57: panic occurred at line 710 of file lianad/src/database/sqli
te/mod.rs: Some("Db must not fail: ToSqlConversionFailure(TryFromIntError(()))")
   0: lianad::setup_panic_hook::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::begin_panic_handler::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::result::unwrap_failed
   7: <lianad::database::sqlite::SqliteConn as lianad::database::DatabaseConnection>::list_txids
   8: lianad::commands::<impl lianad::DaemonControl>::list_confirmed_transactions
   9: <liana_gui::daemon::embedded::EmbeddedDaemon as liana_gui::daemon::Daemon>::list_confirmed_txs::{{cl
osure}}
  10: liana_gui::daemon::Daemon::list_history_txs::{{closure}}
  11: liana_gui::app::export::ExportState::start::{{closure}}::{{closure}}
  12: tokio::runtime::task::core::Core<T,S>::poll
  13: tokio::runtime::task::raw::poll
  14: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  15: tokio::runtime::scheduler::multi_thread::worker::Context::run
  16: tokio::runtime::context::runtime::enter_runtime
  17: tokio::runtime::scheduler::multi_thread::worker::run
  18: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  19: tokio::runtime::task::core::Core<T,S>::poll
  20: tokio::runtime::task::raw::poll
  21: tokio::runtime::blocking::pool::Inner::run
  22: std::sys_common::backtrace::__rust_begin_short_backtrace
  23: core::ops::function::FnOnce::call_once{{vtable.shim}}
  24: std::sys::pal::unix::thread::Thread::new::thread_start
  25: <unknown>
  26: <unknown>

it seems it's related to this part of the query

maybe SqliteConn::db_list_txids() limit arg and Daemon::list_history_txs() limit arg should be u32 instead u64?

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Jan 2, 2025

Based on the integer data types used by SQLite, I think the biggest value that could be used for the LIMIT is i64::MAX , so I guess we could use i64, or otherwise u32 should be enough.

This change will need to be made to the list_confirmed_transactions command and all downstream functions updated.

@nondiremanuel nondiremanuel added Daemon / Liana library This is about lianad or the liana library (not the GUI) Robustness Something could be made les brittle labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daemon / Liana library This is about lianad or the liana library (not the GUI) Robustness Something could be made les brittle
Projects
None yet
Development

No branches or pull requests

3 participants