Skip to content

Commit

Permalink
add fvm fork from eos-vm
Browse files Browse the repository at this point in the history
  • Loading branch information
findbug2019 committed Sep 20, 2019
1 parent 5c282ee commit a8c4de3
Show file tree
Hide file tree
Showing 2,401 changed files with 30,514 additions and 0 deletions.
133 changes: 133 additions & 0 deletions processor/fvm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# ##################################################################################################
# Defines the eos-vm library and associated tooling. See docs/cmake.md for instructions on how to
# build eos-vm or integrate with another system with CMake.
# ##################################################################################################
cmake_minimum_required(VERSION 3.8)
set(VERSION_MAJOR 1)
set(VERSION_MINOR 0)
set(VERSION_PATCH 0)
set(VERSION_SUFFIX rc1)
project(eos-vm VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})

if (VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
else()
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
endif()

message(STATUS "Building eos-vm v${VERSION_FULL}...")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads)
link_libraries(Threads::Threads)

# ##################################################################################################
# Defined options for building or integrating eos-vm.
# ##################################################################################################
include(CMakeDependentOption)
option(ENABLE_SOFTFLOAT "enable the backend to use deterministic software floating point operations"
ON)
option(FULL_DEBUG_BUILD "enables stack dumping and instruction tracing" OFF)
option(ENABLE_INSTALL "enable this library to be installed" ON)
option(ENABLE_MEMORY_OPS_ALIGNMENT "enable the backend to obey alignment hints" OFF)
option(ENABLE_TOOLS "enable building of tools" ON)
option(ENABLE_TESTS "enable building of unit tests, spec tests" ON)
cmake_dependent_option(ENABLE_FUZZ_TESTS "enable fuzz testing" OFF "ENABLE_TESTS" ON)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/modules")
include(EosVMBuildUtils)

# ##################################################################################################
# Create the eos-vm library.
# ##################################################################################################
add_library(eos-vm INTERFACE)
target_include_directories(eos-vm
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/external/softfloat/source/include
${CMAKE_CURRENT_SOURCE_DIR}/external/outcome/single-header)

# ##################################################################################################
# Enable debugging stats for eos-vm.
# ##################################################################################################
if(FULL_DEBUG_BUILD)
target_compile_definitions(eos-vm INTERFACE -DEOS_VM_FULL_DEBUG)
endif()

# ##################################################################################################
# Option specific build configurations.
# ##################################################################################################
if(ENABLE_SOFTFLOAT)
if(NOT TARGET softfloat)
add_subdirectory(external)
endif()
target_compile_definitions(eos-vm INTERFACE -DEOS_VM_SOFTFLOAT)
target_link_libraries(eos-vm INTERFACE softfloat)
endif()

if(NOT USE_EXISTING_BOOST)
target_compile_definitions(eos-vm INTERFACE -DEOS_VM_USE_EXTERNAL_OUTCOME)
add_subdirectory(external/outcome)
endif()

if(ENABLE_MEMORY_OPS_ALIGNMENT)
target_compile_definitions(eos-vm INTERFACE -DEOS_VM_ALIGN_MEMORY_OPS)
endif()

# ##################################################################################################
# Build eos-vm tools.
# ##################################################################################################
if(ENABLE_TOOLS)
add_subdirectory(tools)
endif()

# ##################################################################################################
# Build eos-vm tests.
# ##################################################################################################
if(ENABLE_TESTS)
include(CTest)
set(CATCH_BUILD_TESTING OFF CACHE BOOL "disable building tests")
set(CATCH_INSTALL_DOCS OFF CACHE BOOL "disable installing docs")
set(CATCH_INSTALL_HELPERS OFF CACHE BOOL "disable installing helpers")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/Catch2)
include(external/Catch2/contrib/Catch.cmake)
add_subdirectory(tests)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/wasms)
include(ExternalProject)
ExternalProject_Add(
eos_vm_test_wasms
GIT_REPOSITORY "https://github.com/EOSIO/eos-vm-test-wasms.git"
SOURCE_DIR ${CMAKE_BINARY_DIR}/wasms
BINARY_DIR ${CMAKE_BINARY_DIR}/wasms
BUILD_ALWAYS 0
BUILD_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ""
)
endif()
endif()

# ##################################################################################################
# Installation.
# ##################################################################################################
if(ENABLE_INSTALL)
include(GNUInstallDirs)
message(STATUS "Installing...")
install(TARGETS eos-vm
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Libraries
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT Headers)

install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/eosio
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()

148 changes: 148 additions & 0 deletions processor/fvm/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Contributing to EOS-VM

Interested in contributing? That's awesome! Here are some guidelines to get started quickly and easily:

- [Reporting An Issue](#reporting-an-issue)
- [Bug Reports](#bug-reports)
- [Feature Requests](#feature-requests)
- [Change Requests](#change-requests)
- [Working on EOS-VM](#working-on-eos-vm)
- [Feature Branches](#feature-branches)
- [Submitting Pull Requests](#submitting-pull-requests)
- [Testing and Quality Assurance](#testing-and-quality-assurance)
- [Conduct](#conduct)
- [Contributor License & Acknowledgments](#contributor-license--acknowledgments)
- [References](#references)

## Reporting An Issue

If you're about to raise an issue because you think you've found a problem with EOS-VM, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first.

The GitHub issue tracker is the preferred channel for [bug reports](#bug-reports), [feature requests](#feature-requests), and [submitting pull requests](#submitting-pull-requests), but please respect the following restrictions:

* Please **search for existing issues**. Help us keep duplicate issues to a minimum by checking to see if someone has already reported your problem or requested your idea.

* Please **be civil**. Keep the discussion on topic and respect the opinions of others. See also our [Contributor Code of Conduct](#conduct).

### Bug Reports

A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

1. **Use the GitHub issue search** — check if the issue has already been
reported.

1. **Check if the issue has been fixed** — look for [closed issues in the
current milestone](https://github.com/EOSIO/eos-vm/issues?q=is%3Aissue+is%3Aclosed) or try to reproduce it
using the latest `develop` branch.

A good bug report shouldn't leave others needing to chase you up for more information. Be sure to include the details of your environment and relevant tests that demonstrate the failure.

[Report a bug](https://github.com/EOSIO/eos-vm/issues/new?title=Bug%3A)

### Feature Requests

Feature requests are welcome. Before you submit one be sure to have:

1. **Use the GitHub search** and check the feature hasn't already been requested.
1. Take a moment to think about whether your idea fits with the scope and aims of the project.
1. Remember, it's up to *you* to make a strong case to convince the project's leaders of the merits of this feature. Please provide as much detail and context as possible, this means explaining the use case and why it is likely to be common.

### Change Requests

Change requests cover both architectural and functional changes to how EOS-VM works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to:

1. **Use the GitHub search** and check someone else didn't get there first
1. Take a moment to think about the best way to make a case for, and explain what you're thinking. Are you sure this shouldn't really be
a [bug report](#bug-reports) or a [feature request](#feature-requests)? Is it really one idea or is it many? What's the context? What problem are you solving? Why is what you are suggesting better than what's already there?

## Working on EOS-VM

Code contributions are welcome and encouraged! If you are looking for a good place to start, check out the [good first issue](https://github.com/EOSIO/eos-vm/labels/good%20first%20issue) label in GitHub issues.

Also, please follow these guidelines when submitting code:

### Feature Branches

To get it out of the way:

- **[develop](https://github.com/EOSIO/eos-vm/tree/develop)** is the development branch. All work on the next release happens here so you should generally branch off `develop`. Do **NOT** use this branch for a production site.
- **[master](https://github.com/EOSIO/eos-vm/tree/master)** contains the latest release of EOS-VM. This branch may be used in production. Do **NOT** use this branch to work on EOS-VM's source.

### Submitting Pull Requests

*Not yet licensed as OSS and not ready for PRs.* Please [raise an issue](#reporting-an-issue) for now, especially if you find a bug. Later, this makes it more likely that there will be enough information available for later PRs to be properly investigated, tested, and merged.

### Testing and Quality Assurance

Never underestimate just how useful quality assurance is. If you're looking to get involved with the code base and don't know where to start, checking out and testing a pull request is one of the most useful things you could do.

Essentially, [check out the latest develop branch](#working-on-eos-vm), take it for a spin, and if you find anything odd, please follow the [bug report guidelines](#bug-reports) and let us know!

## Conduct

While contributing, please be respectful and constructive, so that participation in our project is a positive experience for everyone.

Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Contributor License & Acknowledgments

Whenever you make a contribution to this project, you license your contribution under the same terms as set out in LICENSE, and you represent and warrant that you have the right to license your contribution under those terms. Whenever you make a contribution to this project, you also certify in the terms of the Developer’s Certificate of Origin set out below:

```
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

## References

* Overall CONTRIB adapted from https://github.com/mathjax/MathJax/blob/master/CONTRIBUTING.md
* Conduct section adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
1 change: 1 addition & 0 deletions processor/fvm/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (c) 2018-2019 block.one and its contributors. All rights reserved.
Loading

0 comments on commit a8c4de3

Please sign in to comment.