Skip to content
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

Messages for unknown calls #342

Open
Tracked by #346
daejunpark opened this issue Aug 13, 2024 · 0 comments
Open
Tracked by #346

Messages for unknown calls #342

daejunpark opened this issue Aug 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@daejunpark
Copy link
Collaborator

Currently, the message generation for calls to known and unknown addresses is inconsistent, with the message for known calls being correct. It would be better to factor out the message generation and use the same message for both types of calls.

Message for known calls:

halmos/src/halmos/sevm.py

Lines 1579 to 1586 in f7ff1f8

message = Message(
target=to if op in [EVM.CALL, EVM.STATICCALL] else ex.this,
caller=caller if op != EVM.DELEGATECALL else ex.caller(),
value=fund if op != EVM.DELEGATECALL else ex.callvalue(),
data=arg,
is_static=(ex.context.message.is_static or op == EVM.STATICCALL),
call_scheme=op,
)

Message for unknown calls:

halmos/src/halmos/sevm.py

Lines 1776 to 1782 in f7ff1f8

message=Message(
target=to,
caller=caller,
value=fund,
data=ex.st.memory.slice(arg_loc, arg_loc + arg_size),
call_scheme=op,
),

This issue isn't critical because the message for unknown calls is used only for tracing purposes, and most unknown calls use the CALL scheme. However, the trace information could be incorrect or confusing if there are unknown calls via DELEGATECALL.

Note: the message generation code is updated by PR #336, but this issue is orthogonal, and can be fixed after merging the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant