-
Notifications
You must be signed in to change notification settings - Fork 70
chore: remove the futures crate
#564
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
Merged
Davidson-Souza
merged 3 commits into
vinteumorg:master
from
Davidson-Souza:remove-futures
Jul 11, 2025
Merged
chore: remove the futures crate
#564
Davidson-Souza
merged 3 commits into
vinteumorg:master
from
Davidson-Souza:remove-futures
Jul 11, 2025
Conversation
This file contains hidden or 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
JoseSK999
reviewed
Jul 11, 2025
JoseSK999
approved these changes
Jul 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK de43c65
Davidson-Souza
added a commit
to Davidson-Souza/Floresta
that referenced
this pull request
Jul 12, 2025
When I started this project, we used async-std as async runtime. async-std did lack some features, like oneshot channes and some macros like select!, for that reason, I've used the futures crate to get some of those functionalities. However, since vinteumorg#172, we use tokio as async runtime. And tokio does have those features. So I'm removing futures as dependencies. tokio also has out-of-the-box support for ctr-c handling, so I'm using it instead of the crate. I've also made the public methods in florestad async. This simplifies some stuff, and shouldn't be a problem, since these methods should only be called with a running runtime. If you need to use them in a sync environment, use a thin wrapper that owns florestad and the runtime. Then block_on every call. * remove futures from floresta-electrum * remove futures and ctrc from florestad and wire * remove futures from floresta
18 tasks
Davidson-Souza
added a commit
that referenced
this pull request
Jul 13, 2025
* wire: don't spam the logs with `PeerNotFound` (#559) * running_node: call maybe_create_connection We are using `create_connection` directly, but this function assumes you've checked whether we are not connected with our `--connec` peer. If we don't check it, we will see the `PeerAlreadyExists` error over and over again. `maybe_create_connection` also helps using the fixed peers and dns seeds if we don't have any available addresses to work with Therefore, I'm replacing `create_connection` with `maybe_create_connection` for `check_connections`. * addr_man: don't return connected peers This will cause `node` to keep loggin `PeerAlreadyExists`, since it won't try to connect with the same peer twice. * Fix electrum tests: read full responses (#560) We have been getting the `"EOF while parsing a string"` error occasionally in our electrum request tests. It seems that sometimes we don't read the full response from the TcpStream, likely because we read anything that is already on the stream without knowing if all the data is already there. So I am **trying** to fix it by reading a full line, until we reach a `\n`, which is the terminator used by electrum responses. * Enable feature-gate banners in docs (#567) I have added `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` to each lib.rs to enable such banners in our docs. To generate them we require the `--cfg docsrs` flag. I have updated our `just` recipe, which now documents all features. This is nice to show the users all options available under each feature. Because we document all features I had to do an exception for the florestad `kv-chainstore` one to avoid a compiler error. * fix: re-index didn't apply changes to chainstate (#562) Before this commit, the re-index code would find the right place where we would work from, but not apply it to our chain. This could create spurious errors like #551. This commit fixes that, and also improves how we handle accumulators on re-indexes. We now try to find our latest accumulator, move validation index there, nad mark future blocks as `HeadersOnly` to not have problems with `BlockDoesntExtendTip`. * chore: remove the `futures` crate (#564) When I started this project, we used async-std as async runtime. async-std did lack some features, like oneshot channes and some macros like select!, for that reason, I've used the futures crate to get some of those functionalities. However, since #172, we use tokio as async runtime. And tokio does have those features. So I'm removing futures as dependencies. tokio also has out-of-the-box support for ctr-c handling, so I'm using it instead of the crate. I've also made the public methods in florestad async. This simplifies some stuff, and shouldn't be a problem, since these methods should only be called with a running runtime. If you need to use them in a sync environment, use a thin wrapper that owns florestad and the runtime. Then block_on every call. * remove futures from floresta-electrum * remove futures and ctrc from florestad and wire * remove futures from floresta --------- Co-authored-by: S \times 3 🗿 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
chore
Cleaning, refactoring, reducing complexity
code quality
Generally improves code readability and maintainability
dependencies
Pull requests that update a dependency file
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Which crates are being modified?
Description
When I started this project, we used
async-stdas async runtime.async-stddid lack some features, likeoneshotchannes and some macros likeselect!, for that reason, I've used thefuturescrate to get some of those functionalites. However, since #172, we usetokioas async runtime. Andtokiodoes have those features. So I'm removingfuturesas dependencies.tokioalso has out-of-the-box support forctr-chandling, so I'm using it instead of the crate.I've also made the public methods in
florestadasync. This simplifies some stuff, and shouldn't be a problem, since these methods should only be called with a running runtime. If you need to use them in a sync environment, use a thin wrapper that ownsflorestadand the runtime. Thenblock_onevery call.