Skip to content

Commit 69d0985

Browse files
authored
Merge winsvega pull request #1 from winsvega/gaslimit-fixes-new
2 parents 6e4f279 + 5fd9700 commit 69d0985

11 files changed

+1662
-55
lines changed

tests/static/state_tests/VMTests/vmIOandFlowOperations/gasFiller.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ gas:
6767
- :label gas1 :abi f(uint) 0
6868
- :label gas2 :abi f(uint) 1
6969
gasLimit:
70-
- '30000000'
70+
- '1000000'
7171
gasPrice: '10'
7272
nonce: '0'
7373
to: cccccccccccccccccccccccccccccccccccccccc
@@ -93,7 +93,7 @@ gas:
9393
result:
9494
cccccccccccccccccccccccccccccccccccccccc:
9595
storage:
96-
0x00: 0x04b1457b
96+
0x00: 960898
9797

9898

9999

@@ -107,4 +107,4 @@ gas:
107107
result:
108108
cccccccccccccccccccccccccccccccccccccccc:
109109
storage:
110-
0x00: 0x04b1458d
110+
0x00: 960916

tests/static/state_tests/VMTests/vmIOandFlowOperations/msizeFiller.yml renamed to tests/static/state_tests/VMTests/vmIOandFlowOperations/msizeCancunFiller.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ msize:
141141
# Off in hyperspace, is the chunk size still 0x20?
142142
- :label farChunk :abi f(uint) 5
143143
gasLimit:
144-
- 0x1c9c380
144+
- 270_000_000
145145
gasPrice: '10'
146146
nonce: '0'
147147
to: cccccccccccccccccccccccccccccccccccccccc
@@ -158,7 +158,7 @@ msize:
158158
gas: !!int -1
159159
value: !!int -1
160160
network:
161-
- '>=Cancun'
161+
- 'Cancun'
162162
result:
163163
cccccccccccccccccccccccccccccccccccccccc:
164164
storage:
@@ -173,7 +173,7 @@ msize:
173173
gas: !!int -1
174174
value: !!int -1
175175
network:
176-
- '>=Cancun'
176+
- 'Cancun'
177177
result:
178178
cccccccccccccccccccccccccccccccccccccccc:
179179
storage:
@@ -187,7 +187,7 @@ msize:
187187
gas: !!int -1
188188
value: !!int -1
189189
network:
190-
- '>=Cancun'
190+
- 'Cancun'
191191
result:
192192
cccccccccccccccccccccccccccccccccccccccc:
193193
storage:
@@ -201,7 +201,7 @@ msize:
201201
gas: !!int -1
202202
value: !!int -1
203203
network:
204-
- '>=Cancun'
204+
- 'Cancun'
205205
result:
206206
cccccccccccccccccccccccccccccccccccccccc:
207207
storage:
@@ -218,7 +218,7 @@ msize:
218218
gas: !!int -1
219219
value: !!int -1
220220
network:
221-
- '>=Cancun'
221+
- 'Cancun'
222222
result:
223223
cccccccccccccccccccccccccccccccccccccccc:
224224
storage:
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
# Memory size tests
2+
3+
4+
msize:
5+
6+
env:
7+
currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba
8+
currentDifficulty: 0x20000
9+
currentGasLimit: 0x100000000
10+
currentNumber: 1
11+
currentTimestamp: 1000
12+
13+
_info:
14+
comment: Ori Pomerantz [email protected]
15+
16+
pre:
17+
18+
0000000000000000000000000000000000001000:
19+
balance: '0x0ba1a9ce0ba1a9ce'
20+
code: |
21+
{
22+
; Store an entire 32 byte value
23+
[0] 0xFF
24+
[[0]] (msize)
25+
}
26+
nonce: '0'
27+
storage: {}
28+
29+
30+
0000000000000000000000000000000000001001:
31+
balance: '0x0ba1a9ce0ba1a9ce'
32+
code: |
33+
{
34+
; Store an entire 32 byte value
35+
[0] 0xffffffffff
36+
[[0]] (msize)
37+
}
38+
nonce: '0'
39+
storage: {}
40+
41+
42+
43+
0000000000000000000000000000000000001002:
44+
balance: '0x0ba1a9ce0ba1a9ce'
45+
code: |
46+
{
47+
; Store two values
48+
[0] 0xffffffffff
49+
[0x20] 0xeeee
50+
[[0]] (msize)
51+
}
52+
nonce: '0'
53+
storage: {}
54+
55+
56+
57+
0000000000000000000000000000000000001003:
58+
balance: '0x0ba1a9ce0ba1a9ce'
59+
code: |
60+
{
61+
; Store two values
62+
[0] 0xffffffffff
63+
[0x5a] 0xeeee
64+
[[0]] (msize)
65+
66+
; The 0xEEEE value is stored 0x5a-0x79,
67+
; and memory is allocated in 0x20 byte chunks
68+
}
69+
nonce: '0'
70+
storage: {}
71+
72+
73+
# chunks
74+
0000000000000000000000000000000000001004:
75+
balance: '0x0ba1a9ce0ba1a9ce'
76+
code: |
77+
{
78+
; Store at the very end of the first chunk
79+
(mstore8 0x1F 1)
80+
[[0]] (msize)
81+
82+
; Store at the beginning of the second chuck
83+
(mstore8 0x20 1)
84+
[[1]] (msize)
85+
86+
; Does it matter if we reset the memory?
87+
; Spoiler alert, it doesn't
88+
(mstore8 0x20 0)
89+
[[2]] (msize)
90+
91+
}
92+
nonce: '0'
93+
storage: {}
94+
95+
96+
# farChunk
97+
0000000000000000000000000000000000001005:
98+
balance: '0x0ba1a9ce0ba1a9ce'
99+
code: |
100+
{
101+
; Does the chunk size change in very high offsets?
102+
;
103+
; Note: It doesn't
104+
(mstore8 0xa0000 1)
105+
[[0]] (msize)
106+
}
107+
nonce: '0'
108+
storage: {}
109+
110+
111+
112+
# Using DELEGATECALL lets us group results together, because everything
113+
# is written to the same storage.
114+
cccccccccccccccccccccccccccccccccccccccc:
115+
balance: '0x0ba1a9ce0ba1a9ce'
116+
code: |
117+
{
118+
(delegatecall (gas) (+ 0x1000 $4) 0 0 0 0)
119+
}
120+
nonce: '0'
121+
storage: {}
122+
123+
124+
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
125+
balance: 0x100000000000
126+
code: '0x'
127+
nonce: '0'
128+
storage: {}
129+
130+
131+
132+
133+
transaction:
134+
data:
135+
- :label msize0 :abi f(uint) 0
136+
- :label msize1 :abi f(uint) 1
137+
- :label msize2 :abi f(uint) 2
138+
- :label msize3 :abi f(uint) 3
139+
- :label chunks :abi f(uint) 4
140+
141+
# Off in hyperspace, is the chunk size still 0x20?
142+
- :label farChunk :abi f(uint) 5
143+
gasLimit:
144+
- 1_000_000
145+
gasPrice: '10'
146+
nonce: '0'
147+
to: cccccccccccccccccccccccccccccccccccccccc
148+
value:
149+
- '1'
150+
secretKey: "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8"
151+
152+
153+
expect:
154+
- indexes:
155+
data:
156+
- :label msize0
157+
- :label msize1
158+
gas: !!int -1
159+
value: !!int -1
160+
network:
161+
- '>=Prague'
162+
result:
163+
cccccccccccccccccccccccccccccccccccccccc:
164+
storage:
165+
0x00: 0x20
166+
167+
168+
169+
170+
- indexes:
171+
data:
172+
- :label msize2
173+
gas: !!int -1
174+
value: !!int -1
175+
network:
176+
- '>=Prague'
177+
result:
178+
cccccccccccccccccccccccccccccccccccccccc:
179+
storage:
180+
0x00: 0x40
181+
182+
183+
184+
- indexes:
185+
data:
186+
- :label msize3
187+
gas: !!int -1
188+
value: !!int -1
189+
network:
190+
- '>=Prague'
191+
result:
192+
cccccccccccccccccccccccccccccccccccccccc:
193+
storage:
194+
0x00: 0x80
195+
196+
197+
198+
- indexes:
199+
data:
200+
- :label chunks
201+
gas: !!int -1
202+
value: !!int -1
203+
network:
204+
- '>=Prague'
205+
result:
206+
cccccccccccccccccccccccccccccccccccccccc:
207+
storage:
208+
0x00: 0x20
209+
0x01: 0x40
210+
0x02: 0x40
211+
212+
213+
214+
215+
- indexes:
216+
data:
217+
- :label farChunk
218+
gas: !!int -1
219+
value: !!int -1
220+
network:
221+
- '>=Prague'
222+
result:
223+
cccccccccccccccccccccccccccccccccccccccc:
224+
storage:
225+
0x00: 0xa0020

tests/static/state_tests/stEIP1559/baseFeeDiffPlacesFiller.yml renamed to tests/static/state_tests/stEIP1559/baseFeeDiffPlacesCancunFiller.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ baseFeeDiffPlaces:
675675

676676

677677
gasLimit:
678-
- 0x1c9c380
678+
- 0x10000000000000
679679
nonce: 1
680680
to: cccccccccccccccccccccccccccccccccccccccc
681681
value:
@@ -691,7 +691,7 @@ baseFeeDiffPlaces:
691691
value: !!int -1
692692

693693
network:
694-
- '>=Cancun'
694+
- 'Cancun'
695695

696696
result:
697697
cccccccccccccccccccccccccccccccccccccccc:

0 commit comments

Comments
 (0)