Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

feat(preimage): Async client traits#200

Merged
refcell merged 1 commit intomainfrom
cl/async-preimage
Jun 3, 2024
Merged

feat(preimage): Async client traits#200
refcell merged 1 commit intomainfrom
cl/async-preimage

Conversation

@clabby
Copy link
Contributor

@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 K-feature Kind: feature labels Jun 2, 2024
Copy link
Contributor 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 force-pushed the cl/async-preimage branch from 6e475ec to 512031f Compare June 2, 2024 04:56
@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
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
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
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.
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

K-feature Kind: feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants