Skip to content

Commit

Permalink
Merge branch 'master' into alindima/add-systematic-chunks-av-recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
alindima committed May 13, 2024
2 parents da8ca22 + 477a120 commit 84ca508
Show file tree
Hide file tree
Showing 52 changed files with 1,032 additions and 402 deletions.
1 change: 1 addition & 0 deletions .config/lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ exclude = [
"https://github.com/paritytech/polkadot-sdk/substrate/frame/timestamp",
"https://github.com/paritytech/substrate/frame/fast-unstake",
"https://github.com/zkcrypto/bls12_381/blob/e224ad4ea1babfc582ccd751c2bf128611d10936/src/test-data/mod.rs",
"https://polkadot-try-runtime-node.parity-chains.parity.io/",
"https://polkadot.network/the-path-of-a-parachain-block/",
"https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results",
"https://research.web3.foundation/en/latest/polkadot/NPoS/3.%20Balancing.html",
Expand Down
30 changes: 30 additions & 0 deletions .forklift/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[compression]
type = "zstd"

[compression.zstd]
compressionLevel = 3

[general]
jobNameVariable = "CI_JOB_NAME"
jobsBlackList = []
logLevel = "warn"
threadsCount = 6

[metrics]
enabled = true
pushEndpoint = "placeholder"

[metrics.extraLabels]
environment = "production"
job_name = "$CI_JOB_NAME"
project_name = "$CI_PROJECT_PATH"

[storage]
type = "s3"

[storage.s3]
accessKeyId = "placeholder"
bucketName = "placeholder"
concurrency = 10
endpointUrl = "placeholder"
secretAccessKey = "placeholder"
14 changes: 6 additions & 8 deletions .github/workflows/quick-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: arc-runners-polkadot-sdk-default
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
Expand All @@ -24,7 +24,7 @@ jobs:
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
fmt:
runs-on: arc-runners-polkadot-sdk-default
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
needs: [set-image]
container:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Cargo fmt
run: cargo +nightly fmt --all -- --check
check-dependency-rules:
runs-on: arc-runners-polkadot-sdk-default
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
needs: [set-image]
container:
Expand All @@ -46,8 +46,7 @@ jobs:
cd substrate/
../.gitlab/ensure-deps.sh
check-rust-feature-propagation:
runs-on: arc-runners-polkadot-sdk-default
# runs-on: ubuntu-latest
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
needs: [set-image]
container:
Expand All @@ -57,8 +56,7 @@ jobs:
- name: run zepter
run: zepter run check
test-rust-features:
runs-on: arc-runners-polkadot-sdk-default
# runs-on: ubuntu-latest
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
needs: [set-image]
container:
Expand All @@ -68,7 +66,7 @@ jobs:
- name: run rust features
run: bash .gitlab/rust-features.sh .
check-toml-format:
runs-on: arc-runners-polkadot-sdk-default
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
needs: [set-image]
container:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test-github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }}
FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }}
FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }}
FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }}
FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }}

