Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop2beta #1587

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f3e9273
Add mainnet ABIs publication
DimaStebaev Aug 23, 2023
f9cb2eb
Merge branch 'develop' into skale-contracts
DimaStebaev Sep 4, 2023
90c84de
Set version
DimaStebaev Sep 4, 2023
397405f
Set deposit boxes addresses to ContractManager during deployment
DimaStebaev Sep 4, 2023
f0323cb
Set deposit boxes addresses to ContractManager during upgrade
DimaStebaev Sep 4, 2023
ef120b7
Update ganache arguments
DimaStebaev Sep 4, 2023
0ce764b
Upgrade ganache
DimaStebaev Sep 5, 2023
7ec547f
Merge branch 'develop' into skale-contracts
DimaStebaev Sep 5, 2023
6d514fb
Change host name
DimaStebaev Sep 5, 2023
93db0e9
Run ganache in deamon mode
DimaStebaev Sep 5, 2023
03d1a2b
Remove workaround
DimaStebaev Sep 5, 2023
71a3e03
Remove unused import
DimaStebaev Sep 5, 2023
0dd66f1
Run ganache in deamon mode
DimaStebaev Sep 5, 2023
42bb290
Remove unused dependencies
DimaStebaev Sep 5, 2023
f75936e
Add double quote
DimaStebaev Sep 5, 2023
c3fe447
Merge branch 'develop' into skale-contracts
payvint Sep 7, 2023
941f405
Merge branch 'develop' into skale-contracts
DimaStebaev Sep 8, 2023
c66a854
ticket-1584 Fixed own S-chain discovery delays
sergiy-skalelabs Sep 12, 2023
b914ef5
Merge pull request #1575 from skalenetwork/skale-contracts
DimaStebaev Sep 12, 2023
30c447d
ticket-1584 Fixed SNB parallel discovery delays for connected S-chains
sergiy-skalelabs Sep 12, 2023
1cc632e
Merge branch 'develop' into ticket-1584/network-re-discovery-issues
sergiy-skalelabs Sep 12, 2023
7293aae
ticket-1584 own S-chain discovery nodes counting fix
sergiy-skalelabs Sep 12, 2023
862c5eb
ticket-1584 own S-chain discovery nodes periodic continuation fix
sergiy-skalelabs Sep 13, 2023
0d09858
Merge pull request #1586 from skalenetwork/ticket-1584/network-re-dis…
sergiy-skalelabs Sep 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 32 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ on:
branches-ignore:
- 'docs-v*'

env:
NODE_VERSION: 18
PYTHON_VERSION: 3.8

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-contracts:
runs-on: ubuntu-latest

env:
working-directory: ./proxy
defaults:
run:
working-directory: proxy

steps:
- uses: actions/checkout@v2
Expand All @@ -43,47 +48,43 @@ jobs:
- name: Install PYTHON
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ env.PYTHON_VERSION }}

- name: Install NODE JS
uses: actions/setup-node@v2
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}

- name: Install project
working-directory: ${{env.working-directory}}
run: |
yarn install
run: yarn install

- name: Install slither
working-directory: ${{env.working-directory}}
run: pip3 install -r scripts/requirements.txt

- name: Lint solidity
working-directory: ${{env.working-directory}}
run: yarn lint

- name: Compile typescript
working-directory: ${{env.working-directory}}
run: yarn tsc

- name: Lint typescript
working-directory: ${{env.working-directory}}
run: yarn eslint

- name: Slither checks
working-directory: ${{env.working-directory}}
run: yarn slither

- name: Test ABI generation
env:
VERSION: "0.0.0"
run: npx hardhat run scripts/generateAbi.ts

- name: Gas calculation test
working-directory: ${{env.working-directory}}
run: npx hardhat test gas/calculateGas.ts

- name: Test upgrade
run: bash ./proxy/scripts/test_upgrade.sh
run: bash scripts/test_upgrade.sh

- name: Run tests
working-directory: ${{env.working-directory}}
run: |
npx hardhat coverage --solcoverjs .solcover.js
bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
Expand Down Expand Up @@ -120,12 +121,12 @@ jobs:
- name: Install PYTHON
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ env. PYTHON_VERSION }}

- name: Install NODE JS
uses: actions/setup-node@v2
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}

- name: Install project
run: |
Expand Down Expand Up @@ -329,12 +330,12 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: ${{ env.NODE_VERSION }}

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ env.PYTHON_VERSION }}

- name: Compile contracts
working-directory: ./proxy
Expand All @@ -349,9 +350,11 @@ jobs:
yarn install

- name: Start background ganache
working-directory: proxy
run: |
cd proxy
npx ganache --miner.blockGasLimit 12000000 --logging.quiet --chain.allowUnlimitedContractSize --wallet.defaultBalance 2000000 --wallet.accountKeysPath ../test/accounts.json &
INSTANCE=$(npx ganache --😈 --miner.blockGasLimit 12000000 --logging.quiet --chain.allowUnlimitedContractSize --wallet.defaultBalance 2000000 --wallet.accountKeysPath ../test/accounts.json)
echo "INSTANCE=$INSTANCE" >> "$GITHUB_ENV"


