Skip to content

[DRAFT] No need to fetch and transfer for 0 tx to precompile #724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
13 changes: 7 additions & 6 deletions src/EVM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,13 +1167,14 @@ precompiledContract this xGas precompileAddr recipient xValue inOffset inSize ou
case result' of
Nothing -> case stk of
x:_ -> case maybeLitWordSimp x of
Just 0 ->
Just 0 -> pure ()
Just 1 -> do
when (xValue /= Lit 0) $ do
fetchAccount (LitAddr recipient) $ \_ -> do
touchAccount self
touchAccount (LitAddr recipient)
transfer self (LitAddr recipient) xValue
pure ()
Just 1 ->
fetchAccount (LitAddr recipient) $ \_ -> do
touchAccount self
touchAccount (LitAddr recipient)
transfer self (LitAddr recipient) xValue
_ -> unexpectedSymArg "unexpected return value from precompile" [x]
_ -> underrun
_ -> pure ()
Expand Down
Loading