Skip to content

Commit

Permalink
deps: update substrate to polkadot-v1.5.0 (polkadot-evm#1276)
Browse files Browse the repository at this point in the history
* deps: update substrate to polkadot-sdk#8b061a5c5d29a4ef8efa0f2919fdc5c3cfc36361

* some trivials

* adjust the log level of pending runtime api

* deps: update substrate to polkadot-v1.3.0

* fix mock

* use release-polkadot-v1.3.0 branch and remove version field

* update some deps

* deps: update substrate to polkadot-v1.4.0

* fix toml fmt

* deps: update substrate to polkadot-v1.5.0

* fix

---------

Co-authored-by: Wei Tang <[email protected]>
  • Loading branch information
koushiro and sorpaas authored Jan 15, 2024
1 parent c33caba commit 08d5d47
Show file tree
Hide file tree
Showing 34 changed files with 390 additions and 366 deletions.
526 changes: 270 additions & 256 deletions Cargo.lock

Large diffs are not rendered by default.

141 changes: 71 additions & 70 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

pub mod backend;

Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

mod frontier_db_cmd;

Expand Down
2 changes: 1 addition & 1 deletion client/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

use std::{marker::PhantomData, sync::Arc};

Expand Down
2 changes: 1 addition & 1 deletion client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

// Substrate
pub use sc_client_db::DatabaseSource;
Expand Down
2 changes: 1 addition & 1 deletion client/mapping-sync/src/kv/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ mod tests {
use fp_storage::{EthereumStorageSchema, PALLET_ETHEREUM_SCHEMA};
use sc_block_builder::BlockBuilderBuilder;
use sc_client_api::BlockchainEvents;
use sp_api::Encode;
use scale_codec::Encode;
use sp_consensus::BlockOrigin;
use sp_core::{H160, H256, U256};
use sp_runtime::{generic::Header, traits::BlakeTwo256, Digest};
Expand Down
4 changes: 2 additions & 2 deletions client/mapping-sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]
#![allow(clippy::too_many_arguments)]

pub mod kv;
#[cfg(feature = "sql")]
pub mod sql;

use sp_api::BlockT;
use sp_runtime::traits::Block as BlockT;

#[derive(Copy, Clone, Eq, PartialEq)]
pub enum SyncStrategy {
Expand Down
4 changes: 2 additions & 2 deletions client/mapping-sync/src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use std::{ops::DerefMut, sync::Arc, time::Duration};
use futures::prelude::*;
// Substrate
use sc_client_api::backend::{Backend as BackendT, StateBackend, StorageProvider};
use sp_api::{HeaderT, ProvideRuntimeApi};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::{Backend, HeaderBackend};
use sp_consensus::SyncOracle;
use sp_core::H256;
use sp_runtime::traits::{BlakeTwo256, Block as BlockT, UniqueSaturatedInto};
use sp_runtime::traits::{BlakeTwo256, Block as BlockT, Header as HeaderT, UniqueSaturatedInto};
// Frontier
use fp_rpc::EthereumRuntimeRPCApi;

Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

pub mod types;

Expand Down
1 change: 1 addition & 0 deletions client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ sp-blockchain = { workspace = true }
sp-consensus = { workspace = true }
sp-consensus-aura = { workspace = true, features = ["default"] }
sp-core = { workspace = true, features = ["default"] }
sp-externalities = { workspace = true, features = ["default"] }
sp-inherents = { workspace = true, features = ["default"] }
sp-io = { workspace = true, features = ["default"] }
sp-runtime = { workspace = true, features = ["default"] }
Expand Down
3 changes: 2 additions & 1 deletion client/rpc/src/eth/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ use scale_codec::{Decode, Encode};
// Substrate
use sc_client_api::backend::{Backend, StorageProvider};
use sc_transaction_pool::ChainApi;
use sp_api::{ApiExt, CallApiAt, CallApiAtParams, CallContext, Extensions, ProvideRuntimeApi};
use sp_api::{ApiExt, CallApiAt, CallApiAtParams, CallContext, ProvideRuntimeApi};
use sp_block_builder::BlockBuilder as BlockBuilderApi;
use sp_blockchain::HeaderBackend;
use sp_externalities::Extensions;
use sp_inherents::CreateInherentDataProviders;
use sp_io::hashing::{blake2_128, twox_128};
use sp_runtime::{
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
clippy::len_zero,
clippy::new_without_default
)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

mod cache;
mod debug;
Expand Down
2 changes: 1 addition & 1 deletion client/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

mod overrides;
pub use self::overrides::*;
Expand Down
4 changes: 1 addition & 3 deletions frame/evm/precompile/blake2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]

extern crate alloc;
#![warn(unused_crate_dependencies)]

mod eip_152;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/bn128/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/curve25519/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/ed25519/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/modexp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::comparison_chain)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/sha3fips/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/simple/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

