- Mar 14, 2024
-
-
Gonçalo Pestana authored
Currently, the staking logic does not prevent a controller from becoming a stash of *another* ledger (introduced by [removing this check](https://github.com/paritytech/polkadot-sdk/pull/1484/files#diff-3aa6ceab5aa4e0ab2ed73a7245e0f5b42e0832d8ca5b1ed85d7b2a52fb196524L850)). Given that the remaining of the code expects that never happens, bonding a ledger with a stash that is a controller of another ledger may lead to data inconsistencies and data losses in bonded ledgers. For more detailed explanation of this issue: https://hackmd.io/@gpestana/HJoBm2tqo/%2FTPdi28H7Qc2mNUqLSMn15w In a nutshell, when fetching a ledger with a given controller, we may be end up getting the wrong ledger which can lead to unexpected ledger states. This PR also ensures that `set_controller` does not lead to data inconsistencies in the staking ledger and bonded storage in the case when a controller of a stash is a stash of *another* ledger. and improves the staking `try-runtime` checks to catch potential issues with the storage preemptively. In summary, there are two important cases here: 1. **"Sane" double bonded ledger** When a controller of a ledger is a stash of *another* ledger. In this case, we have: ``` > Bonded(stash, controller) (A, B) // stash A with controller B (B, C) // B is also a stash of another ledger (C, D) > Ledger(controller) Ledger(B) = L_a (stash = A) Ledger(C) = L_b (stash = B) Ledger(D) = L_c (stash = C) ``` In this case, the ledgers can be mutated and all operations are OK. However, we should not allow `set_controller` to be called if it means it results in a "corrupt" double bonded ledger (see below). 3. **"Corrupt" double bonded ledger** ``` > Bonded(stash, controller) (A, B) // stash A with controller B (B, B) (C, D) ``` In this case, B is a stash and controller AND is corrupted, since B is responsible for 2 ledgers which is not correct and will lead to inconsistent states. Thus, in this case, in this PR we are preventing these ledgers from mutating (i.e. operations like bonding extra etc) until the ledger is brought back to a consistent state. --- **Changes**: - Checks if stash is already a controller when calling `Call::bond` (fixes the regression introduced by [removing this check](https://github.com/paritytech/polkadot-sdk/pull/1484/files#diff-3aa6ceab5aa4e0ab2ed73a7245e0f5b42e0832d8ca5b1ed85d7b2a52fb196524L850)); - Ensures that all fetching ledgers from storage are done through the `StakingLedger` API; - Ensures that -- when fetching a ledger from storage using the `StakingLedger` API --, a `Error::BadState` is returned if the ledger bonding is in a bad state. This prevents bad ledgers from mutating (e.g. `bond_extra`, `set_controller`, etc) its state and avoid further data inconsistencies. - Prevents stashes which are controllers or another ledger from calling `set_controller`, since that may lead to a bad state. - Adds further try-state runtime checks that check if there are ledgers in a bad state based on their bonded metadata. Related to https://github.com/paritytech/polkadot-sdk/issues/3245 --------- Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: kianenigma <[email protected]>
-
- Mar 13, 2024
-
-
georgepisaltu authored
Revert "FRAME: Create `TransactionExtension` as a replacement for `SignedExtension` (#2280)" (#3665) This PR reverts #2280 which introduced `TransactionExtension` to replace `SignedExtension`. As a result of the discussion [here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700), the changes will be reverted for now with plans to reintroduce the concept in the future. --------- Signed-off-by: georgepisaltu <[email protected]>
-
Alexandru Vasile authored
This PR adds a debug log for displaying all the public addresses that will later be advertised in the DHT record of the authority. The Authority DHT record will contain the address ++ `/p2p/peerID` (if not already present). This log enables us to check if different nodes will advertise in the DHT record of the authority the same IP address, however with different peer IDs. Signed-off-by: Alexandru Vasile <[email protected]>
-
gupnik authored
Moved from https://github.com/paritytech/substrate/pull/14788 ---- Fixes https://github.com/paritytech/polkadot-sdk/issues/232 This PR introduces outer-macro approach for `construct_runtime` as discussed in the linked issue. It looks like the following: ```rust #[frame_support::runtime] mod runtime { #[runtime::runtime] #[runtime::derive( RuntimeCall, RuntimeEvent, RuntimeError, RuntimeOrigin, RuntimeFreezeReason, RuntimeHoldReason, RuntimeSlashReason, RuntimeLockId, RuntimeTask, )] pub struct Runtime; #[runtime::pallet_index(0)] pub type System = frame_system; #[runtime::pallet_index(1)] pub type Timestamp = pallet_timestamp; #[runtime::pallet_index(2)] pub type Aura = pallet_aura; #[runtime::pallet_index(3)] pub type Grandpa = pallet_grandpa; #[runtime::pallet_index(4)] pub type Balances = pallet_balances; #[runtime::pallet_index(5)] pub type TransactionPayment = pallet_transaction_payment; #[runtime::pallet_index(6)] pub type Sudo = pallet_sudo; // Include the custom logic from the pallet-template in the runtime. #[runtime::pallet_index(7)] pub type TemplateModule = pallet_template; } ``` ## Features - `#[runtime::runtime]` attached to a struct defines the main runtime - `#[runtime::derive]` attached to this struct defines the types generated by runtime - `#[runtime::pallet_index]` must be attached to a pallet to define its index - `#[runtime::disable_call]` can be optionally attached to a pallet to disable its calls - `#[runtime::disable_unsigned]` can be optionally attached to a pallet to disable unsigned calls - A pallet instance can be defined as `TemplateModule: pallet_template<Instance>` - An optional attribute can be defined as `#[frame_support::runtime(legacy_ordering)]` to ensure that the order of hooks is same as the order of pallets (and not based on the pallet_index). This is to support legacy runtimes and should be avoided for new ones. ## Todo - [x] Update the latest syntax in kitchensink and tests - [x] Update UI tests - [x] Docs ## Extension - Abstract away the Executive similar to https://github.com/paritytech/substrate/pull/14742 - Optionally avoid the need to specify all runtime types (TBD) --------- Co-authored-by: Francisco Aguirre <[email protected]> Co-authored-by: Nikhil Gupta <>
-
- Mar 12, 2024
-
-
Michal Kucharczyk authored
This functionality is required for #1984. This PR enables [`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b/substrate/primitives/keyring/src/sr25519.rs#L31-L40) in `no-std` environments, allowing to generate the public key (e.g. `AccountKeyring::Alice.public().to_ss58check()`), which can be later used in the any of built-in [_runtime-genesis-config_ variant](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b/polkadot/node/service/src/chain_spec.rs#L1066-L1073). The proposal is as follows: - expose [`core::Pair` trait](https://github.com/paritytech/polkadot-sdk/blob/d6f15306 /substrate/primitives/core/src/crypto.rs#L832) in `no-std`, - `full_crypto` feature enables `sign` method, - `std` feature enables `generate_with_phrase` and `generate` methods (randomness is required), - All other functionality, currently gated by `full_crypto` will be available unconditionally (`no-std`): -- `from_string` -- `from_string_with_seed` -- `from seed` -- `from_seed_slice` -- `from_phrase` -- `derive` -- `verify` --- Depends on https://github.com/rust-bitcoin/rust-bip39/pull/57 --------- Co-authored-by: command-bot <> Co-authored-by: Davide Galassi <[email protected]>
-
Koute authored
This PR adds a new PolkaVM-based executor to Substrate. - The executor can now be used to actually run a PolkaVM-based runtime, and successfully produces blocks. - The executor is always compiled-in, but is disabled by default. - The `SUBSTRATE_ENABLE_POLKAVM` environment variable must be set to `1` to enable the executor, in which case the node will accept both WASM and PolkaVM program blobs (otherwise it'll default to WASM-only). This is deliberately undocumented and not explicitly exposed anywhere (e.g. in the command line arguments, or in the API) to disincentivize anyone from enabling it in production. If/when we'll move this into production usage I'll remove the environment variable and do it "properly". - I did not use our legacy runtime allocator for the PolkaVM executor, so currently every allocation inside of the runtime will leak guest memory until that particular instance is destroyed. The idea here is that I will work on the https://github.com/polkadot-fellows/RFCs/pull/4 which will remove the need for the legacy allocator under WASM, and that will also allow us to use a proper non-leaking allocator under PolkaVM. - I also did some minor cleanups of the WASM executor and deleted some dead code. No prdocs included since this is not intended to be an end-user feature, but an unofficial experiment, and shouldn't affect any current production user. Once this is production-ready a full Polkadot Fellowship RFC will be necessary anyway.
-
gupnik authored
Step in https://github.com/paritytech/polkadot-sdk/issues/171
-
- Mar 11, 2024
-
-
dependabot[bot] authored
Bumps [handlebars](https://github.com/sunng87/handlebars-rust) from 4.3.7 to 5.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/sunng87/handlebars-rust/releases">handlebars's releases</a>.</em></p> <blockquote> <h2>v5.1.0</h2> <h2>What's Changed</h2> <ul> <li>chore(deps-dev): bump follow-redirects from 1.15.2 to 1.15.4 in /playground/www by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/628">sunng87/handlebars-rust#628</a></li> <li>Add chained else expression support by <a href="https://github.com/progmboy"><code>@progmboy</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/629">sunng87/handlebars-rust#629</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/progmboy"><code>@progmboy</code></a> made their first contribution in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/629">sunng87/handlebars-rust#629</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/sunng87/handlebars-rust/compare/v5.0.0...v5.1.0">https://github.com/sunng87/handlebars-rust/compare/v5.0.0...v5.1.0</a></p> <h2>v5.0.0</h2> <h2>5.0.0</h2> <p>A semver major release that introduces some API breaking changes.</p> <h3>Highlights</h3> <ul> <li><code>RenderError</code> has been rewritten for typed error reason. In previous versions we use string message for <code>RenderError</code> which is impossible to handle with code. This version introduces <code>RenderErrorReason</code> so you can use <code>match</code> to deal various error reasons.</li> <li>Lifetime in <code>Helper</code> trait has been simplified.</li> </ul> <h3>Changes compared to 4.3</h3> <ul> <li>[Added] public mutable access to local variables in <code>BlockContext</code> <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/533">#533</a></li> <li>[Changed] Simplified lifetime specifiers for <code>Helper</code>, <code>ScopedJson</code> and some other related types and functions. <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/532">#532</a></li> <li>[Changed] Updated <code>TemplateError</code> to reduce its size. Direct field access is removed in favor of access methods</li> <li>[Changed] Introducing <code>RenderErrorReason</code> for typed render error</li> <li>[Changed] Changed <code>register_template_directory</code> api for more customizations #[610]</li> <li>[Changed] Updated rust-embed to 8.0</li> </ul> <h2>Collaboration Wanted</h2> <p>I'm looking for collaborations to join the development with me on this project. Contact via email if your are interested in.</p> <h2>Auto-generated changelog</h2> <ul> <li>chore(deps): update criterion requirement from 0.3 to 0.4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/530">sunng87/handlebars-rust#530</a></li> <li>issue 529: simplify lifetime requirements by <a href="https://github.com/lovasoa"><code>@lovasoa</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/532">sunng87/handlebars-rust#532</a></li> <li>Allow public access to local variables by <a href="https://github.com/lovasoa"><code>@lovasoa</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/533">sunng87/handlebars-rust#533</a></li> <li>Fix issue when using partial context within each block by <a href="https://github.com/sunng87"><code>@sunng87</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/536">sunng87/handlebars-rust#536</a></li> <li>chore(deps): update tiny_http requirement from 0.11 to 0.12 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/538">sunng87/handlebars-rust#538</a></li> <li>fix: enable include-exclude feature for rust-embed by <a href="https://github.com/sunng87"><code>@sunng87</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/542">sunng87/handlebars-rust#542</a></li> <li>Fix looking up provided null value in strict mode by <a href="https://github.com/sunng87"><code>@sunng87</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/543">sunng87/handlebars-rust#543</a></li> <li>chore(deps): update pprof requirement from 0.10 to 0.11 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/544">sunng87/handlebars-rust#544</a></li> <li>Able to get the missing variable path from error by <a href="https://github.com/linw1995"><code>@linw1995</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/546">sunng87/handlebars-rust#546</a></li> <li>chore(deps): update env_logger requirement from 0.9 to 0.10 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/547">sunng87/handlebars-rust#547</a></li> <li>fix: loading templates which has multiple extensions by <a href="https://github.com/sunng87"><code>@sunng87</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/551">sunng87/handlebars-rust#551</a></li> <li>Web playground by <a href="https://github.com/sunng87"><code>@sunng87</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/548">sunng87/handlebars-rust#548</a></li> <li>chore(deps): bump loader-utils from 1.2.3 to 1.4.2 in /playground/www by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/sunng87/handlebars-rust/pull/553">sunng87/handlebars-rust#553</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md">handlebars's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/sunng87/handlebars-rust/compare/5.0.0...5.1.0">5.1.0</a> - 2024-01-17</h2> <ul> <li>[Added] Chained <code>else if</code> block support <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/629">#629</a></li> </ul> <h2><a href="https://github.com/sunng87/handlebars-rust/compare/4.3.4...5.0.0">5.0.0</a> - 2023-12-31</h2> <ul> <li>[Added] public mutable access to local variables in <code>BlockContext</code> <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/533">#533</a></li> <li>[Changed] Simplified lifetime specifiers for <code>Helper</code>, <code>ScopedJson</code> and some other related types and functions. <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/532">#532</a></li> <li>[Changed] Updated <code>TemplateError</code> to reduce its size. Direct field access is removed in favor of access methods</li> <li>[Changed] Introducing <code>RenderErrorReason</code> for typed render error</li> <li>[Changed] Changed <code>register_template_directory</code> api for more customizations #[610]</li> <li>[Changed] Updated rust-embed to 8.0</li> </ul> <h2><a href="https://github.com/sunng87/handlebars-rust/compare/4.3.3...4.3.4">4.3.4</a> - 2022-09-11</h2> <ul> <li>[Added] New <code>write_fmt</code> function for <code>Output</code> <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/522">#522</a></li> <li>[Added] <code>reason()</code> method for <code>TemplateError</code> to access underlying reason, this replaces original direct <code>.reason</code> access.</li> <li>[Changed] Direct access to <code>TemplateError</code>'s <code>reason</code> field is depreacted will be removed in future.</li> </ul> <h2><a href="https://github.com/sunng87/handlebars-rust/compare/4.3.2...4.3.3">4.3.3</a> - 2022-07-20</h2> <ul> <li>[Fixed] Disable partial expression indentation with <code>{{~> partial}}</code> to bring behavior closer in line with original javascript version. <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/518">#518</a></li> <li>[Fixed] Support for using partial context together with partial parameters <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/520">#520</a></li> </ul> <h2><a href="https://github.com/sunng87/handlebars-rust/compare/4.3.1...4.3.2">4.3.2</a> - 2022-07-14</h2> <ul> <li>[Added] Render functions that reuse <code>Context</code> for custom <code>std::io::Write</code>: <code>render_with_context_to_write</code> and <code>render_template_with_context_to_write</code></li> </ul> <h2><a href="https://github.com/sunng87/handlebars-rust/compare/4.3.0...4.3.1">4.3.1</a> - 2022-06-09</h2> <ul> <li>[Added] Added support for <code>{{~{variable}~}}</code> syntax <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/509">#509</a></li> </ul> <h2><a href="https://github.com/sunng87/handlebars-rust/compare/4.2.2...4.3.0">4.3.0</a> - 2022-05-18</h2> <ul> <li>[Changed] update MSRV to 1.57 as rhai requires</li> <li>[Fixed] Reimplemented indent support for partial expression <code>{{> partial}}</code>, which is introduced in 4.2.0. The new implementation is aligned with original javascript version, that every text line generated from partial are indented as <code>{{> partial}}</code> does. <code>prevent_indent</code> will turn-off this feature. <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/505">#505</a></li> <li>[Changed] changed error support library from quick_error to thiserror</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/sunng87/handlebars-rust/commit/d8d9a78f4a11d1a5e2ad82cd5277a6edb24d3751"><code>d8d9a78</code></a> chore: Release handlebars version 5.1.0</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/137bce5863b6782252b966480c497246e904e008"><code>137bce5</code></a> chore: minor cleanup for chained else support in <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/629">#629</a></li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/e30d8abfa391b643aa93b0e8d5f424f5a436a8c6"><code>e30d8ab</code></a> Merge pull request <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/629">#629</a> from progmboy/else_chain</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/8f16353281b565007ffccddcb8178389aa3bcdc1"><code>8f16353</code></a> format code</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/786d132c1deb295b1fc77441d85201b556685b82"><code>786d132</code></a> add else chain support</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/23672e837bf731a609080366450e587960d39b69"><code>23672e8</code></a> Merge pull request <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/628">#628</a> from sunng87/dependabot/npm_and_yarn/playground/www/f...</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/b849efd171e2ec598383605349f4ef8bcd6b8631"><code>b849efd</code></a> chore(deps-dev): bump follow-redirects in /playground/www</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/7071c9d3ba572b7ac7f29bee43b2f4501652de83"><code>7071c9d</code></a> test: add test for error reason</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/4664a345f373eb9a96b1281640396d098221a28c"><code>4664a34</code></a> (cargo-release) version 5.0.0</li> <li><a href="https://github.com/sunng87/handlebars-rust/commit/ca277489dc80d2392c0029994e59ed26beb64636"><code>ca27748</code></a> Merge pull request <a href="https://redirect.github.com/sunng87/handlebars-rust/issues/625">#625</a> from sunng87/refactor/render-error-reason-2</li> <li>Additional commits viewable in <a href="https://github.com/sunng87/handlebars-rust/compare/v4.3.7...v5.1.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=cargo&previous-version=4.3.7&new-version=5.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> > **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <[email protected]>
-
philoniare authored
# Description *Removes the deprecated `trait Store` feature from the code base* Fixes #222 --------- Co-authored-by: Dónal Murray <[email protected]>
-
s0me0ne-unkn0wn authored
As I've been dancing around this pallet for quite some time anyway, I decided to remove getters at once. There were only a few leftovers in tests. Related: #3326 CC @muraca
-
Dónal Murray authored
This fixes the behaviour of `Linear` which is the default implementation of the `AdaptPrice` trait in the broker pallet. Previously if cores were offered but not sold in only one sale, the price would be set to zero and due to the logic being purely multiplicative, the price would stay at 0 indefinitely. This could be further paired with a configurable minimum in the broker pallet itself, which will be a future PR. This affects the Rococo and Westend Coretime chains, but Kusama has a different implementation so this isn't required for the Kusama launch. I actually thought I opened this a while ago. --------- Co-authored-by: Bastian Köcher <[email protected]>
-
- Mar 10, 2024
-
-
Muharem Ismailov authored
This documentation guide to address an incorrect exchange rate for a non-withdrawable pool.
-
- Mar 09, 2024
-
-
Viki Val authored
## Context Implementing `HolderOf(collection_id)` we have observed a fancy glitch where pallet deposits event with incorrect values ### Test case [Observe following extrinsic](https://assethub-polkadot.subscan.io/extrinsic/0xdc72321b7674aa209c2f194ed49bd6bd12708af103f98b5b9196e0132dcba777) To mint in collection `51` user needs to be `HolderOf(50)`. Therefore current user is owner of item `394` `witness_data { owned_item: 394 }` All checking is done correctly, storage is updated correctly ![photo_2023-12-18 16 07 11](https://github.com/paritytech/polkadot-sdk/assets/22471030/ca991272-156d-4db1-97b2-1a2873fc5d3f) However the event which is emitted does not make semantic sense as we updated storage for `50-394` not for `51-114` ![photo_2023-12-18 16 07 17](https://github.com/paritytech/polkadot-sdk/assets/22471030/c998a92c-e306-4433-aad8-103078140e23) ## The fix This PR fixes that depositing `PalletAttributeSet` emits correct values. --------- Co-authored-by: Jegor Sidorenko <[email protected]> Co-authored-by: Jegor Sidorenko <[email protected]>
-
Michal Kucharczyk authored
This PR replaces the usage of [secp256k](https://crates.io/crates/secp256k1) crate with [k256](https://crates.io/crates/k256) in `core::crypto::ecdsa` for `non-std` environments as outcome of discussion in #3448. `secp256k1` is used in `std`, meaning that we should not affect host performance with this PR. `k256` is enabled in runtimes (`no-std`), and is required to proceed with #2044. If desirable, in future we can switch to `k256` also for `std`. That would require some performance evaluation (e.g. for EVM chains as per https://github.com/paritytech/polkadot-sdk/issues/3448#issuecomment-1976780391). Closes https://github.com/paritytech/polkadot-sdk/issues/3448 --------- Co-authored-by: command-bot <> Co-authored-by: Davide Galassi <[email protected]>
-
- Mar 08, 2024
-
-
cuinix authored
Signed-off-by: cuinix <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
PG Herveou authored
Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: command-bot <>
-
PG Herveou authored
Rustfmt will add a trailing comma for longer expression, this change will make sure that the Range parameters can still be parsed. --------- Co-authored-by: command-bot <> Co-authored-by: Alexander Theißen <[email protected]>
-
PG Herveou authored
ApiVersion should have been bumped with https://github.com/paritytech/polkadot-sdk/pull/3606 this does that and add a test so we don't forget to do that everytime
-
- Mar 07, 2024
-
-
Pablo Andrés Dorado Suárez authored
Closes #376 --------- Co-authored-by: command-bot <>
-
PG Herveou authored
Oversight from PR https://github.com/paritytech/polkadot-sdk/pull/3384. These 2 functions should have been tagged as stable
-
Alexander Theißen authored
Unfortunately, the flakiness wasn't fixed by https://github.com/paritytech/polkadot-sdk/pull/3595. Let's disable the test in the meanwhile since it is hanging on the CI a lot. --------- Co-authored-by: Liam Aharon <[email protected]>
-
PG Herveou authored
This is not maintained, and we should be able to get information from the release changelog
-
Kian Paimani authored
substrate.io deprecation companion: https://github.com/substrate-developer-hub/substrate-docs/pull/2139 pba-content companion: https://github.com/Polkadot-Blockchain-Academy/pba-content/pull/978 partially inspired by: https://github.com/paritytech/polkadot-sdk/issues/3535 --------- Co-authored-by: Ankan <[email protected]>
-
André Silva authored
Moves [substrate-bip39](https://github.com/paritytech/substrate-bip39) into substrate. All git history is preserved. Dependencies have been updated to use the same version as the rest of the repo. Fixes https://github.com/paritytech/polkadot-sdk/issues/1934. --------- Co-authored-by: Maciej Hirsz <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]> Co-authored-by: Gav Wood <[email protected]> Co-authored-by: Stanislav Tkach <[email protected]> Co-authored-by: Robert Habermeier <[email protected]> Co-authored-by: Pierre Krieger <[email protected]> Co-authored-by: Demi M. Obenour <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: NikVolf <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Benjamin Kampmann <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]> Co-authored-by: cheme <[email protected]> Co-authored-by: adoerr <[email protected]> Co-authored-by: Jun Jiang <[email protected]> Co-authored-by: Dan Shields <[email protected]> Co-authored-by: Michal Kucharczyk <[email protected]>
-
Dastan authored
Currently, pool member funds cannot be unbonded if the depositor's stake is less than `MinNominatorBond`. This usually happens after `T::MinNominatorBond` is increased. To fix this, the above mentioned condition is added as a case for permissionless dispatch of `chill`. After pool is chilled, pool members can unbond their funds since pool won't be nominating anymore. Consequently, same check is added to `nominate` call, i.e pool can not start nominating if it's depositor does not have `MinNominatorBond` cc @Ank4n @Kianenigma closes #2350 Polkadot address: 16FqwPZ8GRC5U5D4Fu7W33nA55ZXzXGWHwmbnE1eT6pxuqcT --------- Co-authored-by: Ankan <[email protected]> Co-authored-by: Gonçalo Pestana <[email protected]> Co-authored-by: command-bot <>
-
Alexander Theißen authored
In order to prepare for PolkaVM support I removed the wat support from our test fixture crate. - Removed redundant tests (invalid module checks are already inside the prepare module where they belong - Converted the gas_sync tests to Rust - Moved the start function test to the `wasm` module
-
- Mar 06, 2024
-
-
PG Herveou authored
Co-authored-by: Cyrill Leutwiler <[email protected]> Co-authored-by: command-bot <> Co-authored-by: Alexander Theißen <[email protected]>
-
Alexandru Vasile authored
This PR extends the Initialized event of the chainHead_follow subscription. Now, the event provides multiple finalized block hashes. This information allows clients that are disconnected, and that want to reconnect, to not lose information about the state of the chain. At the moment, the spec encourages servers to provide at least 1 minute of finalized blocks (~10 blocks). The users are responsible for unpinning these blocks at a later time. This PR tries to report at least 1 finalized block and at most 16 blocks, if they are available. Closes: https://github.com/paritytech/polkadot-sdk/issues/3432 cc @paritytech/subxt-team --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
-
André Silva authored
Hopefully helps with test flakiness.
-
Usama Ali authored
This PR makes `sc-network-sync` types public following [this](https://github.com/paritytech/polkadot-sdk/issues/3556) issue. Fixes #3556
-
PG Herveou authored
Co-authored-by: Alexander Theißen <[email protected]>
-
Sergej Sakac authored
Closes: #3196 --------- Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: PG Herveou <[email protected]>
-
- Mar 05, 2024
-
-
Oliver Tale-Yazdi authored
Changes: - `QueueFootprint` gets a new field; `ready_pages` that contains the non-overweight and not yet processed pages. - `XCMP` queue pallet is change to use the `ready_pages` instead of `pages` to calculate the channel suspension thresholds. This should give the XCMP queue pallet a more correct view of when to suspend channels. --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-
Rodrigo Quelhas authored
# Description Removed deprecated type `GenesisConfig` from the codebase. Closes https://github.com/paritytech/polkadot-sdk/issues/175 # Checklist - [x] My PR includes a detailed description as outlined in the "Description" section above - [x] My PR follows the [labeling requirements](CONTRIBUTING.md#Process) of this project (at minimum one label for `T` required) - [x] I have made corresponding changes to the documentation (if applicable) --------- Co-authored-by: Liam Aharon <[email protected]> Co-authored-by: Michal Kucharczyk <[email protected]>
-
Kian Paimani authored
The first step towards https://github.com/paritytech/polkadot-sdk/issues/3155 Brings all templates under the following structure ``` templates | parachain | | polkadot-launch | | runtime --> parachain-template-runtime | | pallets --> pallet-parachain-template | | node --> parachain-template-node | minimal | | runtime --> minimal-template-runtime | | pallets --> pallet-minimal-template | | node --> minimal-template-node | solochain | | runtime --> solochain-template-runtime | | pallets --> pallet-template (the naming is not consistent here) | | node --> solochain-template-node ``` The only note-worthy changes in this PR are: - More `Cargo.toml` fields are forwarded to use the one from the workspace. - parachain template now has weights and benchmarks - adds a shell pallet to the minimal template - remove a few unused deps A list of possible follow-ups: - [ ] Unify READMEs, create a parent README for all - [ ] remove references to `docs.substrate.io` in templates - [ ] make all templates use `#[derive_impl]` - [ ] update and unify all licenses - [ ] Remove polkadot launch, use https://github.com/paritytech/polkadot-sdk/blob/35349df9/cumulus/zombienet/examples/small_network.toml instead.
-
Matteo Muraca authored
Part of #3326 This one is easier as all the storage items are public. @ggwpez @Kianenigma @shawntabrizi --------- Signed-off-by: Matteo Muraca <[email protected]> Co-authored-by: Liam Aharon <[email protected]> Co-authored-by: command-bot <> Co-authored-by: Kian Paimani <[email protected]>
-
Serban Iorga authored
Fixes failures like: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5436619#L3319
-
Niklas Adolfsson authored
After some discussion with @kogeler after the we added the rate-limit middleware it may slow down the rpc call timings metrics significantly because it works as follows: 1. The rate limit guard is checked when the call comes and if a slot is available -> process the call 2. If no free spot is available then the call will be sleeping `jitter_delay + min_time_rate_guard` then woken up and checked at most ten times 3. If no spot is available after 10 iterations -> the call is rejected (this may take tens of seconds) Thus, this PR adds a label "is_rate_limited" to filter those out on the metrics "substrate_rpc_calls_time" and "substrate_rpc_calls_finished". I had to merge two middleware layers Metrics and RateLimit to avoid shared state in a hacky way. --------- Co-authored-by: James Wilson <[email protected]>
-
PG Herveou authored
-
Nazar Mokrynskyi authored
Latest Rust nightly complains with `the item `Result` is imported redundantly` Co-authored-by: Sebastian Kunert <[email protected]> Co-authored-by: Liam Aharon <[email protected]>
-