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

Commit

Permalink
Merge pull request #8093 from EOSIO/merge-release-1.8.5-to-master
Browse files Browse the repository at this point in the history
Merge release 1.8.5 to master
  • Loading branch information
arhag authored Oct 17, 2019
2 parents 1252627 + 0a600a9 commit a2317d3
Show file tree
Hide file tree
Showing 21 changed files with 372 additions and 160 deletions.
21 changes: 11 additions & 10 deletions .cicd/generate-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -eo pipefail
export MOJAVE_ANKA_TAG_BASE=${MOJAVE_ANKA_TAG_BASE:-'clean::cicd::git-ssh::nas::brew::buildkite-agent'}
export MOJAVE_ANKA_TEMPLATE_NAME=${MOJAVE_ANKA_TEMPLATE_NAME:-'10.14.6_6C_14G_40G'}
export PLATFORMS_JSON_ARRAY='[]'

BUILDKITE_BUILD_AGENT_QUEUE='automation-eks-eos-builder-fleet'
BUILDKITE_TEST_AGENT_QUEUE='automation-eks-eos-tester-fleet'
# Determine if it's a forked PR and make sure to add git fetch so we don't have to git clone the forked repo's url
if [[ $BUILDKITE_BRANCH =~ ^pull/[0-9]+/head: ]]; then
PR_ID=$(echo $BUILDKITE_BRANCH | cut -d/ -f2)
Expand Down Expand Up @@ -110,7 +111,7 @@ echo $PLATFORMS_JSON_ARRAY | jq -cr '.[]' | while read -r PLATFORM_JSON; do
IMAGE_TAG: $(echo "$PLATFORM_JSON" | jq -r .FILE_NAME)
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
timeout: ${TIMEOUT:-180}
skip: \${SKIP_$(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_UPCASE)_$(echo "$PLATFORM_JSON" | jq -r .VERSION_MAJOR)$(echo "$PLATFORM_JSON" | jq -r .VERSION_MINOR)}${SKIP_BUILD}
Expand Down Expand Up @@ -164,7 +165,7 @@ for ROUND in $(seq 1 $ROUNDS); do
IMAGE_TAG: $(echo "$PLATFORM_JSON" | jq -r .FILE_NAME)
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
timeout: ${TIMEOUT:-10}
skip: \${SKIP_$(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_UPCASE)_$(echo "$PLATFORM_JSON" | jq -r .VERSION_MAJOR)$(echo "$PLATFORM_JSON" | jq -r .VERSION_MINOR)}${SKIP_UNIT_TESTS}
Expand Down Expand Up @@ -212,7 +213,7 @@ EOF
IMAGE_TAG: $(echo "$PLATFORM_JSON" | jq -r .FILE_NAME)
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
timeout: ${TIMEOUT:-20}
skip: \${SKIP_$(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_UPCASE)_$(echo "$PLATFORM_JSON" | jq -r .VERSION_MAJOR)$(echo "$PLATFORM_JSON" | jq -r .VERSION_MINOR)}${SKIP_SERIAL_TESTS}
Expand Down Expand Up @@ -262,7 +263,7 @@ EOF
IMAGE_TAG: $(echo "$PLATFORM_JSON" | jq -r .FILE_NAME)
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
timeout: ${TIMEOUT:-180}
skip: \${SKIP_$(echo "$PLATFORM_JSON" | jq -r .PLATFORM_NAME_UPCASE)_$(echo "$PLATFORM_JSON" | jq -r .VERSION_MAJOR)$(echo "$PLATFORM_JSON" | jq -r .VERSION_MINOR)}${SKIP_LONG_RUNNING_TESTS:-true}
Expand Down Expand Up @@ -355,7 +356,7 @@ cat <<EOF
echo '+++ :javascript: Running test-metrics.js'
node --max-old-space-size=32768 test-metrics.js
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
timeout: ${TIMEOUT:-10}
soft_fail: true
Expand All @@ -372,7 +373,7 @@ cat <<EOF
OS: "el7" # OS and PKGTYPE required for lambdas
PKGTYPE: "rpm"
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
timeout: ${TIMEOUT:-10}
skip: ${SKIP_CENTOS_7_6}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}
Expand All @@ -386,7 +387,7 @@ cat <<EOF
OS: "ubuntu-16.04" # OS and PKGTYPE required for lambdas
PKGTYPE: "deb"
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
timeout: ${TIMEOUT:-10}
skip: ${SKIP_UBUNTU_16_04}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}
Expand All @@ -400,7 +401,7 @@ cat <<EOF
OS: "ubuntu-18.04" # OS and PKGTYPE required for lambdas
PKGTYPE: "deb"
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_TEST_AGENT_QUEUE"
timeout: ${TIMEOUT:-10}
skip: ${SKIP_UBUNTU_18_04}${SKIP_PACKAGE_BUILDER}${SKIP_LINUX}
Expand Down Expand Up @@ -433,7 +434,7 @@ cat <<EOF
IMAGE_TAG: "ubuntu-18.04-unpinned"
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
timeout: ${TIMEOUT:-30}
skip: ${SKIP_CONTRACT_BUILDER}${SKIP_LINUX}
Expand Down
10 changes: 5 additions & 5 deletions .cicd/submodule-regression-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ while read -r a b; do
done < <(git submodule --quiet foreach --recursive 'echo $path `git log -1 --format=%ct`')

