Skip to content
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

[v6] Allow for CCIP Read to be disabled for calls at the provider level #2499

Closed
fselmo opened this issue Jun 1, 2022 · 0 comments · Fixed by #2503
Closed

[v6] Allow for CCIP Read to be disabled for calls at the provider level #2499

fselmo opened this issue Jun 1, 2022 · 0 comments · Fixed by #2503

Comments

@fselmo
Copy link
Collaborator

fselmo commented Jun 1, 2022

What was wrong?

EIP-3668 recommends the following for CCIP Read support:

Client libraries should disable CCIP read for transactions (but not for calls) by default, and require the caller to explicitly enable this functionality. Enablement should be possible both on a per-contract, per-domain, or global basis.

We currently enable it by default for calls and don't handle this at all automatically for transactions but do provide documentation on how to properly handle offchain lookup for transactions. However, if a user is not interested in enabling CCIP Read at all, even for calls, we could allow this to happen on the provider level and they wouldn't have to worry about disabling it at the eth_call level with each call.

How can it be fixed?

  • Add a provider ccip_read_calls_enabled flag and account for this value at the w3.eth.call() level.

This should be implemented so that the flag on eth.call() can override whatever is set on the global provider flag. This would allow for call-specific control for CCIP read.

i.e. for Eth (and similarly AsyncEth):

def call(self, ..., ccip_read_enabled: Optional[bool] = None):
    ccip_read_enabled_on_provider = self.w3.provider.ccip_read_calls_enabled
    if (
        # default conditions:
        ccip_read_enabled_on_provider and ccip_read_enabled is not False
        # explicit call flag overrides provider flag, enabling ccip read for specific calls:
        or not ccip_read_enabled_on_provider and ccip_read_enabled is True
    ):
        return self._durin_call(...)

    return self._call(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant