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

Sunce86/temporary logs for custom nodes #3

Merged
merged 2 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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