Commit 49014a29 authored by Sebastian Stammler's avatar Sebastian Stammler Committed by GitHub

Merge pull request #6121 from ethereum-optimism/jm/wallet-mon-tx-hash

feat(ctb): Emit tx hash in wallet-mon detection logs
parents 180d33ee 7bc245ff
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
waitForProvider, waitForProvider,
} from '@eth-optimism/common-ts' } from '@eth-optimism/common-ts'
import { getChainId, compareAddrs } from '@eth-optimism/core-utils' import { getChainId, compareAddrs } from '@eth-optimism/core-utils'
import { Provider } from '@ethersproject/abstract-provider' import { Provider, TransactionResponse } from '@ethersproject/abstract-provider'
import mainnetConfig from '@eth-optimism/contracts-bedrock/deploy-config/mainnet.json' import mainnetConfig from '@eth-optimism/contracts-bedrock/deploy-config/mainnet.json'
import goerliConfig from '@eth-optimism/contracts-bedrock/deploy-config/goerli.json' import goerliConfig from '@eth-optimism/contracts-bedrock/deploy-config/goerli.json'
import l2OutputOracleArtifactsMainnet from '@eth-optimism/contracts-bedrock/deployments/mainnet/L2OutputOracleProxy.json' import l2OutputOracleArtifactsMainnet from '@eth-optimism/contracts-bedrock/deployments/mainnet/L2OutputOracleProxy.json'
...@@ -101,7 +101,7 @@ export class WalletMonService extends BaseServiceV2< ...@@ -101,7 +101,7 @@ export class WalletMonService extends BaseServiceV2<
unexpectedCalls: { unexpectedCalls: {
type: Counter, type: Counter,
desc: 'Number of unexpected wallets', desc: 'Number of unexpected wallets',
labels: ['wallet', 'target', 'nickname'], labels: ['wallet', 'target', 'nickname', 'transactionHash'],
}, },
unexpectedRpcErrors: { unexpectedRpcErrors: {
type: Counter, type: Counter,
...@@ -150,7 +150,7 @@ export class WalletMonService extends BaseServiceV2< ...@@ -150,7 +150,7 @@ export class WalletMonService extends BaseServiceV2<
number: block.number, number: block.number,
}) })
const transactions = [] const transactions: TransactionResponse[] = []
for (const txHash of block.transactions) { for (const txHash of block.transactions) {
const t = await this.options.rpc.getTransaction(txHash) const t = await this.options.rpc.getTransaction(txHash)
transactions.push(t) transactions.push(t)
...@@ -175,11 +175,13 @@ export class WalletMonService extends BaseServiceV2< ...@@ -175,11 +175,13 @@ export class WalletMonService extends BaseServiceV2<
nickname: account.label, nickname: account.label,
wallet: account.address, wallet: account.address,
target: transaction.to, target: transaction.to,
transactionHash: transaction.hash,
}) })
this.logger.error('Unexpected call detected', { this.logger.error('Unexpected call detected', {
nickname: account.label, nickname: account.label,
address: account.address, address: account.address,
target: transaction.to, target: transaction.to,
transactionHash: transaction.hash,
}) })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment