From 61f0d3c21223d337353cc698adf204e374b04090 Mon Sep 17 00:00:00 2001 From: JimmyShi22 <417711026@qq.com> Date: Tue, 14 Nov 2023 19:05:59 +0800 Subject: [PATCH] update version to 3.6.0 --- CMakeLists.txt | 2 +- README.md | 2 +- .../src/executive/BillingTransactionExecutive.cpp | 10 ++++++---- bcos-executor/src/vm/EVMHostInterface.cpp | 3 ++- bcos-executor/src/vm/HostContext.cpp | 4 +++- bcos-framework/bcos-framework/protocol/Protocol.h | 3 ++- tools/BcosBuilder/max/conf/config-build-example.toml | 2 +- transaction-executor/tests/TestHostContext.cpp | 2 +- 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 894f7d8e9c..e1ca299ea3 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-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/vm/EVMHostInterface.cpp b/bcos-executor/src/vm/EVMHostInterface.cpp index 522fe35d8a..1c4c70b402 100644 --- a/bcos-executor/src/vm/EVMHostInterface.cpp +++ b/bcos-executor/src/vm/EVMHostInterface.cpp @@ -118,7 +118,8 @@ size_t copyCode(evmc_host_context* _context, const evmc_address* _addr, size_t _ uint8_t* _bufferData, size_t _bufferSize) { auto& hostContext = static_cast(*_context); - if (hostContext.features().get(ledger::Features::Flag::bugfix_evm_create2_delegatecall_staticcall_codecopy)) + if (hostContext.features().get( + ledger::Features::Flag::bugfix_evm_create2_delegatecall_staticcall_codecopy)) { auto addr = fromEvmC(*_addr); bytes const& code = hostContext.codeAt(addr); diff --git a/bcos-executor/src/vm/HostContext.cpp b/bcos-executor/src/vm/HostContext.cpp index b526a1a0fa..bb6b7b6a44 100644 --- a/bcos-executor/src/vm/HostContext.cpp +++ b/bcos-executor/src/vm/HostContext.cpp @@ -128,12 +128,14 @@ 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)) + 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; 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/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(