Skip to content

Conversation

@Davidson-Souza
Copy link
Member

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other: Remove redundant dependency

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other:

Description

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 functionalites. 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.

@Davidson-Souza Davidson-Souza added dependencies Pull requests that update a dependency file chore Cleaning, refactoring, reducing complexity code quality Generally improves code readability and maintainability labels Jul 10, 2025
Copy link
Contributor

@JoseSK999 JoseSK999 left a 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 Davidson-Souza merged commit 39c393e into vinteumorg:master Jul 11, 2025
10 checks passed
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
@Davidson-Souza Davidson-Souza mentioned this pull request Jul 12, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants