Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #544 from EOSIO/merge-release-1.9.2-to-master
Browse files Browse the repository at this point in the history
Version 1.9.2
  • Loading branch information
b1bart committed Dec 16, 2020
2 parents f6578c4 + 5101ded commit d7bc0a5
Show file tree
Hide file tree
Showing 43 changed files with 2,401 additions and 746 deletions.
12 changes: 6 additions & 6 deletions .cicd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eo pipefail
. ./.cicd/helpers/general.sh
. ./.cicd/helpers/dependency-info.sh
mkdir -p $BUILD_DIR
DOCKER_IMAGE=${DOCKER_IMAGE:-eosio/ci-contracts-builder:base-ubuntu-18.04-$EOSIO_COMMIT}
DOCKER_IMAGE=${DOCKER_IMAGE:-eosio/ci-contracts-builder:base-ubuntu-18.04-$SANITIZED_EOSIO_VERSION}
if [[ "$BUILDKITE" == 'true' ]]; then
buildkite-agent meta-data set cdt-url "$CDT_URL"
buildkite-agent meta-data set cdt-version "$CDT_VERSION"
Expand All @@ -16,15 +16,15 @@ else
fi
ARGS=${ARGS:-"--rm -v $(pwd):$MOUNTED_DIR"}
CDT_COMMANDS="dpkg -i $MOUNTED_DIR/eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/\\\$(ls /usr/opt/eosio.cdt/)/bin:\\\$PATH"
PRE_COMMANDS="$CDT_COMMANDS && cd $MOUNTED_DIR/build"
PRE_COMMANDS="$CDT_COMMANDS && cd /root/eosio/ && printf \\\"EOSIO commit: \\\$(git rev-parse --verify HEAD). Click \033]1339;url=https://github.com/EOSIO/eos/commit/\\\$(git rev-parse --verify HEAD);content=here\a for details.\n\\\" && cd $MOUNTED_DIR/build"
BUILD_COMMANDS="cmake -DBUILD_TESTS=true .. && make -j $JOBS"
COMMANDS="$PRE_COMMANDS && $BUILD_COMMANDS"
# Test CDT binary download to prevent failures due to eosio.cdt pipeline.
INDEX='1'
echo "$ curl -sSf $CDT_URL --output eosio.cdt.deb"
while ! $(curl -sSf $CDT_URL --output eosio.cdt.deb); do
echo "ERROR: Expected CDT binary for commit ${CDT_COMMIT:0:7} from $CDT_VERSION. It does not exist at $CDT_URL!"
printf "There must be a successful build against ${CDT_COMMIT:0:7} \033]1339;url=https://buildkite.com/EOSIO/eosio-dot-cdt/builds?commit=$CDT_COMMIT;content=here\a for this package to exist.\n"
echo "ERROR: Expected CDT binary for commit ${CDT_COMMIT} from $CDT_VERSION. It does not exist at $CDT_URL!"
printf "There must be a successful build against ${CDT_COMMIT} \033]1339;url=https://buildkite.com/EOSIO/eosio-dot-cdt/builds?commit=$CDT_COMMIT;content=here\a for this package to exist.\n"
echo "Attempt $INDEX, retry in 60 seconds..."
echo ''
INDEX=$(( $INDEX + 1 ))
Expand All @@ -34,8 +34,8 @@ done
INDEX='1'
echo "$ docker pull $DOCKER_IMAGE"
while [[ "$(docker pull $DOCKER_IMAGE 2>&1 | grep -ice "manifest for $DOCKER_IMAGE not found")" != '0' ]]; do
echo "ERROR: Docker image \"$DOCKER_IMAGE\" not found for eosio commit ${EOSIO_COMMIT:0:7} from \"$EOSIO_VERSION\""'!'
printf "There must be a successful build against ${EOSIO_COMMIT:0:7} \033]1339;url=https://buildkite.com/EOSIO/eosio/builds?commit=$EOSIO_COMMIT;content=here\a for this container to exist.\n"
echo "ERROR: Docker image \"$DOCKER_IMAGE\" not found for eosio \"$EOSIO_VERSION\""'!'
printf "There must be a successful build against ${EOSIO_VERSION} \033]1339;url=${EOSIO_BK_URL};content=here\a for this container to exist.\n"
echo "Attempt $INDEX, retry in 60 seconds..."
echo ''
INDEX=$(( $INDEX + 1 ))
Expand Down
10 changes: 8 additions & 2 deletions .cicd/helpers/dependency-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if [[ -f "$RAW_PIPELINE_CONFIG" ]]; then
cat "$RAW_PIPELINE_CONFIG" | grep -Po '^[^"/]*("((?<=\\).|[^"])*"[^"/]*)*' | jq -c .\"eosio-dot-contracts\" > "$PIPELINE_CONFIG"
CDT_VERSION=$(cat "$PIPELINE_CONFIG" | jq -r '.dependencies."eosio.cdt"')
EOSIO_VERSION=$(cat "$PIPELINE_CONFIG" | jq -r '.dependencies.eosio')
SANITIZED_EOSIO_VERSION=$(echo $EOSIO_VERSION | sed 's/\//\_/')
else
echo 'ERROR: No pipeline configuration file or dependencies file found!'
exit 1
Expand All @@ -29,6 +30,11 @@ else
EOSIO_COMMIT=$(git rev-parse --verify HEAD)
cd ..
fi
echo "Using eosio ${EOSIO_COMMIT:0:7} from \"$EOSIO_VERSION\"..."
echo "Using cdt ${CDT_COMMIT:0:7} from \"$CDT_VERSION\"..."
if [[ "$EOSIO_COMMIT" == "$EOSIO_VERSION" ]]; then
EOSIO_BK_URL="https://buildkite.com/EOSIO/eosio/builds?commit=${EOSIO_COMMIT}"
else
EOSIO_BK_URL="https://buildkite.com/EOSIO/eosio/builds?branch=${EOSIO_VERSION}"
fi
echo "Using eosio \"$EOSIO_VERSION\"..."
echo "Using cdt ${CDT_COMMIT} from \"$CDT_VERSION\"..."
export CDT_URL="https://eos-public-oss-binaries.s3-us-west-2.amazonaws.com/${CDT_COMMIT:0:7}-eosio.cdt-ubuntu-18.04_amd64.deb"
3 changes: 2 additions & 1 deletion .cicd/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$BUILDKITE" == 'true' ]]; then
DOCKER_IMAGE="$(buildkite-agent meta-data get docker-image)"
else # Actions
. ./.cicd/helpers/dependency-info.sh
DOCKER_IMAGE=${DOCKER_IMAGE:-eosio/ci-contracts-builder:base-ubuntu-18.04-$EOSIO_COMMIT}
DOCKER_IMAGE=${DOCKER_IMAGE:-eosio/ci-contracts-builder:base-ubuntu-18.04-$SANITIZED_EOSIO_VERSION}
fi
ARGS=${ARGS:-"--rm -v $(pwd):$MOUNTED_DIR"}
CDT_COMMANDS="dpkg -i $MOUNTED_DIR/eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/$CDT_VERSION/bin:\\\$PATH"
Expand All @@ -18,6 +18,7 @@ TEST_COMMANDS="ctest -j $JOBS --output-on-failure -T Test"
COMMANDS="$PRE_COMMANDS && $TEST_COMMANDS"
curl -sSf $CDT_URL --output eosio.cdt.deb
set +e
echo "docker run $ARGS $(buildkite-intrinsics) $DOCKER_IMAGE bash -c \"$COMMANDS\""
eval docker run $ARGS $(buildkite-intrinsics) $DOCKER_IMAGE bash -c \"$COMMANDS\"
EXIT_STATUS=$?
# buildkite
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
name: Pull Request
on: [pull_request]

jobs:
start-job:
name: Start Job
runs-on: ubuntu-latest
steps:
- name: Start Job.
run: echo "PR created. Builds will be triggered here for forked PRs or Buildkite for internal PRs."

env:
PR_NUMBER: ${{ toJson(github.event.number) }}

jobs:
ubuntu-1804-build:
if: github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id
name: Ubuntu 18.04 | Build
runs-on: ubuntu-latest
needs: start-job
steps:
- name: Checkout
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
with:
submodules: recursive
run: |
git clone https://github.com/${GITHUB_REPOSITORY} .
git fetch -v --prune origin +refs/pull/${PR_NUMBER}/merge:refs/remotes/pull/${PR_NUMBER}/merge
git checkout --force --progress refs/remotes/pull/${PR_NUMBER}/merge
git submodule sync --recursive
git submodule update --init --force --recursive
- name: Build
run: |
./.cicd/build.sh
Expand All @@ -35,9 +32,12 @@ jobs:
needs: ubuntu-1804-build
steps:
- name: Checkout
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
with:
submodules: recursive
run: |
git clone https://github.com/${GITHUB_REPOSITORY} .
git fetch -v --prune origin +refs/pull/${PR_NUMBER}/merge:refs/remotes/pull/${PR_NUMBER}/merge
git checkout --force --progress refs/remotes/pull/${PR_NUMBER}/merge
git submodule sync --recursive
git submodule update --init --force --recursive
- name: Download Build Artifact
uses: actions/download-artifact@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(eosio_contracts)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 9)
set(VERSION_PATCH 1)
set(VERSION_PATCH 2)
#set(VERSION_SUFFIX rc4)

