Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Oct 20, 2023
1 parent 4f26436 commit b8b603f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion eth_defi/confirmation.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ def wait_and_broadcast_multiple_nodes(
except TransactionNotFound as e:
# Happens on LlamaNodes - we have broadcasted the transaction
# but its nodes do not see it yet
logger.warning("Node missing transaction broadcast %s", tx_hash.hex())
name = get_provider_name(web3.provider)
logger.warning("Node %s missing transaction broadcast %s", name, tx_hash.hex())
logger.exception(e)

unconfirmed_tx_strs = ", ".join([tx_hash.hex() for tx_hash in unconfirmed_txs])
Expand Down
1 change: 1 addition & 0 deletions eth_defi/hotwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def address(self):
def sync_nonce(self, web3: Web3):
"""Read the current nonce"""
self.current_nonce = web3.eth.get_transaction_count(self.account.address)
logger.info("Synced nonce for %s to %d", self.account.address, self.current_nonce)

def allocate_nonce(self) -> int:
"""Get the next free available nonce to be used with a transaction.
Expand Down
4 changes: 2 additions & 2 deletions eth_defi/provider/named.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import TypeAlias

from web3 import HTTPProvider
from web3.providers import JSONBaseProvider
from web3.providers import JSONBaseProvider, BaseProvider

from eth_defi.utils import get_url_domain

Expand Down Expand Up @@ -49,7 +49,7 @@ def call_endpoint_uri(self) -> str:
NamedProvider: TypeAlias = BaseNamedProvider | HTTPProvider


def get_provider_name(provider: NamedProvider) -> str:
def get_provider_name(provider: BaseProvider) -> str:
"""Get loggable name of the JSON-RPC provider.
Strips out API keys from the URL of a JSON-RPC API provider.
Expand Down

0 comments on commit b8b603f

Please sign in to comment.