ethereum / ethereum/tests

EOF CREATE3 test vectors

Open
#1,205 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
626
Forks
364
PR merge metrics
No merged PRs in 30d

Description

### Validation

#### Valid cases

##### Container format

- Container with one container section.
- Container with multiple container sections.
- Container with maximum number (255) container sections.

##### Instructions

- Code section with `CREATE3` referring to container section 0, 1, 255.
- Code section with `RETURNCONTRACT` referring to container section 0, 1, 255.

#### Invalid cases

##### Invalid container format

- Truncated container section header
- Container secton header with 0 elements.
- Container section with size 0.
- Container section out of order (before code section, after data section).
- Container section body missing.

##### Invalid instructions

- Truncated `CREATE3` without immediate.
- Truncated `RETURNCONTRACT` without immediate.
- `RJUMP`/`RJUMPI`/`RJUMPV` into immediate byte of `CREATE3`
- `RJUMP`/`RJUMPI`/`RJUMPV` into immediate byte of `RETURNCONTRACT`
- `CREATE3` as last instruction in code section.
- Code section with `CREATE3` referring to non-existing container section.
- Code section with `RETURNCONTRACT` referring to non-existing container section.
- Unreachable instructions after `RETURNCONTRACT`

### Execution

#### Success cases

- `CREATE3` with container section 0, 1, 255
- `RETURNCONTRACT` with container section 0, 1, 255
- `CREATE3` with empty input data
- `CREATE3` with non-empty input data
- `RETURNCONTRACT` with empty aux data
- `RETURNCONTRACT` with non-empty aux data
- `REVERT` in initcode with empty return data
- `REVERT` in initcode with non-empty return data
- `CREATE3` transferring value
- `CREATE3` with the same container but different salt values - check that generated address is different
- `CREATE3` with the same container and salt but different input data - check that generated address is different

#### Error cases
- Initcontainer is invalid
- Exceptional abort during initcontainer execution
- `RETURN` during initcontainer execution
- `STOP` during initcontainer execution
- Returned container has invalid format
- Appending aux_data to returned container results in size above 24K
- Container is invalid after aux_data concatenation
- `CREATE3` in legacy code aborts execution
- `RETURNCONTRACT` in legacy code aborts execution

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.