Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/overview/resources.md

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not specifically related to this file)
@pecornilleau do you want to expand on what we me an by Atomicity and what are the provided guarantees? Can you specify what kind of high-level examples may illustrate this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not specifically related to this file)

Do we want to document the low-level %call, knowing that it requires one to know and deal with low-level details -- are they guaranteed to be stable in the future? Does it allow to do useful things users cannot do with the higher-level entrypoints (%call_evm)?

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ When an EVM contract calls the Michelson gateway:

1. **Setting limits.** The EVM contract's remaining gas is converted to a Michelson gas limit using `c`. The Michelson storage limit is set to a generous upper bound (storage allocation in the Michelson interface is converted to gas when going back to the EVM interface).
2. **On failure.** The error is returned to the EVM caller, along with the remaining gas. The EVM caller can catch the failure and continue.
Note that if the Michelson callee failed by going out of gas (OOG), the EVM caller should have reserved some gas to handle the failure, otherwise it will OOG itself and everything reverts.
3. **On success.** The Michelson storage cost is expressed as additional EVM gas units: `g_storage = storage_cost / base_fee_per_gas`. The remaining EVM gas is converted from the remaining Michelson gas minus `g_storage`. If the resulting gas is negative, the call reverts with an out-of-gas error.

In the end, storage allocation in the Michelson runtime is accounted as gas in the EVM runtime, which preserves its semantics.
Expand Down