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

Basic actor model docs #24

Merged
merged 7 commits into from
May 24, 2024
Merged

Basic actor model docs #24

merged 7 commits into from
May 24, 2024

Conversation

aumetra
Copy link
Member

@aumetra aumetra commented May 21, 2024

No description provided.

Copy link

vercel bot commented May 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cosmwasm-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 11:13am

@aumetra aumetra marked this pull request as ready for review May 24, 2024 10:46
Co-authored-by: Tomasz Kurcz <360248+uint@users.noreply.github.com>
Copy link
Contributor

@uint uint left a comment

Choose a reason for hiding this comment

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

Overall this looks very good! Treat my comments as suggestions, nothing more. (I may have messed up submitting the comments together with the approval.)

@aumetra aumetra merged commit d03386c into main May 24, 2024
3 checks passed
@aumetra aumetra deleted the actor-model branch May 24, 2024 11:15
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Been a while since I've used snail mail, but, I believe I would put the letter in my own mailbox, then the postal service picks it up to put it in the other person's.

Kinda a nit, since the point is more about addresses and messages than delivery - but when adding messages in contracts, we don't actually add the message directly to the other contract either - we add it to our Response object, and then it's picked up and delivered to the destination, so I think it would fit better overall to describe it this way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Dang, okay, I hit the merge button a little too quickly. Yeah, good point, I'll have a look over the wording again and make a separate PR for that.

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

"meaning your state is in a consistent state" is clever, but, could be confusing... maybe something like "meaning your state cannot be changed under your feet mid-execution", or something like that, e.g. explicitly point out the problem it's solving?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants