Skip to content

Commit

Permalink
fix generate snapshot failed and update version
Browse files Browse the repository at this point in the history
  • Loading branch information
bxq2011hust committed Aug 14, 2024
1 parent 81baec7 commit 9bee1df
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

set(VERSION "3.10.0")
set(VERSION "3.11.0")
set(VERSION_SUFFIX "")
include(Options)
configure_project()
Expand Down
5 changes: 3 additions & 2 deletions bcos-framework/bcos-framework/protocol/Protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ enum ProtocolVersion : uint32_t

enum class BlockVersion : uint32_t
{
V3_11_0_VERSION = 0x030b0000,
V3_10_0_VERSION = 0x030a0000,
V3_9_0_VERSION = 0x03090000,
V3_8_0_VERSION = 0x03080000,
Expand All @@ -137,7 +138,7 @@ enum class BlockVersion : uint32_t
V3_0_VERSION = 0x03000000,
RC4_VERSION = 4,
MIN_VERSION = RC4_VERSION,
MAX_VERSION = V3_10_0_VERSION,
MAX_VERSION = V3_11_0_VERSION,
};

enum class TransactionVersion : uint32_t
Expand All @@ -152,7 +153,7 @@ const std::string RC4_VERSION_STR = "3.0.0-rc4";
const std::string RC_VERSION_PREFIX = "3.0.0-rc";
const std::string V3_9_VERSION_STR = "3.9.0";

const BlockVersion DEFAULT_VERSION = bcos::protocol::BlockVersion::V3_10_0_VERSION;
const BlockVersion DEFAULT_VERSION = bcos::protocol::BlockVersion::V3_11_0_VERSION;
const std::string DEFAULT_VERSION_STR = V3_9_VERSION_STR;
const uint8_t MAX_MAJOR_VERSION = std::numeric_limits<uint8_t>::max();
const uint8_t MIN_MAJOR_VERSION = 3;
Expand Down
1 change: 0 additions & 1 deletion bcos-sync/bcos-sync/BlockSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,6 @@ void BlockSync::verifyAndCommitArchivedBlock(bcos::protocol::BlockNumber archive
bcos::storage::Entry(std::to_string(topBlockNumber)));
{
WriteGuard lock(x_archivedBlockQueue);
m_archivedBlockQueue.pop();
for (auto topNumber = m_archivedBlockQueue.top()->blockHeader()->number();
topNumber >= topBlockNumber;)
{
Expand Down
7 changes: 6 additions & 1 deletion libinitializer/Initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,13 @@ bcos::Error::Ptr Initializer::generateSnapshot(
std::cerr << "only support RocksDB storage" << std::endl;
return BCOS_ERROR_PTR(-1, "only support RocksDB storage");
}
auto separatedBlockAndState = m_nodeConfig->enableSeparateBlockAndState();

auto stateDBPath = m_nodeConfig->storagePath();
if (separatedBlockAndState)
{
stateDBPath = m_nodeConfig->stateDBPath();
}
auto blockDBPath = m_nodeConfig->blockDBPath();
auto snapshotRoot = snapshotPath + "/snapshot";
fs::path stateSstPath = snapshotRoot + "/state";
Expand Down Expand Up @@ -782,7 +788,6 @@ bcos::Error::Ptr Initializer::generateSnapshot(
auto validNonceEndKey = bcos::storage::toDBKey(
bcos::ledger::SYS_BLOCK_NUMBER_2_NONCES, std::to_string(currentBlockNumber));
const size_t MAX_SST_FILE_BYTE = 256 * 1024 * 1024;
auto separatedBlockAndState = m_nodeConfig->enableSeparateBlockAndState();
rocksdb::Options options;
options.compression = rocksdb::kZSTD;
auto stateSstFileWriter = rocksdb::SstFileWriter(rocksdb::EnvOptions(), options);
Expand Down
8 changes: 5 additions & 3 deletions tools/BcosAirBuilder/build_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ca_dir=""
prometheus_dir=""
config_path=""
docker_mode=
default_version="v3.10.0"
default_version="v3.11.0"
compatibility_version=${default_version}
default_mtail_version="3.0.0-rc49"
compatibility_mtail_version=${default_mtail_version}
Expand Down Expand Up @@ -71,11 +71,11 @@ log_level="info"

# for pro or max default setting
bcos_builder_package=BcosBuilder.tgz
bcos_builder_version=v3.10.0
bcos_builder_version=v3.11.0
use_exist_binary="false"
download_specific_binary_flag="false"
download_service_binary_type="cdn"
service_binary_version="v3.10.0"
service_binary_version="v3.11.0"
download_service_binary_path="binary"
download_service_binary_path_flag="false"
service_type="all"
Expand Down Expand Up @@ -1443,6 +1443,8 @@ generate_common_ini() {
enable_archive=false
archive_ip=127.0.0.1
archive_port=
;enable_separate_block_state=false
;sync_archived_blocks=false
[txpool]
; size of the txpool, default is 15000
Expand Down
2 changes: 1 addition & 1 deletion tools/BcosBuilder/max/conf/config-build-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ consensus_type = "pbft"
# transaction gas limit
gas_limit = "3000000000"
# compatible version, can be dynamically upgraded through setSystemConfig
compatibility_version = "3.10.0"
compatibility_version = "3.11.0"

[[agency]]
name = "agencyA"
Expand Down
2 changes: 1 addition & 1 deletion tools/BcosBuilder/max/conf/config-deploy-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ consensus_type = "pbft"
# transaction gas limit
gas_limit = "3000000000"
# compatible version, can be dynamically upgraded through setSystemConfig
compatibility_version = "3.10.0"
compatibility_version = "3.11.0"

[[agency]]
name = "agencyA"
Expand Down
2 changes: 1 addition & 1 deletion tools/BcosBuilder/pro/conf/config-build-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ consensus_type = "pbft"
# transaction gas limit
gas_limit = "3000000000"
# compatible version, can be dynamically upgraded through setSystemConfig
compatibility_version = "3.10.0"
compatibility_version = "3.11.0"

[[agency]]
name = "agencyA"
Expand Down
2 changes: 1 addition & 1 deletion tools/BcosBuilder/pro/conf/config-deploy-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ consensus_type = "pbft"
# transaction gas limit
gas_limit = "3000000000"
# compatible version, can be dynamically upgraded through setSystemConfig
compatibility_version = "3.10.0"
compatibility_version = "3.11.0"

[[agency]]
name = "agencyA"
Expand Down
2 changes: 1 addition & 1 deletion tools/BcosBuilder/src/common/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CommandInfo:
network_add_vxlan = "add-vxlan"
download_binary = "download_binary"
download_type = ["cdn", "git"]
default_binary_version = "v3.10.0"
default_binary_version = "v3.11.0"
command_list = [gen_config, upload, deploy,
upgrade, undeploy, expand, start, stop]
service_command_list_str = ', '.join(command_list)
Expand Down
2 changes: 1 addition & 1 deletion tools/BcosBuilder/src/tpl/config.genesis
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

[version]
; compatible version, can be dynamically upgraded through setSystemConfig
compatibility_version=3.10.0
compatibility_version=3.11.0

[tx]
; transaction gas limit
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fiscobcos",
"version-string": "3.10.0",
"version-string": "3.11.0",
"homepage": "https://github.com/FISCO-BCOS/FISCO-BCOS",
"description": "FISCO BCOS",
"dependencies": [
Expand Down

0 comments on commit 9bee1df

Please sign in to comment.