-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CCIP Read support #2457
CCIP Read support #2457
Conversation
56d46c8
to
2995523
Compare
206626b
to
05da735
Compare
3332bec
to
17e34fe
Compare
Indeed, was waiting to iron out the implementation beforehand.
I went a bit back and forth on this... I think we should talk about how this might look like / maybe add this in a future PR. See my reply to your comment on
Having |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I got through the rest! Just a few nitpicky comments
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()``
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()``
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()``
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()``
- Create the OffchainLookup exception and package the payload from the revert message appropriately. Raise the exception when the appropriate revert is caught. - Overhaul transactions.py and async_transactions.py to handle most of the offchain lookup payload processing via the respective handle_offchain_lookup methods. - Refactor request.py a bit to account for json responses for both POST and GET requests that are not formatted to JSON-RPC specs. - Due to possible security risks, CCIP Read support is added as a ``ccip_read_enabled`` flag to the ``BaseProvider`` class whose default value is ``False`` but can be turned on explicitly when a user needs the functionality. - ``ccip_read_enabled`` flags are also added as options to contract calls so the user can make this choice on a per-call basis to specific functions of the contract. Extras: - Simplify the way we handle different ENS resolvers. Use one main ABI but perform checks against ``supportsInterface()`` at the appropriate times when handling different cases. - Added helper utility methods for converting between types within a new ``type_conversion_utils.py`` file. - Fix the typing for state_override argument to eth_call due to a mypy linting error locally: create ``CallOverride`` type that maps the ``CallOverrideParams`` as values to ``ChecksumAddress`` keys.
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()``
d74d47d
to
afcbb48
Compare
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()`` - Refactor data back into post request after linting issues went away - Make CCIP Read max redirects configurable and add tests - OffchainLookup should extend from ContractLogicError - Add some more testing and refactor some more; use web3 ValidationError instead of importing from eth_utils - Add MultipleFailedRequests if multiple failed requests for similar / same data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()`` - Refactor data back into post request after linting issues went away - Make CCIP Read max redirects configurable and add tests - OffchainLookup should extend from ContractLogicError - Add some more testing and refactor some more; use web3 ValidationError instead of importing from eth_utils - Add MultipleFailedRequests if multiple failed requests for similar / same data - Reconcile changes with rebased async contract - Raise an exception if CCIP Read urls do not contain expected keyword - Add tests for ENS offchain resolution via CCIP Read functionality - CCIP Read support for EthereumTesterProvider / eth-tester
- Split CI jobs into async and sync and further split into eth vs non-eth modules - Run ``unlocked_account`` pytest fixture as ``module`` scope. - Organize sync and async spaces in ``go_ethereum/common.py``
- Add documentation - Refactor out the provider flag since there is no support for sending transactions w/ CCIP Read support - Refactor some around the way the ``eth_call`` is made, add flag directly to ``eth_call`` and make ``durin_call()`` and internal ``_durin_call()`` - Refactor data back into post request after linting issues went away - Make CCIP Read max redirects configurable and add tests - OffchainLookup should extend from ContractLogicError - Add some more testing and refactor some more; use web3 ValidationError instead of importing from eth_utils - Add MultipleFailedRequests if multiple failed requests for similar / same data - Reconcile changes with rebased async contract - Raise an exception if CCIP Read urls do not contain expected keyword - Add tests for ENS offchain resolution via CCIP Read functionality - CCIP Read support for EthereumTesterProvider / eth-tester
What was wrong?
How was it fixed?
OffchainLookup
exception added withpayload
property to be filled with appropriate data from the contract revert.ccip_read_enabled
flags on contract call /eth_call
.web3/utils/exception_handling.py
andweb3/utils/async_exception_handling.py
.offchain_lookup_contract
added where setup was needed.tests/ens
.GET
request support added and general, non-json-rpc,POST
request support added.requests.py
to account forjson
payloads for both sync and async POST and GET requests.Todo:
master
once the ENSIP-10 PR is merged inCute Animal Picture