All Projects → kframework → Evm Semantics

kframework / Evm Semantics

Licence: other
K Semantics of the Ethereum Virtual Machine (EVM)

Labels

Projects that are alternatives of or similar to Evm Semantics

Optware Ng
Stars: ✭ 253 (-8%)
Mutual labels:  makefile
Docker To Linux
Make bootable Linux disk image abusing Docker
Stars: ✭ 257 (-6.55%)
Mutual labels:  makefile
Cookiecutter Docker Science
Cookiecutter template for data scientists working with Docker containers
Stars: ✭ 267 (-2.91%)
Mutual labels:  makefile
Face recognition models
Trained models for the face_recognition python library
Stars: ✭ 254 (-7.64%)
Mutual labels:  makefile
React Native Snippets
✏️ A collection of React Native snippets for Sublime Text and Atom
Stars: ✭ 257 (-6.55%)
Mutual labels:  makefile
Arm Eabi Toolchain
Makefile & supporting patches/scripts to build a bare metal ARM EABI toolchain.
Stars: ✭ 259 (-5.82%)
Mutual labels:  makefile
Aosp build
AOSP Build system compatible version of Open GApps
Stars: ✭ 250 (-9.09%)
Mutual labels:  makefile
Hellogopher
Makefile to build a Go project
Stars: ✭ 273 (-0.73%)
Mutual labels:  makefile
Poudriere
Port/Package build and test system
Stars: ✭ 257 (-6.55%)
Mutual labels:  makefile
Android device oneplus bacon
Stars: ✭ 267 (-2.91%)
Mutual labels:  makefile
Packages
Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
Stars: ✭ 2,957 (+975.27%)
Mutual labels:  makefile
Ricing
a book about ricing unix-like systems
Stars: ✭ 257 (-6.55%)
Mutual labels:  makefile
Lmnplayer
完整版的ijkplayer,现在自己改一下
Stars: ✭ 263 (-4.36%)
Mutual labels:  makefile
Go Makefile Example
Example Makefile for Go projects
Stars: ✭ 254 (-7.64%)
Mutual labels:  makefile
Packpack
Simple building of RPMs & Debian packages from git repos
Stars: ✭ 269 (-2.18%)
Mutual labels:  makefile
Learning Nodejs
Project for learning Node.js internals
Stars: ✭ 244 (-11.27%)
Mutual labels:  makefile
Sshb0t
A bot for keeping your ssh authorized_keys up to date with user's GitHub keys, **only** use if you enable 2FA & keep your keys updates.
Stars: ✭ 260 (-5.45%)
Mutual labels:  makefile
Picture In Picture
Picture-in-Picture (PiP)
Stars: ✭ 275 (+0%)
Mutual labels:  makefile
Routeros Scripts
a collection of scripts for Mikrotik RouterOS
Stars: ✭ 270 (-1.82%)
Mutual labels:  makefile
Displaylink Rpm
RPM sources for the DisplayLink USB display adapters
Stars: ✭ 266 (-3.27%)
Mutual labels:  makefile

KEVM: Semantics of EVM in K

In this repository we provide a model of the EVM in K.

Documentation/Support

These may be useful for learning KEVM and K (newest to oldest):

To get support for KEVM, please join our Riot Room.

Repository Structure

The following files constitute the KEVM semantics:

  • network.md provides the status codes which are reported to an Ethereum client on execution exceptions.
  • json-rpc.md is an implementation of JSON RPC in K.
  • evm-types.md provides the (functional) data of EVM (256 bit words, wordstacks, etc...).
  • serialization.md provides helpers for parsing and unparsing data (hex strings, recursive-length prefix, merkle trees, etc.).
  • evm.md is the main KEVM semantics, containing the configuration and transition rules of EVM.

These additional files extend the semantics to make the repository more useful:

  • buf.md defines the #buf byte-buffer abstraction for use during symbolic execution.
  • abi.md defines the Contract ABI Specification for use in proofs and easy contract/function specification.
  • hashed-locations.md defines the #hashedLocation abstraction which makes it easier to specify Solidity-generate storage layouts.
  • edsl.md combines the previous three abstractions for ease-of-use.
  • state-loader.md provides functionality for EVM initialization and setup.
  • driver.md is an execution harness for KEVM, providing a simple language for describing tests/programs.

