Skip to Content
ContractsReserch6. Fee Research (User)

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 Q1Gas Q3Storage (avg)Storage Q1Storage Q3
11,929,487-0.4%+0.4%14,666-1.1%+0.6%
5002,201,166-0.3%+0.3%14,766-0.4%+0.2%
1,0002,269,367-0.3%+0.3%14,800+0.0%+0.0%

SetMetadata

N (users)Gas (avg)Gas Q1Gas Q3Storage (avg)Storage Q1Storage Q3
13,716,929-0.2%+0.2%27,400+0.0%+0.0%
5004,010,522-0.2%+0.2%27,800+0.0%+0.0%
1,0004,089,656-0.2%+0.2%28,000+0.0%+0.0%

4) Analysis

SetMetadatum Gas Growth

RangeGas increaseIncrease 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

RangeGas increaseIncrease 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

NSetMetadata / SetMetadatum
11.93x
5001.82x
1,0001.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
Docsv1.0.10