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

WIP: ECIP1045 Features #671

Closed
wants to merge 154 commits into from
Closed

WIP: ECIP1045 Features #671

wants to merge 154 commits into from

Conversation

whilei
Copy link
Contributor

@whilei whilei commented Sep 17, 2018

Rel ethereumproject/ECIPs#95

This branch is a work in progress. While most features (except EIP1283) have been implemented, still TODO is testing and review, including:

  • integration tests with documented contracts using OPCODES/pcontracts in question
  • code review and implementation comparison with Parity and SVM machines
  • regression test(s)
  • import @mersinvald 's handrolled JSON Byz+Const tests from SVM
  • refactor (places like exec2 are just plain ugly)
  • reconcile branch ecip1045-with-tests, which replaces /tests/ with ethereum/tests; this depends heavily on establishing correctness of those tests for ETC, fixing test generators/fillers

whilei added 30 commits August 20, 2018 10:27
solution:

since STATICCALL functions equivalently to CALL, use congruent behavior
to CALL during gas decision log switch statement
Includes a fix where signature had accepted 'value' param, and should not have
This should disallow state modificaation on StaticCall method, and if an
opcode is called that writes to the state layer, the vm should throw an exception

solution:
- implement IsReadOnly and SetReadOnly interface methods
- add field for opcode instruction regard whether or not it makes (or
can make) changes to state, eg LOG*, SSTORE, SUICIDE, and possibly CALL
returning a non-zero value.
solution: add placehold fn to satisfy interface
... it will cause confusion

solution: rename fork to ECIP1045
solution: this is handled in core/vm/vm.go conditional,
see comment there
solution: include congruent DELEGATECALL:STATICCALL tests
…face

(missing IsECIP1045 method)

solution: implement method as default
solution: implement IsECIP1045, IsReadOnly, and SetReadOnly methods
for associated RuleSet and VMEnv structs
solution: set in fn

Since STATICCALL and incoming OPCODES should only be activated after the
fork (and tests configured with envs after the fork), this number can be
safely set to 0
solution: refactor field to vm.Opcode#IsStateModifying
whilei and others added 29 commits October 11, 2018 11:55
…interface

solution: remove it

core.ChainConfig#IsEIP658 can still be used for implementation
- allows reuse of init_code keccak hash
- modifies Create2 unit tests for consistency with ETH
- moves spec tests (again) from crypto -> core/vm/
because this allows gas testing as well as expected
address hash val tests.
If PostState is present in RLP decoded Receipt (received from network),
we can't assume anything about transaction Status, so it should be set
to TxStatusUnknown.
Type of Status changed to from `byte` to `uint8` to emphasize that
it's a scalar.
Struct used in RLP encoding changed, so it can handle both `uint8`
(Status) and `[]byte` (PostState).
RLP decoding changed accordingly. Comment added.
solution: append 'Msg' to name to make clear why string
and not error type
This causes TestEIP658RLPRoundTrip2 to break.
solution: invalid returning of writer.Flush() causes EOF error
Ensures round trip RLP en/de-coder works for both empty (eg zero-value address) hash and
arbitrary value.
@soc1c soc1c closed this Jun 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants