Harden XCM v1 for Recursions (#3586)
* Guard against XCM recursive bombs by setting a recursion limit * Add test and set a lower recursion limit * Use u32 instead of usize for recursion limit * Make spellcheck happy * Cargo fmt * Limit XCM decoding depth in UMP message processing * Modify test to check for recursion in BuyExecution * Update xcm/xcm-simulator/example/src/lib.rs Co-authored-by:Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Make cargo fmt happy * WIP for testing recursion limit in WASM * Revert "WIP for testing recursion limit in WASM" This reverts commit 39181b46d1adf79358f5ae8aafcf480e0c0c22e6. * Remove XCM recursion limit test * Add recursion test for XCM message execution * Set a more sensible recursion limit * Cargo fmt * Implement successful_origin for benchmarks * Set recursion limit to 8 and create integration tests directory for xcm-executor * Cargo fmt * Add runtime-benchmarks feature to test-runtime * Give up creating ConvertOriginToLocal and use EnsureXcm * Re-add ConvertOriginToLocal * Fix compilation * Update xcm/xcm-executor/src/lib.rs Co-authored-by:
Gavin Wood <gavin@parity.io> * Add decoding limit to all versioned XCM decode calls * Fix recursion limit test * Set a lower recursion count for recursion test * move integration tests to their own folder, fix recursion check in execute_effects * Remove xcm-executor integration tests directory * fix up * Update Cargo.lock * Update runtime/parachains/src/ump.rs * use proper decode limit * fix decode depth limit * here too * Update traits.rs * fix compile * fix test * Revert `decode_all_with_depth_limit` changes in parachain.rs * Remove unused imports in parachain.rs Co-authored-by:
Keith Yeung <kungfukeith11@gmail.com> Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by:
Bastian Köcher <info@kchr.de> Co-authored-by:
Gavin Wood <gavin@parity.io>
Showing
- polkadot/Cargo.lock 24 additions, 0 deletionspolkadot/Cargo.lock
- polkadot/Cargo.toml 1 addition, 0 deletionspolkadot/Cargo.toml
- polkadot/runtime/parachains/src/ump.rs 6 additions, 2 deletionspolkadot/runtime/parachains/src/ump.rs
- polkadot/runtime/test-runtime/Cargo.toml 8 additions, 0 deletionspolkadot/runtime/test-runtime/Cargo.toml
- polkadot/runtime/test-runtime/src/lib.rs 27 additions, 0 deletionspolkadot/runtime/test-runtime/src/lib.rs
- polkadot/runtime/test-runtime/src/xcm_config.rs 91 additions, 0 deletionspolkadot/runtime/test-runtime/src/xcm_config.rs
- polkadot/xcm/src/double_encoded.rs 1 addition, 3 deletionspolkadot/xcm/src/double_encoded.rs
- polkadot/xcm/src/lib.rs 3 additions, 0 deletionspolkadot/xcm/src/lib.rs
- polkadot/xcm/src/v0/traits.rs 2 additions, 0 deletionspolkadot/xcm/src/v0/traits.rs
- polkadot/xcm/src/v1/traits.rs 2 additions, 0 deletionspolkadot/xcm/src/v1/traits.rs
- polkadot/xcm/xcm-executor/integration-tests/Cargo.toml 30 additions, 0 deletionspolkadot/xcm/xcm-executor/integration-tests/Cargo.toml
- polkadot/xcm/xcm-executor/integration-tests/src/lib.rs 141 additions, 0 deletionspolkadot/xcm/xcm-executor/integration-tests/src/lib.rs
- polkadot/xcm/xcm-executor/src/lib.rs 38 additions, 7 deletionspolkadot/xcm/xcm-executor/src/lib.rs
- polkadot/xcm/xcm-simulator/example/Cargo.toml 1 addition, 1 deletionpolkadot/xcm/xcm-simulator/example/Cargo.toml
Please register or sign in to comment