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

Bump parity-common #5673

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
206 changes: 102 additions & 104 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,9 @@ enumflags2 = { version = "0.7.7" }
enumn = { version = "0.1.13" }
environmental = { version = "1.1.4", default-features = false }
equivocation-detector = { path = "bridges/relays/equivocation" }
ethabi = { version = "1.0.0", default-features = false, package = "ethabi-decode" }
ethbloom = { version = "0.13.0", default-features = false }
ethereum-types = { version = "0.14.1", default-features = false }
ethabi = { version = "1.1.0", default-features = false, package = "ethabi-decode" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ethabi = { version = "1.1.0", default-features = false, package = "ethabi-decode" }
ethabi = { version = "2.0.0", default-features = false, package = "ethabi-decode" }

ethbloom = { version = "0.14.0", default-features = false }
ethereum-types = { version = "0.15.0", default-features = false }
exit-future = { version = "0.2.0" }
expander = { version = "2.0.0" }
fatality = { version = "0.1.1" }
Expand Down Expand Up @@ -1002,7 +1002,6 @@ parachains-relay = { path = "bridges/relays/parachains" }
parachains-runtimes-test-utils = { path = "cumulus/parachains/runtimes/test-utils", default-features = false }
parity-bytes = { version = "0.1.2", default-features = false }
parity-db = { version = "0.4.12" }
parity-util-mem = { version = "0.12.0" }
parity-wasm = { version = "0.45.0" }
parking_lot = { version = "0.12.1", default-features = false }
partial_sort = { version = "0.2.0" }
Expand Down Expand Up @@ -1076,7 +1075,7 @@ polkavm-derive = "0.9.1"
polkavm-linker = "0.9.2"
portpicker = { version = "0.1.1" }
pretty_assertions = { version = "1.3.0" }
primitive-types = { version = "0.12.1", default-features = false }
primitive-types = { version = "0.13.0", default-features = false }
proc-macro-crate = { version = "3.0.0" }
proc-macro-warning = { version = "1.0.0", default-features = false }
proc-macro2 = { version = "1.0.86" }
Expand Down Expand Up @@ -1104,7 +1103,7 @@ relay-substrate-client = { path = "bridges/relays/client-substrate" }
relay-utils = { path = "bridges/relays/utils" }
remote-externalities = { path = "substrate/utils/frame/remote-externalities", default-features = false, package = "frame-remote-externalities" }
reqwest = { version = "0.11", default-features = false }
rlp = { version = "0.5.2", default-features = false }
rlp = { version = "0.6.0", default-features = false }
rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/relays/rococo" }
rococo-parachain-runtime = { path = "cumulus/parachains/runtimes/testing/rococo-parachain" }
rococo-runtime = { path = "polkadot/runtime/rococo" }
Expand Down
2 changes: 0 additions & 2 deletions bridges/primitives/polkadot-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ workspace = true

[dependencies]
codec = { features = ["derive"], workspace = true }
parity-util-mem = { optional = true, workspace = true }
scale-info = { features = ["derive"], workspace = true }
serde = { optional = true, features = [
"derive",
Expand Down Expand Up @@ -42,7 +41,6 @@ std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"parity-util-mem",
"scale-info/std",
"serde",
"sp-core/std",
Expand Down
5 changes: 1 addition & 4 deletions bridges/primitives/polkadot-core/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ use sp_std::vec::Vec;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};

#[cfg(feature = "std")]
use parity_util_mem::MallocSizeOf;

/// Parachain id.
///
/// This is an equivalent of the `polkadot_parachain_primitives::Id`, which is a compact-encoded
Expand Down Expand Up @@ -71,7 +68,7 @@ impl From<u32> for ParaId {
#[derive(
PartialEq, Eq, Clone, PartialOrd, Ord, Encode, Decode, RuntimeDebug, TypeInfo, Default,
)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash, MallocSizeOf))]
pgherveou marked this conversation as resolved.
Show resolved Hide resolved
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash))]
pub struct ParaHead(pub Vec<u8>);

