Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into at/remove-duplicate-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
athei committed Jan 19, 2023
2 parents 1f6c0d0 + 0b6aec5 commit 60b6b71
Show file tree
Hide file tree
Showing 189 changed files with 1,143 additions and 288 deletions.
64 changes: 47 additions & 17 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion bin/node-template/pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository = "https://github.com/substrate-developer-hub/substrate-node-template
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [
"derive",
] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bin/node-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository = "https://github.com/substrate-developer-hub/substrate-node-template
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }

pallet-aura = { version = "4.0.0-dev", default-features = false, path = "../../../frame/aura" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ crate-type = ["cdylib", "rlib"]
# third-party dependencies
array-bytes = "4.1"
clap = { version = "4.0.9", features = ["derive"], optional = true }
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.2.2" }
serde = { version = "1.0.136", features = ["derive"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
futures = "0.3.21"
Expand Down
2 changes: 1 addition & 1 deletion bin/node/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.2.2" }
scale-info = { version = "2.1.1", features = ["derive"] }
frame-benchmarking = { version = "4.0.0-dev", path = "../../../frame/benchmarking" }
node-primitives = { version = "2.0.0", path = "../primitives" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
clap = { version = "4.0.9", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.2.2" }
thiserror = "1.0"
sc-cli = { version = "0.10.0-dev", path = "../../../client/cli" }
sc-client-api = { version = "4.0.0-dev", path = "../../../client/api" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [
"derive",
] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]

# third-party dependencies
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [
"derive",
"max-encoded-len",
] }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.2.2" }
fs_extra = "1"
futures = "0.3.21"
log = "0.4.17"
Expand Down
2 changes: 1 addition & 1 deletion client/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [
"derive",
] }
fnv = "1.0.6"
Expand Down
22 changes: 21 additions & 1 deletion client/api/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,24 @@ pub trait StorageProvider<Block: BlockT, B: Backend<Block>> {
///
/// Manages the data layer.
///
/// Note on state pruning: while an object from `state_at` is alive, the state
/// # State Pruning
///
/// While an object from `state_at` is alive, the state
/// should not be pruned. The backend should internally reference-count
/// its state objects.
///
/// The same applies for live `BlockImportOperation`s: while an import operation building on a
/// parent `P` is alive, the state for `P` should not be pruned.
///
/// # Block Pruning
///
/// Users can pin blocks in memory by calling `pin_block`. When
/// a block would be pruned, its value is kept in an in-memory cache
/// until it is unpinned via `unpin_block`.
///
/// While a block is pinned, its state is also preserved.
///
/// The backend should internally reference count the number of pin / unpin calls.
pub trait Backend<Block: BlockT>: AuxStore + Send + Sync {
/// Associated block insertion operation type.
type BlockImportOperation: BlockImportOperation<Block, State = Self::State>;
Expand Down Expand Up @@ -502,6 +514,14 @@ pub trait Backend<Block: BlockT>: AuxStore + Send + Sync {
/// Returns a handle to offchain storage.
fn offchain_storage(&self) -> Option<Self::OffchainStorage>;

/// Pin the block to keep body, justification and state available after pruning.
/// Number of pins are reference counted. Users need to make sure to perform
/// one call to [`Self::unpin_block`] per call to [`Self::pin_block`].
fn pin_block(&self, hash: Block::Hash) -> sp_blockchain::Result<()>;

/// Unpin the block to allow pruning.
fn unpin_block(&self, hash: Block::Hash);

/// Returns true if state for given block is available.
fn have_state_at(&self, hash: Block::Hash, _number: NumberFor<Block>) -> bool {
self.state_at(hash).is_ok()
Expand Down
Loading

0 comments on commit 60b6b71

Please sign in to comment.