Support EIP-3668 for non-read transactions #3080
Replies: 4 comments 3 replies
-
I think using EIP-3668 for “write” transactions is powerful, especially when combined with EIP-712 for offchain signing of payloads returned by the Gateway. |
Beta Was this translation helpful? Give feedback.
-
Afaik, EIP-3668 isn't aware whether the call is read or write at all, here is an example transferring tokens: https://github.com/smartcontractkit/ccip-read/tree/master/packages/examples/trusted-gateway-token I suspect the functionality is not fully implemented in ethers.js exactly per specification, which might be why it is not working properly (with erros such as the one above). Another thing I noticed is that if the network doesn't have ENS deployed (which is often the case during development/localhost node), the call fails even earlier in the process. Although one use-case proposed is off-chain ENS resolution, IMO this should not be a limitation. I have adapted my solidity project and frontend to support this EIP, only to hit a wall when trying to use it with ethers. Now I'm pondering if I should drop EIP-3668 altogether or wait until it is better developed on ethers.. I'm happy to collaborate if anyone is interested in figuring what is failing in ethers - I have a project ready for EIP-3668 (both solidity, frontend and backend) for testing/debugging. |
Beta Was this translation helpful? Give feedback.
-
Ethers only supported CCIP-read for read operations currently. The “deferred write” operations are still early draft, I believe but once they are former they will be added to ethers. If a network doesn’t support ENS, attempting to use an ENS operation will fail quite early, but CCIP-read will work fine on those networks; CCIP-read does not require ENS. If you are having issues with CCIP-read, for reading, feel free to start a new discussion outlining your issue. It is a complex protocol, so if it is failing it could be at a lot of various levels. In v6, I’ve added a whack load of additional debug logging (I.E. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the info @ricmoo. Indeed it is a complex protocol and it has been hard to figure out what is expected to work and what not just by looking at ethers code. I suppose you had in mind https://eips.ethereum.org/EIPS/eip-5559 ? This is a new EIP which I haven't seen before, but it seems to be out of scope for my use case. I really just need ethers to pass on the calldata payload to the indicated method, like it already does for read operations I suppose. What exactly makes the write operation different as opposed to read-only from ethers perspective? In my dapp the 'gateway' is not being called by ethers after a revert is thrown. What I need to do is similar to method token.transferWithSig() from https://github.com/smartcontractkit/ccip-read/blob/master/packages/examples/trusted-gateway-token/contracts/contracts/Token.sol . In the example above, contract state on L1 does change, if the payload is signed by the expected signer, and as far as I can tell it "only" uses EIP-3668 (not EIP-5559). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As per EIP-3668 (https://eips.ethereum.org/EIPS/eip-3668#use-of-ccip-read-for-transactions), it is possible to use CCIP read for non-read calls by sending a pre-flight read transaction before the write transaction. However, it does seem that ethers doesn't yet support it, since I'm running into the following error when trying to enable CCIP read on a transaction:
Error: invalid object key - ccipReadEnabled (argument="transaction:ccipReadEnabled"
. Is there any plan to support it?Beta Was this translation helpful? Give feedback.
All reactions