Skip to content

Commit fc29b3a

Browse files
added error logs
1 parent bcaae0d commit fc29b3a

4 files changed

+40
-22
lines changed

.sqlx/query-0d4e055d87b4496202041f3c28618688afa91dc0b8eeb8e551b271fc73c1157e.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

.sqlx/query-1e672d98779cf3082906a5aaee744861fecdad20b4a52d0cec851712f8cba862.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-56c3678866ffe0ec2eed7290394d07007990cc244f598b763ec5470515efe019.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tap-agent/src/agent/sender_allocation.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use tap_core::{
2727
signed_message::EIP712SignedMessage,
2828
};
2929
use thegraph_core::Address;
30-
use tracing::{error, warn};
30+
use tracing::{debug, error, warn};
3131

3232
use crate::{agent::sender_account::ReceiptFees, lazy_static};
3333

@@ -692,6 +692,7 @@ impl SenderAllocationState {
692692
let mut timestamps = Vec::with_capacity(reciepts_len);
693693
let mut nounces = Vec::with_capacity(reciepts_len);
694694
let mut values = Vec::with_capacity(reciepts_len);
695+
let mut error_logs = Vec::with_capacity(reciepts_len);
695696

696697
for received_receipt in receipts.iter() {
697698
let receipt = received_receipt.signed_receipt();
@@ -704,12 +705,19 @@ impl SenderAllocationState {
704705
error!("Failed to recover receipt signer: {}", e);
705706
anyhow!(e)
706707
})?;
708+
debug!(
709+
"Receipt for allocation {} and signer {} failed reason: {}",
710+
allocation_id.encode_hex(),
711+
receipt_signer.encode_hex(),
712+
receipt_error
713+
);
707714
reciepts_signers.push(receipt_signer.encode_hex());
708715
encoded_signatures.push(encoded_signature);
709716
allocation_ids.push(allocation_id.encode_hex());
710717
timestamps.push(BigDecimal::from(receipt.message.timestamp_ns));
711718
nounces.push(BigDecimal::from(receipt.message.nonce));
712719
values.push(BigDecimal::from(BigInt::from(receipt.message.value)));
720+
error_logs.push(receipt_error);
713721
}
714722
sqlx::query!(
715723
r#"INSERT INTO scalar_tap_receipts_invalid (
@@ -718,21 +726,24 @@ impl SenderAllocationState {
718726
allocation_id,
719727
timestamp_ns,
720728
nonce,
721-
value
729+
value,
730+
error_log
722731
) SELECT * FROM UNNEST(
723732
$1::CHAR(40)[],
724733
$2::BYTEA[],
725734
$3::CHAR(40)[],
726735
$4::NUMERIC(20)[],
727736
$5::NUMERIC(20)[],
728-
$6::NUMERIC(40)[]
737+
$6::NUMERIC(40)[],
738+
$7::TEXT[]
729739
)"#,
730740
&reciepts_signers,
731741
&encoded_signatures,
732742
&allocation_ids,
733743
&timestamps,
734744
&nounces,
735745
&values,
746+
&error_logs
736747
)
737748
.execute(&self.pgpool)
738749
.await

0 commit comments

Comments
 (0)