Skip to content

Commit

Permalink
Merge pull request #2763 from bitshares/testnet_release
Browse files Browse the repository at this point in the history
Merge release branch into testnet branch for test-7.0.0 pre-release for Testnet
  • Loading branch information
abitmore authored Jul 3, 2023
2 parents aa56685 + 0cb02c3 commit dc10502
Show file tree
Hide file tree
Showing 125 changed files with 8,195 additions and 1,662 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test.mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ jobs:
run: |
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
make -j 2 -C _build witness_node cli_wallet app_test cli_test chain_test
make -j 3 -C _build witness_node cli_wallet app_test cli_test chain_test
df -h
- name: Unit-Tests
timeout-minutes: 15
run: |
_build/tests/app_test -l test_suite
libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l test_suite
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/build-and-test.ubuntu-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,26 @@ jobs:
name: Build and test in Debug mode
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-20.04 ]
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
services:
elasticsearch:
image: docker://elasticsearch:7.17.7
options: --env discovery.type=single-node --publish 9200:9200 --publish 9300:9300
elasticsearch8:
image: elastic/elasticsearch:8.8.1
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env xpack.security.enabled=false
--env xpack.security.http.ssl.enabled=false
--env action.destructive_requires_name=false
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9200:9200
elasticsearch7:
image: elastic/elasticsearch:7.17.10
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9201:9200
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -51,11 +65,6 @@ jobs:
pwd
df -h .
free
sudo dd if=/dev/zero of=/swapfile bs=1024 count=4M
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free
mkdir -p _build
sudo mkdir -p /_build/libraries /_build/programs /_build/tests /mnt/_build
sudo chmod a+rwx /_build/libraries /_build/programs /_build/tests
Expand Down Expand Up @@ -89,25 +98,25 @@ jobs:
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
df -h
make -j 1 -C _build chain_test
make -j 1 -C _build cli_test
make -j 1 -C _build app_test
make -j 1 -C _build es_test
make -j 1 -C _build cli_wallet
make -j 1 -C _build witness_node
make -j 1 -C _build
make -j 2 -C _build chain_test
make -j 2 -C _build cli_test
make -j 2 -C _build app_test
make -j 2 -C _build es_test
make -j 2 -C _build cli_wallet
make -j 2 -C _build witness_node
make -j 2 -C _build
df -h
du -hs _build/libraries/* _build/programs/* _build/tests/*
du -hs _build/*
du -hs /_build/*
- name: Unit-Tests
timeout-minutes: 15
run: |
_build/tests/app_test -l test_suite
df -h
rm -rf /tmp/graphene*
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings \
-d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'
echo
_build/tests/es_test -l test_suite
export GRAPHENE_TESTING_ES_URL=http://127.0.0.1:9201/
_build/tests/es_test -l test_suite
df -h
rm -rf /tmp/graphene*
Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/build-and-test.ubuntu-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,26 @@ jobs:
name: Build and test in Release mode
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-20.04 ]
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
services:
elasticsearch:
image: docker://elasticsearch:7.17.7
options: --env discovery.type=single-node --publish 9200:9200 --publish 9300:9300
elasticsearch8:
image: elastic/elasticsearch:8.8.1
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env xpack.security.enabled=false
--env xpack.security.http.ssl.enabled=false
--env action.destructive_requires_name=false
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9200:9200
elasticsearch7:
image: elastic/elasticsearch:7.17.10
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9201:9200
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -45,6 +59,8 @@ jobs:
submodules: recursive
- name: Configure
run: |
df -h
free
mkdir -p _build
pushd _build
export -n BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR
Expand All @@ -68,14 +84,14 @@ jobs:
run: |
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
make -j 1 -C _build
make -j 2 -C _build
df -h
- name: Unit-Tests
timeout-minutes: 15
run: |
_build/tests/app_test -l test_suite
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings \
-d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'
echo
_build/tests/es_test -l test_suite
export GRAPHENE_TESTING_ES_URL=http://127.0.0.1:9201/
_build/tests/es_test -l test_suite
libraries/fc/tests/run-parallel-tests.sh _build/tests/chain_test -l test_suite
_build/tests/cli_test -l test_suite
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ env:
# The following are for windows cross-build only:
BOOST_VERSION: 1_69_0
BOOST_DOTTED_VERSION: 1.69.0
CURL_VERSION: 7.86.0
OPENSSL_VERSION: 1.1.1s
CURL_VERSION: 8.1.2
OPENSSL_VERSION: 1.1.1u
ZLIB_VERSION: 1.2.13
jobs:
prepare-mingw64-libs:
Expand Down Expand Up @@ -154,4 +154,4 @@ jobs:
run: |
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
make -j 2 -C _build witness_node cli_wallet
make VERBOSE=1 -j 2 -C _build witness_node cli_wallet
6 changes: 3 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build only
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
load: true
Expand All @@ -46,14 +46,14 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to DockerHub (for branches)
if: env.DOCKER_PUSH_TAG != '' && env.DOCKER_PUSH_TAG_SHORT == ''
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_REPO_PATH }}:${{ env.DOCKER_PUSH_TAG }}
- name: Push to DockerHub (for tags)
if: env.DOCKER_PUSH_TAG != '' && env.DOCKER_PUSH_TAG_SHORT != ''
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand Down
50 changes: 20 additions & 30 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ jobs:
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
services:
elasticsearch:
image: docker://elasticsearch:7.17.7
options: --env discovery.type=single-node --publish 9200:9200 --publish 9300:9300
elasticsearch8:
image: elastic/elasticsearch:8.8.1
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
--env xpack.security.enabled=false
--env xpack.security.http.ssl.enabled=false
--env action.destructive_requires_name=false
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9200:9200
steps:
- name: Download and install latest SonarScanner CLI tool
run: |
Expand Down Expand Up @@ -43,6 +50,7 @@ jobs:
sudo apt-get install -y --allow-downgrades openssl=${openssl_ver} libssl-dev=${libssl_ver}
sudo apt-get install -y \
ccache \
gcovr \
parallel \
libboost-thread-dev \
libboost-iostreams-dev \
Expand Down Expand Up @@ -70,11 +78,6 @@ jobs:
pwd
df -h .
free
sudo dd if=/dev/zero of=/swapfile bs=1024 count=4M
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free
mkdir -p _build
sudo mkdir -p /_build/libraries /_build/programs /mnt/_build/tests
sudo chmod a+rwx /_build/libraries /_build/programs /mnt/_build/tests
Expand Down Expand Up @@ -107,7 +110,6 @@ jobs:
with:
path: |
ccache
sonar_cache
key: testnet-sonar-${{ env.OS_VERSION }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
testnet-sonar-${{ env.OS_VERSION }}-${{ github.ref }}-
Expand All @@ -117,7 +119,7 @@ jobs:
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
mkdir -p "$CCACHE_DIR"
df -h
programs/build_helpers/make_with_sonar bw-output -j 1 -C _build \
programs/build_helpers/make_with_sonar bw-output -j 2 -C _build \
witness_node cli_wallet js_operation_serializer get_dev_key network_mapper \
app_test chain_test cli_test es_test
df -h
Expand Down Expand Up @@ -162,14 +164,12 @@ jobs:
rm -rf _build/programs/genesis_util/get_dev_key
df -h
- name: Unit-Tests
timeout-minutes: 15
run: |
_build/tests/app_test -l test_suite
df -h
echo "Cleanup"
rm -rf /tmp/graphene*
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings \
-d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'
echo
_build/tests/es_test -l test_suite
df -h
echo "Cleanup"
Expand All @@ -185,24 +185,14 @@ jobs:
df -h
- name: Prepare for scanning with SonarScanner
run: |
mkdir -p sonar_cache
find _build/libraries/[acdenptuw]*/CMakeFiles/*.dir \
_build/libraries/plugins/*/CMakeFiles/*.dir \
-type d -print \
| while read d; do \
tmpd="${d:7}"; \
srcd="${tmpd/CMakeFiles*.dir/.}"; \
gcov -o "$d" "${srcd}"/*.[ch][px][px] \
"${srcd}"/include/graphene/*/*.[ch][px][px] ; \
done >/dev/null
find _build/programs/[cdgjsw]*/CMakeFiles/*.dir \
-type d -print \
| while read d; do \
tmpd="${d:7}"; \
srcd="${tmpd/CMakeFiles*.dir/.}"; \
gcov -o "$d" "${srcd}"/*.[ch][px][px] ; \
done >/dev/null
programs/build_helpers/set_sonar_branch_for_github_actions sonar-project.properties
pushd _build
gcovr --version
gcovr --exclude-unreachable-branches --exclude-throw-branches \
--exclude '\.\./programs/' \
--exclude '\.\./tests/' \
--sonarqube ../coverage.xml -r ..
popd
- name: Scan with SonarScanner
env:
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2022 Cryptonomex Inc. <contact@cryptonomex.com> and
Copyright (c) 2015-2023 Cryptonomex Inc. <contact@cryptonomex.com> and
contributors (see CONTRIBUTORS.txt)

The MIT License
Expand Down
7 changes: 2 additions & 5 deletions docker/default_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,10 @@ max-ops-per-account = 100
# ==============================================================================

# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
# bucket-size = [15,60,300,3600,86400]
bucket-size = [60,300,900,1800,3600,14400,86400]
# for 1 min, 5 mins, 30 mins, 1h, 4 hs and 1 day. i think this should be the default.
# https://github.com/bitshares/bitshares-core/issues/465
bucket-size = [60,300,900,3600,14400,86400,604800]

# How far back in time to track history for each bucket size, measured in the number of buckets (default: 1000)
history-per-size = 1000
history-per-size = 1500

# Will only store this amount of matched orders for each market in order history for querying, or those meet the other option, which has more data (default: 1000)
max-order-his-records-per-market = 1000
Expand Down
16 changes: 7 additions & 9 deletions libraries/app/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,19 @@ namespace graphene { namespace app {
return uint32_t(1); // Note: hard code it here for backward compatibility

FC_ASSERT( o_user.valid() && o_password.valid(), "Must provide both user and password" );
string user = *o_user;

optional< api_access_info > acc = _app.get_api_access_info( user );
if( !acc.valid() )
optional< api_access_info > acc = _app.get_api_access_info( *o_user );
if( !acc )
return logout();
if( acc->password_hash_b64 != "*" )
{
std::string password_salt = fc::base64_decode( acc->password_salt_b64 );
std::string acc_password_hash = fc::base64_decode( acc->password_hash_b64 );

string password = *o_password;
fc::sha256 hash_obj = fc::sha256::hash( password + password_salt );
if( hash_obj.data_size() != acc_password_hash.length() )
if( fc::sha256::data_size() != acc_password_hash.length() )
return logout();
if( memcmp( hash_obj.data(), acc_password_hash.c_str(), hash_obj.data_size() ) != 0 )

std::string password_salt = fc::base64_decode( acc->password_salt_b64 );
fc::sha256 hash_obj = fc::sha256::hash( *o_password + password_salt );
if( memcmp( hash_obj.data(), acc_password_hash.data(), fc::sha256::data_size() ) != 0 )
return logout();
}

Expand Down
Loading

0 comments on commit dc10502

Please sign in to comment.