22 Commits

Author SHA1 Message Date
Luke Parker
8970031f42 Update to latest substrate-wasm-builder 2025-09-30 06:44:12 -04:00
Luke Parker
10ca5b9757 Manually insert the authority discovery key into the keystore
I did try pulling in `pallet-authority-discovery` for this, updating
`SessionKeys`, but that was insufficient for whatever reason.
2025-09-30 06:40:19 -04:00
Luke Parker
1d0a26e32e Adopt patch-polkadot-sdk with fixed peering 2025-09-30 03:53:14 -04:00
Luke Parker
e1671dd71b Mention every account on-chain before they publish a transaction
`CheckNonce` required accounts have a provider in order to even have their
nonce considered. This shims that by claiming every account has a provider at
the start of a block, if it signs a transaction.

The actual execution could presumably diverge between block building (which
sets the provider before each transaction) and execution (which sets the
providers at the start of the block). It doesn't diverge in our current
configuration and it won't be propagated to `next` (which doesn't use
`CheckNonce`).

Also uses explicit indexes for the `serai_abi::{Call, Event}` `enum`s.
2025-09-23 18:04:46 -04:00
Luke Parker
0b377f3c4e Always generate a new key for the P2P network 2025-09-22 06:41:30 -04:00
Luke Parker
3655ae68df Restore chain_getBlockBin to the RPC 2025-09-22 06:41:07 -04:00
Luke Parker
3f2c1bf303 Move from Debian bookworm to trixie 2025-09-22 03:41:25 -04:00
Luke Parker
c12c471602 Restore clang as a dependency due to the Debian Dockerfile as we require a C++ compiler 2025-09-22 02:57:50 -04:00
Luke Parker
77ceb86f9a Update to a version of substrate without wasmtimer
Turns out `wasmtimer` is WASM only. This should restore the node's functioning
on non-WASM environments.
2025-09-22 02:20:57 -04:00
Luke Parker
486409c9ef Set the CODE storage slot 2025-09-22 01:04:03 -04:00
Luke Parker
de460e368a Add libclang-dev as dependency to the Debian Dockerfile 2025-09-22 00:58:33 -04:00
Luke Parker
c904167920 Replace hard-coded path with the intended env variable to fix macOS 13 2025-09-22 00:41:16 -04:00
Luke Parker
d20a66891c Use sw_vers instead of uname on macOS
Yields the macOS version instead of the kernel's version.
2025-09-22 00:14:14 -04:00
Luke Parker
18ce7efc19 Correct how macOS 13 and 14 have different homebrew paths 2025-09-22 00:08:20 -04:00
Luke Parker
fabe22e99f Correct llvm/lib path on macOS 2025-09-21 23:54:58 -04:00
Luke Parker
feb6166190 Correct Windows build dependencies 2025-09-21 23:42:50 -04:00
Luke Parker
87920d8685 Use libp2p 0.56 in serai-node 2025-09-21 23:34:33 -04:00
Luke Parker
5087b32cc8 Attempt to use LD_LIBRARY_PATH in macOS GitHub CI 2025-09-21 23:32:33 -04:00
Luke Parker
9fa7a08c1a Add /usr/local/opt/llvm/lib to paths on macOS hosts 2025-09-21 23:17:11 -04:00
Luke Parker
9a08ffde09 CI fixes 2025-09-21 22:53:22 -04:00
Luke Parker
41bb2c7b2a Update develop to patch-polkadot-sdk
Allows us to finally remove the old `serai-dex/substrate` repository _and_
should have CI pass without issue on `develop` again.

The changes made here should be trivial and maintain all prior
behavior/functionality. The most notable are to `chain_spec.rs`, in order to
still use a SCALE-encoded `GenesisConfig` (avoiding `serde_json`).
2025-09-21 22:36:43 -04:00
Luke Parker
52d15b789c Update build-dependencies CI action 2025-09-21 15:41:09 -04:00
45 changed files with 634 additions and 686 deletions

View File

