Skip to content

Commit

Permalink
update symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
Leouarz committed Feb 21, 2024
1 parent 673a169 commit 351b797
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 126 deletions.
132 changes: 66 additions & 66 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ members = [

[workspace.dependencies]
# Avail core
avail-core = { git = "https://github.com/availproject/avail-core", branch = "main", default-features = false, features = [
avail-core = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", default-features = false, features = [
"runtime",
] }
kate = { git = "https://github.com/availproject/avail-core", branch = "main", default-features = false }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "main", default-features = false }
kate = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", default-features = false }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", default-features = false }

# Substrate
sp-std = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-v1.6.0-patch", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion avail-js/examples/next-example/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Home() {
chain: api.runtimeChain.toString(),
specVersion: api.runtimeVersion.specVersion.toNumber(),
tokenDecimals: api.registry.chainDecimals[0] || 18,
tokenSymbol: api.registry.chainTokens[0] || "AVL",
tokenSymbol: api.registry.chainTokens[0] || "AVAIL",
genesisHash: api.genesisHash.toHex(),
ss58Format: isNumber(api.registry.chainSS58) ? api.registry.chainSS58 : 0,
chainType: "substrate" as "substrate",
Expand Down
2 changes: 1 addition & 1 deletion avail-subxt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ curve25519-dalek = "2.1.3"
schnorrkel = "0.9.1"
serde = { version = "1.0.195", features = ["derive"] }
serde-hex = "0.1"
avail-core = { git = "https://github.com/availproject/avail-core", branch = "main", features = ["serde"]}
avail-core = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", features = ["serde"]}

# Substrate
subxt = { version = "0.29" }
Expand Down
2 changes: 1 addition & 1 deletion avail-subxt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub mod avail {
pub type Bounded =
api::runtime_types::frame_support::traits::preimages::Bounded<RuntimeCall, BlakeTwo256>;

pub const AVL: u128 = 1_000_000_000_000_000_000;
pub const AVAIL: u128 = 1_000_000_000_000_000_000;

pub type MaxCells = ConstU32<64>;
pub type Cells = bounded_collections::BoundedVec<Cell, MaxCells>;
Expand Down
6 changes: 3 additions & 3 deletions e2e/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ sp-keyring = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "
subxt = "0.29"
anyhow = "1.0.66"
codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full", "bit-vec"] }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "main" }
kate = { git = "https://github.com/availproject/avail-core", branch = "main" }
avail-core = { git = "https://github.com/availproject/avail-core", branch = "main" }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol" }
kate = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol" }
avail-core = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol" }
binary-merkle-tree = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-v1.6.0-patch" }
serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] }

Expand Down
2 changes: 1 addition & 1 deletion misc/genesis/devnet.chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"protocolId": "Avail",
"properties": {
"tokenDecimals": 18,
"tokenSymbol": "AVL"
"tokenSymbol": "AVAIL"
},
"forkBlocks": null,
"badBlocks": null,
Expand Down
2 changes: 1 addition & 1 deletion misc/genesis/devnet.chain.raw.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"protocolId": "Avail",
"properties": {
"tokenDecimals": 18,
"tokenSymbol": "AVL"
"tokenSymbol": "AVAIL"
},
"forkBlocks": null,
"badBlocks": null,
Expand Down
4 changes: 2 additions & 2 deletions node/src/chains/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use avail_core::{BLOCK_CHUNK_SIZE, NORMAL_DISPATCH_RATIO};
use kate::config::{MAX_BLOCK_COLUMNS, MAX_BLOCK_ROWS};

