-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(levm): fix validation errors (part 2) and some extra things (#1345)
**Motivation** The main motivation is to fix validation related tests. Return a validation exception everytime that is necessary (while being careful of not returning them in cases in which they are not expected). It also fixes/changes some things that I find along the way and I consider appropriate changing. <!-- Why does this pull request exist? What are its goals? --> **Description** <!-- A clear and concise general description of the changes this PR introduces --> - Adds function `add_intrinsic_gas()` - Uses our gas_price as an effective gas price. So it works for transactions Type 2 and 3. - Implements blob gas cost - Implements calculation of base fee per blob gas and it's associated validation. - Fixes `add_gas_with_max` for report - It implements somewhat of a revert for create, but I'm not sure if it is well done because cache's purpose has recently changed. Diffs for `add_intrinsic_gas` and `validate_transaction` don't look very good. I recommend to watch the code directly for those functions. **End Result** ```bash ✓ Ethereum Foundation Tests: 1466 passed 2635 failed 4101 total run - 39:12 ✓ Summary: 1466/4101 (35.75) Cancun: 1356/3578 (37.90%) Shanghai: 55/221 (24.89%) Homestead: 0/17 (0.00%) Istanbul: 0/34 (0.00%) London: 19/39 (48.72%) Byzantium: 0/33 (0.00%) Berlin: 17/35 (48.57%) Constantinople: 0/66 (0.00%) Merge: 19/62 (30.65%) Frontier: 0/16 (0.00%) ``` After mergin main into branch: ``` Summary: 1471/4101 (35.87) Cancun: 1361/3578 (38.04%) ``` <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number --------- Co-authored-by: Ivan Litteri <[email protected]>
- Loading branch information
Showing
9 changed files
with
294 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Transaction Validation | ||
|
||
1. **GASLIMIT_PRICE_PRODUCT_OVERFLOW**: The product of gas limit and gas price is too high. | ||
2. **INSUFFICIENT_ACCOUNT_FUNDS**: Sender does not have enough funds to pay for the gas. | ||
3. **INSUFFICIENT_MAX_FEE_PER_GAS**: The max fee per gas is lower than the base fee per gas. | ||
4. **INITCODE_SIZE_EXCEEDED**: The size of the initcode is too big. | ||
5. **INTRINSIC_GAS_TOO_LOW**: The gas limit is lower than the intrinsic gas. | ||
6. **NONCE_IS_MAX**: The nonce of the sender is at its maximum value. | ||
7. **PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS**: The priority fee is greater than the max fee per gas. | ||
8. **SENDER_NOT_EOA**: The sender is not an EOA (it has code). | ||
9. **GAS_ALLOWANCE_EXCEEDED**: The gas limit is higher than the block gas limit. | ||
10. **INSUFFICIENT_MAX_FEE_PER_BLOB_GAS**: The max fee per blob gas is lower than the base fee per gas. | ||
11. **TYPE_3_TX_ZERO_BLOBS**: The transaction has zero blobs. | ||
12. **TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH**: The blob versioned hash is invalid. | ||
13. **TYPE_3_TX_PRE_FORK**: The transaction is a pre-cancun transaction. | ||
14. **TYPE_3_TX_BLOB_COUNT_EXCEEDED**: The blob count is higher than the max allowed. | ||
15. **TYPE_3_TX_CONTRACT_CREATION**: The type 3 transaction is a contract creation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.