Skip to content

Commit

Permalink
feat(GC): remove Chunks by height_created (#2716)
Browse files Browse the repository at this point in the history
* feat(GC): remove chunks with zero height_included

* cache update

* WIP

* feat(store validator): block_chunks_exist function (#2718)

* WIP

* moving Store Validator module into Chain

* block_chunks_exist relies on "do I care about the shard"

* ++ protocol version
  • Loading branch information
Kouprin authored Jun 1, 2020
1 parent aea2c72 commit 2fefd76
Show file tree
Hide file tree
Showing 31 changed files with 542 additions and 343 deletions.
14 changes: 1 addition & 13 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ members = [
"test-utils/testlib",
"test-utils/loadtester",
"test-utils/state-viewer",
"test-utils/store-validator-bin",
"test-utils/store-validator",
"neard/",
"tools/rpctypegen/core",
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ release:
cargo build -p genesis-csv-to-json --release
cargo build -p near-vm-runner-standalone --release
cargo build -p state-viewer --release
cargo build -p store-validator-bin --release
cargo build -p store-validator --release

debug:
cargo build -p neard
cargo build -p keypair-generator
cargo build -p genesis-csv-to-json
cargo build -p near-vm-runner-standalone
cargo build -p state-viewer
cargo build -p store-validator-bin
cargo build -p store-validator
1 change: 0 additions & 1 deletion chain/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ near-pool = { path = "../pool" }

[dev-dependencies]
near-logger-utils = {path = "../../test-utils/logger"}
near-store-validator = { path = "../../test-utils/store-validator" }

[features]
# if enabled, we assert in most situations that are impossible unless some byzantine behavior is observed.
Expand Down
4 changes: 2 additions & 2 deletions chain/chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use chrono::Duration;
use log::{debug, error, info};

use near_chain_configs::GenesisConfig;
use near_primitives::block::genesis_chunks;
use near_primitives::block::{genesis_chunks, Tip};
use near_primitives::challenge::{
BlockDoubleSign, Challenge, ChallengeBody, ChallengesResult, ChunkProofs, ChunkState,
MaybeEncodedShardChunk, SlashedValidator,
Expand Down Expand Up @@ -40,7 +40,7 @@ use crate::store::{
use crate::types::{
AcceptedBlock, ApplyTransactionResult, Block, BlockHeader, BlockStatus, BlockSyncResponse,
Provenance, ReceiptList, ReceiptProofResponse, ReceiptResponse, RootProof, RuntimeAdapter,
ShardStateSyncResponseHeader, StatePartKey, Tip,
ShardStateSyncResponseHeader, StatePartKey,
};
use crate::validate::{
validate_challenge, validate_chunk_proofs, validate_chunk_with_chunk_extra,
Expand Down
4 changes: 3 additions & 1 deletion chain/chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ pub use doomslug::{Doomslug, DoomslugBlockProductionReadiness, DoomslugThreshold
pub use error::{Error, ErrorKind};
pub use lightclient::create_light_client_block_view;
pub use store::{ChainStore, ChainStoreAccess, ChainStoreUpdate};
pub use types::{Block, BlockHeader, BlockStatus, Provenance, ReceiptResult, RuntimeAdapter, Tip};
pub use store_validator::{ErrorMessage, StoreValidator};
pub use types::{Block, BlockHeader, BlockStatus, Provenance, ReceiptResult, RuntimeAdapter};

pub mod chain;
mod doomslug;
mod error;
mod lightclient;
mod metrics;
mod store;
pub mod store_validator;
pub mod test_utils;
pub mod types;
pub mod validate;
Expand Down
Loading

0 comments on commit 2fefd76

Please sign in to comment.