-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
light-client: Replace
Io
with async variant (#995)
* light-client: Rename ProdIo to RpcIo The implication of production always has been an unfortunate choice at it assumes implicit consensus of what a production deployment environment entails. Instead it does exactly what it says on the tin. Signed-off-by: xla <[email protected]> * light-client: Turn denies into warning To make local development more forgiving while doing larger changes this turns denies into warnings. This should be reasonably safe as long as CI keeps using `-Dwarnings`. Signed-off-by: xla <[email protected]> * light-client: Replace Io trait with async variant While invasive this change transforms the light-client to be async all the way. This touches all places where some I/O is taking place. Achieved by roping in the async-trait[0] crate and dropping the existing `block_on` implementation. Lo, this drops the timeout which guarded the side-effectful operation, which will be reintroduced in a follow-up change. [0] https://github.com/dtolnay/async-trait Signed-off-by: xla <[email protected]> * light-client: Guard rpc calls with timeout During the move to async io the block_on implementation was dropped, which relied on tokio. In said implementation a timeout was enforced to limit the duration of the execution of the given task. To not permanently loose that guard rail this change introduces a timeout implementation based on the futures-timer[0] crate. It supports a wasm environment, which hasn't been validated or assessed yet but should give reasonable confidence that it might work in a `no_std` environment, q.e.d. [0] https://crates.io/crates/futures-timer Signed-off-by: xla <[email protected]> * light-client: Guard rpc calls with timeout During the move to async io the block_on implementation was dropped, which relied on tokio. In said implementation a timeout was enforced to limit the duration of the execution of the given task. To not permanently loose that guard rail this change introduces a timeout implementation based on the futures-timer[0] crate. It supports a wasm environment, which hasn't been validated or assessed yet but should give reasonable confidence that it might work in a `no_std` environment, q.e.d. [0] https://crates.io/crates/futures-timer Signed-off-by: xla <[email protected]> * light-client: Add changelog for async Io changes Signed-off-by: xla <[email protected]> * light-client: Fix import Signed-off-by: xla <[email protected]> * tools: Fix kv-test impl Signed-off-by: xla <[email protected]> * tools: Fix rpc-probe Signed-off-by: xla <[email protected]> * light-client: Fix blocking supervisor handle Signed-off-by: xla <[email protected]> * light-client: Formatting Signed-off-by: xla <[email protected]>
- Loading branch information
Showing
23 changed files
with
350 additions
and
297 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
.changelog/unreleased/breaking-changes/light-client/953-async-light-client.md
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,2 @@ | ||
- Replace Io with async variant | ||
([#953](https://github.com/informalsystems/tendermint-rs/issues/953)) |
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
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
Oops, something went wrong.