Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions components/toolbox/console/layer-1/create/GenesisBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,22 @@ const gweiToWei = (gwei: number): number => gwei * 1000000000;
// --- Main Component ---

type GenesisBuilderProps = {
genesisData: string;
setGenesisData: (data: string) => void;
genesisData?: string;
setGenesisData?: (data: string) => void;
initiallyExpandedSections?: SectionId[];
};

function GenesisBuilderInner({
genesisData,
setGenesisData,
genesisData: externalGenesisData,
setGenesisData: externalSetGenesisData,
initiallyExpandedSections = ["chainParams"]
}: GenesisBuilderProps) {
// Internal state for when used standalone (e.g., in MDX files)
const [internalGenesisData, setInternalGenesisData] = useState<string>("");

// Use external state if provided, otherwise use internal state
const genesisData = externalGenesisData !== undefined ? externalGenesisData : internalGenesisData;
const setGenesisData = externalSetGenesisData || setInternalGenesisData;
const { walletEVMAddress } = useWalletStore();
const { setHighlightPath, clearHighlight } = useGenesisHighlight();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Activating Native Minter Precompile
title: Activate Native Minter
description: Learn how to activate the native minter precompile.
updated: 2024-06-28
authors: [usmaneth]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Introduction
description: Let's recap our knowledge on transaction fees in blockchains
updated: 2024-06-28
authors: [usmaneth]
icon: BookOpen
---

import TransactionFees from '@/content/common/multi-chain-architecture/transaction-fees.mdx';

<TransactionFees />
<Quiz quizId="403"/>
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
---
title: Transaction Fees
description: Let's recap our knowledge on transaction fees in blockchains.
description: Learn about L1 blockchain gas fees.
updated: 2024-06-28
authors: [usmaneth]
icon: BookOpen
---

import TransactionFees from '@/content/common/multi-chain-architecture/transaction-fees.mdx';
When creating an Avalanche L1 we can configure not only our custom native token, but also how the transaction fees (also known as gas fees) are determined. This allows Avalanche L1s to define the desired or maximal throughput of the blockchain differently.

<TransactionFees />
<Quiz quizId="403"/>
![](https://qizat5l3bwvomkny.public.blob.vercel-storage.com/builders-hub/course-images/multi-chain-architecture/subnet-fee-comparison-RDdq99JjKbXqvCIQBnreWAwwjzY2jn.png)

To adjust the fee dynamics we have the following parameters:

**Gas Limit:** The total amount of gas that can be used in a single block. This impacts how much computation happens in one block. The value represents the maximum amount of gas a single transaction can use (which would result in a single-transaction block).

**Target Block Rate:** The network aims to produce a new block in targetBlockRate seconds. This value is in seconds. If the network starts producing faster than this, base fees are increased accordingly. Otherwise, if the network starts producing slower than this, base fees are decreased accordingly.

**Min. Base Fee:** The minimum base fee that can be used by a transaction and the cost to do native token transfers. No matter how simple a transaction is, it will cost at least the minimum base fee.

**Target Gas:** The targeted amount of gas (including block gas cost) to consume within a rolling 10s window.

**Base Fee Change Denominator:** The transaction base fee changes with demand of the block space. If the parent block used more gas than its target, the base fee should increase. Otherwise, if the parent block used less gas than its target, the base fee should decrease by the amount. There is a formula behind this that would go beyond the scope of this section, but setting this value to a larger value means that the base fee will change more gradually. Setting it to a smaller value will make the base fee change more rapidly.

**Min. Block Gas Cost:** Minimum gas cost a block should cover.

**Max. Block Gas cost:** Maximum gas cost a block should cover.

**Block Gas Cost Step:** This value determines the block gas change rate depending on the targetBlockRate. If the parent block is produced at the targetBlockRate, the block gas cost will stay the same. If the parent block is produced at a slower rate, the block gas cost will decrease.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Activate Fee Config
description: Learn how to configure your blockchain gas fees.
updated: 2024-06-28
authors: [usmaneth]
icon: Terminal
---

Below you can set your custom fee configuration, select **Customize fee config**. Below toggle the **Reward Manager** and hit the *Add Wallet* button to include your connected wallet in the allowlist for this Precompile.

<Callout type="warning">
Remember, we're still configuring the genesis for our L1—**don't hit "Create Chain" yet!** We'll continue adding more configurations in the following sections and finally create the chain in the Genesis Breakdown section where you'll see all your configurations come together.
</Callout>

<GenesisBuilder initiallyExpandedSections={['feeConfiguration']} />

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions content/academy/l1-native-tokenomics/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
"...03-precompiles",
"---Native Minter---",
"...04-native-minter",
"---Fee Config---",
"...05-fee-config",
"---Distribution---",
"...07-token-distribution",
"---Governance---",
"...08-governance",
"Certificate Coming Soon..."

]
}