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

Develop to v20 #1934

Merged
merged 43 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
cf60f2e
Merge pull request #1826 from skalenetwork/beta
DmytroNazarenko Feb 17, 2024
d01f2a2
Merge pull request #1897 from skalenetwork/develop
DmytroNazarenko May 14, 2024
850b36b
Merge pull request #1898 from skalenetwork/beta
DmytroNazarenko May 14, 2024
421c5d1
Merge branch 'beta' into develop
DmytroNazarenko May 17, 2024
859d742
Merge pull request #1904 from skalenetwork/develop
DmytroNazarenko May 17, 2024
3ecac21
SKALED-1878 Colorful logs
dimalit Apr 28, 2024
850eed8
SKALED-1877 Add blockHash support
dimalit May 2, 2024
31be37f
SKALED-1877 Fix wrong filter range
dimalit May 3, 2024
d8edbd2
SKALED-1877 Throw if blockHash doesn't exist or empty
dimalit May 3, 2024
5c6e5fc
Cherry-pick commits
dimalit May 22, 2024
6a9203a
Fix build
dimalit May 22, 2024
16519fb
Fix random in test
dimalit May 22, 2024
1ccff34
Fix tests
dimalit May 23, 2024
09624d5
Fix test
dimalit May 24, 2024
4805b84
Cosmetic changes
dimalit May 24, 2024
c8c58e4
Format
dimalit May 24, 2024
93c07eb
Merge pull request #1905 from skalenetwork/enhancement/code-style-has…
dimalit May 27, 2024
c8f3c74
Merge remote-tracking branch 'origin/beta' into stable-to-beta
dimalit May 29, 2024
5a08172
Merge pull request #1908 from skalenetwork/stable-to-beta
DmytroNazarenko May 30, 2024
bff6ece
bug 1911 eth feeHistory
olehnikolaiev Jun 6, 2024
8cb6ecf
#1911 format
olehnikolaiev Jun 6, 2024
cbda0bd
#1911 fix unittests
olehnikolaiev Jun 6, 2024
d2cbf12
Merge pull request #1915 from skalenetwork/beta
DmytroNazarenko Jun 7, 2024
48ad689
Merge branch 'develop' into bug/1911-eth-feeHistory-blockCount
olehnikolaiev Jun 10, 2024
a89f6d0
consensus 836 update consensus
olehnikolaiev Jun 11, 2024
a09a4d2
Merge pull request #1914 from skalenetwork/bug/1911-eth-feeHistory-bl…
olehnikolaiev Jun 11, 2024
e321dfb
Merge branch 'develop' into enhancement/consensus-836-more-catchup-logs
olehnikolaiev Jun 11, 2024
36cd865
Merge pull request #1918 from skalenetwork/enhancement/consensus-836-…
olehnikolaiev Jun 11, 2024
6bc6a27
Add setup-build-publish workflow
DmytroNazarenko Jun 11, 2024
e81939a
1774 revert hwm limits
olehnikolaiev Jun 12, 2024
38791ff
Merge pull request #1920 from skalenetwork/bug/1774-revert-hwm-limits
olehnikolaiev Jun 12, 2024
46761ca
Implement reusable workflows
DmytroNazarenko Jun 12, 2024
d619b43
Customize cmake options
DmytroNazarenko Jun 12, 2024
9f680b8
#1922 fix block by number error
olehnikolaiev Jun 12, 2024
3b420ca
Pass secrets into reusable workflow
DmytroNazarenko Jun 12, 2024
18cb2f5
Update setup-build-publish.yml
DmytroNazarenko Jun 13, 2024
44527ec
Update custom_build.yml
DmytroNazarenko Jun 13, 2024
2720745
Merge branch 'develop' into enhancement/add-historic-custom-builds
DmytroNazarenko Jun 13, 2024
2b72617
Update custom_build.yml
DmytroNazarenko Jun 13, 2024
a0d0c55
Merge pull request #1925 from skalenetwork/enhancement/add-historic-c…
DmytroNazarenko Jun 14, 2024
473e118
Merge branch 'develop' into bug/1922-block-by-number-error
olehnikolaiev Jun 14, 2024
348ef4b
Merge pull request #1923 from skalenetwork/bug/1922-block-by-number-e…
DmytroNazarenko Jun 14, 2024
a8aaefd
Merge branch 'v3.20.0' into develop-to-v20
DmytroNazarenko Jul 3, 2024
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
144 changes: 22 additions & 122 deletions .github/workflows/custom_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,126 +25,26 @@ on:
default: RelWithDebInfo

