Skip to content

Commit

Permalink
Sunce86/temporary logs for custom nodes (#3)
Browse files Browse the repository at this point in the history
* added more logs
  • Loading branch information
sunce86 authored Apr 5, 2022
1 parent 275723d commit e73b207
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/solver/src/settlement_submission/submitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,11 @@ impl<'a> Submitter<'a> {
let submitter_name = self.submit_api.name();
let target_confirm_time = Instant::now() + params.target_confirm_time;

tracing::info!(
"submit_with_increasing_gas_prices_until_simulation_fails entered with submitter: {}",
submitter_name
);

// Try to find submitted transaction from previous submission loop (with the same address and nonce)
let pending_gas_price = self
.submit_api
Expand All @@ -347,6 +352,8 @@ impl<'a> Submitter<'a> {
let mut access_list: Option<AccessList> = None;

loop {
tracing::info!("entered loop with submitter: {}", submitter_name);

let submission_status = self
.submit_api
.submission_status(&settlement, &params.network_id);
Expand Down Expand Up @@ -456,6 +463,10 @@ impl<'a> Submitter<'a> {
}
Err(err) => tracing::warn!("submission failed: {:?}", err),
}
tracing::info!(
"Finished sending transaction with submitter {}...",
submitter_name
);
tokio::time::sleep(params.retry_interval).await;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ impl TransactionSubmitting for CustomNodesApi {
&self,
tx: TransactionBuilder<DynTransport>,
) -> Result<TransactionHandle> {
tracing::info!("Custom nodes submit transaction entered");
let transaction_request = tx.build().now_or_never().unwrap().unwrap();
let mut futures = self
.nodes
.iter()
.map(|node| {
async {
tracing::info!("Sending transaction...");
match transaction_request.clone() {
Transaction::Request(tx) => node.eth().send_transaction(tx).await,
Transaction::Raw { bytes, hash: _ } => {
Expand All @@ -63,6 +65,7 @@ impl TransactionSubmitting for CustomNodesApi {
loop {
let (result, index, rest) = futures::future::select_all(futures).await;
let lable = format!("custom_nodes_{index}");
tracing::info!("Loop iteration with node: {}", lable);
match result {
Ok(tx_hash) => {
super::track_submission_success(lable.as_str(), true);
Expand All @@ -73,6 +76,7 @@ impl TransactionSubmitting for CustomNodesApi {
});
}
Err(err) => {
tracing::info!("Error on sending transaction...");
// error is not real error if transaction pool responded that received transaction is already in the pool
let real_error = match &err {
web3::Error::Rpc(rpc_error) => !ALREADY_KNOWN_TRANSACTION
Expand Down

0 comments on commit e73b207

Please sign in to comment.