Skip to content

Commit

Permalink
Merge branch 'release/1.0' into gh_544_check
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp authored Aug 23, 2024
2 parents be71b28 + 68de44f commit ddc0307
Show file tree
Hide file tree
Showing 56 changed files with 1,687 additions and 523 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set( CXX_STANDARD_REQUIRED ON)
set(VERSION_MAJOR 1)
set(VERSION_MINOR 0)
set(VERSION_PATCH 0)
set(VERSION_SUFFIX dev)
set(VERSION_SUFFIX rc2)

if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
Expand Down
3 changes: 2 additions & 1 deletion libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ add_library( eosio_chain
## Boost::accumulators depends on Boost::numeric_ublas, which is still missing cmake support (see
## https://github.com/boostorg/cmake/issues/39). Until this is fixed, manually add Boost::numeric_ublas
## as an interface library
## ** Remove the two lines below when upgrading to Boost 1.86 or above **
## ----------------------------------------------------------------------------------------------------
add_library(boost_numeric_ublas INTERFACE)
add_library(Boost::numeric_ublas ALIAS boost_numeric_ublas)

target_link_libraries( eosio_chain PUBLIC bn256 fc chainbase eosio_rapidjson Logging IR WAST WASM
softfloat builtins ${CHAIN_EOSVM_LIBRARIES} ${LLVM_LIBS} ${CHAIN_RT_LINKAGE}
Boost::signals2 Boost::hana Boost::property_tree Boost::multi_index Boost::asio Boost::lockfree
Boost::assign Boost::accumulators
Boost::assign Boost::accumulators Boost::rational
)
target_include_directories( eosio_chain
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include"
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/abi_serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ namespace eosio { namespace chain {
fc::raw::unpack(stream, size);
} EOS_RETHROW_EXCEPTIONS( unpack_exception, "Unable to unpack size of array '${p}'", ("p", ctx.get_path_string()) )
vector<fc::variant> vars;
vars.reserve(size);
vars.reserve(std::min(size.value, 1024u)); // limit the maximum size that can be reserved before data is read
auto h1 = ctx.push_to_path( impl::array_index_path_item{} );
for( decltype(size.value) i = 0; i < size; ++i ) {
ctx.set_array_index_of_path_back(i);
Expand Down
17 changes: 12 additions & 5 deletions libraries/chain/block_header_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,16 @@ void finish_next(const block_header_state& prev,

// finality_core
// -------------
block_ref parent_block {
.block_id = prev.block_id,
.timestamp = prev.timestamp(),
.finality_digest = prev.compute_finality_digest()
};
block_ref parent_block = prev.make_block_ref();
next_header_state.core = prev.core.next(parent_block, f_ext.qc_claim);

// finalizer policy
// ----------------
next_header_state.active_finalizer_policy = prev.active_finalizer_policy;

// will be reset in evaluate_finalizer_policies_for_promotion if needed
next_header_state.last_pending_finalizer_policy_start_timestamp = prev.last_pending_finalizer_policy_start_timestamp;

evaluate_finalizer_policies_for_promotion(prev, next_header_state);

next_header_state.last_pending_finalizer_policy_digest = fc::sha256::hash(next_header_state.get_last_pending_finalizer_policy());
Expand Down Expand Up @@ -347,6 +346,14 @@ void finish_next(const block_header_state& prev,
ilog("New finalizer policy becoming active in block ${n}:${id}: ${pol}",
("n",block_header::num_from_id(id))("id", id)("pol", *act));
}

if (next_header_state.active_proposer_policy->proposer_schedule.version != prev.active_proposer_policy->proposer_schedule.version) {
const auto& act = next_header_state.active_proposer_policy;
dlog("Proposer policy version change: ${old_ver} -> ${new_ver}",
("old_ver", prev.active_proposer_policy->proposer_schedule.version)("new_ver",act->proposer_schedule.version));
dlog("New proposer policy becoming active in block ${n}:${id}: ${pol}",
("n",block_header::num_from_id(id))("id", id)("pol", *act));
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/block_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ namespace eosio { namespace chain {
open(log_dir);
const auto log_size = std::filesystem::file_size(block_file.get_file_path());

if (log_size == 0 && !catalog.empty()) {
if ((log_size == 0 || !head) && !catalog.empty()) {
basic_block_log::reset(catalog.verifier.chain_id, catalog.last_block_num() + 1);
update_head(read_block_by_num(catalog.last_block_num()));
} else {
Expand Down
8 changes: 2 additions & 6 deletions libraries/chain/block_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ block_state_ptr block_state::create_if_genesis_block(const block_state_legacy& b
assert(f_ext.new_finalizer_policy_diff); // required by transition mechanism
result.active_finalizer_policy = std::make_shared<finalizer_policy>(finalizer_policy{}.apply_diff(std::move(*f_ext.new_finalizer_policy_diff)));

block_ref genesis_block_ref {
.block_id = bsp.id(),
.timestamp = bsp.timestamp()
};
result.core = finality_core::create_core_for_genesis_block(genesis_block_ref);
result.core = finality_core::create_core_for_genesis_block(bsp.id(), bsp.timestamp());

result.last_pending_finalizer_policy_digest = fc::sha256::hash(*result.active_finalizer_policy);
result.last_pending_finalizer_policy_start_timestamp = bsp.timestamp();
Expand Down Expand Up @@ -181,7 +177,7 @@ void block_state::set_trxs_metas( deque<transaction_metadata_ptr>&& trxs_metas,
// Called from vote threads
aggregate_vote_result_t block_state::aggregate_vote(uint32_t connection_id, const vote_message& vote) {
auto finalizer_digest = vote.strong ? strong_digest.to_uint8_span() : std::span<const uint8_t>(weak_digest);
return aggregating_qc.aggregate_vote(connection_id, vote, block_num(), finalizer_digest);
return aggregating_qc.aggregate_vote(connection_id, vote, block_id, finalizer_digest);
}

// Only used for testing
Expand Down
Loading

0 comments on commit ddc0307

Please sign in to comment.