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

feat(utxo): prioritize electrum connections #1966

Merged
merged 206 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
bd00a99
stash
rozhkovdmitrii Aug 26, 2023
a31179a
stash
Aug 29, 2023
da4e5f9
save state of being able to be compiled
Sep 4, 2023
38e3cc4
save state
Sep 7, 2023
50c8052
introduce conn_mng guarded state
Sep 8, 2023
4ba4a1a
stash
Sep 10, 2023
9466e53
get rid of warnings
Sep 11, 2023
ae5ed65
pushing secondary connection is implemented
Sep 21, 2023
c1bffff
move connect_to
Sep 21, 2023
03af8ce
Conn manager works as it was supposed
Sep 21, 2023
b31a9ff
refactor: get `get_conn` and `get_conn_by_address` apart
Sep 21, 2023
f325ebf
refactor: electrum_request_multi rolled back
Sep 21, 2023
39a7475
feat: introduce conn_mng_policy and start moving parts into the files…
Sep 22, 2023
0e612bb
feat: started to implement multiple_conn_mng based on dev branch
Sep 22, 2023
d5fa172
feat: stash
Sep 25, 2023
e7a10f0
feat: multiple conn mng has been simplified
Sep 25, 2023
cfbeea0
doc: get rid of typo
Sep 27, 2023
99408ce
refactor: Bring Priority enum into mm2_rpc::rpc_data
Sep 27, 2023
de14a3f
feat: Provide setting conn_mng_policy during config initialization us…
Sep 27, 2023
8363353
refactor: Prefer &str in some places
Sep 27, 2023
04eae35
feat: implement rotate_servers for conn_mng_multiple
Sep 27, 2023
48d507c
get rid of redundant trace
Sep 27, 2023
a193f5d
revert doc comment
Sep 27, 2023
7b98067
revert commenting
Sep 27, 2023
3663716
process creating subsystem errors
Sep 27, 2023
7f10b19
Merge branch 'dev' into 1520-prioritize-nodes
Sep 28, 2023
4c1a577
commit working state
Sep 28, 2023
da4d58d
make wasm version working
Sep 29, 2023
5686619
Get rid of some warnings
Sep 29, 2023
3534ddb
Renaming
Sep 29, 2023
d98521f
refactor: implement `duplicate_suspend_timeout` and `reset_supend_tim…
Oct 1, 2023
9031c9f
fix: getting of connecting state
Oct 1, 2023
fa25b6f
refactor: spit and polish
Oct 1, 2023
6500dbd
refactor: get_conn_ctx and get_conn_ctx_mut for the selective con_mng
Oct 1, 2023
41c1872
refactor: bring ConnMngTrait into separate file
Oct 1, 2023
22116e1
refactor: introduce ConnMngError
Oct 1, 2023
0d09323
refactor: rollback some changes
Oct 3, 2023
9d045ef
refactor: rollback some changes
Oct 3, 2023
4fce08b
Revert "refactor: rollback some changes"
Oct 3, 2023
95bf9fa
refactor: rollback some changes
Oct 3, 2023
2373174
refactor: rollback some changes
Oct 3, 2023
9608966
refactor: spit and polish
Oct 3, 2023
d05347d
refactor: spit and polish
Oct 3, 2023
291d901
refactor: spit and polish
Oct 3, 2023
5e51798
refactor: spit and polish
Oct 3, 2023
5b23e37
refactor: spit and polish
Oct 3, 2023
eb82125
refactor: spit and polish
Oct 3, 2023
3e98a42
refactor: spit and polish
Oct 3, 2023
5663668
refactor: spit and polish
Oct 3, 2023
79e6850
refactor: spit and polish
Oct 3, 2023
0e10bcb
refactor: spit and polish
Oct 3, 2023
6f96d6e
Merge branch 'dev' into 1520-prioritize-nodes
borngraced Jan 30, 2024
c630ee0
fix merge conflicts
borngraced Jan 30, 2024
71d9664
fix wasm clippy warnings
borngraced Jan 30, 2024
b2434da
rename conn_mng -> connection_manager
borngraced Jan 30, 2024
935bee5
merge ConnectionManagerSelectiveQueue with ConnectionManagerSelective…
borngraced Jan 31, 2024
2097e53
manage sending multiple sub requests for same scripthash and other fi…
borngraced Feb 6, 2024
0ed6c3a
Merge remote-tracking branch 'origin/dev' into 1520-prioritize-nodes
borngraced Feb 12, 2024
e6585ee
fix merge conflicts
borngraced Feb 12, 2024
9cc0378
fix review notes and improvements
borngraced Feb 15, 2024
0e59572
rename guarded to state_guard and move connect impl to impl trait for…
borngraced Feb 15, 2024
e6f2ba3
move get_connection_ctx_mut and get_connection_ctx to ConnectionManag…
borngraced Feb 15, 2024
5eede71
move ElectrumConnCtx to rpc_clients::connection_manager_common and co…
borngraced Feb 16, 2024
350a992
merge get_suspend_timeout and duplicate_suspend_timeout and other ver…
borngraced Feb 16, 2024
2d24da3
connection is_connected is properly checked for selective
borngraced Feb 16, 2024
7b7110d
move state related/only method to it's impl
borngraced Feb 16, 2024
10ff5c8
revert is_connected impl for multiple
borngraced Feb 16, 2024
ef6ff41
handle error in ConnectionManagerMultipleImpl
borngraced Feb 16, 2024
f87278d
Refactor ConnectionManagerMultiple & ConnectionManagerSelective
mariocynicys Feb 15, 2024
61af931
fix merge conflicts
borngraced Mar 22, 2024
a1d0a9a
set the state as running when we start executing the future
mariocynicys Apr 17, 2024
ebb5394
this type annotation isn't needed
mariocynicys Apr 17, 2024
9bed9d1
remove deadcode
mariocynicys Apr 17, 2024
5666936
stashing
mariocynicys Apr 18, 2024
426037c
stashing
mariocynicys Apr 19, 2024
94a90aa
stashing
mariocynicys Apr 21, 2024
20c70bf
pushing working tree for starter review - still messy tho
mariocynicys Apr 22, 2024
0471735
stashing
mariocynicys Apr 30, 2024
bf3781f
stashing
mariocynicys May 5, 2024
2129a8f
compiles for linux targets only
mariocynicys May 5, 2024
dafff72
atomically start connections
mariocynicys May 13, 2024
a9a56fe
fix wasm build
mariocynicys May 13, 2024
7cffd67
some lint fixes and formatting
mariocynicys May 13, 2024
1b49971
add back scripthash notification sender since it's used to send Subsc…
mariocynicys May 13, 2024
af03de3
multiple connection manager
mariocynicys May 17, 2024
b296728
record a fixme
mariocynicys May 17, 2024
5a06371
fix lint issues
mariocynicys May 20, 2024
85c3609
abort all jobs in the queue but keep it intact
mariocynicys May 22, 2024
c2f4488
add get_all_server_addresses method to connection manager trait
mariocynicys May 22, 2024
dd7cb96
fix: reuse type def - RpcTransportEventHandler
mariocynicys May 22, 2024
6bb5e4f
fix: get rid of useless async closure
mariocynicys May 22, 2024
2d72df4
add fixme: reminder to fire a ping loop to keep connections alive
mariocynicys May 22, 2024
d31f648
fix: send ping requests to all the active servers
mariocynicys May 22, 2024
d8c11b9
fix: add a pinging loop and manage it from the connection manager
mariocynicys May 22, 2024
5f91ca5
store next suspend time in terms of seconds and not milliseconds
mariocynicys May 22, 2024
518819b
bound establish_connecion_loop method with a timeout
mariocynicys May 23, 2024
2be78df
refactor constant names
mariocynicys May 23, 2024
dfc4bc7
discuss -> fixme, to better find problems in the PR
mariocynicys May 23, 2024
769304b
complete the selective connection manager, fixmes left
mariocynicys May 29, 2024
dc47f67
fix some bugs and fixmes
mariocynicys May 30, 2024
cce2ec4
temp fix: leak the abortable system to keep its children systems alive
mariocynicys May 30, 2024
4c76491
remove panic
mariocynicys May 30, 2024
ed6801d
wait till one of the electrum server connects
mariocynicys May 30, 2024
3d9680a
don't query for the version again
mariocynicys May 31, 2024
229a809
don't create an extra child subsystem, use the parent directly
mariocynicys May 31, 2024
1e0e162
wait till one of the electrum server connects, applied while initiali…
mariocynicys May 31, 2024
8d9ac1c
set the test timeout back to 120s
mariocynicys May 31, 2024
4c8d834
get rid of debuging printlns
mariocynicys May 31, 2024
732e00e
fix wasm issues
mariocynicys Jun 2, 2024
3185860
merge with origin/dev
mariocynicys Jun 3, 2024
ffa086d
fix adex-cli compilation issue
mariocynicys Jun 3, 2024
d908ec6
fix wrong electrum script hash calculation
mariocynicys Jun 4, 2024
eddb9ee
adapt test_unavailable_electrum_proto_version to the new design
mariocynicys Jun 4, 2024
c4592fc
fmt
mariocynicys Jun 4, 2024
f7297b5
implement common trait methods for duplicated impls
mariocynicys Jun 14, 2024
84fc19d
also generalize add_subscriptions method
mariocynicys Jun 14, 2024
76b2f68
fix wasm tests: use wasm's `now_ms` func & don't mutate the original …
mariocynicys Jun 23, 2024
ef4f458
add doc comments for the configuration types
mariocynicys Jun 28, 2024
a447eff
use hashset instead of vec for the subs list
mariocynicys Jun 28, 2024
0103f0b
package `disconnected_at` and `next_suspend_time` in one mutex
mariocynicys Jun 28, 2024
6dab399
don't collect connections list to avoid unnecessary allocations
mariocynicys Jun 28, 2024
d81bd8b
move priority next to electrum stuff :/
mariocynicys Jun 28, 2024
8ae8d02
play safe: call abort on the previous system only after the new system
mariocynicys Jun 28, 2024
220d70b
use mem::take instead of mem::replace + default
mariocynicys Jun 28, 2024
54acd8e
remove fixmes
mariocynicys Jun 28, 2024
d9549ab
connection context: use atomics for u64 feilds
mariocynicys Jul 1, 2024
260192e
adex cli: use closer versions in cargo toml
mariocynicys Jul 1, 2024
5b92281
remove irrelevant comment
mariocynicys Jul 1, 2024
0eedd97
don't convert to json back and forth in wasm
mariocynicys Jul 1, 2024
0395e2c
merge with origin/dev
mariocynicys Jul 1, 2024
8513b37
decide the connection manager policy per coin in the electrum request
mariocynicys Jul 29, 2024
62993a0
merge with origin/dev
mariocynicys Aug 13, 2024
33075e9
retry connections in parallel in selective mode
mariocynicys Aug 14, 2024
064a12d
make sure we don't stuck in the case where all connections are suspended
mariocynicys Aug 14, 2024
ae04b68
add important note
mariocynicys Aug 14, 2024
bf01ba0
add more robustness to `get_active_connections`
mariocynicys Aug 14, 2024
21b0799
endlessly try `electrum_request_multi`
mariocynicys Aug 15, 2024
22fb7ff
only try endlessly on non-test env
mariocynicys Aug 15, 2024
484143a
cfg! is better structured than #[cfg]
mariocynicys Aug 15, 2024
6d71546
trigger disconnecting a connection if it errored
mariocynicys Aug 29, 2024
6c48485
fix: resolve a couple of fixmes optimisitcally
mariocynicys Aug 29, 2024
4b2464c
refactor: replace multiple & selective manager with one more dynamic …
mariocynicys Sep 2, 2024
1a0058c
some macros to simplify if-let & let-else patterns
mariocynicys Sep 2, 2024
7a458e3
only aquire write lock when needed
mariocynicys Sep 2, 2024
ced724b
try connections sequentially on the background task
mariocynicys Sep 2, 2024
21fda09
remove trigger_disconnect
mariocynicys Sep 2, 2024
09f34ca
resolve fixme: version negotiation logic is correct
mariocynicys Sep 3, 2024
7e5e8dd
introduce a connection establishment synchronizer
mariocynicys Sep 3, 2024
4809812
simplify timeouting with a new macro
mariocynicys Sep 3, 2024
f836f04
revert to trying connections in parallel in background task (to some …
mariocynicys Sep 3, 2024
678601f
clean up unused methods, structs, fields
mariocynicys Sep 3, 2024
a6e8d69
merge with origin/dev
mariocynicys Sep 3, 2024
6945ad1
fix the qrc20 issue on CI
mariocynicys Sep 3, 2024
48f5ddd
fix adex-cli compilation (removing traces of conn_manager_policy)
mariocynicys Sep 4, 2024
62d26c7
refactor expirable map
mariocynicys Sep 4, 2024
4a16d78
let the responses map in eletrum connections be expriable
mariocynicys Sep 4, 2024
ea0cbe3
make wait_till_connected test-only
mariocynicys Sep 4, 2024
c37cc9b
split the connection manager into multiple impl blocks
mariocynicys Sep 4, 2024
8fd92df
let connections map inside the manager be dynaimc
mariocynicys Sep 4, 2024
122cf7d
not important; organization
mariocynicys Sep 4, 2024
bf3608d
resolve the last fixmes
mariocynicys Sep 4, 2024
3fb958b
simplfying establish_connection_loop method as much as possible
mariocynicys Sep 5, 2024
69db230
don't retry forever, and also try all connections when the active one…
mariocynicys Sep 10, 2024
eead6a8
properly respect the max_connected threshold
mariocynicys Sep 10, 2024
ffd2052
suggestion from omar - 1
mariocynicys Sep 12, 2024
f9866b1
suggestion from omar - 2 - (un)maintain methods
mariocynicys Sep 12, 2024
d98fd21
testing if this would fix tests
mariocynicys Sep 12, 2024
ff8833a
Revert "testing if this would fix tests"
mariocynicys Sep 15, 2024
df2fdcc
bug: don't disconnect the connection we want to connect while version…
mariocynicys Sep 16, 2024
0971d9c
don't disconnect immediately
mariocynicys Sep 18, 2024
fe90391
abandon the wait_till_connected test-only method
mariocynicys Sep 18, 2024
69a6810
fix test_electrum_rpc_client_error
mariocynicys Sep 18, 2024
9bda46b
fix: flaky test_unavailable_electrum_proto_version
mariocynicys Sep 19, 2024
2c61c61
yield in both test and non-test environment
mariocynicys Sep 24, 2024
25b174a
suggestions from omar: don't send to all
mariocynicys Sep 24, 2024
b546bbd
merge with origin/dev
mariocynicys Sep 24, 2024
49564b3
add a todo regarding abortablequeue abort vs finish
mariocynicys Sep 24, 2024
4c2a5e0
patch on_future_finished to not mark id as finished if it was aborted
mariocynicys Sep 24, 2024
2f9c568
add a todo
mariocynicys Sep 26, 2024
417d054
fix test_one_unavailable_electrum_proto_version
mariocynicys Oct 3, 2024
b791204
review(omar): let version mismatch be an irrecoverable error
mariocynicys Oct 3, 2024
989ec9e
review(omar): use simpiler method args
mariocynicys Oct 4, 2024
e0e7708
simplyfy timeouting - handle timeout in establish_connection_loop only
mariocynicys Oct 4, 2024
db93005
simplify erroring: handle disconnection in establish_connection_loop …
mariocynicys Oct 4, 2024
d2906ff
fix: electrum server labels as irrecoverable when DNS is down
mariocynicys Oct 4, 2024
1e92dfd
review(omar): don't provide a defualt impl for event handler trait
mariocynicys Oct 4, 2024
fc3f172
actually validate min & max connected
mariocynicys Oct 4, 2024
dc8a84e
merge with origin/dev
mariocynicys Oct 4, 2024
c93bcb9
add clear() back to expirable map
mariocynicys Oct 4, 2024
be219ee
reduce the btree key of json bach request to its hash
mariocynicys Oct 4, 2024
556b65f
use a deterministically-selected rpc_id from the batch
mariocynicys Oct 4, 2024
72b3ab9
don't overwrite connection data that's already set
mariocynicys Oct 7, 2024
ee7f6a4
omit unnecessary json conversion
mariocynicys Oct 7, 2024
e99fd25
label version mismatch only when the electrum server replys
mariocynicys Oct 7, 2024
a2e4348
add coin name in error logs
mariocynicys Oct 7, 2024
decacb8
to revert: try to deser the electrum response as json and log it
mariocynicys Oct 7, 2024
89bad4f
disable the coin if the balance query fails
mariocynicys Oct 7, 2024
5e38086
run rpc futures in a tokio thread till completion
mariocynicys Oct 8, 2024
643d1f3
reduce the default connection establishment timeout to 20s
mariocynicys Oct 9, 2024
2060704
cap the electrum request to 5s
mariocynicys Oct 9, 2024
d5b2ef3
mitigate the noisy logs from the endless retries
mariocynicys Oct 10, 2024
00b71c3
Revert "to revert: try to deser the electrum response as json and log…
mariocynicys Oct 10, 2024
cae9842
convert async mutexs to sync ones
mariocynicys Oct 16, 2024
596cba0
parallelize the request when all connections fail
mariocynicys Oct 16, 2024
2457b96
review(sami): let max & min connected be usize
mariocynicys Oct 18, 2024
24a64e3
review(sami): split up the background_task of the connection manager
mariocynicys Oct 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 17 additions & 44 deletions mm2src/adex_cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions mm2src/adex_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,33 @@ description = "Provides a CLI interface and facilitates interoperating to komodo
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
anyhow = { version = "=1.0.42", features = ["std"] }
async-trait = "=0.1.52"
anyhow = { version = "1.0", features = ["std"] }
async-trait = "0.1"
clap = { version = "4.2", features = ["derive"] }
common = { path = "../common" }
derive_more = "0.99"
directories = "5.0"
env_logger = "0.7.1"
env_logger = "0.9.3"
http = "0.2"
hyper = { version = "0.14.26", features = ["client", "http2", "tcp"] }
hyper-rustls = "0.24.0"
gstuff = { version = "=0.7.4" , features = [ "nightly" ]}
hyper-rustls = "0.24"
gstuff = { version = "0.7" , features = [ "nightly" ]}
inquire = "0.6"
itertools = "0.10"
log = "0.4.21"
mm2_net = { path = "../mm2_net" }
mm2_number = { path = "../mm2_number" }
mm2_rpc = { path = "../mm2_rpc"}
mm2_core = { path = "../mm2_core" }
passwords = "3.1"
rpc = { path = "../mm2_bitcoin/rpc" }
rustls = { version = "0.21", features = [ "dangerous_configuration" ] }
serde = "1.0"
serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
sysinfo = "0.28"
tiny-bip39 = "0.8.0"
tokio = { version = "=1.25.0", features = [ "macros" ] }
uuid = { version = "=1.2.2", features = ["fast-rng", "serde", "v4"] }
tokio = { version = "1.20.0", features = [ "macros" ] }
uuid = { version = "1.2.2", features = ["fast-rng", "serde", "v4"] }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.3", features = ["processthreadsapi", "winnt"] }
4 changes: 2 additions & 2 deletions mm2src/adex_cli/src/adex_proc/adex_proc_impl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{anyhow, bail, Result};
use log::{error, info, warn};
use log::{debug, error, info, warn};
use mm2_rpc::data::legacy::{BalanceResponse, CoinInitResponse, GetEnabledResponse, Mm2RpcResult, MmVersionResponse,
OrderbookRequest, OrderbookResponse, SellBuyRequest, SellBuyResponse, Status};
use serde_json::{json, Value as Json};
Expand Down Expand Up @@ -38,7 +38,7 @@ impl<T: Transport, P: ResponseHandler, C: AdexConfig + 'static> AdexProc<'_, '_,

let activation_scheme = get_activation_scheme()?;
let activation_method = activation_scheme.get_activation_method(asset)?;

debug!("Got activation scheme for the coin: {}, {:?}", asset, activation_method);
let enable = Command::builder()
.flatten_data(activation_method)
.userpass(self.get_rpc_password()?)
Expand Down
5 changes: 5 additions & 0 deletions mm2src/adex_cli/src/rpc_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ pub(crate) struct ElectrumRequest {
#[serde(skip_serializing_if = "Vec::is_empty")]
pub(super) servers: Vec<Server>,
#[serde(skip_serializing_if = "Option::is_none")]
min_connected: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
max_connected: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
mm2: Option<u8>,
#[serde(default)]
tx_history: bool,
Expand All @@ -62,4 +66,5 @@ pub(super) struct Server {
protocol: ElectrumProtocol,
#[serde(default)]
disable_cert_verification: bool,
pub timeout_sec: Option<u64>,
}
22 changes: 11 additions & 11 deletions mm2src/coins/eth/web3_transport/http_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ async fn send_request(request: Call, transport: HttpTransport) -> Result<Json, E
request_bytes.len(),
common::PROXY_REQUEST_EXPIRATION_SEC,
)
.map_err(|e| request_failed_error(request.clone(), Web3RpcError::Internal(e.to_string())))?;
.map_err(|e| request_failed_error(&request, Web3RpcError::Internal(e.to_string())))?;

let proxy_sign_serialized = serde_json::to_string(&proxy_sign)
.map_err(|e| request_failed_error(request.clone(), Web3RpcError::Internal(e.to_string())))?;
.map_err(|e| request_failed_error(&request, Web3RpcError::Internal(e.to_string())))?;

req.headers_mut()
.insert(X_AUTH_PAYLOAD, proxy_sign_serialized.parse().unwrap());
Expand All @@ -145,22 +145,22 @@ async fn send_request(request: Call, transport: HttpTransport) -> Result<Json, E
transport.node.uri, REQUEST_TIMEOUT_S, method, id
);
warn!("{}", error);
return Err(request_failed_error(request, Web3RpcError::Transport(error)));
return Err(request_failed_error(&request, Web3RpcError::Transport(error)));
},
};

let (status, _headers, body) = match res {
Ok(r) => r,
Err(err) => {
return Err(request_failed_error(request, Web3RpcError::Transport(err.to_string())));
return Err(request_failed_error(&request, Web3RpcError::Transport(err.to_string())));
},
};

transport.event_handlers.on_incoming_response(&body);

if !status.is_success() {
return Err(request_failed_error(
request,
&request,
Web3RpcError::Transport(format!(
"Server: '{}', response !200: {}, {}",
transport.node.uri,
Expand All @@ -174,7 +174,7 @@ async fn send_request(request: Call, transport: HttpTransport) -> Result<Json, E
Ok(r) => r,
Err(err) => {
return Err(request_failed_error(
request,
&request,
Web3RpcError::InvalidResponse(format!("Server: '{}', error: {}", transport.node.uri, err)),
));
},
Expand All @@ -195,10 +195,10 @@ async fn send_request(request: Call, transport: HttpTransport) -> Result<Json, E
request_bytes.len(),
common::PROXY_REQUEST_EXPIRATION_SEC,
)
.map_err(|e| request_failed_error(request.clone(), Web3RpcError::Internal(e.to_string())))?;
.map_err(|e| request_failed_error(&request, Web3RpcError::Internal(e.to_string())))?;

let proxy_sign_serialized = serde_json::to_string(&proxy_sign)
.map_err(|e| request_failed_error(request.clone(), Web3RpcError::Internal(e.to_string())))?;
.map_err(|e| request_failed_error(&request, Web3RpcError::Internal(e.to_string())))?;

Some(proxy_sign_serialized)
} else {
Expand All @@ -215,11 +215,11 @@ async fn send_request(request: Call, transport: HttpTransport) -> Result<Json, E
{
Ok(response_json) => Ok(response_json),
Err(Error::Transport(e)) => Err(request_failed_error(
request,
&request,
Web3RpcError::Transport(format!("Server: '{}', error: {}", transport.node.uri, e)),
)),
Err(e) => Err(request_failed_error(
request,
&request,
Web3RpcError::InvalidResponse(format!("Server: '{}', error: {}", transport.node.uri, e)),
)),
}
Expand Down Expand Up @@ -275,7 +275,7 @@ async fn send_request_once(
}
}

fn request_failed_error(request: Call, error: Web3RpcError) -> Error {
fn request_failed_error(request: &Call, error: Web3RpcError) -> Error {
let error = format!("request {:?} failed: {}", request, error);
Error::Transport(TransportError::Message(error))
}
2 changes: 1 addition & 1 deletion mm2src/coins/eth/web3_transport/websocket_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ async fn send_request(

let mut tx = transport.controller_channel.tx.lock().await;

let (notification_sender, notification_receiver) = futures::channel::oneshot::channel::<Vec<u8>>();
let (notification_sender, notification_receiver) = oneshot::channel::<Vec<u8>>();

event_handlers.on_outgoing_request(&request_bytes);

Expand Down
6 changes: 3 additions & 3 deletions mm2src/coins/lightning/ln_platform.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::*;
use crate::lightning::ln_errors::{SaveChannelClosingError, SaveChannelClosingResult};
use crate::utxo::rpc_clients::{BestBlock as RpcBestBlock, BlockHashOrHeight, ConfirmedTransactionInfo,
ElectrumBlockHeader, ElectrumClient, ElectrumNonce, EstimateFeeMethod,
UtxoRpcClientEnum, UtxoRpcResult};
use crate::lightning::ln_utils::RpcBestBlock;
use crate::utxo::rpc_clients::{BlockHashOrHeight, ConfirmedTransactionInfo, ElectrumBlockHeader, ElectrumClient,
ElectrumNonce, EstimateFeeMethod, UtxoRpcClientEnum, UtxoRpcResult};
use crate::utxo::spv::SimplePaymentVerification;
use crate::utxo::utxo_standard::UtxoStandardCoin;
use crate::utxo::GetConfirmedTxError;
Expand Down
Loading
Loading