-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix: bug with gasLimit being set to block max (#1489)
## Description _Concise description of proposed changes_ ## Testing Explain the quality checks that have been done on the code changes ## Additional Information - [ ] I read the [contributing docs](../docs/contributing.md) (if this is your first contribution) Your ENS/address: <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Corrected the handling of the `gasLimit` parameter in the `@tevm/actions` package to ensure accurate simulation behavior. - **New Features** - Introduced a new TypeScript file for testing Ethereum transactions, enhancing the testing framework with a memory client setup. - **Improvements** - Updated error handling and transaction execution logic in the `executeCall` function to enforce unconditional skipping of balance checks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
8ea0f89
commit 42590c1
Showing
11 changed files
with
111 additions
and
162 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tevm/actions": patch | ||
--- | ||
|
||
Fixed bug where gasLimit was set to block max when simulating calls |
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
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
21 changes: 0 additions & 21 deletions
21
packages/actions/src/DumpState/__snapshots__/dumpStateHandler.spec.ts.snap
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,41 +1,68 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`call fee cap too high 1`] = `"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000084e6f745761676d69000000000000000000000000000000000000000000000000"`; | ||
|
||
exports[`call fee cap too high 2`] = `[CallExecutionError: The fee cap (\`maxFeePerGas\` = 115792089237316195423570985008687907853269984665640564039457584007913.129639936 gwei) cannot be higher than the maximum allowed value (2^256-1). | ||
exports[`call contract revert (contract error) 1`] = ` | ||
"Missing or invalid parameters. | ||
Double check you have provided the correct parameters. | ||
Raw Call Arguments: | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 | ||
maxFeePerGas: 115792089237316195423570985008687907853269984665640564039457584007913.129639936 gwei | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 | ||
Version: [email protected]]`; | ||
Details: revert | ||
exports[`call gas too low 1`] = `[CallExecutionError: Missing or invalid parameters. | ||
Docs: https://tevm.sh/reference/tevm/errors/classes/reverterror/ | ||
Details: {"error":"revert","errorType":"EvmError"} | ||
Version: 1.1.0.next-73 | ||
Version: [email protected]" | ||
`; | ||
|
||
exports[`call contract revert (insufficient params) 1`] = ` | ||
"Missing or invalid parameters. | ||
Double check you have provided the correct parameters. | ||
Raw Call Arguments: | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 | ||
gas: 100 | ||
data: 0xa0712d68 | ||
Details: revert | ||
Docs: https://tevm.sh/reference/tevm/errors/classes/reverterror/ | ||
Details: {"error":"revert","errorType":"EvmError"} | ||
Version: 1.1.0.next-73 | ||
Version: [email protected]]`; | ||
Version: [email protected]" | ||
`; | ||
|
||
exports[`call gas too low 2`] = `[Function]`; | ||
exports[`call duplicate address 1`] = ` | ||
"State for account "0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2" is set multiple times. | ||
exports[`call gas too high 1`] = ` | ||
{ | ||
"data": undefined, | ||
} | ||
Raw Call Arguments: | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0x06fdde03 | ||
State Override: | ||
0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2: | ||
stateDiff: | ||
0x00000000000000000000000000000000000000000000000000000000000001a4: 0x00000000000000000000000000000000000000000000000000000000000001a4 | ||
0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2: | ||
stateDiff: | ||
0x00000000000000000000000000000000000000000000000000000000000001a4: 0x00000000000000000000000000000000000000000000000000000000000001a4 | ||
Version: [email protected]" | ||
`; | ||
|
||
exports[`call fee cap too high 1`] = `"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000084e6f745761676d69000000000000000000000000000000000000000000000000"`; | ||
|
||
exports[`call fee cap too high 2`] = `[CallExecutionError: The fee cap (\`maxFeePerGas\` = 115792089237316195423570985008687907853269984665640564039457584007913.129639936 gwei) cannot be higher than the maximum allowed value (2^256-1). | ||
Raw Call Arguments: | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 | ||
maxFeePerGas: 115792089237316195423570985008687907853269984665640564039457584007913.129639936 gwei | ||
Version: [email protected]]`; | ||
|
||
exports[`call gas fee is less than block base fee 1`] = ` | ||
{ | ||
"data": undefined, | ||
|
@@ -48,66 +75,39 @@ exports[`call gas fee is less than block base fee 2`] = ` | |
} | ||
`; | ||
|
||
exports[`call maxFeePerGas less than maxPriorityFeePerGas 1`] = ` | ||
"The provided tip (\`maxPriorityFeePerGas\` = 22 gwei) cannot be higher than the fee cap (\`maxFeePerGas\` = 20 gwei). | ||
Raw Call Arguments: | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 | ||
maxFeePerGas: 20 gwei | ||
maxPriorityFeePerGas: 22 gwei | ||
Version: [email protected]" | ||
exports[`call gas too high 1`] = ` | ||
{ | ||
"data": undefined, | ||
} | ||
`; | ||
|
||
exports[`call contract revert (contract error) 1`] = ` | ||
"Missing or invalid parameters. | ||
exports[`call gas too low 1`] = `[CallExecutionError: Missing or invalid parameters. | ||
Double check you have provided the correct parameters. | ||
Raw Call Arguments: | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 | ||
gas: 100 | ||
Details: revert | ||
Docs: https://tevm.sh/reference/tevm/errors/classes/reverterror/ | ||
Details: {"error":"revert","errorType":"EvmError"} | ||
Version: 1.1.0.next-73 | ||
Version: [email protected]" | ||
`; | ||
|
||
exports[`call contract revert (insufficient params) 1`] = ` | ||
"Missing or invalid parameters. | ||
Double check you have provided the correct parameters. | ||
Raw Call Arguments: | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d68 | ||
Details: revert | ||
Version: [email protected]]`; | ||
|
||
Docs: https://tevm.sh/reference/tevm/errors/classes/reverterror/ | ||
Details: {"error":"revert","errorType":"EvmError"} | ||
Version: 1.1.0.next-73 | ||
Version: [email protected]" | ||
`; | ||
exports[`call gas too low 2`] = `[Function]`; | ||
|
||
exports[`call duplicate address 1`] = ` | ||
"State for account "0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2" is set multiple times. | ||
exports[`call maxFeePerGas less than maxPriorityFeePerGas 1`] = ` | ||
"The provided tip (\`maxPriorityFeePerGas\` = 22 gwei) cannot be higher than the fee cap (\`maxFeePerGas\` = 20 gwei). | ||
Raw Call Arguments: | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0x06fdde03 | ||
State Override: | ||
0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2: | ||
stateDiff: | ||
0x00000000000000000000000000000000000000000000000000000000000001a4: 0x00000000000000000000000000000000000000000000000000000000000001a4 | ||
0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2: | ||
stateDiff: | ||
0x00000000000000000000000000000000000000000000000000000000000001a4: 0x00000000000000000000000000000000000000000000000000000000000001a4 | ||
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | ||
to: 0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2 | ||
data: 0xa0712d6800000000000000000000000000000000000000000000000000000000000001a4 | ||
maxFeePerGas: 20 gwei | ||
maxPriorityFeePerGas: 22 gwei | ||
Version: [email protected]" | ||
`; | ||
|
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.