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

Conversation

dominicletz
Copy link

This is a draft pull request to reference in EIP-2330: EXTSLOAD opcode

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

This is my first pull on aleth and changing the code was a bliss. Let me know if I did something obvious wrong here. Also I would like to include a test, how do you gus sync this with the remote test repo? Anything I can do there apart from local testing.

Thanks

@dominicletz
Copy link
Author

dominicletz commented Nov 5, 2019

The linux-clang6 test failed while gcc and xcode90 went through. In the clang6 build it falied in a network test:

663/749 Test #668: network/net/evictionWithOldNodeAnswering ..............................................................................***Failed    0.50 sec

For which I don't see how it could be related to my change. Is this test itself unstable?

@gumb0 gumb0 self-requested a review November 7, 2019 11:09
@gumb0
Copy link
Member

gumb0 commented Nov 7, 2019

Hi @dominicletz, thanks for interest in implementing your proposal in aleth!

Here are some comments:

  1. we have currently two versions of the interpreter, you've added your implementation to aleth-interpreter, but I would recommend to implement in LegacyVM, because it's somewhat simpler and allows to activate the EIP without fork definition/EVMC complications.
    It's in https://github.com/ethereum/aleth/blob/master/libevm/LegacyVM.cpp and the code is mostly similar to aleth-interpreter.
  2. You didn't define opcode's cost. This should be added to https://github.com/ethereum/aleth/blob/master/libevm/Instruction.cpp
  3. The way you defined it it's activated at genesis (so this breaks Frontier and all further fork rules). You should throw "unknown instruction" error if EIP is not activated. See for example how CHAINID does it.
  4. It would be best to support activation of this EIP similar to for example Move LegacyVM EIP-1380 implementation from Berlin to individual activation #5809
    Then we could merge it and you would be able to create the state tests for it using testeth.
  5. Tests repo is a submodule here at tests/jsontests, new consensus tests should go to subdirs there, but maybe they shouldn't be included in this PR.
  6. Some network/net tests are unstable, yes, ignore them for now.

@@ -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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants