-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(host): Blocking native client program (#201)
* feat(preimage): Async client handles 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. * fix(host): Blocking native client program Improves the asynchronous logic in `kona-host` to handle gracefully exiting the parallel host and client threads if either throw. * Update bin/host/src/main.rs Co-authored-by: refcell <[email protected]> --------- Co-authored-by: refcell <[email protected]>
- Loading branch information
Showing
6 changed files
with
226 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! This module contains the types used in the host program. | ||
use std::fs::File; | ||
|
||
/// Represents the files that are used to communicate with the native client. | ||
pub(crate) struct NativePipeFiles { | ||
/// The file that the preimage oracle reads from. | ||
pub preimage_read: File, | ||
/// The file that the preimage oracle writes to. | ||
pub preimage_writ: File, | ||
/// The file that the hint reader reads from. | ||
pub hint_read: File, | ||
/// The file that the hint reader writes to. | ||
pub hint_writ: File, | ||
} |
Oops, something went wrong.