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

The docstring of func process_message in vm/interpreter.py is wrong #992

Open
Alleysira opened this issue Aug 20, 2024 · 0 comments
Open
Labels
A-doc Area: documentation C-bug Category: this is a bug, deviation, or other problem.

Comments

@Alleysira
Copy link

Alleysira commented Aug 20, 2024

Metadata

  • Hardfork: From Frontier to Cancun

What was wrong?

Hello, developers! This is just a Inappropriate expression in docstring.

Take the func process_message() in vm/interpreter.py in Cancun as an example:

def process_message(message: Message, env: Environment) -> Evm:
"""
Executes a call to create a smart contract.
Parameters
----------
message :
Transaction specific items.
env :
External items required for EVM execution.
Returns
-------
evm: :py:class:`~ethereum.cancun.vm.Evm`
Items containing execution specific objects
"""
if message.depth > STACK_DEPTH_LIMIT:
raise StackDepthLimitError("Stack depth limit reached")
# take snapshot of state before processing the message
begin_transaction(env.state, env.transient_storage)
touch_account(env.state, message.current_target)
if message.should_transfer_value and message.value != 0:
move_ether(
env.state, message.caller, message.current_target, message.value
)
evm = execute_code(message, env)
if evm.error:
# revert state to the last saved checkpoint
# since the message call resulted in an error
rollback_transaction(env.state, env.transient_storage)
else:
commit_transaction(env.state, env.transient_storage)
return evm

I think here process_message() is just a smart contract call that executes the code of message, instead of what is described in the func's docstring:

Executes a call to create a smart contract.

I checked all vm/interpreter.py from Frontier to Cancun, it seems that all forks have this issue. Perhaps a slight adjustment to the description could help clarify this.

Thanks for you attention!

@Alleysira Alleysira added A-doc Area: documentation C-bug Category: this is a bug, deviation, or other problem. labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doc Area: documentation C-bug Category: this is a bug, deviation, or other problem.
Projects
None yet
Development

No branches or pull requests

1 participant