Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d1bce56
inherent overhaul
liamaharon May 7, 2024
20878ee
bump version
liamaharon May 7, 2024
d58941c
clean up custom idps
liamaharon May 8, 2024
ff30415
smart inherent provider
liamaharon May 8, 2024
5883f46
licence and basic docs
liamaharon May 9, 2024
b27fd10
clippy
liamaharon May 9, 2024
62d9696
remove node-executor node-primitive deps
liamaharon May 9, 2024
9c5fcbe
fmt
liamaharon May 9, 2024
ac898c2
update cargo.lock
liamaharon May 9, 2024
36a8cf1
move shared params to common
liamaharon May 10, 2024
4424f61
move misc logging to common
liamaharon May 10, 2024
a0a5485
move parse to common
liamaharon May 10, 2024
16c5b39
move state to common
liamaharon May 10, 2024
9632a14
move inherents to empty block production dir
liamaharon May 10, 2024
4f7e04e
move block creation out of fast forward
liamaharon May 10, 2024
b728086
improve log
liamaharon May 10, 2024
039cdaf
clippy
liamaharon May 10, 2024
bcdd083
cargo fmt
liamaharon May 13, 2024
4a406c6
update test runtimes and snapshots
liamaharon May 14, 2024
fd0092e
use stable for clippy
liamaharon May 14, 2024
4b4648b
fix typos
liamaharon May 14, 2024
527c857
Update core/src/common/empty_block/inherents/pre_apply.rs
liamaharon May 15, 2024
c7dbbfe
address comments
liamaharon May 16, 2024
8b465e2
doc comment
liamaharon May 16, 2024
828a357
doc
liamaharon May 16, 2024
5980993
use valueenum
liamaharon May 16, 2024
aee8086
rename execute_next_block to mine_block
liamaharon May 16, 2024
2254202
bump relay_offset +1
liamaharon May 17, 2024
00e2962
blocktime arg
liamaharon May 20, 2024
e80f524
make blocktime a required value
liamaharon May 20, 2024
47a76ca
hardcode relaychain blocktime
liamaharon May 20, 2024
c6a143b
clippy
liamaharon May 26, 2024
5fdd6d5
free disk space on test runner
liamaharon May 26, 2024
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
Prev Previous commit
Next Next commit
update test runtimes and snapshots
  • Loading branch information
liamaharon committed May 14, 2024
commit 4a406c6ea585486c185328ccb93e1613af7ab903
500 changes: 259 additions & 241 deletions Cargo.lock

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,39 @@ tokio = { version = "1.37.0" }
zstd = { version = "0.11.2", default-features = false }

# Polkadot SDK
frame-remote-externalities = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
frame-remote-externalities = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }

sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sc-service = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }

sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-externalities = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-transaction-storage-proof = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
sp-api = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-externalities = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-transaction-storage-proof = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }

substrate-cli-test-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
substrate-rpc-client = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
substrate-cli-test-utils = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
substrate-rpc-client = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }

polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
cumulus-client-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "liam-remote-ext-snapshot-header" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }
cumulus-client-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", rev = "efc2132fa2ece419d36af03c935b3c2c60440eb5" }

# Local
try-runtime-core = { path = "core" }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
69 changes: 69 additions & 0 deletions core/tests/runtimes/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

# Test Runtimes

Some runtimes to use in tests.

## Generation Instructions

### No Migrations

Just pass an empty Migrations tuple to executive.

### Bad Spec Name

Set the `spec_name` to something other than what's in the on-chain runtime.

### Non-Incrementing Spec Version

Set the `spec_version` to less than or equal to the current on-chain runtime version.

### Not Idempotent Execution

Add a migration that is non-idempotent. E.g.

```rust
pub struct NonIdempotentExceptionMigration;

impl frame_support::traits::OnRuntimeUpgrade for NonIdempotentExceptionMigration {
fn on_runtime_upgrade() -> Weight {
let key = sp_core::blake2_128(b"some_random_seed");
if frame_support::storage::unhashed::get(&key[..]).unwrap_or(false) {
panic!("exception");
};
frame_support::storage::unhashed::put::<bool>(&key[..], &true);

<Runtime as frame_system::Config>::DbWeight::get().writes(1)
}
}
```

### Not Idempotent State Root

Add a migration that is non-idempotnent w.r.t the state root. E.g.

```rust
pub struct NonIdempotentStateRootMigration;

impl frame_support::traits::OnRuntimeUpgrade for NonIdempotentStateRootMigration {
fn on_runtime_upgrade() -> Weight {
let key = sp_core::blake2_128(b"some_random_seed");
let cur = frame_support::storage::unhashed::get(&key[..]).unwrap_or(0);
frame_support::storage::unhashed::put::<u32>(&key[..], &(cur + 1u32));
<Runtime as frame_system::Config>::DbWeight::get().writes(1)
}
}
```

### Weight Issue

Add a migration that is overweight. E.g.

```rust
pub struct OverweightMigration;

impl frame_support::traits::OnRuntimeUpgrade for OverweightMigration {
fn on_runtime_upgrade() -> Weight {
<Runtime as frame_system::Config>::BlockWeights::get().max_block
}
}
```
Binary file modified core/tests/snaps/kusama-asset-hub.snap
Binary file not shown.
Binary file modified core/tests/snaps/rococo-bridge-hub.snap
Binary file not shown.