This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Move sr-arithmetic to a new crate and add in a fuzzer #3799
Merged
kianenigma
merged 70 commits into
paritytech:master
from
expenses:sr-arithmetic-fuzzing
Oct 19, 2019
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
963a14d
Split up sr_arithmetic.rs
expenses 0bc870d
Add some basic fuzzing
expenses b1a9793
Add more tests
expenses dc8cc41
Add printing to fuzzing
expenses ee26625
Clean things up
expenses 38597b9
Remove arbitrary
expenses c7c5888
Remove comments
expenses cd2db5d
More cleaning, fix small error that was causing a panic
expenses 8a0ef6b
Add rational128
expenses 562cdff
Remove old random tests
expenses c66f882
introduce panic
expenses 7adc99d
fuzzing should panic properly
expenses c28ae3f
Bit of cleanup
expenses 77a8cbb
Add a test uncovered via fuzzing that fails!
expenses 1fe1a9f
Few small changes
expenses 40c0708
Move sr-arithmetic to its own crate
expenses c7f5345
Fix fuzzing
expenses 20813dd
Got rid of fuzzer Cargo.lock
expenses 4aa7dd5
Added no_std
expenses e8cbb1d
re-export assert_eq_error_rate
expenses ed264e5
Merge branch 'master' of https://github.com/paritytech/substrate into…
expenses f4c5154
bump impl and spec version
expenses 85f8487
re add convert into
expenses 03dd42e
Add an ignore to the test
expenses aeb6a1d
Enabled benchmarking
expenses 117f818
Reindent
expenses 458edbd
Clean up biguint fuzzer
expenses 419bc5a
Clean up biguint more
expenses 89f6b06
shuffle sr-primitives/traits about
expenses 8fb2890
Remove unused dependencies
expenses 5eb310a
Apply clippy suggestions
expenses 316f562
upgrade primitive-types versions
expenses ac9a2f2
Run tests against num-bigint
expenses 5a21213
Get rid of allocation in assert_biguints_eq
expenses 99f366e
Merge branch 'master' of https://github.com/paritytech/substrate into…
expenses 2123d00
Add an optimisation to multiply_by_rational
expenses dc651e4
rename parts_per_x -> per_things
expenses 2acc346
Change fuzzer cargo.toml
expenses 38650cf
Remove allocation from BigUint PartialEq impl
expenses a377d3e
Remove accidental indentation
expenses ae25a41
Renmove Lazy and Convert traits
expenses 20a0488
Copy assert_eq_error_rate macro back to sr-primitives
expenses 17933d1
Add documentation to fuzzers
expenses 7c80be9
fix sr-primitives assert_eq_error_rate
expenses c5616c2
add cfg(test)
expenses c082792
Update core/sr-arithmetic/src/traits.rs
expenses 7878cec
Update core/sr-arithmetic/src/traits.rs
expenses 5387c96
Update core/sr-arithmetic/fuzzer/src/biguint.rs
expenses 98cdb31
Allow rounding up in rational128
expenses 42f6521
Merge branch 'sr-arithmetic-fuzzing' of https://github.com/expenses/s…
expenses 3ac8b87
Make changes to biguint.rs
expenses 41cfa3a
Update core/sr-arithmetic/src/traits.rs
expenses 99099c9
Final touches
expenses 85a790b
Merge branch 'sr-arithmetic-fuzzing' of https://github.com/expenses/s…
expenses e32f887
Convert to num_bigint::BigUint to compare
expenses 883272c
remove unused mut
expenses 1209939
more small changes
expenses 7202e2d
shuffle sr-primitives trait imports
expenses 1cadf86
more code review
expenses a934f37
Merge branch 'master' into sr-arithmetic-fuzzing
expenses 2dd9c31
move assert_eq_error_rate to lib.rs
expenses 9a02591
Update core/sr-arithmetic/fuzzer/src/biguint.rs
expenses d58d6d3
Get rid of S
expenses 9dd0688
Merge branch 'sr-arithmetic-fuzzing' of https://github.com/expenses/s…
expenses ab5ec37
Simplify rational128 honggfuzz link
expenses dcf169c
Insignificantly change rational128 fuzzing code
expenses f51e484
Fix merge conflict
expenses 900c305
Slightly tidy up some of the arithmetic logic
expenses 79e4348
Get rid of sr_arithmetic again(?) and fix sr-primitives/weights
expenses 0a843c8
Apply updates to sr_arithmetic.rs to crate
expenses 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "sr-arithmetic" | ||
version = "2.0.0" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
num-traits = { version = "0.2.8", default-features = false } | ||
serde = { version = "1.0.101", optional = true, features = ["derive"] } | ||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] } | ||
rstd = { package = "sr-std", path = "../sr-std", default-features = false } | ||
integer-sqrt = "0.1.2" | ||
|
||
[dev-dependencies] | ||
primitive-types = "0.6.0" | ||
rand = "0.7.2" | ||
|
||
[features] | ||
bench = [] | ||
default = ["std"] | ||
std = [ | ||
"serde", | ||
"num-traits/std", | ||
"rstd/std", | ||
"codec/std", | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hfuzz_target | ||
hfuzz_workspace |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "sr-arithmetic-fuzzer" | ||
version = "2.0.0" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
sr-arithmetic = { path = ".." } | ||
honggfuzz = "0.5" | ||
primitive-types = "0.6" | ||
num-bigint = "0.2" | ||
num-traits = "0.2" | ||
|
||
[[bin]] | ||
name = "biguint" | ||
path = "src/biguint.rs" | ||
|
||
[[bin]] | ||
name = "rational128" | ||
path = "src/rational128.rs" |
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.
Uh oh!
There was an error while loading. Please reload this page.