jobs:
main_job:
runs-on: self-hosted
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
BUILD_TYPE: ${{ github.event.inputs.build_type }}
steps:
- name: update apt
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test || true
sudo apt-get update || true
- name: install packages
run: |
sudo apt-get -y remove libzmq* || true
sudo apt-get -y install software-properties-common gcc-9 g++-9 || true
core_build:
uses: ./.github/workflows/setup-build-publish.yml
with:
image_version: ${{ github.event.inputs.image_version }}
branch_name: ${{ github.event.inputs.branch_name }}
cmake_options: ${{ github.event.inputs.cmake_options }}
build_type: ${{ github.event.inputs.build_type }}
node_type: core
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Use g++-9 and gcov-9 by default
run: |
echo "Updating all needed alternatives"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9
echo "Checking alternative for gcc"
which gcc
gcc --version
echo "Checking alternative for g++"
which g++
g++ --version
echo "Checking alternative for gcov"
which gcov
gcov --version
echo "Checking alternative for gcov-dump"
which gcov-dump
gcov-dump --version
echo "Checking alternative for gcov-tool"
which gcov-tool
gcov-tool --version
- name: Extract repo name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch_name }}
- name: Submodule update
run: |
rm -rf ./libconsensus || true
ls -1
git submodule update --init --recursive
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: Ccache cache files
uses: actions/[email protected]
with:
path: .ccache
key: ${ { matrix.config.name } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } }
restore-keys: |
${ { matrix.config.name } }-ccache-
- name: Build dependencies
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
[[ $CMAKE_BUILD_TYPE = "Debug" ]] && export DEBUG_FLAG=1 || export DEBUG_FLAG=0
cd deps
./clean.sh
rm -f ./libwebsockets-from-git.tar.gz
./build.sh PARALLEL_COUNT=$(nproc) DEBUG=$DEBUG_FLAG
cd ..
- name: Configure all
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE ${{ github.event.inputs.cmake_options }} ..
cd ..
- name: Build all
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
cd build
make skaled -j$(nproc)
#echo "Ensure release mode skaled does not have any debug markers"
#strip skaled/skaled
cd ..
- name: Build and publish container
run: |
cp build/skaled/skaled scripts/skale_build/executable/
export BRANCH=${{ github.event.inputs.branch_name }}
[[ $BUILD_TYPE = "Debug" ]] && export VERSION_SUFFIX=debug || export VERSION_SUFFIX=release
export VERSION=${{ github.event.inputs.image_version }}-$VERSION_SUFFIX
echo "Version $VERSION"
export RELEASE=true
bash ./scripts/build_and_publish.sh
- name: Upload skaled binary as artifact
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: skaled
path: ./build/skaled/skaled
historic_build:
uses: ./.github/workflows/setup-build-publish.yml
with:
image_version: ${{ github.event.inputs.image_version }}
branch_name: ${{ github.event.inputs.branch_name }}
cmake_options: ${{ github.event.inputs.cmake_options }}
build_type: ${{ github.event.inputs.build_type }}
node_type: historic
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
168 changes: 168 additions & 0 deletions .github/workflows/setup-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: 'Setup, Build and Publish'
on:
workflow_call:
inputs:
branch_name:
type: string
description: 'Branch name'
required: true
image_version:
type: string
description: 'Image version for docker hub'
required: true
cmake_options:
type: string
description: 'Additional cmake options'
required: false
build_type:
type: string
description: 'Build type of skaled binary'
required: true
node_type:
type: string
description: 'Node type of skaled build'
required: true
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true

