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

fix(host): Blocking native client program #201

Merged
merged 3 commits into from
Jun 3, 2024
Merged

Conversation

clabby
Copy link
Collaborator

@clabby clabby commented Jun 2, 2024

Overview

Improves the asynchronous logic in kona-host to handle gracefully exiting the parallel host and client threads if either throw.

Also does a bit of cleanup in the host.

@clabby clabby self-assigned this 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 added K-chore Kind: chore K-fix Kind: fix A-host Area: host binary labels Jun 2, 2024
@clabby clabby force-pushed the cl/host-termination branch 2 times, most recently from 331e918 to fec70d2 Compare June 2, 2024 05:52
@clabby clabby requested a review from refcell June 2, 2024 05:53
bin/host/src/main.rs Outdated Show resolved Hide resolved
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.
Improves the asynchronous logic in `kona-host` to handle gracefully
exiting the parallel host and client threads if either throw.
@clabby clabby changed the base branch from cl/async-preimage to main June 3, 2024 15:57
@clabby clabby requested a review from refcell June 3, 2024 16:00
Copy link
Collaborator

@refcell refcell left a comment

Choose a reason for hiding this comment

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

Very nice

@refcell refcell added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit 40603e1 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
@clabby clabby deleted the cl/host-termination 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-host Area: host binary K-chore Kind: chore K-fix Kind: fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants