Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/AntelopeIO/leap
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoenebeck committed Jun 30, 2023
2 parents 76e4fd9 + aed53c0 commit 9007161
Show file tree
Hide file tree
Showing 77 changed files with 1,485 additions and 793 deletions.
9 changes: 9 additions & 0 deletions .cicd/defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cdt":{
"target":"4",
"prerelease":false
},
"eossystemcontracts":{
"ref":"release/3.1"
}
}
144 changes: 139 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ on:
- "release/*"
pull_request:
workflow_dispatch:
inputs:
override-cdt:
description: 'Override cdt target'
type: string
override-cdt-prerelease:
type: choice
description: Override cdt prelease
options:
- default
- true
- false
override-eos-system-contracts:
description: 'Override eos-system-contracts ref'
type: string

permissions:
packages: read
Expand All @@ -31,6 +45,33 @@ jobs:
platform-file: .cicd/platforms.json
password: ${{secrets.GITHUB_TOKEN}}
package-name: builders
v:
name: Discover Versions
runs-on: ubuntu-latest
outputs:
cdt-target: ${{steps.versions.outputs.cdt-target}}
cdt-prerelease: ${{steps.versions.outputs.cdt-prerelease}}
eos-system-contracts-ref: ${{steps.versions.outputs.eos-system-contracts-ref}}
steps:
- name: Setup cdt and eos-system-contracts versions
id: versions
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
DEFAULTS_JSON=$(curl -sSfL $(gh api https://api.github.com/repos/${{github.repository}}/contents/.cicd/defaults.json?ref=${{github.sha}} --jq .download_url))
echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.target') >> $GITHUB_OUTPUT
echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.prerelease') >> $GITHUB_OUTPUT
echo eos-system-contracts-ref=$(echo "$DEFAULTS_JSON" | jq -r '.eossystemcontracts.ref') >> $GITHUB_OUTPUT
if [[ "${{inputs.override-cdt}}" != "" ]]; then
echo cdt-target=${{inputs.override-cdt}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-cdt-prerelease}}" == +(true|false) ]]; then
echo cdt-prerelease=${{inputs.override-cdt-prerelease}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-eos-system-contracts}}" != "" ]]; then
echo eos-system-contracts-ref=${{inputs.override-eos-system-contracts}} >> $GITHUB_OUTPUT
fi
build-platforms:
name: Build Platforms
needs: d
Expand Down Expand Up @@ -88,16 +129,20 @@ jobs:
name: Build leap-dev package
needs: [d, Build]
if: always() && needs.Build.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ubuntu-latest
container: ${{fromJSON(needs.d.outputs.p)['ubuntu20'].image}}
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download builddir
uses: actions/download-artifact@v3
with:
name: ubuntu20-build
name: ${{matrix.platform}}-build
- name: Build dev package
run: |
zstdcat build.tar.zst | tar x
Expand All @@ -113,8 +158,9 @@ jobs:
- name: Upload dev package
uses: actions/upload-artifact@v3
with:
name: leap-dev-ubuntu20-amd64
name: leap-dev-${{matrix.platform}}-amd64
path: build/leap-dev*.deb

tests:
name: Tests
needs: [d, Build]
Expand Down Expand Up @@ -201,11 +247,99 @@ jobs:
name: ${{matrix.platform}}-lr-logs
path: '*-logs.tar.gz'