echo "getting submodule info for $BASE_BRANCH"
git checkout $BASE_BRANCH &> /dev/null
git submodule update --init &> /dev/null
git checkout $BASE_BRANCH 1> /dev/null
git submodule update --init 1> /dev/null
while read -r a b; do
BASE_MAP[$a]=$b
done < <(git submodule --quiet foreach --recursive 'echo $path `git log -1 --format=%ct`')

# We need to switch back to the PR ref/head so we can git log properly
if [[ $TRAVIS == true && ! -z $TRAVIS_PULL_REQUEST_SLUG ]]; then
echo "git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:"
git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge: &> /dev/null
git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge: 1> /dev/null
echo "switching back to $TRAVIS_COMMIT"
echo 'git checkout -qf FETCH_HEAD'
git checkout -qf FETCH_HEAD &> /dev/null
git checkout -qf FETCH_HEAD 1> /dev/null
elif [[ $BUILDKITE == true ]]; then
echo "switching back to $CURRENT_BRANCH"
git checkout -f $CURRENT_BRANCH &> /dev/null
git checkout -f $CURRENT_BRANCH 1> /dev/null
fi

for k in "${!BASE_MAP[@]}"; do
Expand Down
4 changes: 2 additions & 2 deletions .cicd/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ if [[ $(uname) == 'Darwin' ]]; then # macOS
EXIT_STATUS=$?
else # Linux
. $HELPERS_DIR/file-hash.sh $CICD_DIR/platforms/$IMAGE_TAG.dockerfile
echo "$ docker run --rm --init -v $(pwd):$MOUNTED_DIR $(buildkite-intrinsics) $FULL_TAG bash -c \"$MOUNTED_DIR/$@\""
echo "$ docker run --rm --init -v $(pwd):$MOUNTED_DIR $(buildkite-intrinsics) -e JOBS $FULL_TAG bash -c \"$MOUNTED_DIR/$@\""
set +e # defer error handling to end
eval docker run --rm --init -v $(pwd):$MOUNTED_DIR $(buildkite-intrinsics) $FULL_TAG bash -c \"$MOUNTED_DIR/$@\"
eval docker run --rm --init -v $(pwd):$MOUNTED_DIR $(buildkite-intrinsics) -e JOBS $FULL_TAG bash -c \"$MOUNTED_DIR/$@\"
EXIT_STATUS=$?
fi
# buildkite
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 8)
set(VERSION_PATCH 4)
set(VERSION_PATCH 5)
#set(VERSION_SUFFIX develop)

if(VERSION_SUFFIX)
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ $ brew remove eosio