if (VERSION_SUFFIX)
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# eosio.contracts

## Version : 1.9.1
## Version : 1.9.2

The design of the EOSIO blockchain calls for a number of smart contracts that are run at a privileged permission level in order to support functions such as block producer registration and voting, token staking for CPU and network bandwidth, RAM purchasing, multi-sig, etc. These smart contracts are referred to as the bios, system, msig, wrap (formerly known as sudo) and token contracts.

Expand All @@ -16,9 +16,11 @@ The following unprivileged contract(s) are also part of the system.

Dependencies:
* [eosio.cdt v1.7.x](https://github.com/EOSIO/eosio.cdt/releases/tag/v1.7.0)
* [eosio v2.0.x](https://github.com/EOSIO/eos/releases/tag/v2.0.1) (optional dependency only needed to build unit tests)
* [eosio v2.0.x](https://github.com/EOSIO/eos/releases/tag/v2.0.8) (optional dependency only needed to build unit tests)

To build the contracts follow the instructions in [`Build and deploy` section](./docs/02_build-and-deploy.md).
## Build

To build the contracts follow the instructions in [Build and deploy](https://developers.eos.io/manuals/eosio.contracts/latest/build-and-deploy) section.

## Contributing

Expand Down
26 changes: 5 additions & 21 deletions contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@
#include <eosio/privileged.hpp>
#include <eosio/producer_schedule.hpp>

/**
* EOSIO Contracts
*
* The design of the EOSIO blockchain calls for a number of smart contracts that are run at a
* privileged permission level in order to support functions such as block producer registration and
* voting, token staking for CPU and network bandwidth, RAM purchasing, multi-sig, etc. These smart
* contracts are referred to as the system, token, msig and wrap (formerly known as sudo) contracts.
*
* This repository contains examples of these privileged contracts that are useful when deploying,
* managing, and/or using an EOSIO blockchain. They are provided for reference purposes:
* - eosio.bios
* - eosio.system
* - eosio.msig
* - eosio.wrap
*
* The following unprivileged contract(s) are also part of the system.
* - eosio.token
*/

namespace eosiobios {

using eosio::action_wrapper;
Expand Down Expand Up @@ -85,6 +66,11 @@ namespace eosiobios {
(schedule_version)(new_producers))
};

/**
* The `eosio.bios` is the first sample of system contract provided by `block.one` through the EOSIO platform. It is a minimalist system contract because it only supplies the actions that are absolutely critical to bootstrap a chain and nothing more. This allows for a chain agnostic approach to bootstrapping a chain.
*
* Just like in the `eosio.system` sample contract implementation, there are a few actions which are not implemented at the contract level (`newaccount`, `updateauth`, `deleteauth`, `linkauth`, `unlinkauth`, `canceldelay`, `onerror`, `setabi`, `setcode`), they are just declared in the contract so they will show in the contract's ABI and users will be able to push those actions to the chain via the account holding the `eosio.system` contract, but the implementation is at the EOSIO core level. They are referred to as EOSIO native actions.
*/
class [[eosio::contract("eosio.bios")]] bios : public eosio::contract {
public:
using contract::contract;
Expand Down Expand Up @@ -182,8 +168,6 @@ namespace eosiobios {
[[eosio::action]]
void setcode( name account, uint8_t vmtype, uint8_t vmversion, const std::vector<char>& code ) {}

/** @}*/

/**
* Set abi action sets the abi for contract identified by `account` name. Creates an entry in the abi_hash_table
* index, with `account` name as key, if it is not already present and sets its value with the abi hash.
Expand Down
14 changes: 8 additions & 6 deletions contracts/eosio.msig/include/eosio.msig/eosio.msig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
#include <eosio/transaction.hpp>

namespace eosio {

/**
* @defgroup eosiomsig eosio.msig
* @ingroup eosiocontracts
* eosio.msig contract defines the structures and actions needed to manage the proposals and approvals on blockchain.
* @{
* The `eosio.msig` system contract allows for creation of proposed transactions which require authorization from a list of accounts, approval of the proposed transactions by those accounts required to approve it, and finally, it also allows the execution of the approved transactions on the blockchain.
*
* In short, the workflow to propose, review, approve and then executed a transaction it can be described by the following:
* - first you create a transaction json file,
* - then you submit this proposal to the `eosio.msig` contract, and you also insert the account permissions required to approve this proposal into the command that submits the proposal to the blockchain,
* - the proposal then gets stored on the blockchain by the `eosio.msig` contract, and is accessible for review and approval to those accounts required to approve it,
* - after each of the appointed accounts required to approve the proposed transactions reviews and approves it, you can execute the proposed transaction. The `eosio.msig` contract will execute it automatically, but not before validating that the transaction has not expired, it is not cancelled, and it has been signed by all the permissions in the initial proposal's required permission list.
*/
class [[eosio::contract("eosio.msig")]] multisig : public contract {
public:
Expand Down Expand Up @@ -156,5 +159,4 @@ namespace eosio {

typedef eosio::multi_index< "invals"_n, invalidation > invalidations;
};
/** @}*/ // end of @defgroup eosiomsig eosio.msig
} /// namespace eosio
11 changes: 11 additions & 0 deletions contracts/eosio.system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ add_contract(eosio.system eosio.system
${CMAKE_CURRENT_SOURCE_DIR}/src/eosio.system.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/delegate_bandwidth.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/exchange_state.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/name_bidding.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/native.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/producer_pay.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/powerup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rex.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/voting.cpp
)
Expand All @@ -18,15 +20,24 @@ set_target_properties(eosio.system
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")

add_contract(rex.results rex.results ${CMAKE_CURRENT_SOURCE_DIR}/src/rex.results.cpp)
add_contract(powup.results powup.results ${CMAKE_CURRENT_SOURCE_DIR}/src/powerup.results.cpp)

target_include_directories(rex.results
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)

target_include_directories(powup.results
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)

set_target_properties(rex.results
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.rex")

set_target_properties(powup.results
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.powerup")

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ricardian/eosio.system.contracts.md.in ${CMAKE_CURRENT_BINARY_DIR}/ricardian/eosio.system.contracts.md @ONLY )

target_compile_options( eosio.system PUBLIC -R${CMAKE_CURRENT_SOURCE_DIR}/ricardian -R${CMAKE_CURRENT_BINARY_DIR}/ricardian )
Loading

0 comments on commit d7bc0a5

Please sign in to comment.