-
Notifications
You must be signed in to change notification settings - Fork 27
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
Remove chia-blockchain dependency for most of chia_rs #887
Open
matt-o-how
wants to merge
16
commits into
main
Choose a base branch
from
remove_chia_blockchain_from_tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fe7819a
remove imports from test_blscache and delete test_program_fidelity
matt-o-how 315fab0
remove imports from block_record by implement pot_iterations
matt-o-how 0d406e7
clippy and fmt
matt-o-how d27c1a5
don't export new functions
matt-o-how 19ca423
black tests
matt-o-how 264058d
import PyValueError at top of file
matt-o-how 719b8a2
add pot_iterations and pos_quality modules; refactor block_record to …
matt-o-how 74a700e
fix circular import
matt-o-how ef8c936
temp commit
matt-o-how 06cdaad
fix build with py-bindings
matt-o-how 2b9d0f7
clippy and fmt
matt-o-how 242c993
black format test
matt-o-how b8c0305
fix fetching rust values from python
matt-o-how 7d38538
tests run but overflow
matt-o-how 2bb5c1e
correct order of blockrecord args
matt-o-how 31bdbc7
add tests to pot_iterations.rs
matt-o-how File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,19 @@ | ||
// The actual space in bytes of a plot, is _expected_plot_size(k) * UI_ACTUAL_SPACE_CONSTANT_FACTO | ||
// This is not used in consensus, only for display purposes | ||
|
||
pub const UI_ACTUAL_SPACE_CONSTANT_FACTOR: f32 = 0.78; | ||
|
||
// TODO: Update this when new plot format releases | ||
#[cfg(feature = "py-bindings")] | ||
#[pyo3::pyfunction] | ||
pub fn expected_plot_size(k: u32) -> pyo3::PyResult<u64> { | ||
// """ | ||
// Given the plot size parameter k (which is between 32 and 59), computes the | ||
// expected size of the plot in bytes (times a constant factor). This is based on efficient encoding | ||
// of the plot, and aims to be scale agnostic, so larger plots don't | ||
// necessarily get more rewards per byte. The +1 is added to give half a bit more space per entry, which | ||
// is necessary to store the entries in the plot. | ||
// """ | ||
|
||
Ok((2 * k as u64 + 1) * (1_u64 << (k - 1))) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I think you have to do
#[cfg_attr(feature = "py-bindings", pyo3::pyfunction)]
instead?