Installing/Building

K Backends

There are three backends of K available: LLVM (default) for concrete execution and Java (default) and Haskell for symbolic execution. This repository generates the build-products for each backend in .build/defn/.

System Dependencies

The following are needed for building/running KEVM:

For the exact dependencies check the Dockerfile.

Ubuntu

On Ubuntu >= 18.04 (for example):

sudo apt-get install --yes                                                       \
            autoconf bison clang-8 cmake curl flex gcc jq libboost-test-dev      \
            libcrypto++-dev libffi-dev libgflags-dev libjemalloc-dev libmpfr-dev \
            libprocps-dev libsecp256k1-dev libssl-dev libtool libyaml-dev        \
            lld-8 llvm-8-tools make maven netcat-openbsd openjdk-11-jdk          \
            pkg-config python3 python-pygments python-recommonmark               \
            python-sphinx rapidjson-dev time z3 zlib1g-dev

On Ubuntu < 18.04, you'll need to skip libsecp256k1-dev and instead build it from source (via our Makefile):

make libsecp256k1

Arch Linux

On ArchLinux:

sudo pacman -S                                               \
    base base-devel boost clang cmake crypto++ curl git gmp  \
    gflags jdk-openjdk jemalloc libsecp256k1 lld llvm maven  \
    mpfr python stack yaml-cpp z3 zlib

In addition, you'll need the glog-git AUR package: https://aur.archlinux.org/packages/glog-git/.

MacOS

On OSX, using Homebrew, after installing the command line tools package:

brew tap homebrew/cask
brew install --cask java
brew install automake libtool gmp mpfr pkg-config maven z3 libffi openssl python
make libsecp256k1

NOTE: a previous version of these instructions required the user to run brew link flex --force. After fetching this revision, you should first run brew unlink flex, as it is no longer necessary and will cause an error if you have the homebrew version of flex installed instead of the xcode command line tools version.

Haskell Stack (all platforms)

  • Haskell Stack. Note that the version of the stack tool provided by your package manager might not be recent enough. Please follow installation instructions from the Haskell Stack website linked above.

To upgrade stack (if needed):

stack upgrade
export PATH=$HOME/.local/bin:$PATH

Build Dependencies

K Framework

The Makefile and kevm will work with either a (i) globally installed K, or (ii) a K submodule included in this repository. If you want to use the K submodule, follow these instructions get the submodule and build K:

git submodule update --init --recursive -- deps/k
make k-deps

If you don't need either the LLVM or Haskell backend, there are flags to skip them:

make k-deps SKIP_LLVM=true SKIP_HASKELL=true

Blockchain Plugin

You also need to get the blockchain plugin submodule and install it.

git submodule update --init --recursive -- deps/plugin
make plugin-deps

Building

Finally, you can build the semantics.

make build

Example Usage

After building, make sure you setup PATH correctly:

export PATH=$(pwd)/.build/usr/bin:$PATH

After building the definition, you can run the definition using the kevm runner. You can call kevm help to get a quick summary of how to use the script.

Run the file tests/ethereum-tests/VMTests/vmArithmeticTest/add0.json:

kevm run tests/ethereum-tests/VMTests/vmArithmeticTest/add0.json --schedule DEFAULT --mode VMTESTS

To run proofs, you can similarly use kevm. For example, to prove one of the specifications:

kevm prove tests/specs/erc20/ds/transfer-failure-1-a-spec.k VERIFICATION

Running Tests

The tests are run using the supplied Makefile. First, run make split-tests to generate some of the tests from the markdown files.

The following subsume all other tests:

  • make test: All of the quick tests.
  • make test-all: All of the quick and slow tests.

These are the individual test-suites (all of these can be suffixed with -all to also run slow tests):

When running tests with the Makefile, you can specify the TEST_CONCRETE_BACKEND (for concrete tests), or TEST_SYMBOLIC_BACKEND (for proofs).

Media

This repository can build two pieces of documentation for you, the Jello Paper and the 2017 Devcon3 presentation.

System Dependencies

For the presentations in the media directory, you'll need pdflatex, commonly provided with texlive-full, and pandoc.

sudo apt install texlive-full pandoc

Building

To build all the PDFs (presentations and reports) available in the media/ directory, use:

make media

Resources

For more information about The K Framework, refer to these sources:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].