feat(ethrpc): Add idempotencyKey support to ERC20 TransferFrom#174
feat(ethrpc): Add idempotencyKey support to ERC20 TransferFrom#174dhyaniarun1993 merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces idempotency support for token transfers by adding an idempotency key (or command ID) to the Token and ERC20 interfaces and their respective implementations. The Ethereum RPC service now utilizes the transaction hash as the idempotency key for these operations. Review feedback suggests ensuring robustness by generating a UUID if the command ID is empty to prevent gRPC failures, addressing potential idempotency issues caused by non-deterministic timestamps in command arguments, and noting that the interface modifications constitute breaking changes for external consumers.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request implements idempotent token transfers by introducing an idempotencyKey parameter across the Token and ERC20 interfaces, which is mapped to the Canton CommandId. The ethService now uses the Ethereum transaction hash as this key. Review feedback highlights a backward compatibility issue where the new mandatory check for the idempotencyKey would break existing callers; it is recommended to generate a random UUID if the key is missing and update the documentation accordingly.
Description
This PR introduces an idempotencyKey parameter to the ERC20 TransferFrom method and its implementation. This is the first step toward supporting an intent-based mempool and miner architecture for EthRPC. The idempotencyKey will be used to uniquely identify and track transfer intents, enabling safe retries and reconciliation between Canton ledger state and synthetic EVM state.
This change is backward-compatible(internal service) and does not alter existing transfer semantics, but is required for the upcoming mempool and miner features.