User Fee Research
TL;DR
- SetMetadatum gas: ~1.9M at N=1 -> ~2.3M at N=1,000 (+17.6%), storage ~15Kugnot (constant)
- SetMetadata gas: ~3.7M at N=1 -> ~4.1M at N=1,000 (+10.0%), storage ~28Kugnot (constant)
1) Background and Goal
Measure gas/storage costs for User contract actions across different data scales.
User actions (N = total registered user count):
- SetMetadatum: set a single metadata key-value pair for a user
- SetMetadata: set multiple metadata key-value pairs for a user (pipe-delimited)
Goals:
- Identify gas cost growth pattern as N increases
- Identify storage fee change pattern
- Establish a basis for production cost estimation
2) Test Environment
- Date: 2026-02-09
- Execution: gnodev (local machine)
- Gno RPC:
localhost:26657 - Chain ID:
dev - Scripts:
bin/gno/research/user.sh all - Milestones: 1, 500, 1,000
- Repeat: 3
3) Results
SetMetadatum
| N (users) | Gas (avg) | Gas Q1 | Gas Q3 | Storage (avg) | Storage Q1 | Storage Q3 |
|---|---|---|---|---|---|---|
| 1 | 1,929,487 | -0.4% | +0.4% | 14,666 | -1.1% | +0.6% |
| 500 | 2,201,166 | -0.3% | +0.3% | 14,766 | -0.4% | +0.2% |
| 1,000 | 2,269,367 | -0.3% | +0.3% | 14,800 | +0.0% | +0.0% |
SetMetadata
| N (users) | Gas (avg) | Gas Q1 | Gas Q3 | Storage (avg) | Storage Q1 | Storage Q3 |
|---|---|---|---|---|---|---|
| 1 | 3,716,929 | -0.2% | +0.2% | 27,400 | +0.0% | +0.0% |
| 500 | 4,010,522 | -0.2% | +0.2% | 27,800 | +0.0% | +0.0% |
| 1,000 | 4,089,656 | -0.2% | +0.2% | 28,000 | +0.0% | +0.0% |
4) Analysis
SetMetadatum Gas Growth
| Range | Gas increase | Increase rate |
|---|---|---|
| 1 -> 500 | +271,679 | +14.1% |
| 500 -> 1,000 | +68,201 | +3.1% |
- Sub-linear growth: gas increase decelerates at larger scale
- N=1 -> 500: ~544 gas/user, N=500 -> 1,000: ~136 gas/user
SetMetadata Gas Growth
| Range | Gas increase | Increase rate |
|---|---|---|
| 1 -> 500 | +293,593 | +7.9% |
| 500 -> 1,000 | +79,134 | +2.0% |
- Sub-linear growth with even gentler increase than SetMetadatum
- N=1 -> 500: ~588 gas/user, N=500 -> 1,000: ~158 gas/user
SetMetadata vs SetMetadatum Ratio
| N | SetMetadata / SetMetadatum |
|---|---|
| 1 | 1.93x |
| 500 | 1.82x |
| 1,000 | 1.80x |
- SetMetadata (2 key-value pairs) costs ~1.8-1.9x of SetMetadatum (1 key-value pair)
- Ratio slightly decreases at scale: batch overhead becomes relatively smaller
Storage
- SetMetadatum: ~15K ugnot (constant)
- SetMetadata: ~28K ugnot (constant, ~1.9x of SetMetadatum)
- Storage scales linearly with the number of key-value pairs written, independent of N
Variance
- SetMetadatum: Q1/Q3 < 0.5% — stable
- SetMetadata: Q1/Q3 < 0.3% — very stable
5) Conclusions
- SetMetadatum scales sub-linearly: ~2.3M gas at 1,000 users, gentle +17.6% growth
- SetMetadata scales sub-linearly: ~4.1M gas at 1,000 users, gentle +10.0% growth
- Batch efficiency: SetMetadata (2 pairs) costs ~1.8x of SetMetadatum (1 pair), not 2x — batch has amortized overhead
- Storage is predictable: ~15K per single pair, ~28K per 2 pairs — constant regardless of user count
- Low gas per user: user registry (avl.Tree) traversal adds only ~136-544 gas per additional user
Last updated on