diff --git a/src/pages/core/architecture/actor-model.mdx b/src/pages/core/architecture/actor-model.mdx index 109ef2bd..856243b7 100644 --- a/src/pages/core/architecture/actor-model.mdx +++ b/src/pages/core/architecture/actor-model.mdx @@ -27,9 +27,13 @@ means a contract can only interact with the outside world via messages and only manipulate its own state. Picture two people living in two houses, each house has a mailbox. If person A -wants to talk to person B, they write a letter and put it in person B's mailbox. -Person B will read the letter and write a response, putting it in person A's -mailbox. +wants to talk to person B, they write a letter, address to to person B, and send +it off. The mailman (or in this case, the chain) will put the letter in person +B's mailbox. + +Person B will then read the letter and can choose to write a response, address +it to person A with a note indicating that this is a reply, and send it off once +again. No direct interaction is happening here, nobody visits each other's house which would allow them to rummage around in their belongings (state). They simply @@ -50,8 +54,8 @@ be. But how does that fix reentrancy? In CosmWasm, you can only send out messages at the end of a contract execution as part of the response. This ensures you have -already written everything to the state, meaning your state is in a consistent -state. +already written everything to the state, meaning the state can't suddenly change +mid-execution and make your contract exhibit buggy behaviour. CosmWasm effectively forces you to follow the [CEI pattern (Checks, Effects, Interactions)](https://fravoll.github.io/solidity-patterns/checks_effects_interactions.html)