Skip to content

Commit

Permalink
Merge pull request #2028 from skalenetwork/develop
Browse files Browse the repository at this point in the history
3.20.0 beta
  • Loading branch information
DmytroNazarenko authored Oct 18, 2024
2 parents d5954f1 + afb8365 commit 5bc5e67
Show file tree
Hide file tree
Showing 42 changed files with 1,454 additions and 1,650 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: skalenetwork/skale-ci-integration_tests
ref: master
ref: v3.20.0
submodules: recursive
- name: Set up Node
uses: actions/setup-node@v3.4.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
sudo rm -rf /tmp/tests/*
cd build/test
export NO_NTP_CHECK=1
export NO_ULIMIT_CHECK=1
export NO_ULIMIT_CHECK=1
function run_test() { ./testeth --report_level=detailed -t "$1" -- --express && touch "/tmp/tests/${1}Passed"; }
run_test TransitionTests
run_test TransactionTests
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.19.3
3.20.0
2 changes: 1 addition & 1 deletion cmake/EthUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ macro(eth_add_test NAME)
add_custom_target("test.${NAME}"
DEPENDS testeth
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -DETH_TEST_NAME="${NAME}" -DCTEST_COMMAND="${CTEST_COMMAND}" -P "${ETH_SCRIPTS_DIR}/runtest.cmake"
COMMAND ${CMAKE_COMMAND} -DETH_TEST_NAME="${NAME}" -DCTEST_COMMAND="${CMAKE_CTEST_COMMAND}" -P "${ETH_SCRIPTS_DIR}/runtest.cmake"
)

endmacro()
Expand Down
32 changes: 25 additions & 7 deletions deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1158,16 +1158,20 @@ then
#
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd libuv
eval ./autogen.sh
eval ./configure "${CONF_CROSSCOMPILING_OPTS_GENERIC}" --enable-static --disable-shared --with-pic --prefix="$INSTALL_ROOT" "${CONF_DEBUG_OPTIONS}"
# eval ./autogen.sh
# eval ./configure "${CONF_CROSSCOMPILING_OPTS_GENERIC}" --enable-static --disable-shared --with-pic --prefix="$INSTALL_ROOT" "${CONF_DEBUG_OPTIONS}"
#--with-sysroot=="$INSTALL_ROOT"
cd ..
mkdir build && cd build
eval "$CMAKE" "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \
-DBUILD_SHARED_LIBS=OFF -DLIBUV_BUILD_SHARED=OFF\
..
cd ../..
fi
echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}"
cd libuv
cd libuv/build
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}"
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}" install
cd ..
cd ../..
cd "$SOURCES_ROOT"
else
echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}"
Expand Down Expand Up @@ -1391,13 +1395,21 @@ then
cd boost_1_68_0
echo -e "${COLOR_INFO}configuring and building it${COLOR_DOTS}...${COLOR_RESET}"
eval ./bootstrap.sh --prefix="$INSTALL_ROOT" --with-libraries=atomic,context,filesystem,program_options,regex,system,thread,date_time,iostreams

if [ "$DEBUG" = "1" ]; then
variant=debug
else
variant=release
fi

if [ ${ARCH} = "arm" ]
then
sed -i -e 's#using gcc ;#using gcc : arm : /usr/local/toolchains/gcc7.2-arm/bin/arm-linux-gnueabihf-g++ ;#g' project-config.jam
eval ./b2 "${CONF_CROSSCOMPILING_OPTS_BOOST}" cxxflags=-fPIC cflags=-fPIC "${PARALLEL_MAKE_OPTIONS}" --prefix="$INSTALL_ROOT" --layout=system variant=debug link=static threading=multi install
eval ./b2 "${CONF_CROSSCOMPILING_OPTS_BOOST}" cxxflags=-fPIC cflags=-fPIC "${PARALLEL_MAKE_OPTIONS}" --prefix="$INSTALL_ROOT" --layout=system variant=$variant link=static threading=multi install
else
eval ./b2 cxxflags=-fPIC cflags=-fPIC "${PARALLEL_MAKE_OPTIONS}" --prefix="$INSTALL_ROOT" --layout=system variant=debug link=static threading=multi install
eval ./b2 cxxflags=-fPIC cflags=-fPIC "${PARALLEL_MAKE_OPTIONS}" --prefix="$INSTALL_ROOT" --layout=system variant=$variant link=static threading=multi install
fi

cd ..
cd "$SOURCES_ROOT"
else
Expand Down Expand Up @@ -2082,6 +2094,7 @@ then
eval tar -xzf folly-from-git.tar.gz
fi
echo -e "${COLOR_INFO}fixing it${COLOR_DOTS}...${COLOR_RESET}"
sed -i 's/list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})/list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES} lzma)/' ./folly/CMake/folly-deps.cmake
sed -i 's/google::InstallFailureFunction(abort);/google::InstallFailureFunction( reinterpret_cast < google::logging_fail_func_t > ( abort ) );/g' ./folly/folly/init/Init.cpp
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd folly
Expand All @@ -2091,6 +2104,8 @@ then
-DBOOST_ROOT="$INSTALL_ROOT" -DBOOST_LIBRARYDIR="$INSTALL_ROOT/lib" -DBoost_NO_WARN_NEW_VERSIONS=1 -DBoost_DEBUG=ON \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTS=OFF -DBUILD_BROKEN_TESTS=OFF -DBUILD_HANGING_TESTS=OFF -DBUILD_SLOW_TESTS=OFF \
-DCMAKE_INCLUDE_PATH="${INSTALL_ROOT}/include" \
-DCMAKE_LIBRARY_PATH="${INSTALL_ROOT}/lib" \
..
cd ..
else
Expand All @@ -2100,6 +2115,9 @@ then
cd build2
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}"
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}" install
if [ "$DEBUG" = "0" ]; then
eval strip --strip-debug "${INSTALL_ROOT}"/lib/libfolly*.a
fi
cd "$SOURCES_ROOT"
else
echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}"
Expand Down
4 changes: 3 additions & 1 deletion libethcore/ChainOperationParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ EVMSchedule const ChainOperationParams::makeEvmSchedule(
result = EIP158Schedule;
else if ( _workingBlockNumber >= EIP150ForkBlock )
result = EIP150Schedule;
else if ( _workingBlockNumber >= homesteadForkBlock )
return HomesteadSchedule;
else
result = HomesteadSchedule;
return FrontierSchedule;

// 2 based on previous - decide by timestamp
if ( PushZeroPatch::isEnabledWhen( _committedBlockTimestamp ) )
Expand Down
11 changes: 7 additions & 4 deletions libethcore/ChainOperationParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ class PrecompiledContract {
u256 const& _blockNumber ) const {
return m_cost( _in, _chainParams, _blockNumber );
}
std::pair< bool, bytes > execute( bytesConstRef _in ) const { return m_execute( _in ); }
std::pair< bool, bytes > execute(
bytesConstRef _in, skale::OverlayFS* _overlayFS = nullptr ) const {
return m_execute( _in, _overlayFS );
}

u256 const& startingBlock() const { return m_startingBlock; }

Expand Down Expand Up @@ -270,9 +273,9 @@ struct ChainOperationParams {
Address const& _a, bytesConstRef _in, u256 const& _blockNumber ) const {
return precompiled.at( _a ).cost( _in, *this, _blockNumber );
}
std::pair< bool, bytes > executePrecompiled(
Address const& _a, bytesConstRef _in, u256 const& ) const {
return precompiled.at( _a ).execute( _in );
std::pair< bool, bytes > executePrecompiled( Address const& _a, bytesConstRef _in, u256 const&,
skale::OverlayFS* _overlayFS = nullptr ) const {
return precompiled.at( _a ).execute( _in, _overlayFS );
}
bool precompiledExecutionAllowedFrom(
Address const& _a, Address const& _from, bool _readOnly ) const {
Expand Down
2 changes: 2 additions & 0 deletions libethcore/EVMSchedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ struct EVMSchedule {
};

static const EVMSchedule DefaultSchedule = EVMSchedule();
// Used only in GeneralStateTests --all tests
static const EVMSchedule FrontierSchedule = EVMSchedule( false, false, 21000 );
static const EVMSchedule HomesteadSchedule = EVMSchedule( true, true, 53000 );

static const EVMSchedule EIP150Schedule = [] {
Expand Down
48 changes: 24 additions & 24 deletions libethereum/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,37 +799,37 @@ void Client::onPostStateChanged() {
void Client::startSealing() {
if ( m_wouldSeal == true )
return;
LOG( m_logger ) << cc::notice( "Client::startSealing: " ) << author();
LOG( m_logger ) << "Client::startSealing: " << author();
if ( author() ) {
m_wouldSeal = true;
m_signalled.notify_all();
} else
LOG( m_logger ) << cc::warn( "You need to set an author in order to seal!" );
LOG( m_logger ) << "You need to set an author in order to seal!";
}

void Client::rejigSealing() {
if ( ( wouldSeal() || remoteActive() ) && !isMajorSyncing() ) {
if ( sealEngine()->shouldSeal( this ) ) {
m_wouldButShouldnot = false;

LOG( m_loggerDetail ) << cc::notice( "Rejigging seal engine..." );
LOG( m_loggerDetail ) << "Rejigging seal engine...";
DEV_WRITE_GUARDED( x_working ) {
if ( m_working.isSealed() ) {
LOG( m_logger ) << cc::notice( "Tried to seal sealed block..." );
LOG( m_logger ) << "Tried to seal sealed block...";
return;
}
// TODO is that needed? we have "Generating seal on" below
LOG( m_loggerDetail ) << cc::notice( "Starting to seal block" ) << " "
<< cc::warn( "#" ) << cc::num10( m_working.info().number() );
LOG( m_loggerDetail ) << "Starting to seal block"
<< " #" << m_working.info().number();

// TODO Deduplicate code!
// TODO Deduplicate code
dev::h256 stateRootToSet;
if ( m_snapshotAgent->getLatestSnapshotBlockNumer() > 0 ) {
dev::h256 state_root_hash = this->m_snapshotAgent->getSnapshotHash(
dev::h256 stateRootHash = this->m_snapshotAgent->getSnapshotHash(
m_snapshotAgent->getLatestSnapshotBlockNumer() );
stateRootToSet = state_root_hash;
stateRootToSet = stateRootHash;
}
// propagate current!
// propagate current
else if ( this->number() > 0 ) {
stateRootToSet =
blockInfo( this->hashFromNumber( this->number() ) ).stateRoot();
Expand All @@ -847,15 +847,15 @@ void Client::rejigSealing() {

if ( wouldSeal() ) {
sealEngine()->onSealGenerated( [=]( bytes const& _header ) {
LOG( m_logger ) << cc::success( "Block sealed" ) << " " << cc::warn( "#" )
<< cc::num10( BlockHeader( _header, HeaderData ).number() );
LOG( m_logger ) << "Block sealed"
<< " #" << BlockHeader( _header, HeaderData ).number();
if ( this->submitSealed( _header ) )
m_onBlockSealed( _header );
else
LOG( m_logger ) << cc::error( "Submitting block failed..." );
LOG( m_logger ) << "Submitting block failed...";
} );
ctrace << cc::notice( "Generating seal on " ) << m_sealingInfo.hash( WithoutSeal )
<< " " << cc::warn( "#" ) << cc::num10( m_sealingInfo.number() );
ctrace << "Generating seal on " << m_sealingInfo.hash( WithoutSeal ) << " #"
<< m_sealingInfo.number();
sealEngine()->generateSeal( m_sealingInfo );
}
} else
Expand All @@ -868,24 +868,24 @@ void Client::rejigSealing() {
void Client::sealUnconditionally( bool submitToBlockChain ) {
m_wouldButShouldnot = false;

LOG( m_loggerDetail ) << cc::notice( "Rejigging seal engine..." );
LOG( m_loggerDetail ) << "Rejigging seal engine...";
DEV_WRITE_GUARDED( x_working ) {
if ( m_working.isSealed() ) {
LOG( m_logger ) << cc::notice( "Tried to seal sealed block..." );
LOG( m_logger ) << "Tried to seal sealed block...";
return;
}
// TODO is that needed? we have "Generating seal on" below
LOG( m_loggerDetail ) << cc::notice( "Starting to seal block" ) << " " << cc::warn( "#" )
<< cc::num10( m_working.info().number() );
// latest hash is really updated after NEXT snapshot already started hash computation!
// TODO Deduplicate code!
LOG( m_loggerDetail ) << "Starting to seal block"
<< " #" << m_working.info().number();
// latest hash is really updated after NEXT snapshot already started hash computation
// TODO Deduplicate code
dev::h256 stateRootToSet;
if ( m_snapshotAgent->getLatestSnapshotBlockNumer() > 0 ) {
dev::h256 state_root_hash = this->m_snapshotAgent->getSnapshotHash(
dev::h256 stateRootHash = this->m_snapshotAgent->getSnapshotHash(
m_snapshotAgent->getLatestSnapshotBlockNumer() );
stateRootToSet = state_root_hash;
stateRootToSet = stateRootHash;
}
// propagate current!
// propagate current
else if ( this->number() > 0 ) {
stateRootToSet = blockInfo( this->hashFromNumber( this->number() ) ).stateRoot();
} else {
Expand Down
7 changes: 2 additions & 5 deletions libethereum/Executive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,8 @@ bool Executive::call( CallParameters const& _p, u256 const& _gasPrice, Address c
m_gas = ( u256 )( _p.gas - g );
bytes output;
bool success;
// dev::eth::g_state = m_s.delegateWrite();
dev::eth::g_overlayFS = m_s.fs();
tie( success, output ) =
m_chainParams.executePrecompiled( _p.codeAddress, _p.data, m_envInfo.number() );
// m_s = dev::eth::g_state.delegateWrite();
tie( success, output ) = m_chainParams.executePrecompiled(
_p.codeAddress, _p.data, m_envInfo.number(), m_s.fs().get() );
size_t outputSize = output.size();
m_output = owning_bytes_ref{ std::move( output ), 0, outputSize };
if ( !success ) {
Expand Down
Loading

0 comments on commit 5bc5e67

Please sign in to comment.