Skip to content

Commit 1ad695c

Browse files
authored
Updated gas calculations for CosmWasm v2.1.2 (#27)
1 parent e24174d commit 1ad695c

4 files changed

Lines changed: 1525 additions & 1210 deletions

File tree

blog/2026-05-31-eof-notice.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ and no longer receive maintenance, security patches, or compatibility support:
1111

1212
This is aligned with EOL notices for
1313
[Cosmos SDK](https://docs.cosmos.network/sdk/latest/release-family#end-of-life-notices) `v0.50.x`.
14+
15+
{/* truncate */}

docs/core/architecture/gas.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,23 @@ overflow, the gas values were lowered in this issue [#1599].
124124

125125
Below is a breakdown of what this change entails:
126126

127-
| | CosmWasm 1.x | CosmWasm 2.0 | CosmWasm 2.1 |
128-
|-----------------------------------------------------|:------------:|:------------:|:------------:|
129-
| **Cost target** | 1 Tgas/ms | 1 Tgas/s | 1 Tgas/s |
130-
| **Exceeds 64-bit unsigned<br/>integer range after** | 5 hours | 5124 hours | 5124 hours |
131-
| **Cost per Wasm operation** | 150.000 | 150 | 170 |
132-
| **Multiplier** | 140.000.000 | 140.000 | 140.000 |
127+
| | CosmWasm v1.0.x | CosmWasm v2.0.x | CosmWasm v2.1.x | CosmWasm v2.1.2 | CosmWasm v2.1.4 → |
128+
|-------------------------------------------------|:---------------:|:---------------:|:---------------:|:---------------:|:-----------------:|
129+
| **Cost target** | 1 Tgas/ms | 1 Tgas/s | 1 Tgas/s | 1 Tgas/s | 1 Tgas/s |
130+
| **Exceeds 64-bit unsigned integer range after** | 5 hours | 5 124 hours | 5 124 hours | 5 124 hours | 5 124 hours |
131+
| **Cost per Wasm operation** | 150 000 | 150 | 170 | 115 (×14) ¹⁾ | 115 (×14) ²⁾ |
132+
| **Multiplier** | 140 000 000 | 140 000 | 140 000 | 140 000 | 140 000 |
133+
134+
¹⁾ **Remarks to CosmWasm v2.1.2**
135+
- Cost for non-accounting Wasm operators is **115**.
136+
- Cost for accounting Wasm operators is 115×14 = **1610**.
137+
- Wasm accounting operators: Br, BrIf, BrTable, Call, CallIndirect, Else, End, Loop, Return
138+
139+
²⁾ **Remarks to CosmWasm v2.1.4**
140+
- Cost for non-accounting Wasm operators is **115**.
141+
- Cost for accounting Wasm operators is 115×14 = **1610**.
142+
- Wasm accounting operators: Br, BrIf, BrOnCast, BrOnCastFail, BrOnNonNull, BrOnNull, BrTable, Call, CallIndirect,
143+
CallRef, Catch, Delegate, Else, End, If, Loop, Rethrow, Return, ReturnCall, ReturnCallIndirect, ReturnCallRef, Throw, ThrowRef
133144

134145
[#1599]: https://github.com/CosmWasm/cosmwasm/pull/1599
135146
[JSON numbers]: https://www.json.org/

0 commit comments

Comments
 (0)