@@ -45,12 +45,12 @@ multiple ways:
45
45
46
46
## Gas overflow potential
47
47
48
- CosmWasm gas aims for 1 Teragas/second , i.e. the uint64 range exceeds after 18
49
- billion seconds (213 days )<sup >1</sup >. Assuming a max supported block execution
50
- time of 100 seconds, the gas price has to be over-priced by a factor of 184
51
- million (184 Petagas/second ) in order to exceed the uint64 range<sup >2</sup >.
48
+ CosmWasm gas aims for 1 Teragas/millisecond , i.e. the uint64 range exceeds after
49
+ 18 million seconds (5 hours )<sup >1</sup >. Assuming a max supported block
50
+ execution time of 30 seconds, the gas price has to be over-priced by a factor of
51
+ 614 (614 Teragas/millisecond ) in order to exceed the uint64 range<sup >2</sup >.
52
52
Since serious over or underpricing is considered a bug, using uint64 for gas
53
- mesurments is considered safe.
53
+ measurements is considered safe.
54
54
55
55
Cosmos SDK gas uses values that are smaller by a factor of 150_000, so those
56
56
don't overflow as well. Since no Cosmos SDK gas values are processed inside of
@@ -62,6 +62,6 @@ their JSON implementation. Go and Rust do that while many other implementations
62
62
don't support integers numbers and convert to them to IEEE-754 doubles, which
63
63
has a safe integer range up about 53 bit (e.g. JavaScript and jq).
64
64
65
- <sup >1</sup > Python3: ` (2**64-1) / 10**12 `
65
+ <sup >1</sup > Python3: ` (2**64-1)/1000 / 10**12 `
66
66
67
- <sup >2</sup > Python3: ` ((2**64-1)/100 ) / 10**12 `
67
+ <sup >2</sup > Python3: ` ((2**64-1)/1000/30 ) / 10**122 `
0 commit comments