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

Simplify signatures of Host methods #154

Merged
merged 6 commits into from
Sep 17, 2018
Merged

Simplify signatures of Host methods #154

merged 6 commits into from
Sep 17, 2018

Conversation

chfast
Copy link
Member

@chfast chfast commented Sep 9, 2018

This reverts most of the Host method changes introduced recently.

Should I also change evmc_get_block_hash_fn?

I tried the previous API in Aleth and it is very messy. Here is an example of trying to expose the information if an account exists when checking balance: ethereum/aleth#5261

This information is not useful in any of the use cases (no place where you would not to fold it to 0 balance).

Reverts #146, #140, #135.

@gumb0
Copy link
Member

gumb0 commented Sep 10, 2018

ABI stays v6?

@chfast
Copy link
Member Author

chfast commented Sep 10, 2018

ABI stays v6?

I think there are still some changes. I will compare later on wit v5.0.0.

include/evmc/evmc.h Outdated Show resolved Hide resolved
include/evmc/evmc.h Outdated Show resolved Hide resolved
@chfast
Copy link
Member Author

chfast commented Sep 11, 2018

ABI stays v6?

I think there are still some changes. I will compare later on wit v5.0.0.

Oh, you mean it should be v7? No, we bump it after the previous release if breaking changes are planned and it stays 6 until 6.0.0 is released.

@chfast chfast merged commit adbe01c into master Sep 17, 2018
@chfast chfast deleted the simplify-host branch September 17, 2018 08:59
* @return The storage value at the given storage key or null bytes
* if the account does not exist.
*/
typedef evmc_bytes32 (*evmc_get_storage_fn)(struct evmc_context* context,
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sold this change makes sense.

I can agree with the account lookups, but storage is different.

Copy link
Member Author

Choose a reason for hiding this comment

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

I partly agree, but also this case is exotic at the moment.
I can do the following for now:

  • extract this commit to a separate PR for a reference (not to be merge soon),
  • add a comment to evmc_get_storage_fn and evmc_set_storage_fn that the account MUST exist.

/**
* An attempt to modify storage of an non-existing account.
*/
EVMC_STORAGE_NON_EXISTING_ACCOUNT = 5
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

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.

3 participants