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

Various improvements #1745

Merged
merged 8 commits into from
Jan 30, 2024
Merged

Various improvements #1745

merged 8 commits into from
Jan 30, 2024

Conversation

vmx
Copy link
Contributor

@vmx vmx commented Dec 21, 2023

This PR is a mix of smaller changes that I accumulated over the year. This PR should be reviewed on a commit by commit basis. I thought I bundle them in a single PR so that I don't have to rebase all of them all the time.

The review is not urgent, but I hope we can get all of those eventually merged.

Include a graph of the workspace dependencies for clarity. Also add
additional information to the `filecoin-proofs` crate in regards to
the FFI.
Make `build_binary_tree()` private as it isn't used anywhere else.
Move information about the settings to the settings object in core.
This way the `use_gpu_tree_builder` setting can easily be accessed
without constructing a `StackedDrg`.
Currently almost everything from the cache implementation is public,
although that's not really needed.

With having less things public, it's easier to reason about, where the
entry points are and which parts are implementation details.
The `EmptySectorUpdate::encode_into()` function doesn't use the `new_cache_path`
and `sector_key_cachce_path` for anything, other than checking that they are
directories. Those checks are moved to the caller instead.

BREAKING CHANGE: EmptySectorUpdate::encode_into() now takes one less arguments.
The `encode_into()` function takes a `PoRepConfig` and immediately converts it
into a `SectorUpdateConfig`. It's a better and more consistent with existing
APIs (e.g. the `decode_from()`) to take a `SectorUpdateConfig` directly.

BREAKING CHANGE: `encode_into()` not takes a `SectorUpdateConfig` instead of
a `PoRepConfig`. In order to upgrade you can call

    let config = SectorUpdateConfig::from_porep_config(&porep_config);

before calling `encode_into()`.
Re-export `AggregateVersion`:

`bellperson`s `AggregateVersion` is part of the public API due to the
`CompoundProof` trait. With re-exporting it, it's possible that downstream
dependants like filecoin proofs API don't need to depend on `bellperson`
directly, but can use this re-export instead.

Re-export `filecoin_hashers::Hasher` trait:

The `filecoin_hashers::Hasher` trait is needed a lot in downstream dependants
when the domain of the Tree hasher needs to be accessed. Hence re-export it,
so that those dependents don't need to depend directly on `filecoin_hashers`
only due to this single trait.
@vmx vmx merged commit f7fcd54 into master Jan 30, 2024
32 checks passed
@vmx vmx deleted the improvements-202312 branch January 30, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants