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

[Feature]: make transaction execution thread-safe #19613

Closed
2 tasks
yihuang opened this issue Mar 1, 2024 · 3 comments
Closed
2 tasks

[Feature]: make transaction execution thread-safe #19613

yihuang opened this issue Mar 1, 2024 · 3 comments

Comments

@yihuang
Copy link
Collaborator

yihuang commented Mar 1, 2024

Summary

When experimenting with parallel transaction execution, I noticed several race conditions in current transaction execution flow.

Problem Definition

there are a few race conditions when trying to execute transactions in parallel.

Proposed Feature

@tac0turtle
Copy link
Member

This is accounted for in server v2 design. It might make sense to wait for that and implement a custom stf

@yihuang
Copy link
Collaborator Author

yihuang commented Mar 1, 2024

This is accounted for in server v2 design. It might make sense to wait for that and implement a custom stf

I can submit a few trivial cleanups first. it seems it's mostly thread-safe already, in the sense of go test -race not complaining.

yihuang added a commit to yihuang/cosmos-sdk that referenced this issue Mar 1, 2024
ref: cosmos#19613

Before the ante handler set the gas meter using tx gas-wanted, the gas meter in
ctx remains a globally shared one, although it don't have bad effect right now,
but it's a race condition when executing in parallel.
yihuang added a commit to yihuang/cosmos-sdk that referenced this issue Mar 3, 2024
ref: cosmos#19613

block gas meter is not safe when executing transactions in parallel.
yihuang added a commit to yihuang/cosmos-sdk that referenced this issue Mar 5, 2024
ref: cosmos#19613

block gas meter is not safe when executing transactions in parallel.
@tac0turtle
Copy link
Member

closing this as we merged the prs that were proposed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

No branches or pull requests

2 participants