Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/scripts/run_rpc_tests_ethereum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ DISABLED_TEST_LIST=(
DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}")

# Call the main test runner script with the required and optional parameters
"$(dirname "$0")/run_rpc_tests.sh" mainnet v1.114.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR"
"$(dirname "$0")/run_rpc_tests.sh" mainnet v1.115.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR"
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ DISABLED_TEST_LIST=(
DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}")

# Call the main test runner script with the required and optional parameters
"$(dirname "$0")/run_rpc_tests.sh" mainnet v1.114.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "latest" "$REFERENCE_HOST" "do-not-compare-error-message" "$DUMP_RESPONSE"
"$(dirname "$0")/run_rpc_tests.sh" mainnet v1.115.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "latest" "$REFERENCE_HOST" "do-not-compare-error-message" "$DUMP_RESPONSE"
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ DISABLED_TEST_LIST=(
DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}")

# Call the main test runner script with the required and optional parameters
"$(dirname "$0")/run_rpc_tests.sh" mainnet v1.114.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR"
"$(dirname "$0")/run_rpc_tests.sh" mainnet v1.115.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR"
20 changes: 20 additions & 0 deletions execution/vm/gas_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ func statelessGasCall(evm *EVM, callContext *CallContext, availableGas uint64, m
return 0, false, ErrGasUintOverflow
}

if availableGas < gas {
return 0, false, ErrOutOfGas
}

if !withCallGasCalc {
if dbg.TraceDyanmicGas && evm.intraBlockState.Trace() {
fmt.Printf("%d (%d.%d) Call Gas: avail: %d, base: %d memory(%d): %d\n",
Expand All @@ -412,6 +416,10 @@ func statelessGasCall(evm *EVM, callContext *CallContext, availableGas uint64, m
if err != nil {
return 0, false, err
}

if availableGas < gas {
return 0, false, ErrOutOfGas
}
callGas, err := calcCallGas(evm, callContext, availableGas, gas)
if err != nil {
return 0, false, err
Expand Down Expand Up @@ -499,6 +507,10 @@ func statelessGasCallCode(evm *EVM, callContext *CallContext, availableGas uint6
return 0, false, ErrGasUintOverflow
}

if availableGas < gas {
return 0, false, ErrOutOfGas
}

if !withCallGasCalc {
if dbg.TraceDyanmicGas && evm.intraBlockState.Trace() {
fmt.Printf("%d (%d.%d) CallCode Gas: base: %d memory(%d): %d\n",
Expand Down Expand Up @@ -537,6 +549,10 @@ func statelessGasDelegateCall(evm *EVM, callContext *CallContext, availableGas u
return 0, false, err
}

if availableGas < gas {
return 0, false, ErrOutOfGas
}

var callGasTemp uint64
callGasTemp, err = callGas(evm.ChainRules().IsTangerineWhistle, availableGas, gas, callContext.Stack.Back(0))
evm.SetCallGasTemp(callGasTemp)
Expand Down Expand Up @@ -584,6 +600,10 @@ func statelessGasStaticCall(evm *EVM, callContext *CallContext, availableGas uin
return 0, false, err
}

if availableGas < gas {
return 0, false, ErrOutOfGas
}

if !withCallGasCalc {
if dbg.TraceDyanmicGas && evm.intraBlockState.Trace() {
fmt.Printf("%d (%d.%d) StaticCall Gas: memory(%d): %d\n",
Expand Down
4 changes: 4 additions & 0 deletions execution/vm/operations_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ func makeCallVariantGasCallEIP7702(statelessCalculator statelessGasFunc, statefu
evm.intraBlockState.AddAddressToAccessList(dd)
}

if availableGas-accessGas-delegationGas < statefulBaseGas {
return 0, ErrOutOfGas
}

// Call the old calculator, which takes into account
// - 63/64ths rule
callGas, err := calcCallGas(evm, callContext, availableGas-accessGas-delegationGas, statefulBaseGas)
Expand Down
Loading