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

Initial pruning logic #46

Merged
merged 26 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
18e226e
next_pruning_point_and_candidate_by_block_hash
someone235 Sep 28, 2022
512e3f9
expected_header_pruning_point
someone235 Sep 29, 2022
09172f0
Fix tests
someone235 Sep 29, 2022
88d7311
block level
someone235 Oct 4, 2022
f18c2e4
calc_block_parents
someone235 Oct 6, 2022
38c0d63
fix off by one
someone235 Oct 8, 2022
a4efa13
Add devnet params
someone235 Oct 10, 2022
d9e903d
Replace cache
someone235 Oct 10, 2022
c9d80a2
Fix lint errors
someone235 Oct 10, 2022
3add5a0
fmt
someone235 Oct 10, 2022
1d79560
Optimize cache
someone235 Oct 12, 2022
ec6c8d9
Remove unused import
someone235 Oct 12, 2022
be50602
Use parking lot rwlock
someone235 Oct 12, 2022
78d7104
Remove moka
someone235 Oct 12, 2022
4e1cf96
Add pruning point info
someone235 Oct 12, 2022
9223acd
Add check to number of levels in check_indirect_parents
someone235 Oct 12, 2022
23db589
Remove redundant static lifetime specifier
someone235 Oct 12, 2022
bb37736
Fix the pruning point check
michaelsutton Oct 13, 2022
40ec22b
typos
michaelsutton Oct 13, 2022
53faccc
get pruning info with one call from store
michaelsutton Oct 13, 2022
75bc319
Build payload with iterators
michaelsutton Oct 13, 2022
3a412e6
Test iterator edge case, remove comment, add test todos
michaelsutton Oct 13, 2022
b2a9894
Fix a parenthesis location bug...
michaelsutton Oct 13, 2022
edd8441
use ..= syntax to be more explicit about the inclusiveness of the range
michaelsutton Oct 13, 2022
15cc087
once
michaelsutton Oct 13, 2022
ffcdd33
Pass PruningPointInfo struct to expected_header_pruning_point to avoi…
michaelsutton Oct 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 3 additions & 204 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ rand_chacha = "0.3"
rayon = "1"
tempfile = "3.3"
serde = { version = "1", features = ["derive", "rc"] }
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
futures-util = { version = "0.3", default-features = false, features = [
"alloc",
] }
bincode = { version = "1", default-features = false }
tokio = { version = "1", features = ["sync"] }
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
criterion = { version = "0.4", default-features = false }
indexmap = "1.9.1"
3 changes: 2 additions & 1 deletion consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ tokio.workspace = true
bincode.workspace = true
tempfile.workspace = true
rayon.workspace = true
rand.workspace = true
indexmap.workspace = true

rocksdb = "0.19"
moka = "0.9"
parking_lot = "0.12"
crossbeam-channel = "0.5"

Expand Down
4 changes: 2 additions & 2 deletions consensus/pow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ impl State {

#[inline]
#[must_use]
pub fn check_pow(&self, nonce: u64) -> bool {
pub fn check_pow(&self, nonce: u64) -> (bool, Uint256) {
let pow = self.calculate_pow(nonce);
// The pow hash must be less or equal than the claimed target.
pow <= self.target
(pow <= self.target, pow)
}
}
Loading