libtester-tests:
name: libtester tests
needs: [d, v, Build, dev-package]
if: always() && needs.v.result == 'success' && needs.dev-package.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
test: [build-tree, make-dev-install, deb-install]
runs-on: ["self-hosted", "enf-x86-midtier"]
container: ${{ matrix.test != 'deb-install' && fromJSON(needs.d.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
steps:
# LEAP
- if: ${{ matrix.test != 'deb-install' }}
name: Clone leap
uses: actions/checkout@v3
with:
submodules: recursive
- if: ${{ matrix.test != 'deb-install' }}
name: Download leap builddir
uses: actions/download-artifact@v3
with:
name: ${{matrix.platform}}-build
- if: ${{ matrix.test != 'deb-install' }}
name: Extract leap build
run: |
zstdcat build.tar.zst | tar x
- if: ${{ matrix.test == 'build-tree' }}
name: Set leap_DIR env var
run: |
echo "leap_DIR=$PWD/build/lib/cmake/leap" >> "$GITHUB_ENV"
- if: ${{ matrix.test == 'make-dev-install' }}
name: leap dev-install
run: |
cmake --install build
cmake --install build --component dev
- if: ${{ matrix.test == 'make-dev-install' }}
name: Delete leap artifacts
run: |
rm -r *
- if: ${{ matrix.test == 'deb-install' }}
name: Download leap-dev
uses: actions/download-artifact@v3
with:
name: leap-dev-${{matrix.platform}}-amd64
- if: ${{ matrix.test == 'deb-install' }}
name: Install leap-dev Package
run: |
apt-get update
export DEBIAN_FRONTEND='noninteractive'
export TZ='Etc/UTC'
apt-get install -y ./*.deb
rm ./*.deb
# CDT
- name: Download cdt
uses: AntelopeIO/asset-artifact-download-action@v2
with:
owner: AntelopeIO
repo: cdt
file: 'cdt_.*amd64.deb'
target: '${{needs.v.outputs.cdt-target}}'
prereleases: ${{fromJSON(needs.v.outputs.cdt-prerelease)}}
artifact-name: cdt_ubuntu_package_amd64
token: ${{github.token}}
- name: Install cdt Packages
run: |
apt install -y ./*.deb
rm ./*.deb
# Reference Contracts
- name: checkout eos-system-contracts
uses: actions/checkout@v3
with:
repository: eosnetworkfoundation/eos-system-contracts
path: eos-system-contracts
ref: '${{needs.v.outputs.eos-system-contracts-ref}}'
- if: ${{ matrix.test == 'deb-install' }}
name: Install eos-system-contracts deps
run: |
apt-get -y install cmake build-essential
- name: Build & Test eos-system-contracts
run: |
cmake -S eos-system-contracts -B eos-system-contracts/build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=On -DSYSTEM_ENABLE_LEAP_VERSION_CHECK=Off -DSYSTEM_ENABLE_CDT_VERSION_CHECK=Off
cmake --build eos-system-contracts/build -- -j $(nproc)
cd eos-system-contracts/build/tests
ctest --output-on-failure -j $(nproc)
all-passing:
name: All Required Tests Passed
needs: [dev-package, tests, np-tests]
needs: [dev-package, tests, np-tests, libtester-tests]
if: always()
runs-on: ubuntu-latest
steps:
- if: needs.dev-package.result != 'success' || needs.tests.result != 'success' || needs.np-tests.result != 'success'
- if: needs.dev-package.result != 'success' || needs.tests.result != 'success' || needs.np-tests.result != 'success' || needs.libtester-tests.result != 'success'
run: false
40 changes: 35 additions & 5 deletions .github/workflows/pinned_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,40 @@ defaults:
shell: bash

jobs:
Temp:
name: temp
runs-on: ubuntu-latest
Build:
name: Build
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-beefy-long"]
container: ${{ matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
steps:
- name: test
- name: Update and Install git
run: |
pwd
apt-get update
apt-get install -y git
git --version
- name: Clone leap
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: |
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
./scripts/install_deps.sh
- name: Build Pinned Build
env:
LEAP_PINNED_INSTALL_PREFIX: /usr
run: |
./scripts/pinned_build.sh deps build "$(nproc)"
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: leap-${{matrix.platform}}-pinned-amd64
path: build/leap_*.deb
- name: Run Parallel Tests
run: |
cd build
ctest --output-on-failure -j $(nproc) -LE "(nonparallelizable_tests|long_running_tests)" --timeout 420
23 changes: 18 additions & 5 deletions docs/01_nodeos/03_plugins/chain_plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,16 @@ Config Options for eosio::chain_plugin:
code cache
--eos-vm-oc-compile-threads arg (=1) Number of threads to use for EOS VM OC
tier-up
--eos-vm-oc-enable Enable EOS VM OC tier-up runtime
--eos-vm-oc-enable arg (=auto) Enable EOS VM OC tier-up runtime
('auto', 'all', 'none').
'auto' - EOS VM OC tier-up is enabled
for eosio.* accounts, read-only trxs,
and applying blocks.
'all' - EOS VM OC tier-up is enabled
for all contract execution.
'none' - EOS VM OC tier-up is
completely disabled.

--enable-account-queries arg (=0) enable queries to find accounts by
various metadata.
--max-nonprivileged-inline-action-size arg (=4096)
Expand All @@ -192,13 +201,17 @@ Config Options for eosio::chain_plugin:
feature. Setting above 0 enables this
feature.
--transaction-retry-interval-sec arg (=20)
How often, in seconds, to resend an
incoming transaction to network if not
How often, in seconds, to resend an
incoming transaction to network if not
seen in a block.
Needs to be at least twice as large as
p2p-dedup-cache-expire-time-sec.
--transaction-retry-max-expiration-sec arg (=120)
Maximum allowed transaction expiration
for retry transactions, will retry
Maximum allowed transaction expiration
for retry transactions, will retry
transactions up to this value.
Should be larger than
transaction-retry-interval-sec.
--transaction-finality-status-max-storage-size-gb arg
Maximum size (in GiB) allowed to be
allocated for the Transaction Finality
Expand Down
15 changes: 15 additions & 0 deletions libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,4 +1094,19 @@ action_name apply_context::get_sender() const {
return action_name();
}

// Context | OC?
//-------------------------------------------------------------------------------
// Building block | baseline, OC for eosio.*
// Applying block | OC unless a producer, OC for eosio.* including producers
// Speculative API trx | baseline, OC for eosio.*
// Speculative P2P trx | baseline, OC for eosio.*
// Compute trx | baseline, OC for eosio.*
// Read only trx | OC
bool apply_context::should_use_eos_vm_oc()const {
return receiver.prefix() == config::system_account_name // "eosio"_n, all cases use OC
|| (is_applying_block() && !control.is_producer_node()) // validating/applying block
|| trx_context.is_read_only();
}


} } /// eosio::chain
Loading

0 comments on commit 9007161

Please sign in to comment.