Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gurukamath committed Aug 29, 2024
1 parent 75c6e86 commit a41b2c1
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 183 deletions.
3 changes: 2 additions & 1 deletion src/ethereum/prague/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ def process_system_transaction(
accessed_addresses=set(),
accessed_storage_keys=set(),
parent_evm=None,
eof=None,
)

system_tx_env = vm.Environment(
Expand Down Expand Up @@ -927,7 +928,7 @@ def process_transaction(
)
except InvalidEof:
output = MessageCallOutput(
gas, U256(0), tuple(), set(), set(), InvalidEof()
gas, U256(0), tuple(), set(), set(), InvalidEof(), b""
)
else:
output = process_message_call(message, env)
Expand Down
24 changes: 12 additions & 12 deletions src/ethereum/prague/vm/eof/stack_height_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from . import Validator


def stack_height_callf(validator: Validator) -> None:
def stack_validation_callf(validator: Validator) -> None:
"""
Validate stack height for CALLF instruction.
Expand Down Expand Up @@ -47,7 +47,7 @@ def stack_height_callf(validator: Validator) -> None:
validator.current_stack_height.max += increment


def stack_height_jumpf(validator: Validator) -> None:
def stack_validation_jumpf(validator: Validator) -> None:
"""
Validate stack height for JUMPF instruction.
Expand Down Expand Up @@ -139,7 +139,7 @@ def stack_validation_retf(validator: Validator) -> None:
)


def stack_height_dupn(validator: Validator) -> None:
def stack_validation_dupn(validator: Validator) -> None:
"""
Validate stack height for DUPN instruction.
Expand Down Expand Up @@ -168,7 +168,7 @@ def stack_height_dupn(validator: Validator) -> None:
validator.current_stack_height.max += 1


def stack_height_swapn(validator: Validator) -> None:
def stack_validation_swapn(validator: Validator) -> None:
"""
Validate stack height for SWAPN instruction.
Expand Down Expand Up @@ -196,7 +196,7 @@ def stack_height_swapn(validator: Validator) -> None:
pass


def stack_height_exchange(validator: Validator) -> None:
def stack_validation_exchange(validator: Validator) -> None:
"""
Validate stack height for EXCHANGE instruction.
Expand Down Expand Up @@ -224,7 +224,7 @@ def stack_height_exchange(validator: Validator) -> None:
pass


def stack_height_other_instructions(validator: Validator) -> None:
def stack_validation_other_instructions(validator: Validator) -> None:
"""
Validate stack height for other instructions.
Expand Down Expand Up @@ -261,12 +261,12 @@ def stack_height_other_instructions(validator: Validator) -> None:


stack_validation: Dict[Ops, Callable] = {
Ops.CALLF: stack_height_callf,
Ops.JUMPF: stack_height_jumpf,
Ops.CALLF: stack_validation_callf,
Ops.JUMPF: stack_validation_jumpf,
Ops.RETF: stack_validation_retf,
Ops.DUPN: stack_height_dupn,
Ops.SWAPN: stack_height_swapn,
Ops.EXCHANGE: stack_height_exchange,
Ops.DUPN: stack_validation_dupn,
Ops.SWAPN: stack_validation_swapn,
Ops.EXCHANGE: stack_validation_exchange,
}


Expand All @@ -288,4 +288,4 @@ def get_stack_validation(op: Ops) -> Callable:
if op in stack_validation:
return stack_validation[op]
else:
return stack_height_other_instructions
return stack_validation_other_instructions
Loading

0 comments on commit a41b2c1

Please sign in to comment.