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

Downgrade transaction warnings #4697

Merged
merged 2 commits into from
Apr 19, 2024
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
18 changes: 9 additions & 9 deletions stackslib/src/chainstate/stacks/db/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,14 +970,14 @@ impl StacksChainState {
// Their presence in this variant makes the transaction invalid.
if tx.post_conditions.len() > 0 {
let msg = format!("Invalid Stacks transaction: TokenTransfer transactions do not support post-conditions");
warn!("{}", &msg);
info!("{}", &msg);

return Err(Error::InvalidStacksTransaction(msg, false));
}

if *addr == origin_account.principal {
let msg = format!("Invalid TokenTransfer: address tried to send to itself");
warn!("{}", &msg);
info!("{}", &msg);
return Err(Error::InvalidStacksTransaction(msg, false));
}

Expand Down Expand Up @@ -1088,7 +1088,7 @@ impl StacksChainState {
if epoch_id >= StacksEpochId::Epoch21 {
// in 2.1 and later, this is a permitted runtime error. take the
// fee from the payer and keep the tx.
warn!("Contract-call encountered an analysis error at runtime";
info!("Contract-call encountered an analysis error at runtime";
"txid" => %tx.txid(),
"origin" => %origin_account.principal,
"origin_nonce" => %origin_account.nonce,
Expand Down Expand Up @@ -1163,7 +1163,7 @@ impl StacksChainState {
// (because this can be checked statically by the miner before mining the block).
if StacksChainState::get_contract(clarity_tx, &contract_id)?.is_some() {
let msg = format!("Duplicate contract '{}'", &contract_id);
warn!("{}", &msg);
info!("{}", &msg);

return Err(Error::InvalidStacksTransaction(msg, false));
}
Expand Down Expand Up @@ -1225,7 +1225,7 @@ impl StacksChainState {
.sub(&cost_before)
.expect("BUG: total block cost decreased");

warn!(
info!(
"Runtime error in contract analysis for {}: {:?}",
&contract_id, &other_error;
"txid" => %tx.txid(),
Expand Down Expand Up @@ -1329,7 +1329,7 @@ impl StacksChainState {
if epoch_id >= StacksEpochId::Epoch21 {
// in 2.1 and later, this is a permitted runtime error. take the
// fee from the payer and keep the tx.
warn!("Smart-contract encountered an analysis error at runtime";
info!("Smart-contract encountered an analysis error at runtime";
"txid" => %tx.txid(),
"contract" => %contract_id,
"code" => %contract_code_str,
Expand Down Expand Up @@ -1380,7 +1380,7 @@ impl StacksChainState {
// Their presence in this variant makes the transaction invalid.
if tx.post_conditions.len() > 0 {
let msg = format!("Invalid Stacks transaction: PoisonMicroblock transactions do not support post-conditions");
warn!("{}", &msg);
info!("{}", &msg);

return Err(Error::InvalidStacksTransaction(msg, false));
}
Expand Down Expand Up @@ -1412,7 +1412,7 @@ impl StacksChainState {
// Their presence in this variant makes the transaction invalid.
if tx.post_conditions.len() > 0 {
let msg = format!("Invalid Stacks transaction: TenureChange transactions do not support post-conditions");
warn!("{msg}");
info!("{msg}");

return Err(Error::InvalidStacksTransaction(msg, false));
}
Expand Down Expand Up @@ -1475,7 +1475,7 @@ impl StacksChainState {
// requires 2.1 and higher
if clarity_block.get_epoch() < StacksEpochId::Epoch21 {
let msg = format!("Invalid transaction {}: asks for Clarity2, but not in Stacks epoch 2.1 or later", tx.txid());
warn!("{}", &msg);
info!("{}", &msg);
return Err(Error::InvalidStacksTransaction(msg, false));
}
}
Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/chainstate/stacks/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,7 @@ impl StacksBlockBuilder {
// if we have an invalid transaction that was quietly ignored, don't warn here either
}
e => {
warn!("Failed to apply tx {}: {:?}", &txinfo.tx.txid(), &e);
info!("Failed to apply tx {}: {:?}", &txinfo.tx.txid(), &e);
return Ok(Some(result_event));
}
}
Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/net/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5850,7 +5850,7 @@ impl PeerNetwork {
&stacks_epoch.block_limit,
&stacks_epoch.epoch_id,
) {
warn!("Transaction rejected from mempool, {}", &e.into_json(&txid));
info!("Transaction rejected from mempool, {}", &e.into_json(&txid));
return false;
}

Expand Down