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

feat(preimage): Async client traits #200

Merged
merged 1 commit into from
Jun 3, 2024
Merged

feat(preimage): Async client traits #200

merged 1 commit into from
Jun 3, 2024

Conversation

clabby
Copy link
Collaborator

@clabby clabby commented Jun 2, 2024

Overview

Makes the HintWriterClient + PreimageOracleClient traits asynchronous to prevent blocking of the host program when executing a client program natively.

Previously, since the preimage oracle bindings for the client were entirely synchronous, the loops in PipeHandle could cause a deadlock. Now that oracle IO is asynchronous, the runtime can interrupt a future when it yields execution (i.e. tokio::select works.)

In the client program, synchronous execution is still guaranteed. It can run async colored functions in a minimal runtime, such as the block_on runtime in kona_common. simple-revm had to be changed as a part of this PR, which has an example of this.

@clabby clabby added A-preimage Area: kona-preimage crate K-feature Kind: feature labels Jun 2, 2024
Copy link
Collaborator Author

clabby commented Jun 2, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @clabby and the rest of your teammates on Graphite Graphite

@clabby clabby self-assigned this Jun 2, 2024
Makes the `HintWriterClient` + `PreimageOracleClient` traits
asynchronous to prevent blocking of the host program when executing a
client program natively.

Previously, since the preimage oracle bindings for the client were
entirely synchronous, the loops in `PipeHandle` could cause a deadlock.
Now that oracle IO is asynchronous, the runtime can interrupt a future
when it yields execution (i.e. `tokio::select` works.)

In the client program, synchronous execution is still guaranteed. It can
run async colored functions in a minimal runtime, such as the `block_on`
runtime in `kona_common`. `simple-revm` had to be changed as a part of
this PR, which has an example of this.
@clabby clabby changed the title feat(preimage): Async client handles feat(preimage): Async client traits Jun 2, 2024
@clabby clabby requested a review from refcell June 2, 2024 05:53
@refcell refcell added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit b14801f Jun 3, 2024
13 checks passed
This was referenced Jun 3, 2024
@clabby clabby added this to the Phase 3: Kona Client & Host milestone Jun 11, 2024
This was referenced Jun 11, 2024
@github-actions github-actions bot mentioned this pull request Jun 22, 2024
@clabby clabby deleted the cl/async-preimage branch July 2, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-preimage Area: kona-preimage crate K-feature Kind: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants