1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Merge branch 'testnet' into block-generation

This commit is contained in:
SpyCheese 2024-04-26 12:08:28 +03:00
commit a745f6f679
16 changed files with 453 additions and 126 deletions

View file

@ -56,6 +56,12 @@ class ValidatorSession : public td::actor::Actor {
td::BufferSlice proof() const {
return proof_.clone();
}
bool is_cached() const {
return is_cached_;
}
void set_is_cached(bool value = true) {
is_cached_ = value;
}
CandidateDecision(td::uint32 ok_from) {
ok_ = true;
ok_from_ = ok_from;
@ -69,6 +75,12 @@ class ValidatorSession : public td::actor::Actor {
td::uint32 ok_from_ = 0;
std::string reason_;
td::BufferSlice proof_;
bool is_cached_ = false;
};
struct GeneratedCandidate {
BlockCandidate candidate;
bool is_cached = false;
};
class Callback {
@ -76,7 +88,7 @@ class ValidatorSession : public td::actor::Actor {
virtual void on_candidate(td::uint32 round, PublicKey source, ValidatorSessionRootHash root_hash,
td::BufferSlice data, td::BufferSlice collated_data,
td::Promise<CandidateDecision> promise) = 0;
virtual void on_generate_slot(td::uint32 round, td::Promise<BlockCandidate> promise) = 0;
virtual void on_generate_slot(td::uint32 round, td::Promise<GeneratedCandidate> promise) = 0;
virtual void on_block_committed(td::uint32 round, PublicKey source, ValidatorSessionRootHash root_hash,
ValidatorSessionFileHash file_hash, td::BufferSlice data,
std::vector<std::pair<PublicKeyHash, td::BufferSlice>> signatures,