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

Add v0.7 in logs/ track what happens on transaction status fetching #720

Merged
merged 2 commits into from
Oct 16, 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
2 changes: 1 addition & 1 deletion k8s/relayer/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index: 0
relayer:
environment: "production"
name: "relayer-server"
image: "gcr.io/biconomy-prod/sdk/relayer-node-service@sha256:093894c43bc0261d6cf173f2cbc26d1829a15445fc2b7073ced55094fde61ddf"
image: "gcr.io/biconomy-prod/sdk/relayer-node-service:latest"
port: "3000"
replicaCount: 1
resource:
Expand Down
34 changes: 17 additions & 17 deletions src/relayer/transaction-listener/EVMTransactionListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export class EVMTransactionListener
}
if (transactionType === TransactionType.BUNDLER && tryForV07) {
log.info(
`Getting userOps for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`V0.7 Getting userOps for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
const userOps =
await this.userOperationDaoV07.getUserOpsByTransactionId(
Expand All @@ -391,7 +391,7 @@ export class EVMTransactionListener
);
if (!userOps.length) {
log.info(
`No user op found for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`V0.7 No user op found for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
return;
}
Expand Down Expand Up @@ -419,15 +419,15 @@ export class EVMTransactionListener
);
if (!userOpReceipt) {
log.info(
`userOpReceipt not fetched for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`V0.7 userOpReceipt not fetched for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
return;
}
const { success, actualGasCost, actualGasUsed, reason, logs } =
userOpReceipt;

log.info(
`Updating userOp data: ${customJSONStringify(
`v0.7 Updating userOp data: ${customJSONStringify(
convertBigIntToString({
transactionHash,
receipt: convertBigIntToString(transactionReceipt),
Expand Down Expand Up @@ -462,25 +462,25 @@ export class EVMTransactionListener
}),
);
log.info(
`userOp data updated for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 userOp data updated for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);

if (transactionType === TransactionType.BUNDLER) {
log.info(
`updating state to: ${UserOperationStateEnum.CONFIRMED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 updating state to: ${UserOperationStateEnum.CONFIRMED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
await this.userOperationStateDao.updateState(this.chainId, {
transactionId,
message: "Transaction confirmed",
state: UserOperationStateEnum.CONFIRMED,
});
log.info(
`updated state to: ${UserOperationStateEnum.CONFIRMED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 updated state to: ${UserOperationStateEnum.CONFIRMED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
}
} else {
log.info(
`entryPoint: ${entryPoint} not found in entry point map for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 entryPoint: ${entryPoint} not found in entry point map for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
}
}
Expand Down Expand Up @@ -838,7 +838,7 @@ export class EVMTransactionListener
}
if (transactionType === TransactionType.BUNDLER && tryForV07) {
log.info(
`Getting userOps for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`V0.7 Getting userOps for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);

const userOps = await this.userOperationDaoV07.getUserOpsByTransactionId(
Expand All @@ -847,7 +847,7 @@ export class EVMTransactionListener
);
if (!userOps.length) {
log.info(
`No user op found for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`V0.7 No user op found for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
return;
}
Expand All @@ -869,14 +869,14 @@ export class EVMTransactionListener
const latestBlock =
await this.networkService.getLatesBlockNumber();
log.info(
`latestBlock: ${latestBlock} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 latestBlock: ${latestBlock} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
let fromBlock = latestBlock - BigInt(1000);
if (config.astarNetworks.includes(this.chainId)) {
fromBlock += BigInt(501);
}
log.info(
`fromBlock: ${fromBlock} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 fromBlock: ${fromBlock} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
const userOpReceipt =
await getUserOperationReceiptForFailedTransaction(
Expand All @@ -890,10 +890,10 @@ export class EVMTransactionListener

if (!userOpReceipt) {
log.info(
`userOpReceipt not fetched for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 userOpReceipt not fetched for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
log.info(
`Updating userOp data: ${customJSONStringify(
`v0.7 Updating userOp data: ${customJSONStringify(
convertBigIntToString({
transactionHash,
receipt: convertBigIntToString(transactionReceipt),
Expand Down Expand Up @@ -929,12 +929,12 @@ export class EVMTransactionListener
}),
);
log.info(
`userOp data updated for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 userOp data updated for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);

if (transactionType === TransactionType.BUNDLER) {
log.info(
`updating state to: ${UserOperationStateEnum.FAILED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 updating state to: ${UserOperationStateEnum.FAILED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
await this.userOperationStateDao.updateState(this.chainId, {
transactionId,
Expand All @@ -945,7 +945,7 @@ export class EVMTransactionListener
),
});
log.info(
`updated state to: ${UserOperationStateEnum.FAILED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
`v0.7 updated state to: ${UserOperationStateEnum.FAILED} for userOpHash: ${userOpHash} for transactionId: ${transactionId} on chainId: ${this.chainId}`,
);
}
return;
Expand Down