Skip to content
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

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

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

3 changes: 2 additions & 1 deletion migrations/20230912220523_tap_receipts.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ CREATE TABLE IF NOT EXISTS scalar_tap_receipts_invalid (
allocation_id CHAR(40) NOT NULL,
timestamp_ns NUMERIC(20) NOT NULL,
nonce NUMERIC(20) NOT NULL,
value NUMERIC(39) NOT NULL
value NUMERIC(39) NOT NULL,
error_log TEXT NOT NULL DEFAULT ''
);
14 changes: 5 additions & 9 deletions tap-agent/src/agent/sender_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use tap_core::{
signed_message::EIP712SignedMessage,
};
use thegraph_core::Address;
use tracing::{debug, error, warn};
use tracing::{error, warn};

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

Expand Down Expand Up @@ -687,12 +687,6 @@ impl SenderAllocationState {
error!("Failed to recover receipt signer: {}", e);
anyhow!(e)
})?;
debug!(
"Receipt for allocation {} and signer {} failed reason: {}",
allocation_id.encode_hex(),
receipt_signer.encode_hex(),
receipt_error
);
sqlx::query!(
r#"
INSERT INTO scalar_tap_receipts_invalid (
Expand All @@ -701,16 +695,18 @@ impl SenderAllocationState {
allocation_id,
timestamp_ns,
nonce,
value
value,
error_log
)
VALUES ($1, $2, $3, $4, $5, $6)
VALUES ($1, $2, $3, $4, $5, $6, $7)
"#,
receipt_signer.encode_hex(),
encoded_signature,
allocation_id.encode_hex(),
BigDecimal::from(receipt.message.timestamp_ns),
BigDecimal::from(receipt.message.nonce),
BigDecimal::from(BigInt::from(receipt.message.value)),
receipt_error
)
.execute(&self.pgpool)
.await
Expand Down
Loading