@@ -43,8 +43,8 @@ runs:
choco install protoc choco install protoc
elif [ "$RUNNER_OS" == "macOS" ]; then elif [ "$RUNNER_OS" == "macOS" ]; then
brew install protobuf llvm brew install protobuf llvm
HOMEBREW_ROOT_PATH=/opt/homebrew # Apple Silicon HOMEBREW_ROOT_PATH=/opt/homebrew # macOS 14+
if [ $(uname -m) = "x86_64" ]; then HOMEBREW_ROOT_PATH=/usr/local; fi # Intel if [ $(sw_vers -productVersion | awk -F "." '{ print $1 }') = "13" ]; then HOMEBREW_ROOT_PATH=/usr/local; fi # macOS 13
ls $HOMEBREW_ROOT_PATH/opt/llvm/lib | grep "libclang.dylib" # Make sure this installed `libclang` ls $HOMEBREW_ROOT_PATH/opt/llvm/lib | grep "libclang.dylib" # Make sure this installed `libclang`
echo "DYLD_LIBRARY_PATH=$HOMEBREW_ROOT_PATH/opt/llvm/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV" echo "DYLD_LIBRARY_PATH=$HOMEBREW_ROOT_PATH/opt/llvm/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
fi fi

View File

@@ -1 +1 @@
nightly-2025-11-01 nightly-2025-09-01

View File

@@ -11,7 +11,7 @@ jobs:
clippy: clippy:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest] os: [ubuntu-latest, macos-13, macos-14, windows-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:

View File

@@ -70,7 +70,7 @@ jobs:
- name: Buld Rust docs - name: Buld Rust docs
run: | run: |
rustup toolchain install ${{ steps.nightly.outputs.version }} --profile minimal -t wasm32v1-none -c rust-docs rustup toolchain install ${{ steps.nightly.outputs.version }} --profile minimal -t wasm32v1-none -c rust-docs
RUSTDOCFLAGS="--cfg docsrs" cargo +${{ steps.nightly.outputs.version }} doc --workspace --no-deps --all-features RUSTDOCFLAGS="--cfg docsrs" cargo +${{ steps.nightly.outputs.version }} doc --workspace --all-features
mv target/doc docs/_site/rust mv target/doc docs/_site/rust
- name: Upload artifact - name: Upload artifact

7
.gitignore vendored
View File

@@ -1,14 +1,7 @@
target target
# Don't commit any `Cargo.lock` which aren't the workspace's
Cargo.lock
!./Cargo.lock
# Don't commit any `Dockerfile`, as they're auto-generated, except the only one which isn't
Dockerfile Dockerfile
Dockerfile.fast-epoch Dockerfile.fast-epoch
!orchestration/runtime/Dockerfile !orchestration/runtime/Dockerfile
.test-logs .test-logs
.vscode .vscode

1181
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -128,9 +128,8 @@ modular-frost = { path = "crypto/frost" }
# https://github.com/rust-lang-nursery/lazy-static.rs/issues/201 # https://github.com/rust-lang-nursery/lazy-static.rs/issues/201
lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" } lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev = "5735630d46572f1e5377c8f2ba0f79d18f53b10c" }
# These have `std` alternatives # `matches` has an `std` alternative
matches = { path = "patches/matches" } matches = { path = "patches/matches" }
home = { path = "patches/home" }
# directories-next was created because directories was unmaintained # directories-next was created because directories was unmaintained
# directories-next is now unmaintained while directories is maintained # directories-next is now unmaintained while directories is maintained
@@ -184,7 +183,7 @@ range_plus_one = "deny"
redundant_closure_for_method_calls = "deny" redundant_closure_for_method_calls = "deny"
redundant_else = "deny" redundant_else = "deny"
string_add_assign = "deny" string_add_assign = "deny"
unchecked_time_subtraction = "deny" unchecked_duration_subtraction = "deny"
unnecessary_box_returns = "deny" unnecessary_box_returns = "deny"
unnecessary_join = "deny" unnecessary_join = "deny"
unnecessary_wraps = "deny" unnecessary_wraps = "deny"
@@ -206,7 +205,6 @@ unnecessary_map_or = "allow"
result_large_err = "allow" result_large_err = "allow"
unneeded_struct_pattern = "allow" unneeded_struct_pattern = "allow"
[workspace.lints.rust] [workspace.lints.rust]
unused = "allow" # TODO: https://github.com/rust-lang/rust/issues/147648
mismatched_lifetime_syntaxes = "allow" mismatched_lifetime_syntaxes = "allow"
unused_attributes = "allow" unused_attributes = "allow"
unused_parens = "allow" unused-parens = "allow"

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
// Obtain a variable from the Serai environment/secret store. // Obtain a variable from the Serai environment/secret store.
pub fn var(variable: &str) -> Option<String> { pub fn var(variable: &str) -> Option<String> {

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![deny(missing_docs)] #![deny(missing_docs)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
use std::sync::Arc; use std::sync::Arc;

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(all(zalloc_rustc_nightly, feature = "allocator"), feature(allocator_api))] #![cfg_attr(all(zalloc_rustc_nightly, feature = "allocator"), feature(allocator_api))]
//! Implementation of a Zeroizing Allocator, enabling zeroizing memory on deallocation. //! Implementation of a Zeroizing Allocator, enabling zeroizing memory on deallocation.

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
use zeroize::Zeroize; use zeroize::Zeroize;

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("lib.md")] #![doc = include_str!("lib.md")]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,5 +1,5 @@
#![allow(deprecated)] #![allow(deprecated)]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![no_std] // Prevents writing new code, in what should be a simple wrapper, which requires std #![no_std] // Prevents writing new code, in what should be a simple wrapper, which requires std
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![allow(clippy::redundant_closure_call)] #![allow(clippy::redundant_closure_call)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![no_std] #![no_std]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
// This crate requires `dleq` which doesn't support no-std via std-shims // This crate requires `dleq` which doesn't support no-std via std-shims
// #![cfg_attr(not(feature = "std"), no_std)] // #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
// This crate requires `dleq` which doesn't support no-std via std-shims // This crate requires `dleq` which doesn't support no-std via std-shims
// #![cfg_attr(not(feature = "std"), no_std)] // #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![no_std] #![no_std]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![no_std] #![no_std]
#![allow(clippy::redundant_closure_call)] #![allow(clippy::redundant_closure_call)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
/// Tests for the Field trait. /// Tests for the Field trait.

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
use core::fmt::Debug; use core::fmt::Debug;

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
use std::io::{self, Read}; use std::io::{self, Read};

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![no_std] #![no_std]

View File

@@ -111,6 +111,7 @@ unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"] allow-registry = ["https://github.com/rust-lang/crates.io-index"]
allow-git = [ allow-git = [
"https://github.com/rust-lang-nursery/lazy-static.rs", "https://github.com/rust-lang-nursery/lazy-static.rs",
"https://github.com/kayabaNerve/elliptic-curves",
"https://github.com/monero-oxide/monero-oxide", "https://github.com/monero-oxide/monero-oxide",
"https://github.com/serai-dex/patch-polkadot-sdk", "https://github.com/serai-dex/patch-polkadot-sdk",
] ]

View File

@@ -234,7 +234,8 @@ async fn main() {
// TODO: Add a magic value with a key at the start of the connection to make this authed // TODO: Add a magic value with a key at the start of the connection to make this authed
let mut db = db.clone(); let mut db = db.clone();
tokio::spawn(async move { tokio::spawn(async move {
while let Ok(msg_len) = socket.read_u32_le().await { loop {
let Ok(msg_len) = socket.read_u32_le().await else { break };
let mut buf = vec![0; usize::try_from(msg_len).unwrap()]; let mut buf = vec![0; usize::try_from(msg_len).unwrap()];
let Ok(_) = socket.read_exact(&mut buf).await else { break }; let Ok(_) = socket.read_exact(&mut buf).await else { break };
let msg = borsh::from_slice(&buf).unwrap(); let msg = borsh::from_slice(&buf).unwrap();

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]

View File

@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
use core::task; use core::task;

View File

@@ -53,7 +53,8 @@ async fn main() {
let db = db.clone(); let db = db.clone();
tokio::spawn(async move { tokio::spawn(async move {
let mut db = db.clone(); let mut db = db.clone();
while let Ok(msg_len) = socket.read_u32_le().await { loop {
let Ok(msg_len) = socket.read_u32_le().await else { break };
let mut buf = vec![0; usize::try_from(msg_len).unwrap()]; let mut buf = vec![0; usize::try_from(msg_len).unwrap()];
let Ok(_) = socket.read_exact(&mut buf).await else { break }; let Ok(_) = socket.read_exact(&mut buf).await else { break };

View File

@@ -1,16 +0,0 @@
[package]
name = "home"
version = "0.5.99"
description = "Replacement for `home` which uses the `std` impl"
license = "MIT"
repository = "https://github.com/serai-dex/serai/tree/develop/patches/home"
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
keywords = []
edition = "2024"
rust-version = "1.85"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[workspace]

View File

@@ -1 +0,0 @@
pub use std::env::home_dir;

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#![expect(clippy::cast_possible_truncation)] #![expect(clippy::cast_possible_truncation)]

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![expect(clippy::cast_possible_truncation)] #![expect(clippy::cast_possible_truncation)]

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
use serai_primitives::{DAYS, YEARS, SeraiAddress, system_address}; use serai_primitives::{DAYS, YEARS, SeraiAddress, system_address};

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")] #[cfg(feature = "std")]

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
use sp_io::hashing::blake2_256; use sp_io::hashing::blake2_256;

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![expect(clippy::cast_possible_truncation)] #![expect(clippy::cast_possible_truncation)]

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")] #[cfg(feature = "std")]

View File

@@ -1,6 +1,6 @@
#![allow(deprecated)] #![allow(deprecated)]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
@@ -383,11 +383,9 @@ sp_api::impl_runtime_apis! {
fn execute_block(block: Block) { fn execute_block(block: Block) {
for tx in &block.extrinsics { for tx in &block.extrinsics {
if let Some(signer) = tx.signer() { if let Some(signer) = tx.signer() {
let signer = PublicKey::from(signer.0); let signer = signer.0.into();
let mut info = frame_system::Account::<Runtime>::get(signer); if System::providers(&signer) == 0 {
if info.providers == 0 { System::inc_providers(&signer);
info.providers = 1;
frame_system::Account::<Runtime>::set(signer, info);
} }
} }
} }
@@ -403,11 +401,9 @@ sp_api::impl_runtime_apis! {
impl sp_block_builder::BlockBuilder<Block> for Runtime { impl sp_block_builder::BlockBuilder<Block> for Runtime {
fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult { fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
if let Some(signer) = extrinsic.signer() { if let Some(signer) = extrinsic.signer() {
let signer = PublicKey::from(signer.0); let signer = signer.0.into();
let mut info = frame_system::Account::<Runtime>::get(signer); if System::providers(&signer) == 0 {
if info.providers == 0 { System::inc_providers(&signer);
info.providers = 1;
frame_system::Account::<Runtime>::set(signer, info);
} }
} }
Executive::apply_extrinsic(extrinsic) Executive::apply_extrinsic(extrinsic)
@@ -436,11 +432,9 @@ sp_api::impl_runtime_apis! {
block_hash: <Block as BlockT>::Hash, block_hash: <Block as BlockT>::Hash,
) -> TransactionValidity { ) -> TransactionValidity {
if let Some(signer) = tx.signer() { if let Some(signer) = tx.signer() {
let signer = PublicKey::from(signer.0); let signer = signer.0.into();
let mut info = frame_system::Account::<Runtime>::get(signer); if System::providers(&signer) == 0 {
if info.providers == 0 { System::inc_providers(&signer);
info.providers = 1;
frame_system::Account::<Runtime>::set(signer, info);
} }
} }
Executive::validate_transaction(source, tx, block_hash) Executive::validate_transaction(source, tx, block_hash)

View File

@@ -1,5 +1,5 @@
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![expect(clippy::cast_possible_truncation)] #![expect(clippy::cast_possible_truncation)]