Chunk Fee Research
TL;DR
- SetChunkVerifier gas: ~5,446,252 at N=1 -> ~6,028,580 at N=1,000
- SetChunkVerifiers gas (batch=100): ~10,739,676 at N=1 -> ~17,230,457 at N=1,000 (+60.4%)
- Batch efficiency: ~107,397 gas/item (batch) vs ~5,446,252 gas/item (single) — ~98% cheaper per item
- Storage fee (single): constant at ~15,000ugnot per call
- Storage fee (batch): constant at ~1,398,000ugnot per call (~13,980ugnot/item)
- Gas cost is influenced by per-world verifier count rather than global total
- Extremely low variance (Q1/Q3 < 5%)
1) Background and Goal
Measure gas/storage costs for the Chunk contract SetChunkVerifier (single) and SetChunkVerifiers (batch) actions across different data scales.
Scale metric: total number of existing chunk verifiers across all worlds = N
Goals:
- Identify gas cost growth pattern as N increases
- Identify storage fee change pattern
- Compare single vs batch call efficiency
- 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 - Script:
bin/gno/research/chunk.sh all - Milestones: 1, 500, 1,000
- Repeat: 3
- Batch size (SetChunkVerifiers): 100 (fixed)
- Max chunks per world: 784
3) Results
SetChunkVerifier
| N (verifiers) | Gas (avg) | Gas Q1 | Gas Q3 | Storage (avg) | Storage Q1 | Storage Q3 |
|---|---|---|---|---|---|---|
| 1 | 5,446,252 | -4.3% | +4.3% | 15,033 | -1.2% | +0.8% |
| 500 | 9,193,005 | -2.5% | +2.5% | 15,000 | +0.0% | +0.0% |
| 1,000 | 6,028,580 | -0.0% | +0.0% | 15,000 | +0.0% | +0.0% |
SetChunkVerifiers (batch=100)
| N (verifiers) | Gas (avg) | Gas Q1 | Gas Q3 | Storage (avg) | Storage Q1 | Storage Q3 |
|---|---|---|---|---|---|---|
| 1 | 10,739,676 | -2.2% | +2.2% | 1,398,066 | -0.0% | +0.0% |
| 500 | 14,486,383 | -1.6% | +1.6% | 1,398,000 | +0.0% | +0.0% |
| 1,000 | 17,230,457 | -1.3% | +1.3% | 1,398,000 | +0.0% | +0.0% |
4) Analysis
Gas Growth Pattern (SetChunkVerifier)
| Range | Gas change | Change rate |
|---|---|---|
| 1 -> 500 | +3,746,753 | +68.8% |
| 500 -> 1,000 | -3,164,425 | -34.4% |
- N=500 (world 1, 500 entries): highest gas — single world with many entries
- N=1,000 (world 2, 216 entries): lower gas — measurement targets world 2 which has fewer entries
- Gas cost correlates with per-world verifier count, not global total
Gas Growth Pattern (SetChunkVerifiers, batch=100)
| Range | Gas increase | Increase rate |
|---|---|---|
| 1 -> 500 | +3,746,707 | +34.9% |
| 500 -> 1,000 | +2,744,074 | +18.9% |
- N=1 -> 500: approximately 7,509 gas/verifier increase
- N=500 -> 1,000: approximately 5,488 gas/verifier increase
- Growth is sub-linear with per-verifier cost decreasing at larger scale
Single vs Batch Comparison
| Metric | Single (SetChunkVerifier) | Batch (SetChunkVerifiers, 100) | Ratio |
|---|---|---|---|
| Gas per call (N=1) | 5,446,252 | 10,739,676 | 2.0x |
| Gas per item (N=1) | 5,446,252 | 107,397 | 50.7x |
| Storage per call | ~15,000ugnot | ~1,398,000ugnot | 93.2x |
| Storage per item | ~15,000ugnot | ~13,980ugnot | ~1.07x |
- Batch call is ~98% cheaper per item in gas
- Per-item storage cost is nearly identical (~14K-15K ugnot)
- Batch overhead (call setup) is ~2.0x a single call, but processes 100x more items
Storage Change Pattern
- Single: constant at ~15,000ugnot per call regardless of N
- Batch: constant at ~1,398,000ugnot per call regardless of N
- Per-item storage cost is independent of data scale for both
Variance
- Single gas: Q1/Q3 deviation within 4.3% — stable
- Batch gas: Q1/Q3 deviation within 2.2% — stable
- Storage: effectively deterministic for both
5) Conclusions
- Per-world effect: single-call gas cost depends on per-world verifier count, not global total (N=500 in one world > N=1,000 split across two worlds)
- Constant storage: per-call storage cost remains fixed regardless of data scale
- Batch efficiency: SetChunkVerifiers is ~50x more gas-efficient per item than SetChunkVerifier — strongly prefer batch calls in production
- Production implications: for 100 verifiers, one batch call (~10.7M gas) vs 100 single calls (~545M gas total) — batch saves ~98% gas
- Recommended batch size: 100 items per call balances gas efficiency and per-call cost well within block gas limits
Last updated on