perf: avoid tuple allocation in startswith checks#1012
perf: avoid tuple allocation in startswith checks#1012BobTheBuidler wants to merge 8 commits intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
dank_mids/dank_mids/_requests.py
Lines 944 to 945 in d28837a
When Multicall.post() returns a successful RawResponse (i.e., response.exception is falsy), spoof_response currently falls into the else branch and raises using an undefined data symbol. Because post() already raises on response.exception, this means every successful multicall now hits this branch and fails with a NameError/NotImplementedError instead of decoding results. This breaks normal multicall execution for all successful responses.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
startswithchecks with explicit literal calls so mypyc can hit literal fastpathsTesting
pytest(fails: Python 3.14 cannot installevmspecdue to Requires-Python<3.14; alsodank_mids/logging.pyreferenceslogging._acquireLockwhich is missing in 3.14)PATH=/home/takopi/.npm-global/bin:$PATH PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -p asyncio-cooperative -p pytest-brownie(fails during collection:dank_mids/logging.pyuseslogging._acquireLockon 3.14;evmspecnot installable on 3.14; brownie/compiled module import errors)