Skip to content

Commit 8178de5

Browse files
committed
Add some ignore statements to quiet logging
1 parent 355227d commit 8178de5

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

trinity/sync/full/chain.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ def __init__(self,
8585
commands.GetNodeData,
8686
commands.Transactions,
8787
commands.NodeData,
88+
# TODO: all of the following are here to quiet warning logging output
89+
# until the messages are properly handled.
90+
commands.Transactions,
91+
commands.NewBlock,
92+
commands.NewBlockHashes,
8893
}
8994

9095
async def _calculate_td(self, headers: Tuple[BlockHeader, ...]) -> int:
@@ -257,7 +262,12 @@ async def _handle_msg(self, peer: HeaderRequestingPeer, cmd: protocol.Command,
257262
msg: protocol._DecodedMsgType) -> None:
258263
peer = cast(ETHPeer, peer)
259264

260-
if isinstance(cmd, commands.BlockBodies):
265+
# TODO: stop ignoring these once we have proper handling for these messages.
266+
ignored_commands = (commands.Transactions, commands.NewBlock, commands.NewBlockHashes)
267+
268+
if isinstance(cmd, ignored_commands):
269+
pass
270+
elif isinstance(cmd, commands.BlockBodies):
261271
await self._handle_block_bodies(peer, list(cast(Tuple[BlockBody], msg)))
262272
elif isinstance(cmd, commands.Receipts):
263273
await self._handle_block_receipts(peer, cast(List[List[Receipt]], msg))

trinity/sync/full/state.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def __init__(self,
9898
commands.GetBlockBodies,
9999
commands.GetReceipts,
100100
commands.GetNodeData,
101+
# TODO: all of the following are here to quiet warning logging output
102+
# until the messages are properly handled.
103+
commands.Transactions,
104+
commands.NewBlock,
105+
commands.NewBlockHashes,
101106
}
102107

103108
# This is a rather arbitrary value, but when the sync is operating normally we never see
@@ -164,7 +169,12 @@ async def _process_nodes(self, nodes: Iterable[Tuple[Hash32, bytes]]) -> None:
164169

165170
async def _handle_msg(
166171
self, peer: ETHPeer, cmd: Command, msg: _DecodedMsgType) -> None:
167-
if isinstance(cmd, commands.NodeData):
172+
# TODO: stop ignoring these once we have proper handling for these messages.
173+
ignored_commands = (commands.Transactions, commands.NewBlock, commands.NewBlockHashes)
174+
175+
if isinstance(cmd, ignored_commands):
176+
pass
177+
elif isinstance(cmd, commands.NodeData):
168178
msg = cast(List[bytes], msg)
169179
if peer not in self.request_tracker.active_requests:
170180
# This is probably a batch that we retried after a timeout and ended up receiving

0 commit comments

Comments
 (0)