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

Change values in instruction metrics #435

Merged
merged 3 commits into from
Sep 30, 2019
Merged

Change values in instruction metrics #435

merged 3 commits into from
Sep 30, 2019

Conversation

chfast
Copy link
Member

@chfast chfast commented Sep 27, 2019

This updates instruction metrics with changed values - they are easier to explain and represent number directly usable by VM implementations (will benefit aleth-interepreter).

This is tested against evmone's table: ethereum/evmone#191.

The modification can be easily verified by following the rule:

{..., a, b} -> {..., a, b - a}

Continuation of #356.

@chfast chfast force-pushed the instruction_metrics branch 3 times, most recently from 98028d7 to 2162feb Compare September 27, 2019 09:36
@@ -188,11 +188,11 @@ struct evmc_instruction_metrics
/** The instruction gas cost. */
int16_t gas_cost;

/** The number of items the instruction pops from the EVM stack before execution. */
int8_t num_stack_arguments;
/** The number of the EVM stack items required for the instruction. */
Copy link
Member

Choose a reason for hiding this comment

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

"the minimum number" maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed.


/** The number of items the instruction pushes to the EVM stack after execution. */
int8_t num_stack_returned_items;
/** The EVM stack height change caused by the instruction execution. */
Copy link
Member

Choose a reason for hiding this comment

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

I'd clarify that it's stack after execution - stack before

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

@chfast chfast force-pushed the instruction_metrics branch from 2162feb to 2c3eb42 Compare September 28, 2019 09:17
@chfast chfast merged commit 4ee8ff8 into master Sep 30, 2019
@chfast chfast deleted the instruction_metrics branch September 30, 2019 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants