Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IF: add latest commit QC known to proposer to block extension (part 1) #2011

Merged
merged 15 commits into from
Jan 4, 2024

Conversation

linh2931
Copy link
Member

This is the first part of adding QC to block extension, implementing the definition and serialization. The remaining work is the insert of QC, which will be done after new block_header_state is finished (#1941).

Partly resolved #1586

@arhag arhag linked an issue Dec 20, 2023 that may be closed by this pull request
@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: INTERNALS
summary: Add the definition and serialization for quorum certificate to block extension.
Note:end

@linh2931 linh2931 requested review from heifner and greg7mdp January 3, 2024 22:56
@@ -1,5 +1,6 @@
#pragma once
#include <fc/variant.hpp>
#include <fc/variant_dynamic_bitset.hpp>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This include is needed for code using variant conversion directly, as

.../libraries/libfc/include/fc/variant.hpp:619:7: note: in instantiation of function template specialization 'fc::to_variant<eosio::chain::quorum_certificate_extension>' requested here
  619 |       to_variant( val, *this );
      |       ^
.../libraries/libfc/include/fc/variant_object.hpp:188:30: note: in instantiation of function template specialization 'fc::variant::variant<eosio::chain::quorum_certificate_extension>' requested here
  188 |          set(std::move(key), variant( fc::forward<T>(var) ) );
      |                              ^
.../libraries/chain/include/eosio/chain/abi_serializer.hpp:697:16: note: in instantiation of function template specialization 'fc::mutable_variant_object::operator()<const eosio::chain::quorum_certificate_extension &>' requested here
  697 |             mvo("qc_extension", qc_extension);
      |                ^
.../libraries/chain/include/eosio/chain/abi_serializer.hpp:980:26: note: in instantiation of function template specialization 'eosio::chain::impl::abi_to_variant::add<eosio::chain::abi_resolver>' requested here
  980 |    impl::abi_to_variant::add(mvo, "_", o, resolver, ctx);
      |                          ^
.../plugins/chain_plugin/chain_plugin.cpp:1974:20: note: in instantiation of function template specialization 'eosio::chain::abi_serializer::to_variant<eosio::chain::signed_block, eosio::chain::abi_resolver>' requested here
 1974 |    abi_serializer::to_variant( *block, pretty_output, resolver, abi_serializer_max_time );
      |                    ^
1 warning and 1 error generated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abi_serializer should include the header then not variant_object.hpp

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abi_serializer.hpp currently includes variant_object.hpp, not variant.hpp. As variant.hpp and variant_dynamic_bitset.hpp are similar and should be treated in the same way, that's why I placed it in variant_object.hpp as it already includes variant.hpp. I can move it to abi_serilizer if it is more appropriate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After further thought, I agree with your suggestion, as it will limit the occurrences where variant_dynamic_bitset.hpp is included. Thanks.

@linh2931 linh2931 requested a review from heifner January 4, 2024 17:11
@linh2931 linh2931 merged commit a25a8c4 into hotstuff_integration Jan 4, 2024
26 checks passed
@linh2931 linh2931 deleted the block_extension_qc branch January 4, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IF: Add block extension to include latest commit QC known to proposer
4 participants