24 const std::vector<uint8_t>& data,
32 std::optional<ccf::crypto::Sha256Hash>& commit_evidence_digest,
33 bool ignore_strict_versions =
false) = 0;
41 bool track_deletes_on_missing_keys) = 0;
48 std::shared_ptr<TxHistory> history;
49 std::shared_ptr<ILedgerChunker> chunker;
50 const std::vector<uint8_t> data;
59 std::optional<ccf::crypto::Sha256Hash> commit_evidence_digest;
61 const std::optional<TxID> expected_txid;
66 std::shared_ptr<TxHistory> history_,
67 std::shared_ptr<ILedgerChunker> chunker_,
68 const std::vector<uint8_t>& data_,
70 const std::optional<TxID>& expected_txid_) :
72 history(
std::move(history_)),
73 chunker(
std::move(chunker_)),
75 public_only(public_only_),
76 expected_txid(expected_txid_)
81 return std::move(claims_digest);
87 return std::move(commit_evidence_digest);
101 commit_evidence_digest,
107 if (expected_txid.has_value())
109 if (term != expected_txid->view || version != expected_txid->seqno)
112 "TxID mismatch during deserialisation. Expected {}.{}, got {}.{}",
114 expected_txid->seqno,
127 track_deletes_on_missing_keys))
133 const bool signature_in =
134 (changes.find(ccf::Tables::SIGNATURES) != changes.end());
135 const bool cose_signature_in =
136 (changes.find(ccf::Tables::COSE_SIGNATURES) != changes.end());
138 if (signature_in || cose_signature_in)
140 const bool merkle_tree_in =
141 changes.find(ccf::Tables::SERIALISED_MERKLE_TREE) != changes.end();
142 switch (changes.size())
145 if (merkle_tree_in && (cose_signature_in != signature_in))
150 if (merkle_tree_in && cose_signature_in && signature_in)
156 "Unexpected contents in signature transaction {}", version);
162 if (!history->verify_root_signatures(version))
166 "Signature in transaction {} failed to verify", version);
173 auto search = changes.find(ccf::Tables::ENCRYPTED_PAST_LEDGER_SECRET);
174 if (search != changes.end())
181 history->append_entry(
182 ccf::entry_leaf(data, commit_evidence_digest, claims_digest));
187 chunker->append_entry_size(data.size());
191 chunker->produced_chunk_at(version - 1);
196 chunker->produced_chunk_at(version);
Definition claims_digest.h:10
Definition kv_types.h:600
Definition deserialise.h:45
std::optional< ccf::crypto::Sha256Hash > && consume_commit_evidence_digest() override
Definition deserialise.h:84
ccf::kv::ConsensusHookPtrs & get_hooks() override
Definition deserialise.h:203
const std::vector< uint8_t > & get_entry() override
Definition deserialise.h:208
bool support_async_execution() override
Definition deserialise.h:223
ccf::kv::Version get_index() override
Definition deserialise.h:218
bool is_public_only() override
Definition deserialise.h:228
ApplyResult apply(bool track_deletes_on_missing_keys) override
Definition deserialise.h:90
Term get_term() override
Definition deserialise.h:213
bool should_rollback_to_last_committed() override
Definition deserialise.h:233
CFTExecutionWrapper(ExecutionWrapperStore *store_, std::shared_ptr< TxHistory > history_, std::shared_ptr< ILedgerChunker > chunker_, const std::vector< uint8_t > &data_, bool public_only_, const std::optional< TxID > &expected_txid_)
Definition deserialise.h:64
ccf::ClaimsDigest && consume_claims_digest() override
Definition deserialise.h:79
Definition deserialise.h:19
virtual ~ExecutionWrapperStore()=default
virtual bool commit_deserialised(ccf::kv::OrderedChanges &changes, ccf::kv::Version v, ccf::kv::Term term, const MapCollection &new_maps, ccf::kv::ConsensusHookPtrs &hooks, bool track_deletes_on_missing_keys)=0
virtual bool fill_maps(const std::vector< uint8_t > &data, bool public_only, ccf::kv::Version &v, ccf::kv::Term &view, ccf::kv::EntryFlags &entry_flags, ccf::kv::OrderedChanges &changes, ccf::kv::MapCollection &new_maps, ccf::ClaimsDigest &claims_digest, std::optional< ccf::crypto::Sha256Hash > &commit_evidence_digest, bool ignore_strict_versions=false)=0
#define LOG_DEBUG_FMT
Definition internal_logger.h:14
#define LOG_FAIL_FMT
Definition internal_logger.h:16
Definition app_interface.h:18
uint64_t Term
Definition kv_types.h:46
uint64_t Version
Definition version.h:10
std::map< std::string, std::shared_ptr< AbstractMap > > MapCollection
Definition apply_changes.h:16
EntryFlags
Definition serialised_entry_format.h:15
@ FORCE_LEDGER_CHUNK_BEFORE
Definition serialised_entry_format.h:17
@ FORCE_LEDGER_CHUNK_AFTER
Definition serialised_entry_format.h:16
std::map< std::string, MapChanges > OrderedChanges
Definition tx.h:41
ApplyResult
Definition kv_types.h:305
@ PASS_SIGNATURE
Definition kv_types.h:307
@ FAIL
Definition kv_types.h:314
@ PASS
Definition kv_types.h:306
@ PASS_ENCRYPTED_PAST_LEDGER_SECRET
Definition kv_types.h:312
std::vector< ConsensusHookPtr > ConsensusHookPtrs
Definition hooks.h:22