File tree Expand file tree Collapse file tree 4 files changed +47
-4
lines changed
tests/osaka/eip7692_eof_v1 Expand file tree Collapse file tree 4 files changed +47
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ EOFTests/efValidation/callf_into_nonreturning_.json
1818EOFTests/efValidation/EOF1_embedded_container_.json
1919EOFTests/efValidation/EOF1_eofcreate_valid_.json
2020EOFTests/efValidation/EOF1_callf_truncated_.json
21+ EOFTests/efValidation/EOF1_dataloadn_truncated_.json
2122EOFTests/efValidation/EOF1_valid_rjump_.json
2223EOFTests/efValidation/EOF1_valid_rjumpi_.json
2324EOFTests/efValidation/EOF1_valid_rjumpv_.json
Original file line number Diff line number Diff line change @@ -185,7 +185,6 @@ def test_eof_validity(
185185 code = Op .CALLF ,
186186 )
187187 ],
188- validity_error = EOFException .TRUNCATED_INSTRUCTION ,
189188 ),
190189 Container (
191190 name = "imm1" ,
@@ -194,7 +193,6 @@ def test_eof_validity(
194193 code = Op .CALLF + Op .STOP ,
195194 )
196195 ],
197- validity_error = EOFException .TRUNCATED_INSTRUCTION ,
198196 ),
199197 Container (
200198 name = "imm_from_next_section" ,
@@ -215,7 +213,6 @@ def test_eof_validity(
215213 max_stack_height = 2 ,
216214 ),
217215 ],
218- validity_error = EOFException .TRUNCATED_INSTRUCTION ,
219216 ),
220217 ],
221218 ids = container_name ,
Original file line number Diff line number Diff line change @@ -177,3 +177,48 @@ def test_legacy_initcode_invalid_eof_v1_contract(
177177 data = container ,
178178 expect_exception = container .validity_error ,
179179 )
180+
181+
182+ @pytest .mark .parametrize (
183+ "container" ,
184+ [
185+ Container (
186+ name = "imm0" ,
187+ sections = [
188+ Section .Code (Op .DATALOADN ),
189+ Section .Data (b"\xff " * 32 ),
190+ ],
191+ ),
192+ Container (
193+ name = "imm1" ,
194+ sections = [
195+ Section .Code (Op .DATALOADN + Op .STOP ),
196+ Section .Data (b"\xff " * 32 ),
197+ ],
198+ ),
199+ Container (
200+ name = "imm_from_next_section" ,
201+ sections = [
202+ Section .Code (
203+ Op .CALLF [1 ] + Op .JUMPF [2 ],
204+ max_stack_height = 1 ,
205+ ),
206+ Section .Code (
207+ Op .DATALOADN + Op .STOP ,
208+ code_outputs = 1 ,
209+ ),
210+ Section .Code (
211+ Op .STOP ,
212+ ),
213+ Section .Data (b"\xff " * 32 ),
214+ ],
215+ ),
216+ ],
217+ ids = container_name ,
218+ )
219+ def test_dataloadn_truncated_immediate (
220+ eof_test : EOFTestFiller ,
221+ container : Container ,
222+ ):
223+ """Test cases for DATALOADN instructions with truncated immediate bytes."""
224+ eof_test (data = container , expect_exception = EOFException .TRUNCATED_INSTRUCTION )
Original file line number Diff line number Diff line change 354354### Validation
355355
356356- [ ] Valid DATALOADN with various offsets (ethereum/tests: src/EOFTestsFiller/efValidation/dataloadn_Copier.json)
357- - [ ] Truncated DATALOADN immediate (ethereum/ tests: ./src/EOFTestsFiller/efValidation/EOF1_dataloadn_truncated_Copier.json )
357+ - [x ] Truncated DATALOADN immediate ([ ` tests/osaka/eip7692_eof_v1/eip7480_data_section/test_code_validation.py::test_dataloadn_truncated_immediate ` ] ( ./eip7480_data_section/test_code_validation/test_dataloadn_truncated_immediate.md )
358358- [ ] DATALOADN offset out of bounds (ethereum/tests: src/EOFTestsFiller/efValidation/dataloadn_Copier.json)
359359- [ ] DATALOADN accessing not full word (ethereum/tests: src/EOFTestsFiller/efValidation/dataloadn_Copier.json)
360360
You can’t perform that action at this time.
0 commit comments