Some resources in a blockchain network are limited, for example, storage and computation. Transaction fees prevent individual users from consuming too many resources (as an attack method or otherwise). Geode uses a weight-based fee model as opposed to a gas-metering model. As such, fees are charged prior to transaction execution; once the fee is paid, nodes will execute the transaction.

Web3 Foundation Research designed the fee system , which Geode uses, with the following objectives:

  • Each Chain block should be processed efficiently to avoid delays in block production.
  • The growth rate of the Chain should be bounded.
  • Each block should have space for special, high-priority transactions like misconduct reports.
  • The system should be able to handle spikes in demand.
  • Fees should change slowly so that senders can accurately predict the fee for a given transaction.

Fee Calculation

Fees on Geode are calculated based on three parameters:

  • A Weight fee
    • Base weight
    • Call(s) weight
  • A Length fee
  • A Tip (optional).

Weights are a fixed set of numbers used in all Substrate-based chains to manage the time it takes to validate a block. Each transaction has a base weight that accounts for the overhead of inclusion (e.g. signature verification) and a dispatch weight that accounts for the time to execute the transaction. All weights, even the base weight, are a measure of time to execute on some standard hardware. The runtime converts those weights into token units as part of the fee calculation. The weight fee is the sum of the base weight and the sum of the total weight consumed by call(s). 

A TRANSACTION CAN INCLUDE SEVERAL CALLS. For instance, a batch can contain bond and nominate, and the weight would be one base weight and then the sum of the weights for bond and nominate. The length fee is a per-byte fee multiplier for the size of the transaction in bytes. There is also a targeted fee adjustment that serves as a multiplier which tunes the final fee based on network congestion. This can constitute an adjusted weight fee calculated as the targeted fee adjustment times the weight fee. Together, these fees constitute the inclusion fee. The inclusion fee is the base fee plus the length fee plus the adjusted weight fee.

The inclusion fee is deducted from the sender’s account before transaction execution. A portion of the fee will go to the block author (validator node), and the remainder will go to the Treasury. This is 20% and 80%, respectively.

Tips are an optional transaction fee that users can add. Tips are not part of the inclusion fee and are an incentive to block authors for prioritizing a transaction, and the entire tip goes directly to the block author (validator node).

Block Limits and Transaction Priority

Blocks in Geode have both a maximum length (in bytes) and a maximum weight. Block producers will fill blocks with transactions up to these limits. A portion of each block – currently 25% – is reserved for critical transactions that are related to the chain’s operation. Block producers will only fill up to 75% of a block with normal transactions. Some examples of operational transactions:

  • Misbehavior reports
  • Council operations
  • Member operations in an election (e.g. renouncing candidacy)

Block producers prioritize transactions based on each transaction’s total fee. Since a portion of the fee will go to the block producer, producers will include the transactions with the highest fees to maximize their reward.

Fee Adjustment

Transaction volume on blockchains is highly irregular, and therefore transaction fees need a mechanism to adjust. However, users should be able to predict transaction fees. Geode uses a slow-adjusting fee mechanism with tips to balance these two considerations. In addition to block limits, Geode also has a block fullness target. Fees increase or decrease for the next block based on the fullness of the current block relative to the target. The per-weight fee can change up to 30% in a 24 hour period. This rate captures long-term trends in demand, but not short-term spikes. To consider short-term spikes, Geode uses tips on top of the length and weight fees. Users can optionally add a tip to the fee to give the transaction a higher priority.

Other Resource Limitation Strategies

Transaction weight must be computable prior to execution, and therefore can only represent fixed logic. Some transactions warrant limiting resources with other strategies. For example:

  • Bonds: Some transactions, like voting, may require a bond that will be returned or slashed after an on-chain event. In the voting example, returned at the end of the election or slashed if the voter tried anything malicious.
  • Deposits: Some transactions, like setting an identity or claiming an index, use storage space indefinitely. These require a deposit that will be returned if the user decides to free up that storage later.
  • Burns: A transaction may burn funds internally based on its logic. For example, a transaction may burn funds from the sender if it creates new storage entries, thus increasing the state size.
  • Limits: Some limits are part of the protocol. For example, nominators can only nominate 16 validators. This limits the complexity of the election process.

Advanced

This section so far only covered transactions that come from normal users inside the chain. If you look at blocks in a block explorer, though, you may see some “extrinsics” that look different from these transactions. In Geode (and any chain built on Substrate), an extrinsic is a piece of information that comes from outside the chain. Extrinsics fall into three categories:

  • Signed transactions
  • Unsigned transactions
  • Inherents

This section so far only covered signed transactions, which is the way that most users will interact with Geode. Signed transactions come from an account that has funds, and therefore Geode can charge a transaction fee as a way to prevent spam and attacks.

Unsigned transactions are for special cases where a user needs to submit an extrinsic from a key pair that does not control funds. For example, when users claim their GEODE tokens after genesis, their GEODE address doesn’t have any funds yet, so that uses an unsigned transaction. Validators also submit unsigned transactions in the form of “heartbeat” messages to indicate that they are online. These heartbeats must be signed by one of the validator’s session keys. Session keys never control funds. Unsigned transactions are only used in special cases because, since Geode cannot charge a fee for them, each one needs its own, custom validation logic.

Finally, inherents are pieces of information that are not signed or included in the transaction queue. As such, only the block author can add inherents to a block. Inherents are assumed to be “true” simply because a sufficiently large number of validators have agreed on them being reasonable. For example, Geode blocks include a timestamp inherent. There is no way to prove that a timestamp is true the way one proves the desire to send funds with a signature. Rather, validators accept or reject the block based on how reasonable they find the timestamp. In Geode, it must be within some acceptable range of their own system clocks.