|
| 1 | +# Fee Systems |
| 2 | + |
| 3 | +Evolve chains have two layers of fees: execution fees (paid to process transactions) and DA fees (paid to post data). |
| 4 | + |
| 5 | +## Execution Fees |
| 6 | + |
| 7 | +### EVM (ev-reth) |
| 8 | + |
| 9 | +Uses EIP-1559 fee model: |
| 10 | + |
| 11 | +```text |
| 12 | +Transaction Fee = (Base Fee + Priority Fee) × Gas Used |
| 13 | +``` |
| 14 | + |
| 15 | +| Component | Destination | Purpose | |
| 16 | +|-----------|-------------|---------| |
| 17 | +| Base Fee | Burned (or redirected) | Congestion pricing | |
| 18 | +| Priority Fee | Sequencer | Incentive for inclusion | |
| 19 | + |
| 20 | +#### Base Fee Redirect |
| 21 | + |
| 22 | +By default, base fees are burned. ev-reth can redirect them to a treasury: |
| 23 | + |
| 24 | +```json |
| 25 | +{ |
| 26 | + "config": { |
| 27 | + "evolve": { |
| 28 | + "baseFeeSink": "0xTREASURY", |
| 29 | + "baseFeeRedirectActivationHeight": 0 |
| 30 | + } |
| 31 | + } |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +See [Base Fee Redirect](/ev-reth/features/base-fee-redirect) for details. |
| 36 | + |
| 37 | +### Cosmos SDK (ev-abci) |
| 38 | + |
| 39 | +Uses standard Cosmos SDK fee model: |
| 40 | + |
| 41 | +```text |
| 42 | +Transaction Fee = Gas Price × Gas Used |
| 43 | +``` |
| 44 | + |
| 45 | +Configure minimum gas prices: |
| 46 | + |
| 47 | +```toml |
| 48 | +# app.toml |
| 49 | +minimum-gas-prices = "0.025stake" |
| 50 | +``` |
| 51 | + |
| 52 | +Fees go to the fee collector module and can be distributed via standard Cosmos mechanisms. |
| 53 | + |
| 54 | +## DA Fees |
| 55 | + |
| 56 | +Both execution environments incur DA fees when blocks are posted to the DA layer. |
| 57 | + |
| 58 | +### Cost Factors |
| 59 | + |
| 60 | +| Factor | Impact | |
| 61 | +|--------|--------| |
| 62 | +| Block size | Linear cost increase | |
| 63 | +| DA gas price | Market-driven, varies | |
| 64 | +| Batching | Amortizes overhead | |
| 65 | +| Compression | Reduces data size | |
| 66 | + |
| 67 | +### Who Pays? |
| 68 | + |
| 69 | +The sequencer pays DA fees from their own funds. They recover costs through: |
| 70 | + |
| 71 | +- Priority fees from users |
| 72 | +- Base fee redirect (if configured) |
| 73 | +- External subsidy |
| 74 | + |
| 75 | +### Optimization Strategies |
| 76 | + |
| 77 | +#### Lazy Aggregation |
| 78 | + |
| 79 | +Only produce blocks when there are transactions: |
| 80 | + |
| 81 | +```yaml |
| 82 | +node: |
| 83 | + lazy-aggregator: true |
| 84 | + lazy-block-time: 1s # Max wait time |
| 85 | +``` |
| 86 | +
|
| 87 | +Reduces empty blocks and DA costs. |
| 88 | +
|
| 89 | +#### Batching |
| 90 | +
|
| 91 | +ev-node batches multiple blocks into single DA submissions: |
| 92 | +
|
| 93 | +```yaml |
| 94 | +da: |
| 95 | + batch-size-threshold: 100000 # bytes |
| 96 | + batch-max-delay: 5s |
| 97 | +``` |
| 98 | +
|
| 99 | +#### Compression |
| 100 | +
|
| 101 | +Enable blob compression: |
| 102 | +
|
| 103 | +```yaml |
| 104 | +da: |
| 105 | + compression: true |
| 106 | +``` |
| 107 | +
|
| 108 | +## Fee Flow Diagram |
| 109 | +
|
| 110 | +```text |
| 111 | +User Transaction |
| 112 | + │ |
| 113 | + │ Pays: Gas Price × Gas |
| 114 | + ▼ |
| 115 | +┌─────────────────┐ |
| 116 | +│ Sequencer │ |
| 117 | +│ │ |
| 118 | +│ Receives: │ |
| 119 | +│ - Priority fees │ |
| 120 | +│ - Base fees* │ |
| 121 | +└────────┬────────┘ |
| 122 | + │ |
| 123 | + │ Pays: DA fees |
| 124 | + ▼ |
| 125 | +┌─────────────────┐ |
| 126 | +│ DA Layer │ |
| 127 | +│ (Celestia) │ |
| 128 | +└─────────────────┘ |
| 129 | + |
| 130 | +* If base fee redirect is enabled |
| 131 | +``` |
| 132 | + |
| 133 | +## Estimating Costs |
| 134 | + |
| 135 | +### Execution Costs |
| 136 | + |
| 137 | +EVM: |
| 138 | + |
| 139 | +```bash |
| 140 | +cast estimate --rpc-url http://localhost:8545 <CONTRACT> "transfer(address,uint256)" <TO> <AMOUNT> |
| 141 | +``` |
| 142 | + |
| 143 | +Cosmos: |
| 144 | + |
| 145 | +```bash |
| 146 | +appd tx bank send <FROM> <TO> 1000stake --gas auto --gas-adjustment 1.3 |
| 147 | +``` |
| 148 | + |
| 149 | +### DA Costs |
| 150 | + |
| 151 | +Depends on: |
| 152 | + |
| 153 | +- DA layer pricing (e.g., Celestia gas price) |
| 154 | +- Data size per block |
| 155 | +- Submission frequency |
| 156 | + |
| 157 | +Use the [Celestia Gas Calculator](/guides/tools/celestia-gas-calculator) for estimates. |
0 commit comments