#### Ubuntu 18.04 Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.4/eosio_1.8.4-1-ubuntu-18.04_amd64.deb
$ sudo apt install ./eosio_1.8.4-1-ubuntu-18.04_amd64.deb
$ wget https://github.com/eosio/eos/releases/download/v1.8.5/eosio_1.8.5-1-ubuntu-18.04_amd64.deb
$ sudo apt install ./eosio_1.8.5-1-ubuntu-18.04_amd64.deb
```
#### Ubuntu 16.04 Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.4/eosio_1.8.4-1-ubuntu-16.04_amd64.deb
$ sudo apt install ./eosio_1.8.4-1-ubuntu-16.04_amd64.deb
$ wget https://github.com/eosio/eos/releases/download/v1.8.5/eosio_1.8.5-1-ubuntu-16.04_amd64.deb
$ sudo apt install ./eosio_1.8.5-1-ubuntu-16.04_amd64.deb
```
#### Ubuntu Package Uninstall
```sh
$ sudo apt remove eosio
```
#### Centos RPM Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.4/eosio-1.8.4-1.el7.x86_64.rpm
$ sudo yum install ./eosio-1.8.4-1.el7.x86_64.rpm
$ wget https://github.com/eosio/eos/releases/download/v1.8.5/eosio-1.8.5-1.el7.x86_64.rpm
$ sudo yum install ./eosio-1.8.5-1.el7.x86_64.rpm
```
#### Centos RPM Package Uninstall
```sh
Expand Down
19 changes: 16 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,11 +1530,10 @@ struct controller_impl {
// Update resource limits:
resource_limits.process_account_limit_updates();
const auto& chain_config = self.get_global_properties().configuration;
uint32_t max_virtual_mult = 1000;
uint64_t CPU_TARGET = EOS_PERCENT(chain_config.max_block_cpu_usage, chain_config.target_block_cpu_usage_pct);
resource_limits.set_block_parameters(
{ CPU_TARGET, chain_config.max_block_cpu_usage, config::block_cpu_usage_average_window_ms / config::block_interval_ms, max_virtual_mult, {99, 100}, {1000, 999}},
{EOS_PERCENT(chain_config.max_block_net_usage, chain_config.target_block_net_usage_pct), chain_config.max_block_net_usage, config::block_size_average_window_ms / config::block_interval_ms, max_virtual_mult, {99, 100}, {1000, 999}}
{ CPU_TARGET, chain_config.max_block_cpu_usage, config::block_cpu_usage_average_window_ms / config::block_interval_ms, config::maximum_elastic_resource_multiplier, {99, 100}, {1000, 999}},
{EOS_PERCENT(chain_config.max_block_net_usage, chain_config.target_block_net_usage_pct), chain_config.max_block_net_usage, config::block_size_average_window_ms / config::block_interval_ms, config::maximum_elastic_resource_multiplier, {99, 100}, {1000, 999}}
);
resource_limits.process_block_usage(pbhs.block_num);

Expand Down Expand Up @@ -3002,6 +3001,20 @@ void controller::set_subjective_cpu_leeway(fc::microseconds leeway) {
my->subjective_cpu_leeway = leeway;
}

void controller::set_greylist_limit( uint32_t limit ) {
EOS_ASSERT( 0 < limit && limit <= chain::config::maximum_elastic_resource_multiplier,
misc_exception,
"Invalid limit (${limit}) passed into set_greylist_limit. "
"Must be between 1 and ${max}.",
("limit", limit)("max", chain::config::maximum_elastic_resource_multiplier)
);
my->conf.greylist_limit = limit;
}

uint32_t controller::get_greylist_limit()const {
return my->conf.greylist_limit;
}

void controller::add_resource_greylist(const account_name &name) {
my->conf.resource_greylist.insert(name);
}
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/include/eosio/chain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static const uint32_t account_cpu_usage_average_window_ms = 24*60*60*1000l;
static const uint32_t account_net_usage_average_window_ms = 24*60*60*1000l;
static const uint32_t block_cpu_usage_average_window_ms = 60*1000l;
static const uint32_t block_size_average_window_ms = 60*1000l;
static const uint32_t maximum_elastic_resource_multiplier = 1000;

//const static uint64_t default_max_storage_size = 10 * 1024;
//const static uint32_t default_max_trx_runtime = 10*1000;
Expand All @@ -72,6 +73,7 @@ const static uint32_t default_max_block_cpu_usage = 200'000; /
const static uint32_t default_target_block_cpu_usage_pct = 10 * percent_1;
const static uint32_t default_max_transaction_cpu_usage = 3*default_max_block_cpu_usage/4; /// max trx cpu usage in microseconds
const static uint32_t default_min_transaction_cpu_usage = 100; /// min trx cpu usage in microseconds (10000 TPS equiv)
const static uint32_t default_subjective_cpu_leeway_us = 31000; /// default subjective cpu leeway in microseconds

const static uint32_t default_max_trx_lifetime = 60*60; // 1 hour
const static uint32_t default_deferred_trx_expiration_window = 10*60; // 10 minutes
Expand Down
22 changes: 3 additions & 19 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ namespace eosio { namespace chain {

flat_set<account_name> resource_greylist;
flat_set<account_name> trusted_producers;
uint32_t greylist_limit = chain::config::maximum_elastic_resource_multiplier;
};

enum class block_status {
Expand Down Expand Up @@ -271,6 +272,8 @@ namespace eosio { namespace chain {
validation_mode get_validation_mode()const;

void set_subjective_cpu_leeway(fc::microseconds leeway);
void set_greylist_limit( uint32_t limit );
uint32_t get_greylist_limit()const;

void add_to_ram_correction( account_name account, uint64_t ram_bytes );
bool all_subjective_mitigations_disabled()const;
Expand Down Expand Up @@ -331,22 +334,3 @@ namespace eosio { namespace chain {
};

} } /// eosio::chain

FC_REFLECT( eosio::chain::controller::config,
(actor_whitelist)
(actor_blacklist)
(contract_whitelist)
(contract_blacklist)
(blocks_dir)
(state_dir)
(state_size)
(reversible_cache_size)
(read_only)
(force_all_checks)
(disable_replay_opts)
(contracts_console)
(genesis)
(wasm_runtime)
(resource_greylist)
(trusted_producers)
)
9 changes: 5 additions & 4 deletions libraries/chain/include/eosio/chain/resource_limits.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <eosio/chain/exceptions.hpp>
#include <eosio/chain/types.hpp>
#include <eosio/chain/config.hpp>
#include <eosio/chain/snapshot.hpp>
#include <chainbase/chainbase.hpp>
#include <set>
Expand Down Expand Up @@ -87,11 +88,11 @@ namespace eosio { namespace chain { namespace resource_limits {
uint64_t get_block_cpu_limit() const;
uint64_t get_block_net_limit() const;

int64_t get_account_cpu_limit( const account_name& name, bool elastic = true) const;
int64_t get_account_net_limit( const account_name& name, bool elastic = true) const;
std::pair<int64_t, bool> get_account_cpu_limit( const account_name& name, uint32_t greylist_limit = config::maximum_elastic_resource_multiplier ) const;
std::pair<int64_t, bool> get_account_net_limit( const account_name& name, uint32_t greylist_limit = config::maximum_elastic_resource_multiplier ) const;

account_resource_limit get_account_cpu_limit_ex( const account_name& name, bool elastic = true) const;
account_resource_limit get_account_net_limit_ex( const account_name& name, bool elastic = true) const;
std::pair<account_resource_limit, bool> get_account_cpu_limit_ex( const account_name& name, uint32_t greylist_limit = config::maximum_elastic_resource_multiplier ) const;
std::pair<account_resource_limit, bool> get_account_net_limit_ex( const account_name& name, uint32_t greylist_limit = config::maximum_elastic_resource_multiplier ) const;

int64_t get_account_ram_usage( const account_name& name ) const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ namespace eosio { namespace chain { namespace resource_limits {
* real maximum block is less, this virtual number is only used for rate limiting users.
*
* It's lowest possible value is max_block_size * blocksize_average_window_ms / block_interval
* It's highest possible value is 1000 times its lowest possible value
* It's highest possible value is config::maximum_elastic_resource_multiplier (1000) times its lowest possible value
*
* This means that the most an account can consume during idle periods is 1000x the bandwidth
* it is gauranteed under congestion.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace eosio { namespace chain {
bool enforce_whiteblacklist = true;

fc::time_point deadline = fc::time_point::maximum();
fc::microseconds leeway = fc::microseconds(3000);
fc::microseconds leeway = fc::microseconds( config::default_subjective_cpu_leeway_us );
int64_t billed_cpu_time_us = 0;
bool explicit_billed_cpu_time = false;

Expand Down
Loading

0 comments on commit a2317d3

Please sign in to comment.