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

Implement EIP-1153: Transient storage #669

Merged
merged 6 commits into from
Sep 2, 2023
Merged

Implement EIP-1153: Transient storage #669

merged 6 commits into from
Sep 2, 2023

Conversation

chfast
Copy link
Member

@chfast chfast commented Jun 29, 2023

EIP-1153: Transient storage opcodes
Add opcodes for manipulating state that behaves identically to storage but is discarded after every transaction

https://eips.ethereum.org/EIPS/eip-1153

@chfast chfast force-pushed the transient_storage branch 2 times, most recently from fe7c324 to 8ae3166 Compare August 20, 2023 17:16
@chfast chfast marked this pull request as ready for review August 20, 2023 17:27
@chfast chfast requested review from gumb0 and rodiazet August 20, 2023 17:27
lib/evmone/instructions.hpp Outdated Show resolved Hide resolved
@@ -119,6 +119,8 @@ constexpr bool instruction_only_in_evmone(evmc_revision rev, Opcode op) noexcept
case OP_DATALOADN:
case OP_DATASIZE:
case OP_DATACOPY:
case OP_TLOAD:
Copy link
Member

Choose a reason for hiding this comment

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

You could add them to EVMC already

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 stopped adding these to EVMC (e.g. MCOPY is missing). This seems double work with little benefits. Also EVMC instruction information is not directly usable by evmone because not constexpr.

What do you think about removing instructions from EVMC? This is a bit of work, but can be done.

Copy link
Member

Choose a reason for hiding this comment

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

Probably fine, if nobody uses them.

test/utils/bytecode.hpp Outdated Show resolved Hide resolved
@chfast chfast force-pushed the transient_storage branch 2 times, most recently from 1cbbeff to c7efc99 Compare August 23, 2023 13:11
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #669 (5da3bef) into master (503ec3c) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #669      +/-   ##
==========================================
+ Coverage   97.54%   97.56%   +0.01%     
==========================================
  Files          91       92       +1     
  Lines        8473     8535      +62     
==========================================
+ Hits         8265     8327      +62     
  Misses        208      208              
Flag Coverage Δ
blockchaintests 62.61% <0.00%> (-0.44%) ⬇️
statetests 73.45% <100.00%> (+0.17%) ⬆️
statetests-silkpre 22.64% <0.00%> (-0.19%) ⬇️
unittests 95.50% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
test/state/account.hpp 100.00% <ø> (ø)
test/state/host.hpp 100.00% <ø> (ø)
test/unittests/instructions_test.cpp 89.58% <ø> (ø)
lib/evmone/instructions.hpp 100.00% <100.00%> (ø)
test/state/host.cpp 93.03% <100.00%> (+0.25%) ⬆️
...ttests/state_transition_transient_storage_test.cpp 100.00% <100.00%> (ø)
test/utils/bytecode.hpp 95.96% <100.00%> (+0.11%) ⬆️

@gumb0
Copy link
Member

gumb0 commented Aug 28, 2023

Looks good to me, needs rebase.

@chfast chfast added the Cancun Changes for Cancun Ethereum spec revision label Sep 2, 2023
@chfast chfast force-pushed the transient_storage branch 2 times, most recently from d5c39ba to 13e210b Compare September 2, 2023 17:41
@chfast chfast force-pushed the transient_storage branch 2 times, most recently from 8410872 to e391fa6 Compare September 2, 2023 17:55
@chfast chfast merged commit 8867098 into master Sep 2, 2023
3 checks passed
@chfast chfast deleted the transient_storage branch September 2, 2023 18:11
@chfast chfast mentioned this pull request Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cancun Changes for Cancun Ethereum spec revision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants