Skip to content

Commit

Permalink
Merge pull request #2090 from AntelopeIO/finish_add_block_ext
Browse files Browse the repository at this point in the history
IF: Unification: add latest commit QC known to proposer to block extension (final part)
  • Loading branch information
linh2931 authored Jan 17, 2024
2 parents 51ef25d + 152a457 commit 1c1a560
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion libraries/chain/block_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ block_state::block_state(const block_header_state& prev, signed_block_ptr b, con
{}

block_state::block_state(const block_header_state& bhs, deque<transaction_metadata_ptr>&& trx_metas,
deque<transaction_receipt>&& trx_receipts)
deque<transaction_receipt>&& trx_receipts, const std::optional<quorum_certificate>& qc)
: block_header_state(bhs)
, block(std::make_shared<signed_block>(signed_block_header{bhs.header})) // [greg todo] do we need signatures?
, pub_keys_recovered(true) // probably not needed
, cached_trxs(std::move(trx_metas))
{
block->transactions = std::move(trx_receipts);

if( qc && bhs.is_needed(*qc) ) {
emplace_extension(block->block_extensions, quorum_certificate_extension::extension_id(), fc::raw::pack( *qc ));
}
}

// Used for transition from dpos to instant-finality
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ struct assembled_block {
},
[&](assembled_block_if& ab) {
auto bsp = std::make_shared<block_state>(ab.bhs, std::move(ab.trx_metas),
std::move(ab.trx_receipts));
std::move(ab.trx_receipts), ab.qc);
return completed_block{std::move(bsp)};
}},
v);
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/block_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct block_state : public block_header_state { // block_header_state provi
const validator_t& validator, bool skip_validate_signee);

block_state(const block_header_state& bhs, deque<transaction_metadata_ptr>&& trx_metas,
deque<transaction_receipt>&& trx_receipts);
deque<transaction_receipt>&& trx_receipts, const std::optional<quorum_certificate>& qc);

explicit block_state(const block_state_legacy& bsp);
};
Expand Down

0 comments on commit 1c1a560

Please sign in to comment.