Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

ship: add chain_id to get_status_result_v0 #8663

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ struct block_position {
struct get_status_request_v0 {};

struct get_status_result_v0 {
block_position head = {};
block_position last_irreversible = {};
uint32_t trace_begin_block = 0;
uint32_t trace_end_block = 0;
uint32_t chain_state_begin_block = 0;
uint32_t chain_state_end_block = 0;
block_position head = {};
block_position last_irreversible = {};
uint32_t trace_begin_block = 0;
uint32_t trace_end_block = 0;
uint32_t chain_state_begin_block = 0;
uint32_t chain_state_end_block = 0;
fc::sha256 chain_id = {};
};

struct get_blocks_request_v0 {
Expand Down Expand Up @@ -138,7 +139,7 @@ class state_history_plugin : public plugin<state_history_plugin> {
FC_REFLECT(eosio::table_delta, (struct_version)(name)(rows));
FC_REFLECT(eosio::block_position, (block_num)(block_id));
FC_REFLECT_EMPTY(eosio::get_status_request_v0);
FC_REFLECT(eosio::get_status_result_v0, (head)(last_irreversible)(trace_begin_block)(trace_end_block)(chain_state_begin_block)(chain_state_end_block));
FC_REFLECT(eosio::get_status_result_v0, (head)(last_irreversible)(trace_begin_block)(trace_end_block)(chain_state_begin_block)(chain_state_end_block)(chain_id));
FC_REFLECT(eosio::get_blocks_request_v0, (start_block_num)(end_block_num)(max_messages_in_flight)(have_positions)(irreversible_only)(fetch_block)(fetch_traces)(fetch_deltas));
FC_REFLECT(eosio::get_blocks_ack_request_v0, (num_messages));
// clang-format on
1 change: 1 addition & 0 deletions plugins/state_history_plugin/state_history_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ struct state_history_plugin_impl : std::enable_shared_from_this<state_history_pl
get_status_result_v0 result;
result.head = {chain.head_block_num(), chain.head_block_id()};
result.last_irreversible = {chain.last_irreversible_block_num(), chain.last_irreversible_block_id()};
result.chain_id = chain.get_chain_id();
if (plugin->trace_log) {
result.trace_begin_block = plugin->trace_log->begin_block();
result.trace_end_block = plugin->trace_log->end_block();
Expand Down
3 changes: 2 additions & 1 deletion plugins/state_history_plugin/state_history_plugin_abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ extern const char* const state_history_plugin_abi = R"({
{ "name": "trace_begin_block", "type": "uint32" },
{ "name": "trace_end_block", "type": "uint32" },
{ "name": "chain_state_begin_block", "type": "uint32" },
{ "name": "chain_state_end_block", "type": "uint32" }
{ "name": "chain_state_end_block", "type": "uint32" },
{ "name": "chain_id", "type": "checksum256$" }
]
},
{
Expand Down