extern crate alloc;

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/test-vector-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

use std::fs;

Expand Down
16 changes: 12 additions & 4 deletions precompiles/src/solidity/codec/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@

//! Encoding of XCM types for solidity
use crate::solidity::{
codec::{bytes::*, Codec, Reader, Writer},
revert::{BacktraceExt, InjectBacktrace, MayRevert, RevertReason},
};
use alloc::string::String;

use frame_support::{ensure, traits::ConstU32};
use sp_core::H256;
use sp_std::vec::Vec;
use sp_weights::Weight;
use xcm::latest::{Junction, Junctions, MultiLocation, NetworkId};

use crate::solidity::{
codec::{bytes::*, Codec, Reader, Writer},
revert::{BacktraceExt, InjectBacktrace, MayRevert, RevertReason},
};

pub const JUNCTION_SIZE_LIMIT: u32 = 2u32.pow(16);

// Function to convert network id to bytes
Expand Down Expand Up @@ -107,6 +109,11 @@ pub(crate) fn network_id_to_bytes(network_id: Option<NetworkId>) -> Vec<u8> {
encoded.push(9u8);
encoded
}
Some(NetworkId::PolkadotBulletin) => {
encoded.push(11u8);
encoded.push(10u8);
encoded
}
}
}

Expand Down Expand Up @@ -159,6 +166,7 @@ pub(crate) fn network_id_from_bytes(encoded_bytes: Vec<u8>) -> MayRevert<Option<
}
9 => Ok(Some(NetworkId::BitcoinCore)),
10 => Ok(Some(NetworkId::BitcoinCash)),
11 => Ok(Some(NetworkId::PolkadotBulletin)),
_ => Err(RevertReason::custom("Non-valid Network Id").into()),
}
}
Expand Down
2 changes: 1 addition & 1 deletion primitives/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::large_enum_variant)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

use scale_codec::{Decode, Encode};
use sp_core::H256;
Expand Down
2 changes: 1 addition & 1 deletion primitives/dynamic-fee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Core types and inherents for dynamic fee.
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

use sp_core::U256;
use sp_inherents::InherentIdentifier;
Expand Down
2 changes: 1 addition & 1 deletion primitives/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

pub use ethereum::{
AccessListItem, BlockV2 as Block, LegacyTransactionMessage, Log, ReceiptV3 as Receipt,
Expand Down
2 changes: 1 addition & 1 deletion primitives/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

mod precompile;
mod validation;
Expand Down
2 changes: 1 addition & 1 deletion primitives/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::too_many_arguments)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

use ethereum::Log;
use ethereum_types::Bloom;
Expand Down
2 changes: 1 addition & 1 deletion primitives/self-contained/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

mod checked_extrinsic;
mod unchecked_extrinsic;
Expand Down
2 changes: 1 addition & 1 deletion primitives/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]
#![warn(unused_crate_dependencies)]

use scale_codec::{Decode, Encode};

Expand Down
2 changes: 1 addition & 1 deletion template/node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
clippy::too_many_arguments,
clippy::large_enum_variant
)]
#![cfg_attr(feature = "runtime-benchmarks", deny(unused_crate_dependencies))]
#![cfg_attr(feature = "runtime-benchmarks", warn(unused_crate_dependencies))]

#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
Expand Down
7 changes: 4 additions & 3 deletions template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ where
&client.block_hash(0)?.expect("Genesis block exists; qed"),
&config.chain_spec,
);
let (grandpa_protocol_config, grandpa_notification_service) =
sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone());

let warp_sync_params = if sealing.is_some() {
None
} else {
net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config(
grandpa_protocol_name.clone(),
));
net_config.add_notification_protocol(grandpa_protocol_config);
let warp_sync: Arc<dyn WarpSyncProvider<Block>> =
Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
Expand Down Expand Up @@ -577,6 +577,7 @@ where
link: grandpa_link,
network,
sync: sync_service,
notification_service: grandpa_notification_service,
voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(),
prometheus_registry,
shared_voter_state: sc_consensus_grandpa::SharedVoterState::empty(),
Expand Down
2 changes: 1 addition & 1 deletion template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]
#![allow(clippy::new_without_default, clippy::or_fun_call)]
#![cfg_attr(feature = "runtime-benchmarks", deny(unused_crate_dependencies))]
#![cfg_attr(feature = "runtime-benchmarks", warn(unused_crate_dependencies))]

// Make the WASM binary available.
#[cfg(feature = "std")]
Expand Down

0 comments on commit 08d5d47

Please sign in to comment.