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 some dependencies #5886

Merged
merged 13 commits into from
Oct 8, 2024
224 changes: 125 additions & 99 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ env_logger = { version = "0.11.2" }
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 }
ethbloom = { version = "0.14.1", default-features = false }
ethereum-types = { version = "0.15.1", default-features = false }
exit-future = { version = "0.2.0" }
expander = { version = "2.0.0" }
fatality = { version = "0.1.1" }
Expand Down Expand Up @@ -1003,7 +1003,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 @@ -1078,7 +1077,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.1", default-features = false, features = ["num-traits"] }
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 @@ -1106,7 +1105,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.1", 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))]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash))]
pub struct ParaHead(pub Vec<u8>);

impl ParaHead {
Expand Down
18 changes: 18 additions & 0 deletions prdoc/pr_5886.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: Bump some dependencies
doc:
- audience: Runtime Dev
description: |-
This bumps `ethbloom`, `ethereum-types`, `primitive-types` and `rlp` to their latest version.

Fixes: https://github.com/paritytech/polkadot-sdk/issues/5870
crates:
- name: sc-consensus-babe
bump: patch
- name: pallet-babe
bump: patch
- name: pallet-revive
bump: patch
- name: sp-runtime
bump: patch
bkchr marked this conversation as resolved.
Show resolved Hide resolved
- name: bp-polkadot-core
bump: major
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_little_endian(&(randomness, slot).using_encoded(sp_crypto_hashing::blake2_256));
Copy link
Member

@ordian ordian Oct 9, 2024

Choose a reason for hiding this comment

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

wasn't From::from based on from_big_endian?
see https://github.com/paritytech/parity-common/pull/859/files
can this create consensus problems with some nodes upgrading to this code?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is causing the failures in some tests.

https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7540617
https://grafana.teleport.parity.io/goto/P4omWXkHR?orgId=1

--
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7540639
https://grafana.teleport.parity.io/goto/8xYZZXkNg?orgId=1

--
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7540550
https://grafana.teleport.parity.io/goto/WvoIZXkNR?orgId=1

--
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7540540
https://grafana.teleport.parity.io/goto/0uUHWuzHR?orgId=1

--
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7540189
https://grafana.teleport.parity.io/goto/6PeOZXkHR?orgId=1

--
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7540084
https://grafana.teleport.parity.io/goto/jWV5ZXzNR?orgId=1

--
https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7539899
https://grafana.teleport.parity.io/goto/yjEpWukHR?orgId=1

Copy link
Member

Choose a reason for hiding this comment

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


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_little_endian()))
.collect::<Vec<_>>();

let public = pairs.iter().map(|p| p.public()).collect();
Expand Down
4 changes: 1 addition & 3 deletions substrate/frame/revive/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ 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
u.to_little_endian()
}

#[derive(Clone, Copy)]
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
8 changes: 3 additions & 5 deletions substrate/primitives/runtime/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ use crate::{
ApplyExtrinsicResultWithInfo, KeyTypeId,
};
use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize, Serializer};
use sp_core::{
crypto::{key_types, ByteArray, CryptoType, Dummy},
U256,
};
use sp_core::crypto::{key_types, ByteArray, CryptoType, Dummy};
pub use sp_core::{sr25519, H256};
use std::{
cell::RefCell,
Expand Down Expand Up @@ -79,7 +76,8 @@ 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 mut bytes = [0u8; 32];
bytes[0..8].copy_from_slice(&self.0.to_le_bytes());
T::from_slice(&bytes).unwrap()
}
}
Expand Down
Loading