Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
660 changes: 660 additions & 0 deletions .substrate-mcp/polkadot-upgrade/stable2506/FINAL_IMPACT_REPORT.md

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions .substrate-mcp/polkadot-upgrade/stable2506/pr_3811.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# PR #3811 Analysis: Implicit chill when full unbonding in pallet_staking

## PR Information
- **PR Doc**: [pr_3811.prdoc](/Users/manuelmauro/.substrate-mcp/moonbeam/releases/stable2506/pr-docs/pr_3811.prdoc)
- **GitHub PR**: [#3811](https://github.com/paritytech/polkadot-sdk/pull/3811)
- **PR Title**: Full Unbond in Staking
- **Labels**: T2-pallets

## Impact Assessment
- **Initial Sentiment**: INHERITED
- **Confidence Level**: HIGH

## Analysis

**Affected Components**:
- Relay chain staking behavior (not Moonbeam runtime directly)
- User-facing behavior through RelayEncoder precompile

**Changes Detected**:
- `pallet-staking::unbond()` extrinsic now automatically chills validators/nominators when unbonding the full bonded amount
- Weight calculation updated to include `T::WeightInfo::chill()` in worst-case scenario
- No signature changes - still accepts a single balance parameter
- New internal helper function `do_unbond()` extracts core unbonding logic

**Project Impact**:
Moonbeam does **not** use `pallet-staking` in its runtime. The project only encodes relay chain staking calls through:
- `/Users/manuelmauro/Workspace/moonbeam/runtime/relay-encoder/src/polkadot.rs`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/relay-encoder/src/lib.rs`

Since the encoding signature hasn't changed (unbond still takes a balance parameter), **no code changes are required** in Moonbeam. The behavioral change happens on the relay chain side when the encoded call is executed.

## Evidence & References

**From PR (polkadot-sdk)**:
- `substrate/frame/staking/src/pallet/mod.rs:L137-L139` - Unbond extrinsic now calls implicit chill logic when `value >= ledger.total`
- `substrate/frame/staking/src/pallet/impls.rs` - New `do_unbond()` helper function added
- `substrate/frame/staking/src/tests.rs` - New test `unbond_with_chill_works()` validates automatic chill behavior
- `substrate/frame/election-provider-multi-phase/test-staking-e2e/src/lib.rs` - Test updated to remove explicit chill call requirement
- `substrate/frame/nomination-pools/test-delegate-stake/src/lib.rs` - Test simplified by removing separate chill operations

**From Project (moonbeam)**:
- `/Users/manuelmauro/Workspace/moonbeam/runtime/relay-encoder/src/polkadot.rs:L50-L51` - Encodes `Unbond` with balance parameter (unchanged)
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/relay-encoder/src/lib.rs:L103-L123` - `encode_unbond()` precompile function (no changes needed)
- `/Users/manuelmauro/Workspace/moonbeam/test/suites/smoke/test-relay-indices.ts:L192` - Test validates encoding matches relay chain (will continue to work)

**Migration Guide**:
No migration needed for Moonbeam code. However, users should be aware:
- When calling relay chain staking through Moonbeam's RelayEncoder precompile, full unbonds will now automatically chill the validator/nominator
- Previously, users had to manually call `chill()` before unbonding their full stake
- This improves UX by reducing the number of required transactions

**Additional Resources**:
- Closes issue: https://github.com/paritytech/polkadot-sdk/issues/414
- Community tip awarded: Referendum #1534 (80 DOT)

## Rationale for INHERITED Classification

This PR is classified as **INHERITED** because:

1. **No API Changes**: The `unbond()` function signature remains unchanged - it still accepts a balance parameter
2. **No Encoding Changes**: SCALE encoding for the call is identical; Moonbeam's relay-encoder requires no updates
3. **Not Used in Runtime**: Moonbeam doesn't include pallet-staking in its runtime configuration
4. **Relay Chain Behavior**: This is an internal improvement to relay chain staking logic that will automatically apply when the relay chain upgrades
5. **Backward Compatible**: The change is backward compatible - partial unbonds work as before, full unbonds just skip the manual chill step

The behavioral improvement (automatic chill on full unbond) will be inherited when Polkadot/Kusama relay chains upgrade to this version, without requiring any changes to Moonbeam's codebase.
114 changes: 114 additions & 0 deletions .substrate-mcp/polkadot-upgrade/stable2506/pr_5620.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# PR #5620: New NFT traits: granular and abstract interface

## PR Information

- **Title**: New NFT traits: granular and abstract interface
- **GitHub URL**: https://github.com/paritytech/polkadot-sdk/pull/5620
- **Labels**: T1-FRAME
- **Audience**: Runtime Dev
- **Affected Crates**:
- `frame-support` (minor bump)
- `pallet-uniques` (minor bump)

## Impact Assessment

**Category**: INHERITED

**Action Required**: None

**Rationale**: This PR introduces new optional NFT trait abstractions that Moonbeam does not use. The changes are additive and do not affect any existing APIs.

## Analysis

### What Changed

PR #5620 introduces a comprehensive new trait system for NFT operations in the `frame_support::traits::tokens::asset_ops` module:

**New Core Traits**:
- `AssetDefinition` - Defines assets with an `Id` type
- `Inspect<Strategy>` - Retrieve asset state information
- `Update<Strategy>` - Modify asset state
- `Create<Strategy>` - Generate new assets
- `Destroy<Strategy>` - Remove assets permanently
- `Stash<Strategy>` - Temporarily disable assets
- `Restore<Strategy>` - Reactivate stashed assets

**Strategy System**: The framework uses pluggable strategies to customize operations including:
- Inspect strategies: `Bytes`, `Owner`, `CanCreate`, `CanDestroy`, `CanUpdate`
- Create strategies: `WithConfig`, `AutoId`, `PredefinedId`, `DeriveAndReportId`
- Destroy/Stash strategies: `NoParams`, `IfOwnedBy`, `WithWitness`

**Implementation**: Full `asset_ops` implementation added to `pallet-uniques` for both collection-level and item-level operations.

### Why It Doesn't Affect Moonbeam

**Moonbeam does not use NFT functionality**:

1. **No NFT pallets configured**: Examined the `construct_runtime!` macro in all three runtime variants (moonbase, moonbeam, moonriver) - none include `pallet-uniques` or `pallet-nfts`

2. **No NFT trait imports**: Searched the entire codebase for:
- `pallet-uniques` or `pallet-nfts` usage
- `frame_support::traits::tokens::nonfungibles` imports
- `asset_ops` module usage
- NFT-related trait imports (Create, Inspect, Mutate, etc.)

All searches returned no results.

3. **Additive changes only**: The PR adds new traits alongside existing NFT traits (v1 and v2), which remain unchanged. This is confirmed in the PR description: "Existing v1/v2 traits remain unchanged, so there are no immediate breaking changes for current implementations."

### Future Considerations

This PR lays the groundwork for future XCM adapters for NFT operations (referenced as PR #4300). If Moonbeam decides to support NFTs in the future, these new abstractions would provide:
- Better support for derivative NFTs across chains
- More flexible permission checks
- Composable trait design reducing code duplication

However, this remains a future possibility with no current impact.

## Evidence

### Codebase Search Results

**Search 1**: `pallet-uniques` references
```bash
grep -r "pallet.uniques" /Users/manuelmauro/Workspace/moonbeam
# Result: No files found
```

**Search 2**: NFT trait imports
```bash
grep -r "frame_support::traits::tokens::(nonfungibles|fungibles)" /Users/manuelmauro/Workspace/moonbeam
# Result: No files found
```

**Search 3**: `asset_ops` usage
```bash
grep -r "asset_ops" /Users/manuelmauro/Workspace/moonbeam
# Result: No files found
```

**Search 4**: NFT trait usage patterns
```bash
grep -r "nonfungibles::(Inspect|Create|Mutate|Transfer|Destroy)" /Users/manuelmauro/Workspace/moonbeam
# Result: No files found
```

**Search 5**: Runtime pallet configuration
- Examined: `/Users/manuelmauro/Workspace/moonbeam/runtime/moonbase/src/lib.rs`
- Examined: `/Users/manuelmauro/Workspace/moonbeam/runtime/moonbeam/src/lib.rs`
- Examined: `/Users/manuelmauro/Workspace/moonbeam/runtime/moonriver/src/lib.rs`
- Confirmed: No NFT-related pallets in `construct_runtime!` macro

### Key Runtime Pallets (for reference)

Moonbeam's focus is Ethereum compatibility, not NFTs:
- System, Balances, ParachainSystem, ParachainStaking
- EVM, Ethereum, EthereumChainId, EthereumXcm
- XcmpQueue, PolkadotXcm, CumulusXcm, XcmTransactor
- Treasury, ConvictionVoting, Referenda, Identity, Proxy
- AuthorInherent, AuthorFilter, AuthorMapping
- MessageQueue, EmergencyParaXcm, EvmForeignAssets

## Conclusion

PR #5620 introduces valuable new NFT trait abstractions for Substrate runtime development, but has zero impact on Moonbeam. The project does not use any NFT pallets or traits, and the changes are purely additive. Moonbeam inherits this update as part of its frame-support dependency without any required action or breaking changes.
174 changes: 174 additions & 0 deletions .substrate-mcp/polkadot-upgrade/stable2506/pr_5884.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# PR #5884: Set PoV Size Limit to 10 MB

## Overview
This PR increases the `MAX_POV_SIZE` constant from 5 MB to 10 MB in polkadot-sdk primitives and adjusts related bridge constants.

**PR Link**: https://github.com/paritytech/polkadot-sdk/pull/5884
**Labels**: T17-primitives
**Audience**: Runtime Dev

## Changes Made

### 1. Core Primitive Change
- **File**: `polkadot/primitives/src/v8/mod.rs`
- **Change**: `MAX_POV_SIZE` increased from `5 * 1024 * 1024` (5 MB) to `10 * 1024 * 1024` (10 MB)

### 2. Bridge Configuration Updates
- **Files**: Bridge hub runtime configurations (Rococo, Westend, Bulletin)
- **Change**: `PriorityBoostPerMessage` doubled from `182_044_444_444_444` to `364_088_888_888_888`
- **Reason**: This constant scales with PoV size for bridge message prioritization

### 3. Affected Crates
- polkadot-primitives (minor bump)
- bridge-hub-rococo-runtime (minor bump)
- bridge-hub-westend-runtime (minor bump)
- polkadot-omni-node (minor bump)
- polkadot-omni-node-lib (minor bump)
- polkadot-parachain-bin (minor bump)

## Technical Context

### Phased Rollout
This is a **preparatory change** that won't immediately affect existing parachains:
1. New chains starting from genesis can immediately use 10 MB PoVs
2. Existing parachains won't exceed 5 MB until relay chain governance updates the `max_pov_size` parameter
3. Collators remain constrained by relay chain validation data until governance acts

### Safety Guarantees
The actual enforcement happens at the relay chain level via runtime configuration, not the SDK constant. This decouples SDK capability from active network limits, allowing for safe, gradual rollout.

## Impact on Moonbeam

### Current State Analysis

#### Production Runtimes - ALREADY UPDATED ✅
All three Moonbeam production runtimes have already been updated to 10 MB:

**Moonbase Runtime** (`/Users/manuelmauro/Workspace/moonbeam/runtime/moonbase/src/lib.rs:173`):
```rust
/// Maximum PoV size we support right now.
// Reference: https://github.com/polkadot-fellows/runtimes/pull/553
pub const MAX_POV_SIZE: u32 = 10 * 1024 * 1024;
```

**Moonbeam Runtime** (`/Users/manuelmauro/Workspace/moonbeam/runtime/moonbeam/src/lib.rs:172`):
```rust
/// Maximum PoV size we support right now.
// Reference: https://github.com/polkadot-fellows/runtimes/pull/553
pub const MAX_POV_SIZE: u32 = 10 * 1024 * 1024;
```

**Moonriver Runtime** (`/Users/manuelmauro/Workspace/moonbeam/runtime/moonriver/src/lib.rs:180`):
```rust
/// Maximum PoV size we support right now.
// Kusama relay already supports 10Mb maximum PoV
// Reference: https://github.com/polkadot-fellows/runtimes/pull/553
pub const MAX_POV_SIZE: u32 = 10 * 1024 * 1024;
```

**Update History**:
- Moonbase/Moonriver: Commit `10be70a18a` - "Enable 10 Mb PoV for moonbase and moonriver (#3228)"
- Moonbeam: Commit `6045df64ac` - "feat(Moonbeam): Increase PoV limit to 10 MB (#3261)" (April 2025)

#### GasLimitPovSizeRatio Configuration
All runtimes use a consistent ratio of 8:
- Moonbase: `pub const GasLimitPovSizeRatio: u64 = 8;`
- Moonbeam: `pub const GasLimitPovSizeRatio: u64 = 8;`
- Moonriver: `pub const GasLimitPovSizeRatio: u64 = 8;`

This ratio determines how PoV consumption translates to gas costs in the EVM (approximately 1 byte per 4 gas units).

#### Test/Mock Files - OUTDATED ⚠️
The following mock files still use the old 5 MB limit:

**Precompiles (24 files)**:
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/xcm-utils/src/mock.rs:239`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/xcm-transactor/src/mock.rs:175`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/balances-erc20/src/mock.rs:111`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/relay-encoder/src/mock.rs:343`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/author-mapping/src/mock.rs:110`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/gmp/src/mock.rs:255`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/crowdloan-rewards/src/mock.rs:165`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/conviction-voting/src/mock.rs:112`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/relay-data-verifier/src/mock.rs:173`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/batch/src/mock.rs:126`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/referenda/src/mock.rs:133`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/xtokens/src/mock.rs:143`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/collective/src/mock.rs:127`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/parachain-staking/src/mock.rs:116`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/preimage/src/mock.rs:104`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/identity/src/mock.rs:113`
- `/Users/manuelmauro/Workspace/moonbeam/precompiles/proxy/src/mock.rs:153`

**Pallets (2 files)**:
- `/Users/manuelmauro/Workspace/moonbeam/pallets/erc20-xcm-bridge/src/mock.rs:112`
- `/Users/manuelmauro/Workspace/moonbeam/pallets/ethereum-xcm/src/mock.rs:152`

Pattern in all these files:
```rust
const MAX_POV_SIZE: u64 = 5 * 1024 * 1024;
```

#### Bridge Configuration
Moonbeam has bridge configurations for Moonbeam ↔ Moonriver communication:
- `/Users/manuelmauro/Workspace/moonbeam/runtime/moonriver/src/bridge_config.rs`
- `/Users/manuelmauro/Workspace/moonbeam/runtime/moonbeam/src/bridge_config.rs`

**Key Finding**: Moonbeam does NOT use the `PriorityBoostPerMessage` constant that was updated in the polkadot-sdk PR. Moonbeam's bridge implementation uses a different architecture with `pallet_xcm_bridge`, `pallet_bridge_messages`, and `pallet_bridge_grandpa`, which don't require this constant.

## Impact Assessment

### 🟢 Direct Impact: MINIMAL

**Why?**
1. **Production runtimes already aligned**: All Moonbeam runtimes (moonbase, moonbeam, moonriver) have been updated to use 10 MB MAX_POV_SIZE since April 2025
2. **This PR is SDK housekeeping**: The change to polkadot-primitives simply aligns the SDK's default constant with what Moonbeam is already using
3. **No bridge constant conflict**: Moonbeam's bridge implementation doesn't use `PriorityBoostPerMessage`
4. **Gradual enforcement**: The actual 10 MB limit won't be enforced until relay chain governance updates runtime parameters

### ⚠️ Recommended Actions

#### 1. Update Mock Files (Low Priority, Technical Debt)
Consider updating all test/mock files from 5 MB to 10 MB to match production runtime configuration. This would:
- Ensure test environments accurately reflect production
- Prevent potential confusion when debugging PoV-related issues
- Align with the SDK's new default

**Files to update**: 26 mock files (see list above)

**Example change**:
```rust
// Before
const MAX_POV_SIZE: u64 = 5 * 1024 * 1024;

// After
const MAX_POV_SIZE: u64 = 10 * 1024 * 1024;
```

#### 2. Monitor Relay Chain Updates
Watch for relay chain governance proposals to increase the actual `max_pov_size` parameter from 5 MB to 10 MB. This is when the change will actually take effect in production.

#### 3. Review GasLimitPovSizeRatio (Optional)
Consider whether the current ratio of 8 remains appropriate with the increased PoV size. The current configuration means:
- 1 byte of PoV ≈ 4 gas units
- 10 MB PoV ≈ 40M gas worth of PoV consumption

### 📊 Verification Checklist

- ✅ Production runtimes use 10 MB MAX_POV_SIZE
- ✅ MAXIMUM_BLOCK_WEIGHT uses MAX_POV_SIZE in proof_size component
- ✅ GasLimitPovSizeRatio is configured consistently across runtimes
- ⚠️ Mock files still use 5 MB (technical debt, not critical)
- ✅ Bridge configurations don't depend on changed constants

## Conclusion

**This PR has MINIMAL DIRECT IMPACT on Moonbeam** because:
1. Moonbeam already updated to 10 MB PoV size in April 2025
2. The polkadot-sdk change simply catches up to what Moonbeam is already using
3. No code changes are required in Moonbeam's production runtimes
4. Bridge constant changes don't apply to Moonbeam's architecture

**Optional follow-up**: Update mock/test files from 5 MB to 10 MB to align with production configuration and prevent future confusion.

**Compatibility**: ✅ Fully compatible - no breaking changes, no action required
Loading
Loading