use da_runtime::{
constants, AccountId, Balance, DataAvailabilityConfig, SessionKeys, StakerStatus, AVL,
constants, AccountId, Balance, DataAvailabilityConfig, SessionKeys, StakerStatus, AVAIL,
};
use frame_system::limits::BlockLength;
use pallet_vector::constants::{
Expand All @@ -19,7 +19,7 @@ use sp_core::sr25519::Public;
pub const PROTOCOL_ID: &str = "Avail";
pub const TELEMETRY_URL: &str = "ws://telemetry.avail.tools:8001/submit";

const ENDOWMENT: Balance = 1_000_000 * AVL;
const ENDOWMENT: Balance = 1_000_000 * AVAIL;
const STASH_BOND: Balance = ENDOWMENT / 100;
const DEFAULT_ENDOWED_SEEDS: [&str; 12] = [
"Alice",
Expand Down
2 changes: 1 addition & 1 deletion node/src/chains/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu

/// Common properties for chains
pub fn chain_properties() -> Properties {
serde_json::json!({ "tokenDecimals": 18, "tokenSymbol": "AVL" })
serde_json::json!({ "tokenDecimals": 18, "tokenSymbol": "AVAIL" })
.as_object()
.expect("Map given; qed")
.clone()
Expand Down
4 changes: 2 additions & 2 deletions pallets/dactr/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg(test)]

use avail_core::currency::{Balance, AVL};
use avail_core::currency::{Balance, AVAIL};
use frame_support::{
derive_impl, parameter_types,
weights::{ConstantMultiplier, IdentityFee},
Expand Down Expand Up @@ -125,7 +125,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
.unwrap();

pallet_balances::GenesisConfig::<Test> {
balances: vec![(1, 10_000 * AVL), (2, 5_000 * AVL), (3, 1_000 * AVL)],
balances: vec![(1, 10_000 * AVAIL), (2, 5_000 * AVAIL), (3, 1_000 * AVAIL)],
}
.assimilate_storage(&mut storage)
.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions runtime/fuzz/header/kate_commit_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use avail_core::{header::HeaderExtension, InvalidTransactionCustomId as TxAvailE
use da_control::{pallet::Call as DaControlCall, AppDataFor, CheckAppId};
use da_runtime::{
AppId, Executive, Header, Runtime, RuntimeCall, RuntimeGenesisConfig, SignedExtra,
SignedPayload, Timestamp, UncheckedExtrinsic, AVL,
SignedPayload, Timestamp, UncheckedExtrinsic, AVAIL,
};

use codec::Encode;
Expand Down Expand Up @@ -49,7 +49,7 @@ fn runtime_ext(total_app_ids: NonZeroUsize) -> TestExternalities {

// Alice has all the money
pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(alice.clone(), 100_000_000 * AVL)],
balances: vec![(alice.clone(), 100_000_000 * AVAIL)],
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
24 changes: 12 additions & 12 deletions runtime/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! A set of constant values used in substrate runtime.
#![allow(clippy::identity_op)]
use avail_core::currency::{Balance, AVL};
use avail_core::currency::{Balance, AVAIL};
use frame_election_provider_support::bounds::{ElectionBounds, ElectionBoundsBuilder};
use frame_support::{
dispatch::DispatchClass,
Expand Down Expand Up @@ -163,15 +163,15 @@ pub mod indices {
use super::*;

parameter_types! {
pub const IndexDeposit :Balance = 1 * AVL;
pub const IndexDeposit :Balance = 1 * AVAIL;
}
}

pub mod balances {
use super::{currency::*, *};

parameter_types! {
pub const ExistentialDeposit :Balance = 10 * CENTS; // 0.1 AVLs
pub const ExistentialDeposit :Balance = 10 * CENTS; // 0.1 AVAILs
}
}

Expand Down Expand Up @@ -201,8 +201,8 @@ pub mod council {
pub mod nomination_pools {
use super::*;

pub const MIN_CREATE_BOND: Balance = 10 * AVL;
pub const MIN_JOIN_BOND: Balance = 1 * AVL;
pub const MIN_CREATE_BOND: Balance = 10 * AVAIL;
pub const MIN_JOIN_BOND: Balance = 1 * AVAIL;
pub const MAX_POOLS: u32 = 16;
pub const MAX_MEMBERS_PER_POOL: u32 = 100;
pub const MAX_MEMBERS: u32 = MAX_POOLS * MAX_MEMBERS_PER_POOL;
Expand Down Expand Up @@ -259,9 +259,9 @@ pub mod staking {
pub const SignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;

pub const SignedRewardBase: Balance = AVL;
pub const SignedRewardBase: Balance = AVAIL;
pub const SignedDepositByte: Balance = CENTS;
pub const SignedFixedDeposit: Balance = AVL;
pub const SignedFixedDeposit: Balance = AVAIL;
pub const SignedDepositIncreaseFactor: Percent = Percent::from_percent(10);

pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(1u32, 10_000);
Expand Down Expand Up @@ -342,7 +342,7 @@ pub mod preimage {
use super::{currency::*, *};

parameter_types! {
pub const PreimageBaseDeposit: Balance = 1 * AVL;
pub const PreimageBaseDeposit: Balance = 1 * AVAIL;
// One cent: $10,000 / MB
pub const PreimageByteDeposit: Balance = 1 * CENTS;
pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
Expand All @@ -365,11 +365,11 @@ pub mod bounty {
}

parameter_types! {
pub const ValueMinimum: Balance = 5 * AVL;
pub const DepositBase: Balance = AVL;
pub const ValueMinimum: Balance = 5 * AVAIL;
pub const DepositBase: Balance = AVAIL;
pub const CuratorDepositMultiplier: Permill = Permill::from_percent(50);
pub const CuratorDepositMin: Balance = 1 * AVL;
pub const CuratorDepositMax: Balance = 100 * AVL;
pub const CuratorDepositMin: Balance = 1 * AVAIL;
pub const CuratorDepositMax: Balance = 100 * AVAIL;
}
}

Expand Down
28 changes: 14 additions & 14 deletions runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
System, TechnicalCommittee, Timestamp, TransactionPayment, Treasury, TxPause,
UncheckedExtrinsic, VoterList, MINUTES, VERSION,
};
use avail_core::currency::{Balance, AVL, CENTS, NANO_AVL, PICO_AVL};
use avail_core::currency::{Balance, AVAIL, CENTS, NANO_AVAIL, PICO_AVAIL};
use avail_core::AppId;
use avail_core::OpaqueExtrinsic;
use avail_core::NORMAL_DISPATCH_RATIO;
Expand Down Expand Up @@ -116,9 +116,9 @@ impl pallet_vector::Config for Runtime {
}

parameter_types! {
pub const BasicDeposit: Balance = 10 * AVL;
pub const BasicDeposit: Balance = 10 * AVAIL;
pub const ByteDeposit: Balance = constants::currency::deposit(0,1);
pub const SubAccountDeposit: Balance = 2 * AVL;
pub const SubAccountDeposit: Balance = 2 * AVAIL;
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const MaxRegistrars: u32 = 20;
Expand Down Expand Up @@ -176,12 +176,12 @@ impl pallet_authority_discovery::Config for Runtime {

parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = AVL;
pub const ProposalBondMinimum: Balance = AVAIL;
pub const SpendPeriod: BlockNumber = DAYS;
pub const Burn: Permill = Permill::from_percent(0); // Not burning any funds for now
pub const TipCountdown: BlockNumber = DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = AVL;
pub const TipReportDepositBase: Balance = AVAIL;
pub const DataDepositPerByte: Balance = CENTS;
pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
pub const MaximumReasonLength: u32 = 16384;
Expand Down Expand Up @@ -227,7 +227,7 @@ impl ContainsLengthBound for Tippers {

impl pallet_tips::Config for Runtime {
type DataDepositPerByte = DataDepositPerByte;
type MaxTipAmount = ConstU128<{ 500 * AVL }>;
type MaxTipAmount = ConstU128<{ 500 * AVAIL }>;
type MaximumReasonLength = MaximumReasonLength;
type RuntimeEvent = RuntimeEvent;
type TipCountdown = TipCountdown;
Expand All @@ -239,8 +239,8 @@ impl pallet_tips::Config for Runtime {

parameter_types! {
// Temporary increased price of all transactions by 10x
pub const WeightFee: Balance = PICO_AVL;
pub const TransactionByteFee: Balance = 100 * NANO_AVL; // 100 nanoAVL
pub const WeightFee: Balance = PICO_AVAIL;
pub const TransactionByteFee: Balance = 100 * NANO_AVAIL; // 100 nanoAVAIL
pub const OperationalFeeMultiplier: u8 = 5u8;
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(50); // target_utilization 50%
pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000); // 0.000001
Expand Down Expand Up @@ -269,7 +269,7 @@ impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Runtime>>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type RuntimeEvent = RuntimeEvent;
type WeightToFee = ConstantMultiplier<Balance, WeightFee>; // 1 weight = 1 picoAVL -> second_price = 1 AVL
type WeightToFee = ConstantMultiplier<Balance, WeightFee>; // 1 weight = 1 picoAVAIL -> second_price = 1 AVAIL
}

parameter_types! {
Expand Down Expand Up @@ -354,7 +354,7 @@ impl pallet_utility::Config for Runtime {
}

parameter_types! {
pub const DepositBase: Balance = 2 * AVL;
pub const DepositBase: Balance = 2 * AVAIL;
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = 5 * CENTS;
}
Expand Down Expand Up @@ -822,11 +822,11 @@ impl InstanceFilter<RuntimeCall> for ProxyType {

parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = 10 * AVL;
pub const ProxyDepositBase: Balance = 10 * AVAIL;
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = 3 * AVL;
pub const AnnouncementDepositBase: Balance = 10 * AVL;
pub const AnnouncementDepositFactor: Balance = 5 * AVL;
pub const ProxyDepositFactor: Balance = 3 * AVAIL;
pub const AnnouncementDepositBase: Balance = 10 * AVAIL;
pub const AnnouncementDepositFactor: Balance = 5 * AVAIL;
}

impl pallet_proxy::Config for Runtime {
Expand Down
18 changes: 9 additions & 9 deletions runtime/src/impls_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mod multiplier_tests {
use crate::impls::*;
use crate::*;
use avail_core::currency::{CENTS, MICRO_AVL, MILLICENTS};
use avail_core::currency::{CENTS, MICRO_AVAIL, MILLICENTS};
use frame_support::{
dispatch::{DispatchClass, DispatchInfo, Pays},
traits::OnFinalize,
Expand Down Expand Up @@ -303,11 +303,11 @@ mod multiplier_tests {
};
let tx_fee = TransactionPayment::compute_fee(tx_len as u32, &dispatch_info, 0);
println!(
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVL",
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVAIL",
0,
wm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
run_with_system_weight(block_weight, || {
let mut iterations: u32 = 0;
Expand All @@ -322,11 +322,11 @@ mod multiplier_tests {
if iterations % EPOCH_DURATION_IN_SLOTS == 0 {
day_count += 1;
println!(
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVL",
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVAIL",
day_count,
wm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
}
if day_count == 7u32 {
Expand Down Expand Up @@ -359,11 +359,11 @@ mod multiplier_tests {
};
let tx_fee = TransactionPayment::compute_fee(tx_len as u32, &dispatch_info, 0);
println!(
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVL",
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVAIL",
0,
lm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
run_with_system_length(max_padded_length, || {
let mut iterations: u32 = 0;
Expand All @@ -378,11 +378,11 @@ mod multiplier_tests {
if iterations % EPOCH_DURATION_IN_SLOTS == 0 {
day_count += 1;
println!(
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVL",
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVAIL",
day_count,
lm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
}
if day_count == 7u32 {
Expand Down
Loading

2 comments on commit 351b797

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 351b797 Previous: 33f7951 Ratio
commitment_builder/32 4035997223 ns/iter (± 3448384) 4325417137 ns/iter (± 81695432) 0.93
commitment_builder/64 3997378642 ns/iter (± 3345873) 4343451680 ns/iter (± 92231152) 0.92
commitment_builder/128 4352248132 ns/iter (± 4486600) 4647446215 ns/iter (± 137494514) 0.94
commitment_builder/256 2151902700 ns/iter (± 21409412) 2367397557 ns/iter (± 42776582) 0.91

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 351b797 Previous: 909af7f Ratio
commitment_builder_32 Instructions 43503153649 ops (± 0) 43503093041 ops (± 0) 1.00
commitment_builder_32 L1 Accesses 53515178200 ops (± 0) 53514815042 ops (± 0) 1.00
commitment_builder_32 L2 Accesses 792719 ops (± 0) 700403 ops (± 0) 1.13
commitment_builder_32 RAM Accesses 76909 ops (± 0) 89904 ops (± 0) 0.86
commitment_builder_32 Estimated Cycles 53521833610 ops (± 0) 53521463697 ops (± 0) 1.00
commitment_builder_64 Instructions 41971642649 ops (± 0) 41972869826 ops (± 0) 1.00
commitment_builder_64 L1 Accesses 51406652806 ops (± 0) 51407870438 ops (± 0) 1.00
commitment_builder_64 L2 Accesses 873400 ops (± 0) 893120 ops (± 0) 0.98
commitment_builder_64 RAM Accesses 191539 ops (± 0) 191298 ops (± 0) 1.00
commitment_builder_64 Estimated Cycles 51417723671 ops (± 0) 51419031468 ops (± 0) 1.00
commitment_builder_128 Instructions 54203865870 ops (± 0) 54204175550 ops (± 0) 1.00
commitment_builder_128 L1 Accesses 68301819321 ops (± 0) 68301951624 ops (± 0) 1.00
commitment_builder_128 L2 Accesses 1316725 ops (± 0) 1258510 ops (± 0) 1.05
commitment_builder_128 RAM Accesses 243538 ops (± 0) 242507 ops (± 0) 1.00
commitment_builder_128 Estimated Cycles 68316926776 ops (± 0) 68316731919 ops (± 0) 1.00
commitment_builder_256 Instructions 31761155555 ops (± 0) 31758548180 ops (± 0) 1.00
commitment_builder_256 L1 Accesses 40837268720 ops (± 0) 40833274463 ops (± 0) 1.00
commitment_builder_256 L2 Accesses 6824192 ops (± 0) 6788005 ops (± 0) 1.01
commitment_builder_256 RAM Accesses 251303 ops (± 0) 239352 ops (± 0) 1.05
commitment_builder_256 Estimated Cycles 40880185285 ops (± 0) 40875591808 ops (± 0) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.