jobs:
set-image:
# GitHub Actions allows using 'env' in a container context.
Expand Down Expand Up @@ -38,7 +45,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: WASM_BUILD_NO_COLOR=1 time cargo test -p staging-node-cli --release --locked -- --ignored
run: WASM_BUILD_NO_COLOR=1 time forklift cargo test -p staging-node-cli --release --locked -- --ignored
quick-benchmarks:
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
Expand All @@ -54,4 +61,4 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: time cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet
run: time forklift cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ default:
.forklift-cache:
before_script:
- mkdir ~/.forklift
- cp $FL_FORKLIFT_CONFIG ~/.forklift/config.toml
- cp .forklift/config.toml ~/.forklift/config.toml
- >
if [ "$FORKLIFT_BYPASS" != "true" ]; then
echo "FORKLIFT_BYPASS not set";
Expand Down
27 changes: 11 additions & 16 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ members = [
"substrate/utils/build-script-utils",
"substrate/utils/fork-tree",
"substrate/utils/frame/benchmarking-cli",
"substrate/utils/frame/frame-utilities-cli",
"substrate/utils/frame/generate-bags",
"substrate/utils/frame/generate-bags/node-runtime",
"substrate/utils/frame/omni-bencher",
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
pub use binary_merkle_tree::merkle_root;
pub use pallet_beefy_mmr::BeefyEcdsaToEthereum;
pub use pallet_mmr::{
primitives::{DataOrHash as MmrDataOrHash, Proof as MmrProof},
primitives::{DataOrHash as MmrDataOrHash, LeafProof as MmrProof},
verify_leaves_proof as verify_mmr_leaves_proof,
};
pub use sp_consensus_beefy::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pallet-nfts = { path = "../../../../../substrate/frame/nfts", default-features =
pallet-nfts-runtime-api = { path = "../../../../../substrate/frame/nfts/runtime-api", default-features = false }
pallet-proxy = { path = "../../../../../substrate/frame/proxy", default-features = false }
pallet-session = { path = "../../../../../substrate/frame/session", default-features = false }
pallet-state-trie-migration = { path = "../../../../../substrate/frame/state-trie-migration", default-features = false }
pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false }
pallet-transaction-payment = { path = "../../../../../substrate/frame/transaction-payment", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { path = "../../../../../substrate/frame/transaction-payment/rpc/runtime-api", default-features = false }
Expand Down Expand Up @@ -124,7 +123,6 @@ runtime-benchmarks = [
"pallet-nft-fractionalization/runtime-benchmarks",
"pallet-nfts/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-state-trie-migration/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-uniques/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
Expand Down Expand Up @@ -163,7 +161,6 @@ try-runtime = [
"pallet-nfts/try-runtime",
"pallet-proxy/try-runtime",
"pallet-session/try-runtime",
"pallet-state-trie-migration/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-uniques/try-runtime",
Expand Down Expand Up @@ -213,7 +210,6 @@ std = [
"pallet-nfts/std",
"pallet-proxy/std",
"pallet-session/std",
"pallet-state-trie-migration/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
Expand Down
43 changes: 0 additions & 43 deletions cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,6 @@ construct_runtime!(
PoolAssets: pallet_assets::<Instance3> = 55,
AssetConversion: pallet_asset_conversion = 56,

StateTrieMigration: pallet_state_trie_migration = 70,

// TODO: the pallet instance should be removed once all pools have migrated
// to the new account IDs.
AssetConversionMigration: pallet_asset_conversion_ops = 200,
Expand Down Expand Up @@ -1785,47 +1783,6 @@ cumulus_pallet_parachain_system::register_validate_block! {
BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
}

parameter_types! {
// The deposit configuration for the singed migration. Specially if you want to allow any signed account to do the migration (see `SignedFilter`, these deposits should be high)
pub const MigrationSignedDepositPerItem: Balance = CENTS;
pub const MigrationSignedDepositBase: Balance = 2_000 * CENTS;
pub const MigrationMaxKeyLen: u32 = 512;
}

impl pallet_state_trie_migration::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type RuntimeHoldReason = RuntimeHoldReason;
type SignedDepositPerItem = MigrationSignedDepositPerItem;
type SignedDepositBase = MigrationSignedDepositBase;
// An origin that can control the whole pallet: should be Root, or a part of your council.
type ControlOrigin = frame_system::EnsureSignedBy<RootMigController, AccountId>;
// specific account for the migration, can trigger the signed migrations.
type SignedFilter = frame_system::EnsureSignedBy<MigController, AccountId>;

// Replace this with weight based on your runtime.
type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>;

type MaxKeyLen = MigrationMaxKeyLen;
}

frame_support::ord_parameter_types! {
pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
pub const RootMigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
}

#[test]
fn ensure_key_ss58() {
use frame_support::traits::SortedMembers;
use sp_core::crypto::Ss58Codec;
let acc =
AccountId::from_ss58check("5F4EbSkZz18X36xhbsjvDNs6NuZ82HyYtq5UiJ1h9SBHJXZD").unwrap();
assert_eq!(acc, MigController::sorted_members()[0]);
let acc =
AccountId::from_ss58check("5F4EbSkZz18X36xhbsjvDNs6NuZ82HyYtq5UiJ1h9SBHJXZD").unwrap();
assert_eq!(acc, RootMigController::sorted_members()[0]);
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
8 changes: 5 additions & 3 deletions cumulus/xcm/xcm-emulator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ pub use frame_support::{
},
weights::{Weight, WeightMeter},
};
pub use frame_system::{Config as SystemConfig, Pallet as SystemPallet};
pub use frame_system::{
pallet_prelude::BlockNumberFor, Config as SystemConfig, Pallet as SystemPallet,
};
pub use pallet_balances::AccountData;
pub use pallet_message_queue;
pub use sp_arithmetic::traits::Bounded;
Expand All @@ -54,7 +56,7 @@ pub use cumulus_primitives_core::{
pub use cumulus_primitives_parachain_inherent::ParachainInherentData;
pub use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
pub use pallet_message_queue::{Config as MessageQueueConfig, Pallet as MessageQueuePallet};
pub use parachains_common::{AccountId, Balance, BlockNumber};
pub use parachains_common::{AccountId, Balance};
pub use polkadot_primitives;
pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId};

Expand Down Expand Up @@ -657,7 +659,7 @@ macro_rules! decl_test_parachains {
.clone()
);
<Self as Chain>::System::initialize(&block_number, &parent_head_data.hash(), &Default::default());
<<Self as Parachain>::ParachainSystem as Hooks<$crate::BlockNumber>>::on_initialize(block_number);
<<Self as Parachain>::ParachainSystem as Hooks<$crate::BlockNumberFor<Self::Runtime>>>::on_initialize(block_number);

let _ = <Self as Parachain>::ParachainSystem::set_validation_data(
<Self as Chain>::RuntimeOrigin::none(),
Expand Down
6 changes: 3 additions & 3 deletions polkadot/node/service/src/fake_runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ sp_api::impl_runtime_apis! {
fn generate_proof(
_: Vec<BlockNumber>,
_: Option<BlockNumber>,
) -> Result<(Vec<sp_mmr_primitives::EncodableOpaqueLeaf>, sp_mmr_primitives::Proof<Hash>), sp_mmr_primitives::Error> {
) -> Result<(Vec<sp_mmr_primitives::EncodableOpaqueLeaf>, sp_mmr_primitives::LeafProof<Hash>), sp_mmr_primitives::Error> {
unimplemented!()
}

fn verify_proof(_: Vec<sp_mmr_primitives::EncodableOpaqueLeaf>, _: sp_mmr_primitives::Proof<Hash>)
fn verify_proof(_: Vec<sp_mmr_primitives::EncodableOpaqueLeaf>, _: sp_mmr_primitives::LeafProof<Hash>)
-> Result<(), sp_mmr_primitives::Error>
{
unimplemented!()
Expand All @@ -285,7 +285,7 @@ sp_api::impl_runtime_apis! {
fn verify_proof_stateless(
_: Hash,
_: Vec<sp_mmr_primitives::EncodableOpaqueLeaf>,
_: sp_mmr_primitives::Proof<Hash>
_: sp_mmr_primitives::LeafProof<Hash>
) -> Result<(), sp_mmr_primitives::Error> {
unimplemented!()
}
Expand Down
1 change: 1 addition & 0 deletions polkadot/roadmap/implementers-guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Disputes Process](protocol-disputes.md)
- [Dispute Flow](disputes-flow.md)
- [Chain Selection and Finalization](protocol-chain-selection.md)
- [Validator Disabling](protocol-validator-disabling.md)
- [Architecture Overview](architecture.md)
- [Messaging Overview](messaging.md)
- [PVF Pre-checking](pvf-prechecking.md)
Expand Down
6 changes: 3 additions & 3 deletions polkadot/roadmap/implementers-guide/src/protocol-disputes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ All parachain blocks that end up in the finalized relay chain should be valid. T
only backed, but not included.

We have two primary components for ensuring that nothing invalid ends up in the finalized relay chain:
* Approval Checking, as described [here](./protocol-approval.md) and implemented according to the [Approval
Voting](node/approval/approval-voting.md) subsystem. This protocol can be shown to prevent invalid parachain blocks
from making their way into the finalized relay chain as long as the amount of attempts are limited.
* Approval Checking, as described [here](./protocol-approval.md) and implemented accordingly in the [Approval
Voting](node/approval/approval-voting.md) subsystem. This protocol can be shown to prevent invalid parachain blocks
from making their way into the finalized relay chain as long as the amount of attempts are limited.
* Disputes, this protocol, which ensures that each attempt to include something bad is caught, and the offending
validators are punished. Disputes differ from backing and approval process (and can not be part of those) in that a
dispute is independent of a particular fork, while both backing and approval operate on particular forks. This
Expand Down
Loading

0 comments on commit 84ca508

Please sign in to comment.