Skip to content

Commit

Permalink
Merge pull request #43 from lightclient/no-throw
Browse files Browse the repository at this point in the history
core/vm: fail instead of throw in non-zero extvalue
  • Loading branch information
lightclient authored Mar 23, 2021
2 parents 7aed39a + 7bb6bde commit 4c936e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions core/vm/eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,17 @@ func opAuthCall(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) (
// Pop other call parameters.
addr, value, extValue, inOffset, inSize, retOffset, retSize := stack.pop(), stack.pop(), stack.pop(), stack.pop(), stack.pop(), stack.pop(), stack.pop()
// Nonzero extValue not allowed in London
if extValue.Cmp(uint256.NewInt()) != 0 {
return nil, ErrExtValueNonZero
}
toAddr := common.Address(addr.Bytes20())
// Get the arguments from the memory.
args := callContext.memory.GetPtr(int64(inOffset.Uint64()), int64(inSize.Uint64()))

// If extValue is non-zero, fail immediately.
if !extValue.IsZero() {
temp.Clear()
stack.push(&temp)
return nil, nil
}

var bigVal = big0
if !value.IsZero() {
gas += params.CallStipend
Expand Down
1 change: 0 additions & 1 deletion core/vm/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ var (
ErrInvalidRetsub = errors.New("invalid retsub")
ErrReturnStackExceeded = errors.New("return stack limit reached")
ErrNoAuthorizedAccount = errors.New("authorized account not set")
ErrExtValueNonZero = errors.New("authcall extvalue nonzero")
)

// ErrStackUnderflow wraps an evm error when the items on the stack less
Expand Down

0 comments on commit 4c936e2

Please sign in to comment.