Skip to content

Commit

Permalink
add status_request v1 (for finality_data range)
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonincode committed May 1, 2024
1 parent 1633362 commit 8102037
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions include/eosio/ship_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ namespace eosio { namespace ship_protocol {

EOSIO_REFLECT(get_status_request_v0)

struct get_status_request_v1 {};

EOSIO_REFLECT(get_status_request_v1)

struct block_position {
uint32_t block_num = {};
eosio::checksum256 block_id = {};
Expand All @@ -100,6 +104,13 @@ namespace eosio { namespace ship_protocol {
EOSIO_REFLECT(get_status_result_v0, head, last_irreversible, trace_begin_block, trace_end_block,
chain_state_begin_block, chain_state_end_block, chain_id)

struct get_status_result_v1 : get_status_result_v0 {
uint32_t finality_data_begin_block = {};
uint32_t finality_data_end_block = {};
};

EOSIO_REFLECT(get_status_result_v1, base get_status_result_v1, finality_data_begin_block, finality_data_end_block)

struct get_blocks_request_v0 {
uint32_t start_block_num = {};
uint32_t end_block_num = {};
Expand All @@ -126,7 +137,7 @@ namespace eosio { namespace ship_protocol {

EOSIO_REFLECT(get_blocks_ack_request_v0, num_messages)

using request = std::variant<get_status_request_v0, get_blocks_request_v0, get_blocks_ack_request_v0, get_blocks_request_v1>;
using request = std::variant<get_status_request_v0, get_blocks_request_v0, get_blocks_ack_request_v0, get_blocks_request_v1, get_status_request_v1>;

struct get_blocks_result_base {
block_position head = {};
Expand Down Expand Up @@ -374,7 +385,7 @@ namespace eosio { namespace ship_protocol {

EOSIO_REFLECT(signed_block, base signed_block_header, transactions, block_extensions)

using result = std::variant<get_status_result_v0, get_blocks_result_v0, get_blocks_result_v1>;
using result = std::variant<get_status_result_v0, get_blocks_result_v0, get_blocks_result_v1, get_status_result_v1>;

struct transaction_header {
eosio::time_point_sec expiration = {};
Expand Down

0 comments on commit 8102037

Please sign in to comment.