Skip to content

Commit

Permalink
Merge branch 'master' into polling-ref-provides-origin
Browse files Browse the repository at this point in the history
  • Loading branch information
olanod authored Jul 9, 2024
2 parents 8e23940 + d4657f8 commit 4750e01
Show file tree
Hide file tree
Showing 70 changed files with 333 additions and 179 deletions.
36 changes: 13 additions & 23 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ linregress = { version = "0.5.1" }
lite-json = { version = "0.2.0", default-features = false }
litep2p = { version = "0.6.2" }
log = { version = "0.4.21", default-features = false }
macro_magic = { version = "0.5.0" }
macro_magic = { version = "0.5.1" }
maplit = { version = "1.0.2" }
memmap2 = { version = "0.9.3" }
memory-db = { version = "0.32.0", default-features = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westmint"),
impl_name: create_runtime_str!("westmint"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-rococo"),
impl_name: create_runtime_str!("bridge-hub-rococo"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-westend"),
impl_name: create_runtime_str!("bridge-hub-westend"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("collectives-westend"),
impl_name: create_runtime_str!("collectives-westend"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("contracts-rococo"),
impl_name: create_runtime_str!("contracts-rococo"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("coretime-rococo"),
impl_name: create_runtime_str!("coretime-rococo"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("coretime-westend"),
impl_name: create_runtime_str!("coretime-westend"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("glutton-westend"),
impl_name: create_runtime_str!("glutton-westend"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("people-rococo"),
impl_name: create_runtime_str!("people-rococo"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("people-westend"),
impl_name: create_runtime_str!("people-westend"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("test-parachain"),
impl_name: create_runtime_str!("test-parachain"),
authoring_version: 1,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub use disputes::{
/// relatively rare.
///
/// The associated worker binaries should use the same version as the node that spawns them.
pub const NODE_VERSION: &'static str = "1.13.0";
pub const NODE_VERSION: &'static str = "1.14.0";

// For a 16-ary Merkle Prefix Trie, we can expect at most 16 32-byte hashes per node
// plus some overhead:
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("rococo"),
impl_name: create_runtime_str!("parity-rococo-v2.0"),
authoring_version: 0,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westend"),
impl_name: create_runtime_str!("parity-westend"),
authoring_version: 2,
spec_version: 1_013_000,
spec_version: 1_014_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions prdoc/pr_3286.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: "Assets: can_decrease/increase for destroying asset is not successful"

doc:
- audience: Runtime Dev
description: |
Functions `can_decrease` and `can_increase` do not return successful consequence results
for assets undergoing destruction; instead, they return the `UnknownAsset` consequence variant.
This update aligns their behavior with similar functions, such as `reducible_balance`,
`increase_balance`, `decrease_balance`, and `burn`, which return an `AssetNotLive` error
for assets in the process of being destroyed.

crates:
- name: pallet-assets
10 changes: 10 additions & 0 deletions prdoc/pr_4863.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: "Make `tracing::log` work in the runtime"

doc:
- audience: Runtime Dev
description: |
Make `tracing::log` work in the runtime as `log` works in the runtime.

crates:
- name: sp-runtime
bump: patch
14 changes: 14 additions & 0 deletions prdoc/pr_4885.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Removed `pallet::getter` usage from the pallet-transaction-storage

doc:
- audience: Runtime Dev
description: |
This PR removed `pallet::getter`s from `pallet-transaction-storage`s storage items.
When accessed inside the pallet, use the syntax `StorageItem::<T, I>::get()`.

crates:
- name: pallet-transaction-storage
bump: minor
15 changes: 15 additions & 0 deletions prdoc/pr_4912.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Removed `pallet::getter` usage from the pallet-babe

doc:
- audience: Runtime Dev
description: |
This PR removed `pallet::getter`s from `pallet-babe`s storage items.
When accessed inside the pallet, use the syntax `StorageItem::<T>::get()`.
When accessed outside the pallet, use the public functions of storage.

crates:
- name: pallet-babe
bump: minor
13 changes: 13 additions & 0 deletions prdoc/pr_4943.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Update definition of frozen balance (docs PR)

doc:
- audience: Runtime Dev
description: |
This PR fixes a bug in the docs located in the definition of frozen balances. In addition, it extends that definition for completeness.

crates:
- name: frame-support
bump: patch
11 changes: 10 additions & 1 deletion substrate/client/network/src/litep2p/peerstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ impl PeerInfo {
self.reputation < BANNED_THRESHOLD
}

fn add_reputation(&mut self, increment: i32) {
self.reputation = self.reputation.saturating_add(increment);
self.bump_last_updated();
}

fn decay_reputation(&mut self, seconds_passed: u64) {
// Note that decaying the reputation value happens "on its own",
// so we don't do `bump_last_updated()`.
Expand All @@ -103,6 +108,10 @@ impl PeerInfo {
}
}
}

fn bump_last_updated(&mut self) {
self.last_updated = Instant::now();
}
}

#[derive(Debug, Default)]
Expand Down Expand Up @@ -169,7 +178,7 @@ impl PeerStoreProvider for PeerstoreHandle {

match lock.peers.get_mut(&peer) {
Some(info) => {
info.reputation = info.reputation.saturating_add(reputation_change.value);
info.add_reputation(reputation_change.value);
},
None => {
lock.peers.insert(
Expand Down
6 changes: 6 additions & 0 deletions substrate/frame/assets/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Some(details) => details,
None => return DepositConsequence::UnknownAsset,
};
if details.status == AssetStatus::Destroying {
return DepositConsequence::UnknownAsset
}
if increase_supply && details.supply.checked_add(&amount).is_none() {
return DepositConsequence::Overflow
}
Expand Down Expand Up @@ -175,6 +178,9 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
if details.status == AssetStatus::Frozen {
return Frozen
}
if details.status == AssetStatus::Destroying {
return UnknownAsset
}
if amount.is_zero() {
return Success
}
Expand Down
Loading

0 comments on commit 4750e01

Please sign in to comment.