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

Off-Chain Executor #5

Merged
merged 28 commits into from
Sep 17, 2018
Merged

Off-Chain Executor #5

merged 28 commits into from
Sep 17, 2018

Conversation

troggy
Copy link
Member

@troggy troggy commented Jul 22, 2018

#2

Reference:
https://ethervm.io
https://github.com/trailofbits/evm-opcodes
https://ethereum.github.io/yellowpaper/paper.pdf

Code:

execute and stop:

  • export stack
  • export memory
  • export account balances
  • export storage
  • export logs
  • export return data

init and execute:

  • init program counter
  • init stack
  • init memory
  • init account balances
  • init storage
  • init logs
  • init return data

Test cases:

  • Stack only opcodes (ADD, MUL, SUB, DIV, SDIV, MOD, SMOD, ADDMOD, MULMOD, EXP, SIGNEXTEND, SHL, SHR, SAR, LT, GT, SLT, SGT, EQ, ISZERO, AND, OR, XOR, NOT, BYTE, POP, DUP, SWAP)
  • Context and stack opcodes (ADDRESS, BALANCE, ORIGIN, CALLER, CALLVALUE, GASPRICE, BLOCKHASH, COINBASE, TIMESTAMP, NUMBER, DIFFICULTY, GASLIMIT, JUMP, JUMPI, PC, GAS, RETURNDATASIZE)
  • Code and stack opcodes (CODELOAD, CODESIZE, PUSH1 - PUSH32)
  • Data and stack (CALLDATALOAD, CALLDATASIZE)
  • Memory and stack (MLOAD, MSTORE, MSTORE8, MSIZE)
  • Storage and stack (SSTORE, SLOAD)
  • Context, stack and memory type OP-codes (LOG)
  • Data, stack and memory type OP-codes (CALLDATACOPY)
  • Code, stack and memory type OP-codes (CODECOPY)
  • Return, Stack and Memory type OP-codes (RETURN, REVENT, RETURNDATACOPY)

@troggy troggy changed the title WIP: On-Chain Executor WIP: Off-Chain Executor Jul 22, 2018
@troggy troggy force-pushed the feature/off-chain-execution branch from 91c608c to 8e95957 Compare July 28, 2018 12:26
@troggy
Copy link
Member Author

troggy commented Jul 28, 2018

rebased

@troggy troggy force-pushed the feature/off-chain-execution branch from 8e95957 to c60ebf7 Compare August 3, 2018 18:21
@jdkanani
Copy link

jdkanani commented Aug 5, 2018

👍

@troggy troggy mentioned this pull request Aug 10, 2018
@pinkiebell pinkiebell mentioned this pull request Aug 22, 2018
troggy and others added 4 commits August 22, 2018 13:02
we are testing just one opcode execution, so gasUsed in these test will always show only gas price for a single opcode disregarding the code size
* Initial gas metering

Fixes #1 Depends on #5

* gas metering: check gas earlier in the loop & fix/add additional tests
@troggy troggy changed the title WIP: Off-Chain Executor Off-Chain Executor Sep 8, 2018
@troggy troggy requested a review from johannbarbie September 8, 2018 13:05
@@ -0,0 +1,13 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

remove?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@troggy troggy merged commit 1e5cc6c into master Sep 17, 2018
@troggy troggy deleted the feature/off-chain-execution branch September 17, 2018 11:32
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

Successfully merging this pull request may close these issues.

4 participants