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

Synchronous Call Support for Cross-VM Calls #96

Open
conr2d opened this issue Dec 7, 2024 · 0 comments
Open

Synchronous Call Support for Cross-VM Calls #96

conr2d opened this issue Dec 7, 2024 · 0 comments
Labels
K:multi Cross-protocol features P:medium Priority: Medium

Comments

@conr2d
Copy link
Contributor

conr2d commented Dec 7, 2024

Description

In the context of smart contract execution, synchronous call refers to the ability to pause the current contract's execution, execute another contract, and then resume the initial contract's execution with the results from the called contract. Protocols like Ethereum and Solana support synchronous calls. However, in the case of Cosmos, the execution of the current context is terminated, and sub-messages are used to trigger the execution of other contracts. If the result needs to be processed further, it must be handled in a reply entrypoint.

Synchronous calls enable several use cases, such as flash loans, but they also come with risks. Without a thorough understanding and careful implementation, they can open up vulnerabilities like reentrancy attacks.

In the case of Noir, the support for Cross-VM calls introduces additional considerations. It is crucial to evaluate what type of synchronous call mechanisms, if any, should be permitted.

Alternatives for Cross-VM Call Implementation:

  1. Allow full synchronous calls
    This approach provides maximum flexibility but increases complexity and the potential for vulnerabilities, such as reentrancy.

  2. Allow synchronous calls only for read-only operations
    This strikes a balance by enabling limited synchronous interactions without the risk of modifying state during the cross-VM call.

  3. Disallow synchronous calls entirely
    Adopt an approach similar to Cosmos, where cross-VM calls are handled through a message-passing mechanism, avoiding the risks associated with synchronous calls.

Each option has its trade-offs in terms of usability, security, and performance. A careful analysis is necessary to determine the best approach for Noir while aligning with its goals and maintaining a secure environment.

@conr2d conr2d added K:multi Cross-protocol features P:medium Priority: Medium labels Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K:multi Cross-protocol features P:medium Priority: Medium
Projects
None yet
Development

No branches or pull requests

1 participant