Skip to content

Commit 38fe113

Browse files
authored
Merge pull request #29 from CosmWasm/actor-model-rewording
Partially reword the actor model page
2 parents d03386c + 9bb0eb4 commit 38fe113

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/pages/core/architecture/actor-model.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ means a contract can only interact with the outside world via messages and only
2727
manipulate its own state.
2828

2929
Picture two people living in two houses, each house has a mailbox. If person A
30-
wants to talk to person B, they write a letter and put it in person B's mailbox.
31-
Person B will read the letter and write a response, putting it in person A's
32-
mailbox.
30+
wants to talk to person B, they write a letter, address to to person B, and send
31+
it off. The mailman (or in this case, the chain) will put the letter in person
32+
B's mailbox.
33+
34+
Person B will then read the letter and can choose to write a response, address
35+
it to person A with a note indicating that this is a reply, and send it off once
36+
again.
3337

3438
No direct interaction is happening here, nobody visits each other's house which
3539
would allow them to rummage around in their belongings (state). They simply
@@ -50,8 +54,8 @@ be.
5054

5155
But how does that fix reentrancy? In CosmWasm, you can only send out messages at
5256
the end of a contract execution as part of the response. This ensures you have
53-
already written everything to the state, meaning your state is in a consistent
54-
state.
57+
already written everything to the state, meaning the state can't suddenly change
58+
mid-execution and make your contract exhibit buggy behaviour.
5559

5660
CosmWasm effectively forces you to follow the
5761
[CEI pattern (Checks, Effects, Interactions)](https://fravoll.github.io/solidity-patterns/checks_effects_interactions.html)

0 commit comments

Comments
 (0)