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

Add scratchpad to evmc_result #414

Open
chfast opened this issue Aug 22, 2019 · 0 comments
Open

Add scratchpad to evmc_result #414

chfast opened this issue Aug 22, 2019 · 0 comments

Comments

@chfast
Copy link
Member

chfast commented Aug 22, 2019

The current size of evmc_result is 64 bytes. There also exists additional API https://github.com/ethereum/evmc/blob/master/include/evmc/helpers.h#L211 that allows to use last 24 bytes for other purposed in case .create_address is not used. This allows to put a well implemented std::vector there.

I propose to remove such usage. Using unions and same fields for different purposed seems to risky. Instead, we should add 64 bytes of scratchpad in the end. This will allow current optimizations (memory stealing) but also using the space for short outputs. I expect in practice the most common output size is 32 for solidity methods returning uint256. Then outputs of size <= 64 can be copied directly to evmc_result's scratch pad.

The problem will get complicated with #413 where additional int64_t field must be added to evmc_result.

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

No branches or pull requests

1 participant