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

add to ship definitions get_blocks v1 (for fetch_finality_data) #28

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Changes from 1 commit
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
16 changes: 14 additions & 2 deletions include/eosio/ship_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,19 @@ namespace eosio { namespace ship_protocol {
EOSIO_REFLECT(get_blocks_request_v0, start_block_num, end_block_num, max_messages_in_flight, have_positions,
irreversible_only, fetch_block, fetch_traces, fetch_deltas)

struct get_blocks_request_v1 : get_blocks_request_v0 {
bool fetch_finality_data = {};
};

EOSIO_REFLECT(get_blocks_request_v1, base get_blocks_request_v1, fetch_finality_data)

struct get_blocks_ack_request_v0 {
uint32_t num_messages = {};
};

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>;
using request = std::variant<get_status_request_v0, get_blocks_request_v0, get_blocks_ack_request_v0, get_blocks_request_v1>;

struct get_blocks_result_base {
block_position head = {};
Expand All @@ -139,6 +145,12 @@ namespace eosio { namespace ship_protocol {

EOSIO_REFLECT(get_blocks_result_v0, base get_blocks_result_base, block, traces, deltas)

struct get_blocks_result_v1 : get_blocks_result_v0 {
std::optional<eosio::input_stream> finality_data = {};
};

EOSIO_REFLECT(get_blocks_result_v1, base get_blocks_result_v0, finality_data)

struct row_v0 {
bool present = {}; // false (not present), true (present, old / new)
eosio::input_stream data = {};
Expand Down Expand Up @@ -362,7 +374,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>;
using result = std::variant<get_status_result_v0, get_blocks_result_v0, get_blocks_result_v1>;

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