From ed6f1324aab8ded069fd553fbcbdd250c5b29144 Mon Sep 17 00:00:00 2001 From: jimmyshi <417711026@qq.com> Date: Wed, 15 Nov 2023 18:15:17 +0800 Subject: [PATCH] sync code from 3.2.4: fix evm&build_chain (#4011) --- CMakeLists.txt | 2 +- README.md | 2 +- bcos-crypto/bcos-crypto/ChecksumAddress.h | 7 ++++--- .../executive/BillingTransactionExecutive.cpp | 10 ++++++---- .../src/executor/TransactionExecutor.cpp | 8 -------- bcos-executor/src/vm/DelegateHostContext.cpp | 11 +++++++++++ bcos-executor/src/vm/DelegateHostContext.h | 2 ++ bcos-executor/src/vm/EVMHostInterface.cpp | 19 +++++++++++++++++-- bcos-executor/src/vm/HostContext.cpp | 16 ++++++++++++++++ bcos-executor/src/vm/HostContext.h | 8 +++++++- .../bcos-framework/ledger/Features.h | 2 ++ .../bcos-framework/protocol/Protocol.h | 3 ++- .../unittests/interfaces/FeaturesTest.cpp | 18 ++++++++++-------- bcos-scheduler/src/BlockExecutive.cpp | 2 +- bcos-scheduler/src/DmcExecutor.cpp | 2 +- bcos-scheduler/src/DmcExecutor.h | 9 +++++++-- bcos-scheduler/src/ShardingBlockExecutive.cpp | 2 +- bcos-scheduler/src/ShardingDmcExecutor.h | 4 ++-- bcos-scheduler/test/testDmcExecutor.cpp | 9 +++++---- cmake/CompilerSettings.cmake | 1 + tools/BcosAirBuilder/build_chain.sh | 2 +- .../max/conf/config-build-example.toml | 2 +- .../tests/TestHostContext.cpp | 2 +- 23 files changed, 100 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b78ebf21ed..dd7f9e5e3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ endif() list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) -set(VERSION "3.5.0") +set(VERSION "3.6.0") set(VERSION_SUFFIX "") include(Options) configure_project() diff --git a/README.md b/README.md index 3970addc34..482be01706 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ FISCO BCOS(读作/ˈfɪskl bi:ˈkɒz/) 是一个稳定、高效、安全的 ## 版本信息 - 稳定版本(生产环境使用):v3.2.3,版本内容可参考[《FISCO-BCOS v3.2.3版本说明》](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v3.2.3) -- 最新版本(用户体验新特性):v3.5.0,版本内容可参考 [《FISCO-BCOS v3.5.0版本说明》](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v3.5.0) +- 最新版本(用户体验新特性):v3.6.0,版本内容可参考 [《FISCO-BCOS v3.6.0版本说明》](https://github.com/FISCO-BCOS/FISCO-BCOS/releases/tag/v3.6.0) ## 系统概述 FISCO BCOS系统架构包括基础层、核心层、服务层、用户层和接入层提供稳定、安全的区块链底层服务。中间件层通过可视化界面,简化了用户管理区块链系统的流程。右侧配套相关开发、运维、安全控制的组件,辅助应用落地过程中不同角色的需要;同时,提供隐私保护和跨链相关的技术组件,满足不同场景的应用诉求。 diff --git a/bcos-crypto/bcos-crypto/ChecksumAddress.h b/bcos-crypto/bcos-crypto/ChecksumAddress.h index 1369787744..dcf3cff11f 100644 --- a/bcos-crypto/bcos-crypto/ChecksumAddress.h +++ b/bcos-crypto/bcos-crypto/ChecksumAddress.h @@ -100,12 +100,13 @@ inline std::string newEVMAddress( inline std::string newEVMAddress(bcos::crypto::Hash::Ptr _hashImpl, const std::string_view& _sender, bytesConstRef _init, u256 const& _salt) { - auto hash = - _hashImpl->hash(bytes{0xff} + _sender + toBigEndian(_salt) + _hashImpl->hash(_init)); + auto hash = _hashImpl->hash( + bytes{0xff} + (_sender.starts_with("0x") ? fromHexWithPrefix(_sender) : fromHex(_sender)) + + toBigEndian(_salt) + _hashImpl->hash(_init)); std::string hexAddress; hexAddress.reserve(40); - boost::algorithm::hex(hash.data(), hash.data() + 20, std::back_inserter(hexAddress)); + boost::algorithm::hex(hash.data() + 12, hash.data() + 32, std::back_inserter(hexAddress)); toAddress(hexAddress, _hashImpl); diff --git a/bcos-executor/src/executive/BillingTransactionExecutive.cpp b/bcos-executor/src/executive/BillingTransactionExecutive.cpp index 402cb10f87..58936c37d0 100644 --- a/bcos-executor/src/executive/BillingTransactionExecutive.cpp +++ b/bcos-executor/src/executive/BillingTransactionExecutive.cpp @@ -7,6 +7,7 @@ using namespace bcos::precompiled; CallParameters::UniquePtr BillingTransactionExecutive::start(CallParameters::UniquePtr input) { + int64_t originGas = input->gas; uint64_t currentSeq = input->seq; std::string currentSenderAddr = input->senderAddress; auto message = TransactionExecutive::execute(std::move(input)); @@ -19,16 +20,17 @@ CallParameters::UniquePtr BillingTransactionExecutive::start(CallParameters::Uni callParam4AccountPre->senderAddress = currentSenderAddr; callParam4AccountPre->receiveAddress = ACCOUNT_ADDRESS; - //Todo: need to get from block. + // Todo: need to get from block. u256 gasPrice = 1; - bytes subBalanceIn = codec.encodeWithSig("subAccountBalance(uint256)", message->gas * gasPrice); + int64_t gasUsed = originGas - message->gas; + bytes subBalanceIn = codec.encodeWithSig("subAccountBalance(uint256)", gasUsed * gasPrice); std::vector codeParameters{currentSenderAddr}; auto newParams = codec.encode(codeParameters, subBalanceIn); callParam4AccountPre->data = std::move(newParams); - + auto subBalanceRet = callPrecompiled(std::move(callParam4AccountPre)); - if(subBalanceRet->type == CallParameters::REVERT) + if (subBalanceRet->type == CallParameters::REVERT) { message->type = subBalanceRet->type; message->status = subBalanceRet->status; diff --git a/bcos-executor/src/executor/TransactionExecutor.cpp b/bcos-executor/src/executor/TransactionExecutor.cpp index b4b12ff217..dc6325e326 100644 --- a/bcos-executor/src/executor/TransactionExecutor.cpp +++ b/bcos-executor/src/executor/TransactionExecutor.cpp @@ -972,14 +972,6 @@ void TransactionExecutor::executeTransactionsInternal(std::string contractAddres } }); - if (isStaticCall) - { - EXECUTOR_NAME_LOG(FATAL) - << "executeTransactionsInternal() only handle non static transactions but " - "receive static call"; - assert(false); - } - auto prepareT = utcTime() - startT; startT = utcTime(); diff --git a/bcos-executor/src/vm/DelegateHostContext.cpp b/bcos-executor/src/vm/DelegateHostContext.cpp index cbe0f52a3f..949d3ce009 100644 --- a/bcos-executor/src/vm/DelegateHostContext.cpp +++ b/bcos-executor/src/vm/DelegateHostContext.cpp @@ -14,6 +14,7 @@ DelegateHostContext::DelegateHostContext(CallParameters::UniquePtr callParameter } setCode(getCallParameters()->delegateCallCode); m_delegateCallSender = getCallParameters()->delegateCallSender; + m_thisAddress = getCallParameters()->receiveAddress; } std::optional DelegateHostContext::code() @@ -35,6 +36,16 @@ h256 DelegateHostContext::codeHash() return m_codeHash; } +std::string_view DelegateHostContext::myAddress() const +{ + if (this->features().get(ledger::Features::Flag::bugfix_evm_create2_delegatecall_staticcall_codecopy)) + { + return m_thisAddress; + } + + return HostContext::myAddress(); +} + std::string_view DelegateHostContext::caller() const { return m_delegateCallSender; diff --git a/bcos-executor/src/vm/DelegateHostContext.h b/bcos-executor/src/vm/DelegateHostContext.h index c9c700e786..ea0bbabc52 100644 --- a/bcos-executor/src/vm/DelegateHostContext.h +++ b/bcos-executor/src/vm/DelegateHostContext.h @@ -37,11 +37,13 @@ class DelegateHostContext : public HostContext bool setCode(bytes code) override; h256 codeHash() override; + std::string_view myAddress() const override; std::string_view caller() const override; private: storage::Entry m_code; h256 m_codeHash; + std::string m_thisAddress; std::string m_delegateCallSender; }; diff --git a/bcos-executor/src/vm/EVMHostInterface.cpp b/bcos-executor/src/vm/EVMHostInterface.cpp index 685fd485c2..1c4c70b402 100644 --- a/bcos-executor/src/vm/EVMHostInterface.cpp +++ b/bcos-executor/src/vm/EVMHostInterface.cpp @@ -114,10 +114,25 @@ evmc_bytes32 getCodeHash(evmc_host_context* _context, const evmc_address* _addr) * @param _bufferSize : code size to copy * @return size_t : return copied code size(in byte) */ -size_t copyCode(evmc_host_context* _context, const evmc_address*, size_t, uint8_t* _bufferData, - size_t _bufferSize) +size_t copyCode(evmc_host_context* _context, const evmc_address* _addr, size_t _codeOffset, + uint8_t* _bufferData, size_t _bufferSize) { auto& hostContext = static_cast(*_context); + if (hostContext.features().get( + ledger::Features::Flag::bugfix_evm_create2_delegatecall_staticcall_codecopy)) + { + auto addr = fromEvmC(*_addr); + bytes const& code = hostContext.codeAt(addr); + + // Handle "big offset" edge case. + if (_codeOffset >= code.size()) + return 0; + + size_t maxToCopy = code.size() - _codeOffset; + size_t numToCopy = std::min(maxToCopy, _bufferSize); + std::copy_n(&code[_codeOffset], numToCopy, _bufferData); + return numToCopy; + } hostContext.setCode(bytes((bcos::byte*)_bufferData, (bcos::byte*)_bufferData + _bufferSize)); return _bufferSize; diff --git a/bcos-executor/src/vm/HostContext.cpp b/bcos-executor/src/vm/HostContext.cpp index 527768ab5d..bb6b7b6a44 100644 --- a/bcos-executor/src/vm/HostContext.cpp +++ b/bcos-executor/src/vm/HostContext.cpp @@ -128,11 +128,18 @@ evmc_result HostContext::externalRequest(const evmc_message* _msg) request->senderAddress = myAddress(); request->origin = origin(); request->status = 0; + request->value = fromEvmC(_msg->value); const auto& blockContext = m_executive->blockContext(); switch (_msg->kind) { case EVMC_CREATE2: request->createSalt = fromEvmC(_msg->create2_salt); + if (features().get( + ledger::Features::Flag::bugfix_evm_create2_delegatecall_staticcall_codecopy)) + { + request->data.assign(_msg->input_data, _msg->input_data + _msg->input_size); + request->create = true; + } break; case EVMC_CALL: if (blockContext.isWasm()) @@ -209,6 +216,15 @@ evmc_result HostContext::externalRequest(const evmc_message* _msg) request->staticCall = m_callParameters->staticCall; + if (features().get(ledger::Features::Flag::bugfix_evm_create2_delegatecall_staticcall_codecopy)) + { + // EVM STATICCALL opcode support + if (_msg->flags & EVMC_STATIC) + { + request->staticCall = true; + } + } + auto response = m_executive->externalCall(std::move(request)); // Convert CallParameters to evmc_resultx diff --git a/bcos-executor/src/vm/HostContext.h b/bcos-executor/src/vm/HostContext.h index e4fde37387..cb20e51ee9 100644 --- a/bcos-executor/src/vm/HostContext.h +++ b/bcos-executor/src/vm/HostContext.h @@ -115,7 +115,7 @@ class HostContext : public evmc_host_context void log(h256s&& _topics, bytesConstRef _data); /// ------ get interfaces related to HostContext------ - std::string_view myAddress() const; + virtual std::string_view myAddress() const; virtual std::string_view caller() const { return m_callParameters->senderAddress; } std::string_view origin() const { return m_callParameters->origin; } std::string_view codeAddress() const { return m_callParameters->codeAddress; } @@ -160,6 +160,12 @@ class HostContext : public evmc_host_context bool isWasm(); + bcos::bytes codeAt(const std::string_view& address) { return externalCodeRequest(address); } + const bcos::ledger::Features& features() const + { + return m_executive->blockContext().features(); + } + protected: const CallParameters::UniquePtr& getCallParameters() const { return m_callParameters; } virtual bcos::bytes externalCodeRequest(const std::string_view& address); diff --git a/bcos-framework/bcos-framework/ledger/Features.h b/bcos-framework/bcos-framework/ledger/Features.h index a3cd5afb0d..f27c0ce951 100644 --- a/bcos-framework/bcos-framework/ledger/Features.h +++ b/bcos-framework/bcos-framework/ledger/Features.h @@ -32,6 +32,7 @@ class Features { bugfix_revert, // https://github.com/FISCO-BCOS/FISCO-BCOS/issues/3629 bugfix_statestorage_hash, + bugfix_evm_create2_delegatecall_staticcall_codecopy, feature_dmc2serial, feature_sharding, feature_rpbft, @@ -119,6 +120,7 @@ class Features if (version >= protocol::BlockVersion::V3_2_4_VERSION) { set(Flag::bugfix_statestorage_hash); + set(Flag::bugfix_evm_create2_delegatecall_staticcall_codecopy); } setToShardingDefault(version); } diff --git a/bcos-framework/bcos-framework/protocol/Protocol.h b/bcos-framework/bcos-framework/protocol/Protocol.h index 09441e8de6..21352fe57d 100644 --- a/bcos-framework/bcos-framework/protocol/Protocol.h +++ b/bcos-framework/bcos-framework/protocol/Protocol.h @@ -126,7 +126,7 @@ enum class BlockVersion : uint32_t V3_0_VERSION = 0x03000000, RC4_VERSION = 4, MIN_VERSION = RC4_VERSION, - MAX_VERSION = V3_5_VERSION, + MAX_VERSION = V3_6_VERSION, }; enum class TransactionVersion : uint32_t @@ -143,6 +143,7 @@ const std::string V3_2_VERSION_STR = "3.2.0"; const std::string V3_3_VERSION_STR = "3.3.0"; const std::string V3_4_VERSION_STR = "3.4.0"; const std::string V3_5_VERSION_STR = "3.5.0"; +const std::string V3_6_VERSION_STR = "3.6.0"; const std::string RC_VERSION_PREFIX = "3.0.0-rc"; diff --git a/bcos-framework/test/unittests/interfaces/FeaturesTest.cpp b/bcos-framework/test/unittests/interfaces/FeaturesTest.cpp index 4020594f9e..50850fd902 100644 --- a/bcos-framework/test/unittests/interfaces/FeaturesTest.cpp +++ b/bcos-framework/test/unittests/interfaces/FeaturesTest.cpp @@ -126,16 +126,18 @@ BOOST_AUTO_TEST_CASE(feature) BOOST_CHECK_EQUAL(features7.get("feature_balance_policy1"), true); auto keys = Features::featureKeys(); - BOOST_CHECK_EQUAL(keys.size(), 9); + + BOOST_CHECK_EQUAL(keys.size(), 10); BOOST_CHECK_EQUAL(keys[0], "bugfix_revert"); BOOST_CHECK_EQUAL(keys[1], "bugfix_statestorage_hash"); - BOOST_CHECK_EQUAL(keys[2], "feature_dmc2serial"); - BOOST_CHECK_EQUAL(keys[3], "feature_sharding"); - BOOST_CHECK_EQUAL(keys[4], "feature_rpbft"); - BOOST_CHECK_EQUAL(keys[5], "feature_paillier"); - BOOST_CHECK_EQUAL(keys[6], "feature_balance"); - BOOST_CHECK_EQUAL(keys[7], "feature_balance_precompiled"); - BOOST_CHECK_EQUAL(keys[8], "feature_balance_policy1"); + BOOST_CHECK_EQUAL(keys[2], "bugfix_evm_create2_delegatecall_staticcall_codecopy"); + BOOST_CHECK_EQUAL(keys[3], "feature_dmc2serial"); + BOOST_CHECK_EQUAL(keys[4], "feature_sharding"); + BOOST_CHECK_EQUAL(keys[5], "feature_rpbft"); + BOOST_CHECK_EQUAL(keys[6], "feature_paillier"); + BOOST_CHECK_EQUAL(keys[7], "feature_balance"); + BOOST_CHECK_EQUAL(keys[8], "feature_balance_precompiled"); + BOOST_CHECK_EQUAL(keys[9], "feature_balance_policy1"); } BOOST_AUTO_TEST_SUITE_END() diff --git a/bcos-scheduler/src/BlockExecutive.cpp b/bcos-scheduler/src/BlockExecutive.cpp index 2f2eb21b13..0edddcf31e 100644 --- a/bcos-scheduler/src/BlockExecutive.cpp +++ b/bcos-scheduler/src/BlockExecutive.cpp @@ -1514,7 +1514,7 @@ DmcExecutor::Ptr BlockExecutive::buildDmcExecutor(const std::string& name, bcos::executor::ParallelTransactionExecutorInterface::Ptr executor) { auto dmcExecutor = std::make_shared(name, contractAddress, m_block, executor, - m_keyLocks, m_scheduler->m_hashImpl, m_dmcRecorder); + m_keyLocks, m_scheduler->m_hashImpl, m_dmcRecorder, isCall()); return dmcExecutor; } diff --git a/bcos-scheduler/src/DmcExecutor.cpp b/bcos-scheduler/src/DmcExecutor.cpp index 5e6ff06b5e..0b41142c16 100644 --- a/bcos-scheduler/src/DmcExecutor.cpp +++ b/bcos-scheduler/src/DmcExecutor.cpp @@ -223,7 +223,7 @@ void DmcExecutor::go(std::function callbac // record all send message for debug m_dmcRecorder->recordSends(m_contractAddress, *messages); - if (messages->size() == 1 && (*messages)[0]->staticCall()) + if (isCall()) { DMC_LOG(TRACE) << "send call request, address:" << m_contractAddress << LOG_KV("executor", m_name) << LOG_KV("to", (*messages)[0]->to()) diff --git a/bcos-scheduler/src/DmcExecutor.h b/bcos-scheduler/src/DmcExecutor.h index 895bcfba74..8176dff4ff 100644 --- a/bcos-scheduler/src/DmcExecutor.h +++ b/bcos-scheduler/src/DmcExecutor.h @@ -53,14 +53,15 @@ class DmcExecutor : public std::enable_shared_from_this DmcExecutor(std::string name, std::string contractAddress, bcos::protocol::Block::Ptr block, bcos::executor::ParallelTransactionExecutorInterface::Ptr executor, GraphKeyLocks::Ptr keyLocks, bcos::crypto::Hash::Ptr hashImpl, - DmcStepRecorder::Ptr dmcRecorder) + DmcStepRecorder::Ptr dmcRecorder, bool isCall) : m_name(name), m_contractAddress(contractAddress), m_block(block), m_executor(executor), m_keyLocks(keyLocks), m_hashImpl(hashImpl), - m_dmcRecorder(dmcRecorder) + m_dmcRecorder(dmcRecorder), + m_isCall(isCall) {} virtual ~DmcExecutor() = default; @@ -128,6 +129,8 @@ class DmcExecutor : public std::enable_shared_from_this bool hasContractTableChanged() { return m_hasContractTableChanged; } + void setIsCall(bool isCall) { m_isCall = isCall; } + protected: virtual void executorCall(bcos::protocol::ExecutionMessage::UniquePtr input, std::function @@ -153,6 +156,7 @@ class DmcExecutor : public std::enable_shared_from_this std::string newEVMAddress(int64_t blockNumber, int64_t contextID, int64_t seq); std::string newEVMAddress( const std::string_view& _sender, bytesConstRef _init, u256 const& _salt); + bool isCall() { return m_isCall; } protected: std::string m_name; @@ -164,6 +168,7 @@ class DmcExecutor : public std::enable_shared_from_this DmcStepRecorder::Ptr m_dmcRecorder; ExecutivePool m_executivePool; bool m_hasContractTableChanged = false; + bool m_isCall; mutable SharedMutex x_concurrentLock; diff --git a/bcos-scheduler/src/ShardingBlockExecutive.cpp b/bcos-scheduler/src/ShardingBlockExecutive.cpp index e6e1ef05de..e7a18b2b2e 100644 --- a/bcos-scheduler/src/ShardingBlockExecutive.cpp +++ b/bcos-scheduler/src/ShardingBlockExecutive.cpp @@ -225,7 +225,7 @@ DmcExecutor::Ptr ShardingBlockExecutive::buildDmcExecutor(const std::string& nam bcos::executor::ParallelTransactionExecutorInterface::Ptr executor) { auto dmcExecutor = std::make_shared(name, contractAddress, m_block, - executor, m_keyLocks, m_hashImpl, m_dmcRecorder, m_schedulerTermId); + executor, m_keyLocks, m_hashImpl, m_dmcRecorder, m_schedulerTermId, isCall()); return dmcExecutor; } diff --git a/bcos-scheduler/src/ShardingDmcExecutor.h b/bcos-scheduler/src/ShardingDmcExecutor.h index 1297ab156b..a773dc75b3 100644 --- a/bcos-scheduler/src/ShardingDmcExecutor.h +++ b/bcos-scheduler/src/ShardingDmcExecutor.h @@ -33,9 +33,9 @@ class ShardingDmcExecutor : public DmcExecutor bcos::protocol::Block::Ptr block, bcos::executor::ParallelTransactionExecutorInterface::Ptr executor, GraphKeyLocks::Ptr keyLocks, bcos::crypto::Hash::Ptr hashImpl, - DmcStepRecorder::Ptr dmcRecorder, int64_t schedulerTermId) + DmcStepRecorder::Ptr dmcRecorder, int64_t schedulerTermId, bool isCall) : DmcExecutor(std::move(name), std::move(contractAddress), block, executor, keyLocks, - hashImpl, dmcRecorder), + hashImpl, dmcRecorder, isCall), m_schedulerTermId(schedulerTermId) {} diff --git a/bcos-scheduler/test/testDmcExecutor.cpp b/bcos-scheduler/test/testDmcExecutor.cpp index fd77a52209..6ba348e10d 100644 --- a/bcos-scheduler/test/testDmcExecutor.cpp +++ b/bcos-scheduler/test/testDmcExecutor.cpp @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(stateSwitchTest) block->setBlockHeader(blockHeader); // block = fakeBlock(cryptoSuite, blockFactory, 1, 1, 1); auto dmcExecutor = std::make_shared( - "DmcExecutor1", "0xaabbccdd", block, executor1, keyLocks, hashImpl, dmcRecorder); + "DmcExecutor1", "0xaabbccdd", block, executor1, keyLocks, hashImpl, dmcRecorder, false); dmcExecutor->setSchedulerOutHandler( [this, &dmcFlagStruct](bcos::scheduler::ExecutiveState::Ptr executiveState) { @@ -103,7 +103,7 @@ BOOST_AUTO_TEST_CASE(stateSwitchTest) blockHeader->calculateHash(*hashImpl); block->setBlockHeader(blockHeader); auto dmcExecutor2 = std::make_shared( - "DmcExecutor2", to, block, executor1, keyLocks, hashImpl, dmcRecorder); + "DmcExecutor2", to, block, executor1, keyLocks, hashImpl, dmcRecorder, false); dmcExecutor2->scheduleIn(executiveState); }); @@ -226,6 +226,7 @@ BOOST_AUTO_TEST_CASE(stateSwitchTest) // call + dmcExecutor->setIsCall(true); auto callMessage = createMessage(4, 0, 1, "0xaabbccdd", true); dmcExecutor->submit(std::move(callMessage), false); dmcExecutor->prepare(); @@ -253,7 +254,7 @@ BOOST_AUTO_TEST_CASE(keyLocksTest) block->setBlockHeader(blockHeader); // block = fakeBlock(cryptoSuite, blockFactory, 1, 1, 1); auto dmcExecutor = std::make_shared( - "DmcExecutor1", "0xaabbccdd", block, executor1, keyLocks, hashImpl, dmcRecorder); + "DmcExecutor1", "0xaabbccdd", block, executor1, keyLocks, hashImpl, dmcRecorder, false); dmcExecutor->setSchedulerOutHandler( [this, &dmcFlagStruct](bcos::scheduler::ExecutiveState::Ptr executiveState) { @@ -266,7 +267,7 @@ BOOST_AUTO_TEST_CASE(keyLocksTest) blockHeader->calculateHash(*blockFactory->cryptoSuite()->hashImpl()); block->setBlockHeader(blockHeader); auto dmcExecutor2 = std::make_shared( - "DmcExecutor2", to, block, executor1, keyLocks, hashImpl, dmcRecorder); + "DmcExecutor2", to, block, executor1, keyLocks, hashImpl, dmcRecorder, false); dmcExecutor2->scheduleIn(executiveState); }); diff --git a/cmake/CompilerSettings.cmake b/cmake/CompilerSettings.cmake index f3c3a87e57..18e533f0ae 100644 --- a/cmake/CompilerSettings.cmake +++ b/cmake/CompilerSettings.cmake @@ -129,6 +129,7 @@ if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR("${CMAKE_CXX_COMPILER_ID}" MATC add_compile_options(-fstack-protector) add_compile_options(-Winconsistent-missing-override) + add_compile_options(-foptimize-sibling-calls) # Some Linux-specific Clang settings. We don't want these for OS X. if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") diff --git a/tools/BcosAirBuilder/build_chain.sh b/tools/BcosAirBuilder/build_chain.sh index 0976776e76..18676bde9f 100755 --- a/tools/BcosAirBuilder/build_chain.sh +++ b/tools/BcosAirBuilder/build_chain.sh @@ -408,7 +408,7 @@ download_bin() LOG_INFO "Downloading fisco-bcos binary from ${github_link} ..." curl -#LO "${github_link}" fi - if [[ "$(ls -al . | grep "fisco-bcos.*tar.gz" | awk '{print $5}')" -lt "1048576" ]];then + if [[ "$(ls -al . | grep "fisco-bcos.*tar.gz" | grep -vE "lightnode"| awk '{print $5}')" -lt "1048576" ]];then exit_with_clean "Download fisco-bcos failed, please try again. Or download and extract it manually from ${Download_Link} and use -e option." fi mkdir -p bin && mv ${package_name} bin && cd bin && tar -zxf ${package_name} && cd .. diff --git a/tools/BcosBuilder/max/conf/config-build-example.toml b/tools/BcosBuilder/max/conf/config-build-example.toml index 6837763a9f..b378bd9ec7 100644 --- a/tools/BcosBuilder/max/conf/config-build-example.toml +++ b/tools/BcosBuilder/max/conf/config-build-example.toml @@ -36,7 +36,7 @@ consensus_type = "pbft" # transaction gas limit gas_limit = "3000000000" # compatible version, can be dynamically upgraded through setSystemConfig -compatibility_version="3.5.0" +compatibility_version="3.6.0" [[agency]] name = "agencyA" diff --git a/transaction-executor/tests/TestHostContext.cpp b/transaction-executor/tests/TestHostContext.cpp index 88d3157e32..210492738b 100644 --- a/transaction-executor/tests/TestHostContext.cpp +++ b/transaction-executor/tests/TestHostContext.cpp @@ -287,7 +287,7 @@ BOOST_AUTO_TEST_CASE(precompiled) storageWrapper); bcos::ledger::GenesisConfig genesis; genesis.m_txGasLimit = 100000; - genesis.m_compatibilityVersion = bcos::tool::toVersionNumber("3.5.0"); + genesis.m_compatibilityVersion = bcos::tool::toVersionNumber("3.6.0"); ledger.buildGenesisBlock(genesis, ledgerConfig); bcostars::protocol::BlockHeaderImpl blockHeader(