Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

[WIP] EIP-2330 EXTSLOAD #5805

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [1.8.0] - Unreleased

- Added: [#XXXX](https://github.com/ethereum/aleth/pull/XXXX) EIP XXXX: EXTSLOAD opcode.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Added: [#XXXX](https://github.com/ethereum/aleth/pull/XXXX) EIP XXXX: EXTSLOAD opcode.
- Added: [#5805](https://github.com/ethereum/aleth/pull/5805) EIP 2330: EXTSLOAD opcode.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, this is great feedback, I'll make those changes.

Regarding LegacyVM.cpp vs interpreter VM.cpp I would like to understand more about their differences and future. Is there an origin story about them I can read up on?

Copy link
Member

Choose a reason for hiding this comment

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

Not much of a story - aleth-interpreter is the same code adapted to conform to EVMC API. We keep both for now, because EVMC does not yet support all of the features we need in EVM (like tracing and individual EIP activation)

- Added: [#5699](https://github.com/ethereum/aleth/pull/5699) EIP 2046: Reduced gas cost for static calls made to precompiles.
- Added: [#5752](https://github.com/ethereum/aleth/pull/5752) [#5753](https://github.com/ethereum/aleth/pull/5753) Implement EIP1380 (reduced gas costs for call-to-self).
- Removed: [#5760](https://github.com/ethereum/aleth/pull/5760) Official support for Visual Studio 2015 has been dropped. Compilation with this compiler is expected to stop working after migration to C++14.
Expand Down
12 changes: 12 additions & 0 deletions libaleth-interpreter/VM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,18 @@ void VM::interpretCases()
}
NEXT

CASE(EXTSLOAD)
{
ON_OP();
updateIOGas();

auto const address = intx::be::trunc<evmc::address>(m_SP[0]);
auto const key = intx::be::store<evmc_uint256be>(m_SP[1]);
m_SPP[0] =
intx::be::load<intx::uint256>(m_context->host->get_storage(m_context, &address, &key));
}
NEXT

CASE(INVALID)
DEFAULT
{
Expand Down
2 changes: 1 addition & 1 deletion libaleth-interpreter/VMConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace eth
&&MSIZE, \
&&GAS, \
&&JUMPDEST, \
&&BEGINDATA, \
&&EXTSLOAD, \
&&BEGINSUB, \
&&INVALID, \
&&INVALID, \
Expand Down
1 change: 1 addition & 0 deletions libevm/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ enum class Instruction : uint8_t
MSIZE, ///< get the size of active memory
GAS, ///< get the amount of available gas
JUMPDEST, ///< set a potential jump destination
EXTSLOAD, ///< load word from storage of another contract

PUSH1 = 0x60, ///< place 1 byte item on stack
PUSH2, ///< place 2 byte item on stack
Expand Down