test_tstore_rollback_on_failed_create()¶
Documentation for tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py::test_tstore_rollback_on_failed_create@20373115.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py::test_tstore_rollback_on_failed_create --fork Amsterdam
Test TSTORE is rolled back after failed CREATE/CREATE2 initcode.
Regression test for #917
Initcode does TLOAD(1) to compute a return size, then does TSTORE(1, 0x6000), then returns data of the computed size. When TLOAD(1) is 0, the return size is 0x600a (exceeds max code size 0x6000), so creation fails.
The caller invokes CREATE/CREATE2 twice with the same initcode. If TSTORE from the first (failed) creation is properly rolled back, the second creation also sees TLOAD(1)==0 and fails the same way. If not rolled back, TLOAD(1)==0x6000 and the second creation succeeds.
Source code in tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
Parametrized Test Cases¶
This test generates 2 parametrized test cases across 4 forks.