impl ParaHead {
Expand Down
2 changes: 1 addition & 1 deletion cumulus/parachains/runtimes/testing/penpal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ parachain-info = { workspace = true }
parachains-common = { workspace = true }
assets-common = { workspace = true }

primitive-types = { version = "0.12.1", default-features = false, features = ["codec", "num-traits", "scale-info"] }
primitive-types = { workspace = true, default-features = false, features = ["codec", "num-traits", "scale-info"] }

[features]
default = ["std"]
Expand Down
20 changes: 20 additions & 0 deletions prdoc/pr_5673.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 parity-common crates

doc:
- audience: Runtime Dev
description: |
Update parity-common deps see https://github.com/paritytech/parity-common/pull/860
for more details

crates:
- name: bp-polkadot-core
bump: patch
- name: penpal-runtime
bump: patch
- name: pallet-babe
bump: patch
- name: pallet-revive
bump: patch
3 changes: 2 additions & 1 deletion substrate/client/consensus/babe/src/authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ pub(super) fn secondary_slot_author(
return None
}

let rand = U256::from((randomness, slot).using_encoded(sp_crypto_hashing::blake2_256));
let rand =
U256::from_big_endian(&(randomness, slot).using_encoded(sp_crypto_hashing::blake2_256));

let authorities_len = U256::from(authorities.len());
let idx = rand % authorities_len;
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/babe/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub fn new_test_ext_with_pairs(
authorities_len: usize,
) -> (Vec<AuthorityPair>, sp_io::TestExternalities) {
let pairs = (0..authorities_len)
.map(|i| AuthorityPair::from_seed(&U256::from(i).into()))
.map(|i| AuthorityPair::from_seed(&U256::from(i).to_big_endian()))
.collect::<Vec<_>>();

let public = pairs.iter().map(|p| p.public()).collect();
Expand Down
17 changes: 5 additions & 12 deletions substrate/frame/revive/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ type CallOf<T> = <T as frame_system::Config>::RuntimeCall;
/// The maximum nesting depth a contract can use when encoding types.
const MAX_DECODE_NESTING: u32 = 256;

/// Encode a `U256` into a 32 byte buffer.
fn as_bytes(u: U256) -> [u8; 32] {
let mut bytes = [0u8; 32];
u.to_little_endian(&mut bytes);
bytes
}

#[derive(Clone, Copy)]
pub enum ApiVersion {
/// Expose all APIs even unversioned ones. Only used for testing and benchmarking.
Expand Down Expand Up @@ -1509,7 +1502,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.balance()),
&self.ext.balance().to_little_endian(),
false,
already_charged,
)?)
Expand All @@ -1523,7 +1516,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.value_transferred()),
&self.ext.value_transferred().to_little_endian(),
false,
already_charged,
)?)
Expand All @@ -1537,7 +1530,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.now()),
&self.ext.now().to_little_endian(),
false,
already_charged,
)?)
Expand All @@ -1551,7 +1544,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.minimum_balance()),
&self.ext.minimum_balance().to_little_endian(),
false,
already_charged,
)?)
Expand Down Expand Up @@ -1605,7 +1598,7 @@ pub mod env {
Ok(self.write_fixed_sandbox_output(
memory,
out_ptr,
&as_bytes(self.ext.block_number()),
&self.ext.block_number().to_little_endian(),
false,
already_charged,
)?)
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/sassafras/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn new_test_ext_with_pairs(
with_ring_context: bool,
) -> (Vec<AuthorityPair>, sp_io::TestExternalities) {
let pairs = (0..authorities_len)
.map(|i| AuthorityPair::from_seed(&U256::from(i).into()))
.map(|i| AuthorityPair::from_seed(&U256::from(i).to_big_endian()))
.collect::<Vec<_>>();

let authorities: Vec<_> = pairs.iter().map(|p| p.public()).collect();
Expand Down
2 changes: 1 addition & 1 deletion substrate/primitives/runtime/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl From<UintAuthorityId> for u64 {
impl UintAuthorityId {
/// Convert this authority ID into a public key.
pub fn to_public_key<T: ByteArray>(&self) -> T {
let bytes: [u8; 32] = U256::from(self.0).into();
let bytes = U256::from(self.0).to_big_endian();
T::from_slice(&bytes).unwrap()
}
}
Expand Down
Loading