Fix string encoding in network_c2_etherhiding.py#594
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the double quotes from the Ethereum method name checks in the network_c2_etherhiding signature. However, the feedback points out that this fix is incomplete because the outer check still strictly requires double quotes for "jsonrpc" and "method", which are likely subject to the same encoding variations. It is recommended to update the outer check as well and simplify the method checks using any() as suggested.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| "eth_call" in buffer_lower | ||
| or "eth_gettransactionbyhash" in buffer_lower | ||
| or "eth_getstorageat" in buffer_lower |
There was a problem hiding this comment.
While removing the double quotes from the Ethereum method names (e.g., changing '"eth_call"' to "eth_call") allows matching them when quotes are escaped, single-quoted, or omitted, the outer check on line 63 still strictly requires double quotes:
if '"jsonrpc"' in buffer_lower and '"method"' in buffer_lower:If the encoding issue affects the quotes around the method names, it is highly likely to also affect the quotes around "jsonrpc" and "method". As a result, this fix is incomplete and the signature will still fail to match in those scenarios.
To fully resolve this, please also update the outer check on line 63 to not require double quotes (e.g., "jsonrpc" in buffer_lower and "method" in buffer_lower).
Additionally, we can simplify the method check using any() for better readability.
| "eth_call" in buffer_lower | |
| or "eth_gettransactionbyhash" in buffer_lower | |
| or "eth_getstorageat" in buffer_lower | |
| any(m in buffer_lower for m in ("eth_call", "eth_gettransactionbyhash", "eth_getstorageat")) |
No description provided.