Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix bug in resolving log message of user assertion #1784

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

bre4kpo1nt
Copy link
Contributor

try:
message = eth_abi.decode_single(
"string",
bytes(
state.mstate.memory[
mem_start.value + 32 : mem_start.value + size.value
]
),
).decode("utf8")
except:
pass

The function decode_single() at L72 resolves log messages of user assertions. However, referring to the release notes of eth_abi, the function will return a python str instead of bytes if called with ABI type "string" since v2.0.0-alpha.1. Thus, the function will always fail silently as all exceptions will be catched by the except statement at L80.

@CLAassistant
Copy link

CLAassistant commented Jul 3, 2023

CLA assistant check
All committers have signed the CLA.

@bre4kpo1nt bre4kpo1nt force-pushed the fix_user_assertions branch from 79cd15f to 49adb8e Compare July 4, 2023 01:28
Copy link
Collaborator

@norhh norhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 👍

@norhh norhh merged commit 1f330ef into Consensys:develop Jul 4, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants