diff --git a/chain-extensions/types/unified-accounts/src/lib.rs b/chain-extensions/types/unified-accounts/src/lib.rs index 7371e3a9e0..c090ba32e8 100644 --- a/chain-extensions/types/unified-accounts/src/lib.rs +++ b/chain-extensions/types/unified-accounts/src/lib.rs @@ -39,8 +39,10 @@ pub enum Command { pub enum UnifiedAddress { /// The address fetched from the mappings and the account /// is unified + #[codec(index = 0)] Mapped(T), /// The default address associated with account as there /// is no mapping found and accounts are not unified + #[codec(index = 1)] Default(T), } diff --git a/chain-extensions/unified-accounts/src/lib.rs b/chain-extensions/unified-accounts/src/lib.rs index 17ab43f4e4..b4d1efda16 100644 --- a/chain-extensions/unified-accounts/src/lib.rs +++ b/chain-extensions/unified-accounts/src/lib.rs @@ -18,23 +18,19 @@ #![cfg_attr(not(feature = "std"), no_std)] -use astar_primitives::{ - ethereum_checked::AccountMapping, - evm::{EvmAddress, UnifiedAddressMapper}, -}; +use astar_primitives::evm::{EvmAddress, UnifiedAddressMapper}; use core::marker::PhantomData; use sp_runtime::DispatchError; -use frame_support::{traits::Get, DefaultNoBound}; +use frame_support::DefaultNoBound; use pallet_contracts::chain_extension::{ ChainExtension, Environment, Ext, InitState, Result as DispatchResult, RetVal, }; -use pallet_evm::AddressMapping; +use pallet_unified_accounts::WeightInfo; use parity_scale_codec::Encode; -pub use unified_accounts_chain_extension_types::{ - Command::{self, *}, - UnifiedAddress, -}; +pub use unified_accounts_chain_extension_types::Command::{self, *}; + +type UAWeight = ::WeightInfo; #[derive(DefaultNoBound)] pub struct UnifiedAccountsExtension(PhantomData<(T, UA)>); @@ -54,49 +50,34 @@ where })? { GetEvmAddress => { let account_id: T::AccountId = env.read_as()?; - - let base_weight = ::DbWeight::get().reads(1); - env.charge_weight(base_weight)?; + // charge weight + env.charge_weight(UAWeight::::to_h160())?; // write to buffer UA::to_h160(&account_id).using_encoded(|r| env.write(r, false, None))?; } GetEvmAddressOrDefault => { let account_id: T::AccountId = env.read_as()?; + // charge weight + env.charge_weight(UAWeight::::to_h160_or_default())?; - let base_weight = ::DbWeight::get().reads(1); - env.charge_weight(base_weight)?; - - let evm_address = if let Some(h160) = UA::to_h160(&account_id) { - UnifiedAddress::Mapped(h160) - } else { - UnifiedAddress::Default(T::DefaultNativeToEvm::into_h160(account_id)) - }; // write to buffer - evm_address.using_encoded(|r| env.write(r, false, None))?; + UA::to_h160_or_default(&account_id).using_encoded(|r| env.write(r, false, None))?; } GetNativeAddress => { let evm_address: EvmAddress = env.read_as()?; - - let base_weight = ::DbWeight::get().reads(1); - env.charge_weight(base_weight)?; + // charge weight + env.charge_weight(UAWeight::::to_account_id())?; // write to buffer UA::to_account_id(&evm_address).using_encoded(|r| env.write(r, false, None))?; } GetNativeAddressOrDefault => { let evm_address: EvmAddress = env.read_as()?; - - let base_weight = ::DbWeight::get().reads(1); - env.charge_weight(base_weight)?; - - // read the storage item - let native_address = if let Some(native) = UA::to_account_id(&evm_address) { - UnifiedAddress::Mapped(native) - } else { - UnifiedAddress::Default(T::DefaultEvmToNative::into_account_id(evm_address)) - }; + // charge weight + env.charge_weight(UAWeight::::to_account_id_or_default())?; // write to buffer - native_address.using_encoded(|r| env.write(r, false, None))?; + UA::to_account_id_or_default(&evm_address) + .using_encoded(|r| env.write(r, false, None))?; } }; Ok(RetVal::Converging(0)) diff --git a/chain-extensions/xvm/src/lib.rs b/chain-extensions/xvm/src/lib.rs index e86ea687ce..ac232e4cc0 100644 --- a/chain-extensions/xvm/src/lib.rs +++ b/chain-extensions/xvm/src/lib.rs @@ -25,7 +25,7 @@ use astar_primitives::{ evm::UnifiedAddressMapper, xvm::{Context, VmId, XvmCall}, }; -use frame_support::{dispatch::Encode, traits::Get, weights::Weight}; +use frame_support::{dispatch::Encode, weights::Weight}; use frame_system::RawOrigin; use pallet_contracts::chain_extension::{ ChainExtension, Environment, Ext, InitState, RetVal, ReturnFlags, @@ -98,8 +98,10 @@ where // Claim the default evm address if needed. let mut actual_weight = Weight::zero(); if value > 0 { - // `UA::to_h160` 1 DB read. - actual_weight.saturating_accrue(T::DbWeight::get().reads(1)); + // `UA::to_h160`. + actual_weight.saturating_accrue( + ::WeightInfo::to_h160(), + ); if UA::to_h160(&source).is_none() { let weight_of_claim = ::WeightInfo::claim_default_evm_address(); diff --git a/pallets/unified-accounts/src/benchmarking.rs b/pallets/unified-accounts/src/benchmarking.rs index e1a88290e3..0ea2fe6e15 100644 --- a/pallets/unified-accounts/src/benchmarking.rs +++ b/pallets/unified-accounts/src/benchmarking.rs @@ -83,4 +83,80 @@ mod benchmarks { .into(), ); } + + #[benchmark] + fn to_account_id() { + let caller: T::AccountId = whitelisted_caller(); + let evm_address = T::DefaultNativeToEvm::into_h160(caller.clone()); + assert_ok!(T::Currency::mint_into( + &caller, + T::AccountMappingStorageFee::get() + )); + // claim mapping + assert_ok!(Pallet::::claim_default_evm_address( + RawOrigin::Signed(caller.clone()).into() + )); + + #[block] + { + let _ = as UnifiedAddressMapper>::to_account_id(&evm_address); + } + } + + #[benchmark] + fn to_account_id_or_default() { + let caller: T::AccountId = whitelisted_caller(); + let evm_address = T::DefaultNativeToEvm::into_h160(caller.clone()); + assert_ok!(T::Currency::mint_into( + &caller, + T::AccountMappingStorageFee::get() + )); + // claim mapping + assert_ok!(Pallet::::claim_default_evm_address( + RawOrigin::Signed(caller.clone()).into() + )); + + #[block] + { + let _ = as UnifiedAddressMapper>::to_account_id_or_default( + &evm_address, + ); + } + } + + #[benchmark] + fn to_h160() { + let caller: T::AccountId = whitelisted_caller(); + assert_ok!(T::Currency::mint_into( + &caller, + T::AccountMappingStorageFee::get() + )); + // claim mapping + assert_ok!(Pallet::::claim_default_evm_address( + RawOrigin::Signed(caller.clone()).into() + )); + + #[block] + { + let _ = as UnifiedAddressMapper>::to_h160(&caller); + } + } + + #[benchmark] + fn to_h160_or_default() { + let caller: T::AccountId = whitelisted_caller(); + assert_ok!(T::Currency::mint_into( + &caller, + T::AccountMappingStorageFee::get() + )); + // claim mapping + assert_ok!(Pallet::::claim_default_evm_address( + RawOrigin::Signed(caller.clone()).into() + )); + + #[block] + { + let _ = as UnifiedAddressMapper>::to_h160_or_default(&caller); + } + } } diff --git a/pallets/unified-accounts/src/lib.rs b/pallets/unified-accounts/src/lib.rs index cb804d2f3b..8811159619 100644 --- a/pallets/unified-accounts/src/lib.rs +++ b/pallets/unified-accounts/src/lib.rs @@ -67,7 +67,7 @@ use astar_primitives::{ ethereum_checked::AccountMapping, - evm::{EvmAddress, UnifiedAddressMapper}, + evm::{EvmAddress, UnifiedAddress, UnifiedAddressMapper}, Balance, }; use frame_support::{ @@ -351,11 +351,12 @@ impl UnifiedAddressMapper for Pallet { EvmToNative::::get(evm_address) } - fn to_account_id_or_default(evm_address: &EvmAddress) -> T::AccountId { - EvmToNative::::get(evm_address).unwrap_or_else(|| { - // fallback to default account_id - T::DefaultEvmToNative::into_account_id(evm_address.clone()) - }) + fn to_account_id_or_default(evm_address: &EvmAddress) -> UnifiedAddress { + if let Some(native) = Self::to_account_id(&evm_address) { + UnifiedAddress::Mapped(native) + } else { + UnifiedAddress::Default(T::DefaultEvmToNative::into_account_id(evm_address.clone())) + } } fn to_default_account_id(evm_address: &EvmAddress) -> T::AccountId { @@ -366,11 +367,12 @@ impl UnifiedAddressMapper for Pallet { NativeToEvm::::get(account_id) } - fn to_h160_or_default(account_id: &T::AccountId) -> EvmAddress { - NativeToEvm::::get(account_id).unwrap_or_else(|| { - // fallback to default account_id - T::DefaultNativeToEvm::into_h160(account_id.clone()) - }) + fn to_h160_or_default(account_id: &T::AccountId) -> UnifiedAddress { + if let Some(h160) = Self::to_h160(&account_id) { + UnifiedAddress::Mapped(h160) + } else { + UnifiedAddress::Default(T::DefaultNativeToEvm::into_h160(account_id.clone())) + } } fn to_default_h160(account_id: &T::AccountId) -> EvmAddress { @@ -381,7 +383,7 @@ impl UnifiedAddressMapper for Pallet { /// AccountMapping wrapper implementation impl AccountMapping for Pallet { fn into_h160(account: T::AccountId) -> H160 { - >::to_h160_or_default(&account) + >::to_h160_or_default(&account).into_address() } } @@ -389,6 +391,7 @@ impl AccountMapping for Pallet { impl AddressMapping for Pallet { fn into_account_id(evm_address: H160) -> T::AccountId { >::to_account_id_or_default(&evm_address) + .into_address() } } @@ -415,7 +418,8 @@ impl StaticLookup for Pallet { MultiAddress::Address20(i) => Ok( >::to_account_id_or_default( &EvmAddress::from_slice(&i), - ), + ) + .into_address(), ), _ => Err(LookupError), } diff --git a/pallets/unified-accounts/src/weights.rs b/pallets/unified-accounts/src/weights.rs index 81ea31fd29..4d87c151a2 100644 --- a/pallets/unified-accounts/src/weights.rs +++ b/pallets/unified-accounts/src/weights.rs @@ -1,4 +1,3 @@ - // This file is part of Astar. // Copyright (C) 2019-2023 Stake Technologies Pte.Ltd. @@ -20,7 +19,7 @@ //! Autogenerated weights for pallet_unified_accounts //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-10-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `devserver-01`, CPU: `Intel(R) Xeon(R) E-2236 CPU @ 3.40GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("shibuya-dev"), DB CACHE: 1024 @@ -37,7 +36,7 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./benchmark-results/unified_accounts_weights.rs +// --output=./benchmark-results/shibuya-dev/unified_accounts_weights.rs // --template=./scripts/templates/weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -51,15 +50,19 @@ use core::marker::PhantomData; pub trait WeightInfo { fn claim_evm_address() -> Weight; fn claim_default_evm_address() -> Weight; + fn to_account_id() -> Weight; + fn to_account_id_or_default() -> Weight; + fn to_h160() -> Weight; + fn to_h160_or_default() -> Weight; } /// Weights for pallet_unified_accounts using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) - /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: UnifiedAccounts NativeToEvm (r:1 w:1) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: EVMChainId ChainId (r:1 w:0) /// Proof: EVMChainId ChainId (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: System BlockHash (r:1 w:0) @@ -70,32 +73,72 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `256` // Estimated: `3593` - // Minimum execution time: 64_843_000 picoseconds. - Weight::from_parts(65_508_000, 3593) + // Minimum execution time: 91_231_000 picoseconds. + Weight::from_parts(91_688_000, 3593) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) - /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: UnifiedAccounts NativeToEvm (r:1 w:1) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) fn claim_default_evm_address() -> Weight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3533` - // Minimum execution time: 16_399_000 picoseconds. - Weight::from_parts(16_806_000, 3533) + // Minimum execution time: 40_749_000 picoseconds. + Weight::from_parts(41_411_000, 3533) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } + /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_account_id() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_478_000 picoseconds. + Weight::from_parts(5_661_000, 3533) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_account_id_or_default() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_515_000 picoseconds. + Weight::from_parts(5_700_000, 3533) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) + /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_h160() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_626_000 picoseconds. + Weight::from_parts(5_827_000, 3533) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) + /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_h160_or_default() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_578_000 picoseconds. + Weight::from_parts(5_719_000, 3533) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } } // For backwards compatibility and tests impl WeightInfo for () { - /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) - /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: UnifiedAccounts NativeToEvm (r:1 w:1) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: EVMChainId ChainId (r:1 w:0) /// Proof: EVMChainId ChainId (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: System BlockHash (r:1 w:0) @@ -106,22 +149,62 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `256` // Estimated: `3593` - // Minimum execution time: 64_843_000 picoseconds. - Weight::from_parts(65_508_000, 3593) + // Minimum execution time: 91_231_000 picoseconds. + Weight::from_parts(91_688_000, 3593) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) - /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: UnifiedAccounts NativeToEvm (r:1 w:1) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + /// Storage: UnifiedAccounts EvmToNative (r:1 w:1) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) fn claim_default_evm_address() -> Weight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3533` - // Minimum execution time: 16_399_000 picoseconds. - Weight::from_parts(16_806_000, 3533) + // Minimum execution time: 40_749_000 picoseconds. + Weight::from_parts(41_411_000, 3533) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } + /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_account_id() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_478_000 picoseconds. + Weight::from_parts(5_661_000, 3533) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } + /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) + /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_account_id_or_default() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_515_000 picoseconds. + Weight::from_parts(5_700_000, 3533) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } + /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) + /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_h160() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_626_000 picoseconds. + Weight::from_parts(5_827_000, 3533) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } + /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) + /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + fn to_h160_or_default() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `3533` + // Minimum execution time: 5_578_000 picoseconds. + Weight::from_parts(5_719_000, 3533) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + } } diff --git a/primitives/src/evm.rs b/primitives/src/evm.rs index 766f7bf7a8..9b1a5ae6ee 100644 --- a/primitives/src/evm.rs +++ b/primitives/src/evm.rs @@ -19,6 +19,8 @@ use crate::{AccountId, AssetId}; use frame_support::ensure; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; use sp_core::H160; use sp_std::marker::PhantomData; @@ -64,7 +66,7 @@ pub trait UnifiedAddressMapper { fn to_account_id(evm_address: &EvmAddress) -> Option; /// Gets the account id associated with given evm address. /// If no mapping exists, then return the default evm address. - fn to_account_id_or_default(evm_address: &EvmAddress) -> AccountId; + fn to_account_id_or_default(evm_address: &EvmAddress) -> UnifiedAddress; /// Gets the default account id which is associated with given evm address. fn to_default_account_id(evm_address: &EvmAddress) -> AccountId; @@ -72,7 +74,29 @@ pub trait UnifiedAddressMapper { fn to_h160(account_id: &AccountId) -> Option; /// Gets the evm address associated with given account id. /// If no mapping exists, then return the default account id. - fn to_h160_or_default(account_id: &AccountId) -> EvmAddress; + fn to_h160_or_default(account_id: &AccountId) -> UnifiedAddress; /// Gets the default evm address which is associated with given account id. fn to_default_h160(account_id: &AccountId) -> EvmAddress; } + +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo)] +pub enum UnifiedAddress
{ + /// The address fetched from the mappings and the account + /// is unified + #[codec(index = 0)] + Mapped(Address), + /// The default address associated with account as there + /// is no mapping found and accounts are not unified + #[codec(index = 1)] + Default(Address), +} + +impl
UnifiedAddress
{ + /// Get the underlying address + pub fn into_address(self) -> Address { + match self { + Self::Default(a) => a, + Self::Mapped(a) => a, + } + } +} diff --git a/tests/integration/src/unified_accounts.rs b/tests/integration/src/unified_accounts.rs index 3029f4dbb5..d1ffa322af 100644 --- a/tests/integration/src/unified_accounts.rs +++ b/tests/integration/src/unified_accounts.rs @@ -17,9 +17,9 @@ // along with Astar. If not, see . use crate::setup::*; +use astar_primitives::evm::UnifiedAddress; use parity_scale_codec::Encode; use sp_io::hashing::keccak_256; -use unified_accounts_chain_extension_types::UnifiedAddress; const AU_CE_GETTER: &'static str = "au_ce_getters"; @@ -70,7 +70,7 @@ fn unified_accounts_chain_extension_works() { contract_id.clone(), [GET_H160_OR_DEFAULT.to_vec(), ALICE.encode()].concat() ), - UnifiedAddress::Default(UnifiedAccounts::to_h160_or_default(&ALICE)) + UnifiedAccounts::to_h160_or_default(&ALICE) ); // mapped native address should be None assert_eq!( @@ -88,7 +88,7 @@ fn unified_accounts_chain_extension_works() { contract_id.clone(), [GET_NATIVE_OR_DEFAULT.to_vec(), alith().encode()].concat() ), - UnifiedAddress::Default(UnifiedAccounts::to_account_id_or_default(&alith())) + UnifiedAccounts::to_account_id_or_default(&alith()) ); //