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 timestamp and parent_timestamp to finality leaf nodes. #392

Merged
merged 21 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3c5adc9
Add `timestamp` and `parent_timestamp` to finality leaf nodes.
greg7mdp Jul 23, 2024
39d0d9e
Undo change adding `std::move`.
greg7mdp Jul 23, 2024
337203f
Update `deep-mind.log`
greg7mdp Jul 23, 2024
4cfbfca
Merge branch 'main' of github.com:AntelopeIO/spring into gh_387
greg7mdp Jul 23, 2024
099ff5c
WIP
systemzax Jul 23, 2024
d913d4f
WIP
systemzax Jul 23, 2024
efb00c7
Changed timestamp + parent_timestamp serialization form to fc::time_p…
systemzax Jul 24, 2024
3f9fdf1
Clean up
systemzax Jul 24, 2024
96fb137
Clean up
systemzax Jul 24, 2024
e75750d
Merge branch 'gh_387' of https://github.com/antelopeIO/spring into gh…
systemzax Jul 24, 2024
10c2c96
Merge branch 'gh_387' of https://github.com/antelopeIO/spring into gh…
systemzax Jul 24, 2024
bdd3b4e
Removed leftover comments in savanna smart contract, recompiled
systemzax Jul 24, 2024
d4a233a
Merge branch 'gh_387' of https://github.com/antelopeIO/spring into gh…
systemzax Jul 24, 2024
0fbb424
Update `deep-mind` log.
greg7mdp Jul 24, 2024
51964f7
Merge branch 'main' of github.com:AntelopeIO/spring into gh_387
greg7mdp Jul 24, 2024
5db00c5
Switch back to using `block_timestamp_type` instead of `fc::time_point`
greg7mdp Jul 24, 2024
91542ed
Update `deep-mind.log`
greg7mdp Jul 24, 2024
0c6995d
Disable `svnn_ibc` tests.
greg7mdp Jul 24, 2024
af6b56f
Fix disabling of `svnn_ibc` tests
greg7mdp Jul 25, 2024
55755c5
Merge branch 'main' of github.com:AntelopeIO/spring into gh_387
greg7mdp Jul 25, 2024
3088f77
Updated `deep-mind.log`
greg7mdp Jul 25, 2024
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: 10 additions & 6 deletions libraries/chain/block_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ block_state_ptr block_state::create_if_genesis_block(const block_state_legacy& b

// build leaf_node and validation_tree
valid_t::finality_leaf_node_t leaf_node {
.block_num = bsp.block_num(),
.finality_digest = result.strong_digest,
.action_mroot = *bsp.action_mroot_savanna
.block_num = bsp.block_num(),
.timestamp = bsp.timestamp(),
.parent_timestamp = block_timestamp_type(), // for the genesis block, the parent_timestamp is the the earliest representable timestamp.
.finality_digest = result.strong_digest,
.action_mroot = *bsp.action_mroot_savanna
};
// construct valid structure
incremental_merkle_tree validation_tree;
Expand Down Expand Up @@ -322,9 +324,11 @@ valid_t block_state::new_valid(const block_header_state& next_bhs, const digest_

// construct block's finality leaf node.
valid_t::finality_leaf_node_t leaf_node{
.block_num = next_bhs.block_num(),
.finality_digest = strong_digest,
.action_mroot = action_mroot
.block_num = next_bhs.block_num(),
.timestamp = next_bhs.timestamp(),
.parent_timestamp = timestamp(),
.finality_digest = strong_digest,
.action_mroot = action_mroot
};
auto leaf_node_digest = fc::sha256::hash(leaf_node);

Expand Down
14 changes: 8 additions & 6 deletions libraries/chain/include/eosio/chain/block_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ struct block_state_accessor;
* */
struct valid_t {
struct finality_leaf_node_t {
uint32_t major_version{light_header_protocol_version_major};
uint32_t minor_version{light_header_protocol_version_minor};
block_num_type block_num{0}; // the block number
digest_type finality_digest; // finality digest for the block
digest_type action_mroot; // digest of the root of the action Merkle tree of the block
uint32_t major_version{light_header_protocol_version_major};
uint32_t minor_version{light_header_protocol_version_minor};
block_num_type block_num{0}; // the block number
block_timestamp_type timestamp;
block_timestamp_type parent_timestamp;
digest_type finality_digest; // finality digest for the block
digest_type action_mroot; // digest of the root of the action Merkle tree of the block
};

// The Finality Merkle Tree, containing leaf nodes from IF genesis block to current block
Expand Down Expand Up @@ -198,7 +200,7 @@ using block_state_pair = std::pair<std::shared_ptr<block_state_legacy>, blo
} // namespace eosio::chain

// not exporting pending_qc or valid_qc
FC_REFLECT( eosio::chain::valid_t::finality_leaf_node_t, (major_version)(minor_version)(block_num)(finality_digest)(action_mroot) )
FC_REFLECT( eosio::chain::valid_t::finality_leaf_node_t, (major_version)(minor_version)(block_num)(timestamp)(parent_timestamp)(finality_digest)(action_mroot) )
FC_REFLECT( eosio::chain::valid_t, (validation_tree)(validation_mroots))
FC_REFLECT( eosio::chain::finality_data_t, (major_version)(minor_version)(active_finalizer_policy_generation)(final_on_strong_qc_block_num)(action_mroot)(reversible_blocks_mroot)(base_digest)(pending_finalizer_policy) )
FC_REFLECT_DERIVED( eosio::chain::block_state, (eosio::chain::block_header_state), (block)(strong_digest)(weak_digest)(pending_qc)(valid)(validated) )
Loading
Loading