jobs:
main:
runs-on: self-hosted
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
BUILD_TYPE: ${{ inputs.build_type }}
steps:
- name: Prepare workflow variables
if: inputs.node_type != 'historic'
run: |
[[ $BUILD_TYPE = "Debug" ]] && export VERSION_SUFFIX=debug || export VERSION_SUFFIX=release
export VERSION=${{ inputs.image_version }}-$VERSION_SUFFIX
echo "VERSION=$VERSION" >> $GITHUB_ENV
export CMAKE_OPTS="${{ inputs.cmake_options }}"
echo "CMAKE_OPTS=$CMAKE_OPTS" >> $GITHUB_ENV
- name: Prepare workflow variables (historic)
if: inputs.node_type == 'historic'
run: |
[[ $BUILD_TYPE = "Debug" ]] && export VERSION_SUFFIX=debug || export VERSION_SUFFIX=release
export VERSION=${{ inputs.image_version }}-$VERSION_SUFFIX-historic
echo "VERSION=$VERSION" >> $GITHUB_ENV
export CMAKE_OPTS="-DHISTORIC_STATE=1 ${{ inputs.cmake_options }}"
echo "CMAKE_OPTS=$CMAKE_OPTS" >> $GITHUB_ENV
- name: update apt
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test || true
sudo apt-get update || true
- name: install packages
run: |
sudo apt-get -y remove libzmq* || true
sudo apt-get -y install software-properties-common gcc-9 g++-9 || true
- name: Use g++-9 and gcov-9 by default
run: |
echo "Updating all needed alternatives"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9
echo "Checking alternative for gcc"
which gcc
gcc --version
echo "Checking alternative for g++"
which g++
g++ --version
echo "Checking alternative for gcov"
which gcov
gcov --version
echo "Checking alternative for gcov-dump"
which gcov-dump
gcov-dump --version
echo "Checking alternative for gcov-tool"
which gcov-tool
gcov-tool --version
- name: Extract repo name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch_name }}
- name: Submodule update
run: |
rm -rf ./libconsensus || true
ls -1
git submodule update --init --recursive
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: Ccache cache files
uses: actions/[email protected]
with:
path: .ccache
key: ${ { matrix.config.name } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } }
restore-keys: |
${ { matrix.config.name } }-ccache-
- name: Build dependencies
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
[[ $CMAKE_BUILD_TYPE = "Debug" ]] && export DEBUG_FLAG=1 || export DEBUG_FLAG=0
cd deps
./clean.sh
rm -f ./libwebsockets-from-git.tar.gz
./build.sh PARALLEL_COUNT=$(nproc) DEBUG=$DEBUG_FLAG
cd ..
- name: Configure all
env:
CMAKE_OPTS: ${{ env.CMAKE_OPTS }}
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE $CMAKE_OPTS ..
cd ..
- name: Build all
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
cd build
make skaled -j$(nproc)
cd ..
- name: Build and publish container
env:
VERSION: ${{ env.VERSION }}
run: |
cp build/skaled/skaled scripts/skale_build/executable/
export BRANCH=${{ inputs.branch_name }}
export RELEASE=true
bash ./scripts/build_and_publish.sh
- name: Upload skaled binary as artifact
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: skaled-${{ inputs.node_type }}
path: ./build/skaled/skaled
2 changes: 1 addition & 1 deletion libconsensus
2 changes: 1 addition & 1 deletion libethereum/ClientBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class ClientBase : public Interface {
using Interface::blockInfo; // for another overload
using Interface::transactionHashes;
using Interface::uncle;
using Interface::uncleCount;
using Interface::uncleHashes;

h256 hashFromNumber( BlockNumber _number ) const override;
Expand Down Expand Up @@ -152,7 +153,6 @@ class ClientBase : public Interface {
}
return transactionCount( hashFromNumber( _block ) );
}
using Interface::uncleCount;
unsigned uncleCount( h256 _blockHash ) const override;
unsigned number() const override;
h256s pendingHashes() const override;
Expand Down
5 changes: 2 additions & 3 deletions libskale/broadcaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ void* ZmqBroadcaster::server_socket() const {
val = 60000;
zmq_setsockopt( m_zmq_server_socket, ZMQ_HEARTBEAT_TTL, &val, sizeof( val ) );

// remove limits to prevent txns from being dropped out
val = 0;
val = 16;
zmq_setsockopt( m_zmq_server_socket, ZMQ_SNDHWM, &val, sizeof( val ) );


Expand Down Expand Up @@ -132,7 +131,7 @@ void* ZmqBroadcaster::client_socket() const {
value = 300;
zmq_setsockopt( m_zmq_client_socket, ZMQ_TCP_KEEPALIVE_INTVL, &value, sizeof( value ) );

value = 0;
value = 16;
zmq_setsockopt( m_zmq_client_socket, ZMQ_RCVHWM, &value, sizeof( value ) );

const dev::eth::ChainParams& ch = m_client.chainParams();
Expand Down
12 changes: 6 additions & 6 deletions libweb3jsonrpc/Eth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,8 @@ Json::Value Eth::eth_getBlockByNumber( string const& _blockNumber, bool _include
BlockNumber bn = ( h == LatestBlock || h == PendingBlock ) ? client()->number() : h;

u256 baseFeePerGas;
if ( EIP1559TransactionsPatch::isEnabledWhen( client()->blockInfo( bn - 1 ).timestamp() ) )
if ( bn > 0 &&
EIP1559TransactionsPatch::isEnabledWhen( client()->blockInfo( bn - 1 ).timestamp() ) )
try {
baseFeePerGas = client()->gasBidPrice( bn - 1 );
} catch ( std::invalid_argument& _e ) {
Expand Down Expand Up @@ -962,7 +963,7 @@ Json::Value Eth::eth_createAccessList(
return result;
}

Json::Value Eth::eth_feeHistory( const std::string& _blockCount, const std::string& _newestBlock,
Json::Value Eth::eth_feeHistory( dev::u256 _blockCount, const std::string& _newestBlock,
const Json::Value& _rewardPercentiles ) {
try {
if ( !_rewardPercentiles.isArray() )
Expand All @@ -974,8 +975,7 @@ Json::Value Eth::eth_feeHistory( const std::string& _blockCount, const std::stri
}
}

auto blockCount = jsToU256( _blockCount );
if ( blockCount > MAX_BLOCK_RANGE )
if ( _blockCount > MAX_BLOCK_RANGE )
throw std::runtime_error( "Max block range reached. Please try smaller blockCount." );

auto newestBlock = jsToBlockNumber( _newestBlock );
Expand All @@ -984,10 +984,10 @@ Json::Value Eth::eth_feeHistory( const std::string& _blockCount, const std::stri

auto result = Json::Value( Json::objectValue );
dev::u256 oldestBlock;
if ( blockCount > newestBlock )
if ( _blockCount > newestBlock )
oldestBlock = 1;
else
oldestBlock = dev::u256( newestBlock ) - blockCount + 1;
oldestBlock = dev::u256( newestBlock ) - _blockCount + 1;
result["oldestBlock"] = toJS( oldestBlock );

result["baseFeePerGas"] = Json::Value( Json::arrayValue );
Expand Down
Loading
Loading