Skip to content

Synchronous Call Support for Cross-VM Calls  #96

@conr2d

Description

@conr2d

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    K:multiCross-protocol featuresP:mediumPriority: Medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions