Skip to content

Commit

Permalink
Merge branch 'master' into reorder-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored Dec 20, 2024
2 parents 405ee64 + 4e805ca commit fcb32a8
Show file tree
Hide file tree
Showing 248 changed files with 664 additions and 516 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-check-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml

check-publish:
check-publish-compile:
timeout-minutes: 90
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
Expand Down
6 changes: 1 addition & 5 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("statemine"),
impl_name: alloc::borrow::Cow::Borrowed("statemine"),
authoring_version: 1,
spec_version: 1_016_002,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("westmint"),
impl_name: alloc::borrow::Cow::Borrowed("westmint"),
authoring_version: 1,
spec_version: 1_017_002,
spec_version: 1_017_003,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("bridge-hub-rococo"),
impl_name: alloc::borrow::Cow::Borrowed("bridge-hub-rococo"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("bridge-hub-westend"),
impl_name: alloc::borrow::Cow::Borrowed("bridge-hub-westend"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("collectives-westend"),
impl_name: alloc::borrow::Cow::Borrowed("collectives-westend"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 6,
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: alloc::borrow::Cow::Borrowed("contracts-rococo"),
impl_name: alloc::borrow::Cow::Borrowed("contracts-rococo"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("coretime-rococo"),
impl_name: alloc::borrow::Cow::Borrowed("coretime-rococo"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("coretime-westend"),
impl_name: alloc::borrow::Cow::Borrowed("coretime-westend"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("glutton-westend"),
impl_name: alloc::borrow::Cow::Borrowed("glutton-westend"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("people-rococo"),
impl_name: alloc::borrow::Cow::Borrowed("people-rococo"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
4 changes: 2 additions & 2 deletions cumulus/parachains/runtimes/people/people-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("people-westend"),
impl_name: alloc::borrow::Cow::Borrowed("people-westend"),
authoring_version: 1,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
system_version: 1,
};

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.16.1";
pub const NODE_VERSION: &'static str = "1.17.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 @@ -182,7 +182,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("rococo"),
impl_name: alloc::borrow::Cow::Borrowed("parity-rococo-v2.0"),
authoring_version: 0,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
Expand Down
4 changes: 2 additions & 2 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("westend"),
impl_name: alloc::borrow::Cow::Borrowed("parity-westend"),
authoring_version: 2,
spec_version: 1_016_001,
spec_version: 1_017_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 26,
transaction_version: 27,
system_version: 1,
};

Expand Down
34 changes: 34 additions & 0 deletions prdoc/pr_6928.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
title: '[Backport] Version bumps and `prdocs` reordering form 2412'
doc:
- audience: Runtime Dev
description: This PR includes backport of the regular version bumps and `prdocs`
reordering from the `stable2412` branch back ro master
crates:
- name: polkadot-node-primitives
bump: none
- name: asset-hub-rococo-runtime
bump: none
- name: bridge-hub-rococo-runtime
bump: none
- name: bridge-hub-westend-runtime
bump: none
- name: collectives-westend-runtime
bump: none
- name: contracts-rococo-runtime
bump: none
- name: coretime-rococo-runtime
bump: none
- name: coretime-westend-runtime
bump: none
- name: glutton-westend-runtime
bump: none
- name: people-rococo-runtime
bump: none
- name: people-westend-runtime
bump: none
- name: rococo-runtime
bump: none
- name: westend-runtime
bump: none
- name: asset-hub-westend-runtime
bump: none
15 changes: 15 additions & 0 deletions prdoc/pr_6964.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: '[pallet-revive] implement the base fee API'
doc:
- audience: Runtime Dev
description: This PR implements the base fee syscall API method. Currently this
is implemented as a compile time constant in the revive compiler, returning 0.
However, since this is an opocde, if we ever need to implement it for compatibility
reasons with [EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md),
it would break already deployed contracts. Thus we provide a syscall method instead.
crates:
- name: pallet-revive-fixtures
bump: minor
- name: pallet-revive
bump: minor
- name: pallet-revive-uapi
bump: minor
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.
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.
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.
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.
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.
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.
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: 3 additions & 13 deletions substrate/frame/atomic-swap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame = { workspace = true, features = ["experimental", "runtime"] }
scale-info = { features = ["derive"], workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }

[dev-dependencies]
pallet-balances = { workspace = true, default-features = true }
Expand All @@ -31,17 +27,11 @@ pallet-balances = { workspace = true, default-features = true }
default = ["std"]
std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"frame/std",
"pallet-balances/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"frame/try-runtime",
"pallet-balances/try-runtime",
"sp-runtime/try-runtime",
]
16 changes: 4 additions & 12 deletions substrate/frame/atomic-swap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,11 @@ use core::{
marker::PhantomData,
ops::{Deref, DerefMut},
};
use frame_support::{
dispatch::DispatchResult,
pallet_prelude::MaxEncodedLen,
traits::{BalanceStatus, Currency, Get, ReservableCurrency},
weights::Weight,
RuntimeDebugNoBound,
use frame::{
prelude::*,
traits::{BalanceStatus, Currency, ReservableCurrency},
};
use frame_system::pallet_prelude::BlockNumberFor;
use scale_info::TypeInfo;
use sp_io::hashing::blake2_256;
use sp_runtime::RuntimeDebug;

/// Pending atomic swap operation.
#[derive(Clone, Eq, PartialEq, RuntimeDebugNoBound, Encode, Decode, TypeInfo, MaxEncodedLen)]
Expand Down Expand Up @@ -159,11 +153,9 @@ where

pub use pallet::*;

#[frame_support::pallet]
#[frame::pallet]
pub mod pallet {
use super::*;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;

/// Atomic swap's pallet configuration trait.
#[pallet::config]
Expand Down
8 changes: 3 additions & 5 deletions substrate/frame/atomic-swap/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@

use super::*;
use crate as pallet_atomic_swap;

use frame_support::{derive_impl, traits::ConstU32};
use sp_runtime::BuildStorage;
use frame::testing_prelude::*;

type Block = frame_system::mocking::MockBlock<Test>;

frame_support::construct_runtime!(
construct_runtime!(
pub enum Test
{
System: frame_system,
Expand Down Expand Up @@ -54,7 +52,7 @@ impl Config for Test {
const A: u64 = 1;
const B: u64 = 2;

pub fn new_test_ext() -> sp_io::TestExternalities {
pub fn new_test_ext() -> TestExternalities {
let mut t = frame_system::GenesisConfig::<Test>::default().build_storage().unwrap();
let genesis = pallet_balances::GenesisConfig::<Test> { balances: vec![(A, 100), (B, 200)] };
genesis.assimilate_storage(&mut t).unwrap();
Expand Down
36 changes: 36 additions & 0 deletions substrate/frame/revive/fixtures/contracts/base_fee.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This file is part of Substrate.

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Returns the base fee back to the caller.
#![no_std]
#![no_main]

extern crate common;
use uapi::{HostFn, HostFnImpl as api, ReturnFlags};

#[no_mangle]
#[polkavm_derive::polkavm_export]
pub extern "C" fn deploy() {}

#[no_mangle]
#[polkavm_derive::polkavm_export]
pub extern "C" fn call() {
let mut buf = [0; 32];
api::base_fee(&mut buf);
api::return_value(ReturnFlags::empty(), &buf);
}
12 changes: 12 additions & 0 deletions substrate/frame/revive/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,18 @@ mod benchmarks {
assert_eq!(result.unwrap(), u64::from(GAS_PRICE));
}

#[benchmark(pov_mode = Measured)]
fn seal_base_fee() {
build_runtime!(runtime, memory: [[1u8;32], ]);
let result;
#[block]
{
result = runtime.bench_base_fee(memory.as_mut_slice(), 0);
}
assert_ok!(result);
assert_eq!(U256::from_little_endian(&memory[..]), U256::zero());
}

#[benchmark(pov_mode = Measured)]
fn seal_block_number() {
build_runtime!(runtime, memory: [[0u8;32], ]);
Expand Down
18 changes: 18 additions & 0 deletions substrate/frame/revive/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4382,6 +4382,24 @@ fn gas_price_api_works() {
});
}

#[test]
fn base_fee_api_works() {
let (code, _) = compile_module("base_fee").unwrap();

ExtBuilder::default().existential_deposit(100).build().execute_with(|| {
let _ = <Test as Config>::Currency::set_balance(&ALICE, 1_000_000);

// Create fixture: Constructor does nothing
let Contract { addr, .. } =
builder::bare_instantiate(Code::Upload(code)).build_and_unwrap_contract();

// Call the contract: It echoes back the value returned by the base fee API.
let received = builder::bare_call(addr).build_and_unwrap_result();
assert_eq!(received.flags, ReturnFlags::empty());
assert_eq!(U256::from_little_endian(received.data[..].try_into().unwrap()), U256::zero());
});
}

#[test]
fn call_data_size_api_works() {
let (code, _) = compile_module("call_data_size").unwrap();
Expand Down
Loading

0 comments on commit fcb32a8

Please sign in to comment.