- name: Prepare test (PY part)
working-directory: ${{env.working-directory}}
Expand All @@ -373,3 +376,11 @@ jobs:
working-directory: ${{env.working-directory}}
run: |
yarn test

- name: Stop ganache
working-directory: proxy
env:
INSTANCE: ${{ env.INSTANCE }}
run: npx ganache instances stop $INSTANCE


62 changes: 36 additions & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ on:
tags:
- 'custom-release-*'

env:
NODE_VERSION: 18
PYTHON_VERSION: 3.8

jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
PROXY_DIR: "proxy"
defaults:
run:
working-directory: proxy
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -44,64 +50,60 @@ jobs:
- name: Install NODE JS
uses: actions/setup-node@v2
with:
node-version: '16'
node-version: ${{ env.NODE_VERSION }}

- name: Set up Python 3.8
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ env.PYTHON_VERSION }}

- name: Build and publish container
run: |
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(bash ./scripts/calculate_version.sh)
export VERSION=$(bash ../scripts/calculate_version.sh)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Version $VERSION"
( test $BRANCH = "stable" && export PRERELEASE=false ) || export PRERELEASE=true
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
echo ------------ download binaries
LIB_BLS_RELEASE_TAG=${{ secrets.LIB_BLS_RELEASE_TAG }} bash ./scripts/download_binaries.sh
LIB_BLS_RELEASE_TAG=${{ secrets.LIB_BLS_RELEASE_TAG }} bash ../scripts/download_binaries.sh
export RELEASE=true
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
echo ------------ docker image
bash ./scripts/build_image.sh ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_PASSWORD }} #|| echo "----> Looks like deploy failed"
bash ../scripts/build_image.sh ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_PASSWORD }} #|| echo "----> Looks like deploy failed"

- name: Prepare for pip package building
run: |
python3 -m pip install --upgrade build
python3 -m pip install --user --upgrade twine

- name: Install project
working-directory: ${{env.PROXY_DIR}}
run: |
yarn install
run: yarn install

- name: Generate Manifest
working-directory: ${{env.PROXY_DIR}}
run: |
npx hardhat run migrations/generateManifest.ts
run: npx hardhat run migrations/generateManifest.ts

- name: Install python testing staff
working-directory: ${{env.PROXY_DIR}}
run: pip3 install -r predeployed/test/requirements.txt

- name: Build predeployed pip package
working-directory: ${{env.PROXY_DIR}}
env:
VERSION: ${{ env.VERSION }}
run: |
./predeployed/scripts/build_package.sh
run: ./predeployed/scripts/build_package.sh

- name: Publish predeployed pip package
working-directory: ${{env.PROXY_DIR}}
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
./predeployed/scripts/publish_package.sh
run: ./predeployed/scripts/publish_package.sh

- name: Generate mainnet ABIs
env:
VERSION: ${{ env.VERSION }}
run: npx hardhat run scripts/generateAbi.ts

- name: Generate ABIs
working-directory: ${{env.PROXY_DIR}}/predeployed
- name: Generate predeployed ABIs
working-directory: proxy/predeployed
env:
VERSION: ${{ env.VERSION }}
run: |
Expand Down Expand Up @@ -129,7 +131,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: proxy/predeployed/dist/
assets_path: predeployed/dist/

- name: Upload Release Assets
id: upload-static-data
Expand All @@ -138,7 +140,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: proxy/predeployed/data/
assets_path: predeployed/data/

- name: Upload Release Assets
id: upload-manifest-data
Expand All @@ -147,4 +149,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: proxy/data/ima-schain-*-manifest.json
assets_path: data/ima-schain-*-manifest.json

- name: Upload Release Assets
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: data/*-abi.json
11 changes: 7 additions & 4 deletions agent/bls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ function discoverPublicKeyByIndex( nNodeIndex, joSChainNetworkInfo, details, isT
const imaState = state.get();
joSChainNetworkInfo = joSChainNetworkInfo || imaState.joSChainNetworkInfo;
const jarrNodes = joSChainNetworkInfo.network;
const cntNodes = jarrNodes.length;
const joNode = jarrNodes[nNodeIndex];
if( joNode && "imaInfo" in joNode && typeof joNode.imaInfo === "object" &&
"BLSPublicKey0" in joNode.imaInfo &&
Expand All @@ -159,10 +160,12 @@ function discoverPublicKeyByIndex( nNodeIndex, joSChainNetworkInfo, details, isT
};
}
details.write( cc.fatal( "CRITICAL ERROR:" ) +
cc.error( " BLS 1/16 public key discovery failed for node #" ) + cc.info( nNodeIndex ) +
cc.error( ", node data is: " ) + cc.j( joNode ) + "\n" );
if( isThrowException )
throw new Error( "BLS 1/16 public key discovery failed for node #" + nNodeIndex );
cc.error( " BLS 1/" + cntNodes + " public key discovery failed for node #" ) +
cc.info( nNodeIndex ) + cc.error( ", node data is: " ) + cc.j( joNode ) + "\n" );
if( isThrowException ) {
throw new Error(
"BLS 1/" + cntNodes + " public key discovery failed for node #" + nNodeIndex );
}
return null;
}

Expand Down
Loading