drift-labs / gateway

Self hosted API gateway to easily interact with Drift V2 Protocol
Apache License 2.0
22 stars 12 forks source link

GetMultipleAccounts error with QuickNode #52

Closed dzovani closed 1 month ago

dzovani commented 6 months ago
thread 'main' panicked at src/controller.rs:100:14:
ok: Rpc(ClientError { request: Some(GetMultipleAccounts), kind: Reqwest(reqwest::Error { kind: Decode, source: Error("EOF while parsing a string", line: 1, column: 24505) }) })
stack backtrace:
   0:     0x55deb6a25c36 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x55deb6a25c36 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55deb6a25c36 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x55deb6a25c36 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb235daedd7c6190
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55deb6a4ff80 - core::fmt::rt::Argument::fmt::h76c38a80d925a410
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:     0x55deb6a4ff80 - core::fmt::write::h3ed6aeaa977c8e45
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6:     0x55deb6a22def - std::io::Write::write_fmt::h78b18af5775fedb5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
   7:     0x55deb6a25a14 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x55deb6a25a14 - std::sys_common::backtrace::print::h85035a511aafe7a8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x55deb6a27297 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25
  10:     0x55deb6a26ff9 - std::panicking::default_hook::hf5fcb0f213fe709a
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
  11:     0x55deb6a27728 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
  12:     0x55deb6a27602 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
  13:     0x55deb6a26136 - std::sys_common::backtrace::__rust_end_short_backtrace::h9259bc2ff8fd0f76
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x55deb6a27360 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  15:     0x55deb626a095 - core::panicking::panic_fmt::h784f20a50eaab275
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  16:     0x55deb626a5e3 - core::result::unwrap_failed::h03d8a5018196e1cd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
  17:     0x55deb63a570f - drift_gateway::main::{{closure}}::h9bc2c505a08d624b
  18:     0x55deb639f258 - <tokio::task::local::RunUntil<T> as core::future::future::Future>::poll::h64a1c82c4fa6c6c3
  19:     0x55deb639e737 - <core::pin::Pin<P> as core::future::future::Future>::poll::h0f77a58f61414ea3
  20:     0x55deb643846c - tokio::runtime::scheduler::current_thread::Context::enter::h36a737c5081b8894
  21:     0x55deb63bab27 - tokio::runtime::context::scoped::Scoped<T>::set::h8fb2b7e5dcc53ed6
  22:     0x55deb639c600 - tokio::runtime::context::set_scheduler::h355332da3783f5e3
  23:     0x55deb6438795 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::h22e8e8b098cc211c
  24:     0x55deb639ca74 - tokio::runtime::context::runtime::enter_runtime::he16fcd8b99a0139c
  25:     0x55deb639cd9c - tokio::runtime::runtime::Runtime::block_on::h3cbff37105c205a6
  26:     0x55deb633e0d4 - drift_gateway::main::h952b370cbe612eaa
  27:     0x55deb638edb3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdae3cd6c64b311e7
  28:     0x55deb63fcdcd - std::rt::lang_start::{{closure}}::h085cf4426d695253
  29:     0x55deb6a1c0b1 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h37600b1e5eea4ecd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
  30:     0x55deb6a1c0b1 - std::panicking::try::do_call::hb4bda49fa13a0c2b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  31:     0x55deb6a1c0b1 - std::panicking::try::h8bbf75149211aaaa
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  32:     0x55deb6a1c0b1 - std::panic::catch_unwind::h8c78ec68ebea34cb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  33:     0x55deb6a1c0b1 - std::rt::lang_start_internal::{{closure}}::hffdf44a19fd9e220
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
  34:     0x55deb6a1c0b1 - std::panicking::try::do_call::hcb3194972c74716d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  35:     0x55deb6a1c0b1 - std::panicking::try::hcdc6892c5f0dba4c
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  36:     0x55deb6a1c0b1 - std::panic::catch_unwind::h4910beb4573f4776
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  37:     0x55deb6a1c0b1 - std::rt::lang_start_internal::h6939038e2873596b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
  38:     0x55deb633e3e5 - main
  39:     0x7fb653df0d90 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  40:     0x7fb653df0e40 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  41:     0x55deb626a8e5 - _start
  42:                0x0 - <unknown>
jordy25519 commented 6 months ago

Is this using a 3rd party RPC provider? using the free / api.mainnet-beta.solana.com endpoint can cause this issue because it doesn't support the getProgramAccounts endpoint

dzovani commented 6 months ago

i use quicknode,payed subscription

jordy25519 commented 6 months ago

I can reproduce this issue with quicknode, seems like they place some limitations on the getMultipleAccounts RPC which drift SDK uses. The simplest short term solution is to try with a different RPC provider

jordy25519 commented 1 month ago

solved in #80