rippled
Loading...
Searching...
No Matches
SHAMap.h
1#pragma once
2
3#include <xrpl/basics/IntrusivePointer.h>
4#include <xrpl/basics/UnorderedContainers.h>
5#include <xrpl/beast/utility/Journal.h>
6#include <xrpl/beast/utility/instrumentation.h>
7#include <xrpl/nodestore/Database.h>
8#include <xrpl/nodestore/NodeObject.h>
9#include <xrpl/shamap/Family.h>
10#include <xrpl/shamap/SHAMapAddNode.h>
11#include <xrpl/shamap/SHAMapInnerNode.h>
12#include <xrpl/shamap/SHAMapItem.h>
13#include <xrpl/shamap/SHAMapLeafNode.h>
14#include <xrpl/shamap/SHAMapMissingNode.h>
15#include <xrpl/shamap/SHAMapTreeNode.h>
16
17#include <set>
18#include <stack>
19#include <vector>
20
21namespace xrpl {
22
23class SHAMapNodeID;
24class SHAMapSyncFilter;
25
27enum class SHAMapState {
32 Modifying = 0,
33
38 Immutable = 1,
39
44 Synching = 2,
45
50 Invalid = 3,
51};
52
76class SHAMap
77{
78private:
81
84
87
91 bool backed_ = true; // Map is backed by the database
92 mutable bool full_ = false; // Map is believed complete in database
93
94public:
97 static inline constexpr unsigned int branchFactor = SHAMapInnerNode::branchFactor;
98
100 static inline constexpr unsigned int leafDepth = 64;
101
102 using DeltaItem =
103 std::pair<boost::intrusive_ptr<SHAMapItem const>, boost::intrusive_ptr<SHAMapItem const>>;
105
106 SHAMap() = delete;
107 SHAMap(SHAMap const&) = delete;
108 SHAMap&
109 operator=(SHAMap const&) = delete;
110
111 // Take a snapshot of the given map:
112 SHAMap(SHAMap const& other, bool isMutable);
113
114 // build new map
115 SHAMap(SHAMapType t, Family& f);
116
117 SHAMap(SHAMapType t, uint256 const& hash, Family& f);
118
119 ~SHAMap() = default;
120
121 Family const&
122 family() const
123 {
124 return f_;
125 }
126
127 Family&
129 {
130 return f_;
131 }
132
133 //--------------------------------------------------------------------------
134
139 class const_iterator;
140
142 begin() const;
144 end() const;
145
146 //--------------------------------------------------------------------------
147
148 // Returns a new map that's a snapshot of this one.
149 // Handles copy on write for mutable snapshots.
151 snapShot(bool isMutable) const;
152
153 /* Mark this SHAMap as "should be full", indicating
154 that the local server wants all the corresponding nodes
155 in durable storage.
156 */
157 void
158 setFull();
159
160 void
162
163 bool
164 fetchRoot(SHAMapHash const& hash, SHAMapSyncFilter* filter);
165
166 // normal hash access functions
167
169 bool
170 hasItem(uint256 const& id) const;
171
172 bool
173 delItem(uint256 const& id);
174
175 bool
176 addItem(SHAMapNodeType type, boost::intrusive_ptr<SHAMapItem const> item);
177
179 getHash() const;
180
181 // save a copy if you have a temporary anyway
182 bool
183 updateGiveItem(SHAMapNodeType type, boost::intrusive_ptr<SHAMapItem const> item);
184
185 bool
186 addGiveItem(SHAMapNodeType type, boost::intrusive_ptr<SHAMapItem const> item);
187
188 // Save a copy if you need to extend the life
189 // of the SHAMapItem beyond this SHAMap
190 boost::intrusive_ptr<SHAMapItem const> const&
191 peekItem(uint256 const& id) const;
192 boost::intrusive_ptr<SHAMapItem const> const&
193 peekItem(uint256 const& id, SHAMapHash& hash) const;
194
195 // traverse functions
203 upper_bound(uint256 const& id) const;
204
212 lower_bound(uint256 const& id) const;
213
219 void
220 visitNodes(std::function<bool(SHAMapTreeNode&)> const& function) const;
221
228 void
229 visitDifferences(SHAMap const* have, std::function<bool(SHAMapTreeNode const&)> const&) const;
230
235 void
236 visitLeaves(std::function<void(boost::intrusive_ptr<SHAMapItem const> const&)> const&) const;
237
238 // comparison/sync functions
239
251 getMissingNodes(int maxNodes, SHAMapSyncFilter* filter);
252
253 bool
255 SHAMapNodeID const& wanted,
257 bool fatLeaves,
258 std::uint32_t depth) const;
259
267 getProofPath(uint256 const& key) const;
268
276 static bool
277 verifyProofPath(uint256 const& rootHash, uint256 const& key, std::vector<Blob> const& path);
278
280 void
281 serializeRoot(Serializer& s) const;
282
284 addRootNode(SHAMapHash const& hash, Slice const& rootNode, SHAMapSyncFilter* filter);
286 addKnownNode(SHAMapNodeID const& nodeID, Slice const& rawNode, SHAMapSyncFilter* filter);
287
288 // status functions
289 void
290 setImmutable();
291 bool
292 isSynching() const;
293 void
294 setSynching();
295 void
297 bool
298 isValid() const;
299
300 // caution: otherMap must be accessed only by this function
301 // return value: true=successfully completed, false=too different
302 bool
303 compare(SHAMap const& otherMap, Delta& differences, int maxCount) const;
304
306 int
307 unshare();
308
310 int
312
313 void
314 walkMap(std::vector<SHAMapMissingNode>& missingNodes, int maxMissing) const;
315 bool
316 walkMapParallel(std::vector<SHAMapMissingNode>& missingNodes, int maxMissing) const;
317 bool
318 deepCompare(SHAMap& other) const; // Intended for debug/test only
319
320 void
321 setUnbacked();
322
323 void
324 dump(bool withHashes = false) const;
325 void
326 invariants() const;
327
328private:
331 using DeltaRef =
332 std::pair<boost::intrusive_ptr<SHAMapItem const>, boost::intrusive_ptr<SHAMapItem const>>;
333
334 // tree node cache operations
336 cacheLookup(SHAMapHash const& hash) const;
337
338 void
340
341 // database operations
343 fetchNodeFromDB(SHAMapHash const& hash) const;
345 fetchNodeNT(SHAMapHash const& hash) const;
347 fetchNodeNT(SHAMapHash const& hash, SHAMapSyncFilter* filter) const;
349 fetchNode(SHAMapHash const& hash) const;
351 checkFilter(SHAMapHash const& hash, SHAMapSyncFilter* filter) const;
352
354 void
355 dirtyUp(
356 SharedPtrNodeStack& stack,
357 uint256 const& target,
359
364 walkTowardsKey(uint256 const& id, SharedPtrNodeStack* stack = nullptr) const;
367 findKey(uint256 const& id) const;
368
370 template <class Node>
373
375 template <class Node>
378
382
383 // returns the first item at or below this node
386 const;
387
388 // returns the last item at or below this node
390 lastBelow(
392 SharedPtrNodeStack& stack,
393 int branch = branchFactor) const;
394
395 // helper function for firstBelow and lastBelow
399 SharedPtrNodeStack& stack,
400 int branch,
401 std::tuple<int, std::function<bool(int)>, std::function<void(int&)>> const& loopParams)
402 const;
403
404 // Simple descent
405 // Get a child of the specified node
407 descend(SHAMapInnerNode*, int branch) const;
409 descendThrow(SHAMapInnerNode*, int branch) const;
411 descend(SHAMapInnerNode&, int branch) const;
413 descendThrow(SHAMapInnerNode&, int branch) const;
414
415 // Descend with filter
416 // If pending, callback is called as if it called fetchNodeNT
421 SHAMapInnerNode* parent,
422 int branch,
423 SHAMapSyncFilter* filter,
424 bool& pending,
425 descendCallback&&) const;
426
428 descend(
429 SHAMapInnerNode* parent,
430 SHAMapNodeID const& parentID,
431 int branch,
432 SHAMapSyncFilter* filter) const;
433
434 // Non-storing
435 // Does not hook the returned node to its parent
437 descendNoStore(SHAMapInnerNode&, int branch) const;
438
440 boost::intrusive_ptr<SHAMapItem const> const&
442
443 bool
444 hasInnerNode(SHAMapNodeID const& nodeID, SHAMapHash const& hash) const;
445 bool
446 hasLeafNode(uint256 const& tag, SHAMapHash const& hash) const;
447
448 SHAMapLeafNode const*
449 peekFirstItem(SharedPtrNodeStack& stack) const;
450 SHAMapLeafNode const*
451 peekNextItem(uint256 const& id, SharedPtrNodeStack& stack) const;
452 bool
454 SHAMapTreeNode* node,
455 boost::intrusive_ptr<SHAMapItem const> const& otherMapItem,
456 bool isFirstMap,
457 Delta& differences,
458 int& maxCount) const;
459 int
460 walkSubTree(bool doWrite, NodeObjectType t);
461
462 // Structure to track information about call to
463 // getMissingNodes while it's in progress
465 {
466 MissingNodes() = delete;
467 MissingNodes(MissingNodes const&) = delete;
469 operator=(MissingNodes const&) = delete;
470
471 // basic parameters
472 int max_;
474 int const maxDefer_;
476
477 // nodes we have discovered to be missing
480
481 // nodes we are in the process of traversing
483 SHAMapInnerNode*, // pointer to the node
484 SHAMapNodeID, // the node's ID
485 int, // while child we check first
486 int, // which child we check next
487 bool>; // whether we've found any missing children yet
488
489 // We explicitly choose to specify the use of std::deque here, because
490 // we need to ensure that pointers and/or references to existing
491 // elements will not be invalidated during the course of element
492 // insertion and removal. Containers that do not offer this guarantee,
493 // such as std::vector, can't be used here.
495
496 // nodes we may have acquired from deferred reads
498 SHAMapInnerNode*, // parent node
499 SHAMapNodeID, // parent node ID
500 int, // branch
502
507
508 // nodes we need to resume after we get their children from deferred
509 // reads
511
512 MissingNodes(int max, SHAMapSyncFilter* filter, int maxDefer, std::uint32_t generation)
513 : max_(max), filter_(filter), maxDefer_(maxDefer), generation_(generation), deferred_(0)
514 {
515 missingNodes_.reserve(max);
516 finishedReads_.reserve(maxDefer);
517 }
518 };
519
520 // getMissingNodes helper functions
521 void
522 gmn_ProcessNodes(MissingNodes&, MissingNodes::StackEntry& node);
523 static void
524 gmn_ProcessDeferredReads(MissingNodes&);
525
526 // fetch from DB helper function
528 finishFetch(SHAMapHash const& hash, std::shared_ptr<NodeObject> const& object) const;
529};
530
531inline void
533{
534 full_ = true;
535}
536
537inline void
542
543inline void
545{
546 XRPL_ASSERT(state_ != SHAMapState::Invalid, "xrpl::SHAMap::setImmutable : state is valid");
548}
549
550inline bool
552{
554}
555
556inline void
561
562inline void
567
568inline bool
570{
572}
573
574inline void
576{
577 backed_ = false;
578}
579
580//------------------------------------------------------------------------------
581
583{
584public:
588 using reference = value_type const&;
589 using pointer = value_type const*;
590
591private:
593 SHAMap const* map_ = nullptr;
594 pointer item_ = nullptr;
595
596public:
597 const_iterator() = delete;
598
599 const_iterator(const_iterator const& other) = default;
601 operator=(const_iterator const& other) = default;
602
603 ~const_iterator() = default;
604
606 operator*() const;
607 pointer
608 operator->() const;
609
611 operator++();
613 operator++(int);
614
615private:
616 explicit const_iterator(SHAMap const* map);
618 const_iterator(SHAMap const* map, pointer item, SharedPtrNodeStack&& stack);
619
620 friend bool
621 operator==(const_iterator const& x, const_iterator const& y);
622 friend class SHAMap;
623};
624
625inline SHAMap::const_iterator::const_iterator(SHAMap const* map) : map_(map)
626{
627 XRPL_ASSERT(map_, "xrpl::SHAMap::const_iterator::const_iterator : non-null input");
628
629 if (auto temp = map_->peekFirstItem(stack_))
630 item_ = temp->peekItem().get();
631}
632
634{
635}
636
638 SHAMap const* map,
639 pointer item,
640 SharedPtrNodeStack&& stack)
641 : stack_(std::move(stack)), map_(map), item_(item)
642{
643}
644
647{
648 return *item_;
649}
650
653{
654 return item_;
655}
656
659{
660 if (auto temp = map_->peekNextItem(item_->key(), stack_))
661 item_ = temp->peekItem().get();
662 else
663 item_ = nullptr;
664 return *this;
665}
666
669{
670 auto tmp = *this;
671 ++(*this);
672 return tmp;
673}
674
675inline bool
677{
678 XRPL_ASSERT(
679 x.map_ == y.map_,
680 "xrpl::operator==(SHAMap::const_iterator, SHAMap::const_iterator) : "
681 "inputs map do match");
682 return x.item_ == y.item_;
683}
684
685inline bool
687{
688 return !(x == y);
689}
690
691inline SHAMap::const_iterator
693{
694 return const_iterator(this);
695}
696
699{
700 return const_iterator(this, nullptr);
701}
702
703} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
value_type const * pointer
Definition Dir.h:45
const_iterator & operator++()
Definition Dir.cpp:60
pointer operator->() const
Definition Dir.h:63
const_iterator(ReadView const &view, Keylet const &root, Keylet const &page)
Definition Dir.h:95
reference operator*() const
Definition Dir.cpp:51
value_type const & reference
Definition Dir.h:46
static constexpr unsigned int branchFactor
Each inner node has 16 children (the 'radix tree' part of the map)
Identifies a node inside a SHAMap.
const_iterator(const_iterator const &other)=default
reference operator*() const
Definition SHAMap.h:646
SharedPtrNodeStack stack_
Definition SHAMap.h:592
const_iterator & operator++()
Definition SHAMap.h:658
value_type const & reference
Definition SHAMap.h:588
value_type const * pointer
Definition SHAMap.h:589
const_iterator & operator=(const_iterator const &other)=default
friend bool operator==(const_iterator const &x, const_iterator const &y)
Definition SHAMap.h:676
pointer operator->() const
Definition SHAMap.h:652
A SHAMap is both a radix tree with a fan-out of 16 and a Merkle tree.
Definition SHAMap.h:77
SHAMapTreeNode * descend(SHAMapInnerNode *, int branch) const
Definition SHAMap.cpp:276
SHAMapLeafNode * walkTowardsKey(uint256 const &id, SharedPtrNodeStack *stack=nullptr) const
Walk towards the specified id, returning the node.
Definition SHAMap.cpp:103
bool addItem(SHAMapNodeType type, boost::intrusive_ptr< SHAMapItem const > item)
Definition SHAMap.cpp:807
Family const & family() const
Definition SHAMap.h:122
static bool verifyProofPath(uint256 const &rootHash, uint256 const &key, std::vector< Blob > const &path)
Verify the proof path.
const_iterator upper_bound(uint256 const &id) const
Find the first item after the given item.
Definition SHAMap.cpp:579
SHAMapState state_
Definition SHAMap.h:89
const_iterator lower_bound(uint256 const &id) const
Find the object with the greatest object id smaller than the input id.
Definition SHAMap.cpp:612
bool full_
Definition SHAMap.h:92
intr_ptr::SharedPtr< SHAMapTreeNode > checkFilter(SHAMapHash const &hash, SHAMapSyncFilter *filter) const
Definition SHAMap.cpp:182
const_iterator end() const
Definition SHAMap.h:698
std::optional< std::vector< Blob > > getProofPath(uint256 const &key) const
Get the proof path of the key.
SHAMapLeafNode * firstBelow(intr_ptr::SharedPtr< SHAMapTreeNode >, SharedPtrNodeStack &stack, int branch=0) const
Definition SHAMap.cpp:462
intr_ptr::SharedPtr< SHAMapTreeNode > writeNode(NodeObjectType t, intr_ptr::SharedPtr< SHAMapTreeNode > node) const
write and canonicalize modified node
Definition SHAMap.cpp:911
SHAMapTreeNode * descendAsync(SHAMapInnerNode *parent, int branch, SHAMapSyncFilter *filter, bool &pending, descendCallback &&) const
Definition SHAMap.cpp:347
const_iterator begin() const
Definition SHAMap.h:692
std::uint32_t cowid_
ID to distinguish this map for all others we're sharing nodes with.
Definition SHAMap.h:83
void setLedgerSeq(std::uint32_t lseq)
Definition SHAMap.h:538
Family & f_
Definition SHAMap.h:79
std::map< uint256, DeltaItem > Delta
Definition SHAMap.h:104
Family & family()
Definition SHAMap.h:128
boost::intrusive_ptr< SHAMapItem const > const & peekItem(uint256 const &id) const
Definition SHAMap.cpp:556
~SHAMap()=default
int flushDirty(NodeObjectType t)
Flush modified nodes to the nodestore and convert them to shared.
Definition SHAMap.cpp:952
intr_ptr::SharedPtr< SHAMapTreeNode > fetchNodeFromDB(SHAMapHash const &hash) const
Definition SHAMap.cpp:139
void visitDifferences(SHAMap const *have, std::function< bool(SHAMapTreeNode const &)> const &) const
Visit every node in this SHAMap that is not present in the specified SHAMap.
void setUnbacked()
Definition SHAMap.h:575
SHAMapLeafNode * lastBelow(intr_ptr::SharedPtr< SHAMapTreeNode > node, SharedPtrNodeStack &stack, int branch=branchFactor) const
Definition SHAMap.cpp:452
static constexpr unsigned int leafDepth
The depth of the hash map: data is only present in the leaves.
Definition SHAMap.h:100
bool walkMapParallel(std::vector< SHAMapMissingNode > &missingNodes, int maxMissing) const
void walkMap(std::vector< SHAMapMissingNode > &missingNodes, int maxMissing) const
void setSynching()
Definition SHAMap.h:557
bool hasInnerNode(SHAMapNodeID const &nodeID, SHAMapHash const &hash) const
Does this map have this inner node?
intr_ptr::SharedPtr< SHAMapTreeNode > fetchNode(SHAMapHash const &hash) const
Definition SHAMap.cpp:243
SHAMap(SHAMap const &)=delete
bool isSynching() const
Definition SHAMap.h:551
SHAMapLeafNode const * peekNextItem(uint256 const &id, SharedPtrNodeStack &stack) const
Definition SHAMap.cpp:527
bool deepCompare(SHAMap &other) const
SHAMap & operator=(SHAMap const &)=delete
void dump(bool withHashes=false) const
Definition SHAMap.cpp:1082
beast::Journal journal_
Definition SHAMap.h:80
void gmn_ProcessNodes(MissingNodes &, MissingNodes::StackEntry &node)
std::vector< std::pair< SHAMapNodeID, uint256 > > getMissingNodes(int maxNodes, SHAMapSyncFilter *filter)
Check for nodes in the SHAMap not available.
void setFull()
Definition SHAMap.h:532
void serializeRoot(Serializer &s) const
Serializes the root in a format appropriate for sending over the wire.
SHAMapAddNode addRootNode(SHAMapHash const &hash, Slice const &rootNode, SHAMapSyncFilter *filter)
SHAMapLeafNode * belowHelper(intr_ptr::SharedPtr< SHAMapTreeNode > node, SharedPtrNodeStack &stack, int branch, std::tuple< int, std::function< bool(int)>, std::function< void(int &)> > const &loopParams) const
Definition SHAMap.cpp:406
bool backed_
Definition SHAMap.h:91
static constexpr unsigned int branchFactor
Number of children each non-leaf node has (the 'radix tree' part of the map)
Definition SHAMap.h:97
bool isValid() const
Definition SHAMap.h:569
std::shared_ptr< SHAMap > snapShot(bool isMutable) const
Definition SHAMap.cpp:64
bool hasItem(uint256 const &id) const
Does the tree have an item with the given ID?
Definition SHAMap.cpp:647
int unshare()
Convert any modified nodes to shared.
Definition SHAMap.cpp:945
void visitLeaves(std::function< void(boost::intrusive_ptr< SHAMapItem const > const &)> const &) const
Visit every leaf node in this SHAMap.
bool updateGiveItem(SHAMapNodeType type, boost::intrusive_ptr< SHAMapItem const > item)
Definition SHAMap.cpp:825
SHAMapType const type_
Definition SHAMap.h:90
SHAMap()=delete
intr_ptr::SharedPtr< SHAMapTreeNode > finishFetch(SHAMapHash const &hash, std::shared_ptr< NodeObject > const &object) const
Definition SHAMap.cpp:147
intr_ptr::SharedPtr< SHAMapTreeNode > fetchNodeNT(SHAMapHash const &hash) const
Definition SHAMap.cpp:231
bool hasLeafNode(uint256 const &tag, SHAMapHash const &hash) const
Does this map have this leaf node?
void canonicalize(SHAMapHash const &hash, intr_ptr::SharedPtr< SHAMapTreeNode > &) const
Definition SHAMap.cpp:1137
void setImmutable()
Definition SHAMap.h:544
void clearSynching()
Definition SHAMap.h:563
bool getNodeFat(SHAMapNodeID const &wanted, std::vector< std::pair< SHAMapNodeID, Blob > > &data, bool fatLeaves, std::uint32_t depth) const
void invariants() const
Definition SHAMap.cpp:1147
SHAMapLeafNode * findKey(uint256 const &id) const
Return nullptr if key not found.
Definition SHAMap.cpp:130
bool addGiveItem(SHAMapNodeType type, boost::intrusive_ptr< SHAMapItem const > item)
Definition SHAMap.cpp:738
static void gmn_ProcessDeferredReads(MissingNodes &)
intr_ptr::SharedPtr< SHAMapTreeNode > cacheLookup(SHAMapHash const &hash) const
Definition SHAMap.cpp:1129
intr_ptr::SharedPtr< Node > preFlushNode(intr_ptr::SharedPtr< Node > node) const
prepare a node to be modified before flushing
Definition SHAMap.cpp:929
intr_ptr::SharedPtr< Node > unshareNode(intr_ptr::SharedPtr< Node >, SHAMapNodeID const &nodeID)
Unshare the node, allowing it to be modified.
Definition SHAMap.cpp:390
boost::intrusive_ptr< SHAMapItem const > const & onlyBelow(SHAMapTreeNode *) const
If there is only one leaf below this node, get its contents.
Definition SHAMap.cpp:474
void dirtyUp(SharedPtrNodeStack &stack, uint256 const &target, intr_ptr::SharedPtr< SHAMapTreeNode > terminal)
Update hashes up to the root.
Definition SHAMap.cpp:70
bool fetchRoot(SHAMapHash const &hash, SHAMapSyncFilter *filter)
Definition SHAMap.cpp:865
std::uint32_t ledgerSeq_
The sequence of the ledger that this map references, if any.
Definition SHAMap.h:86
intr_ptr::SharedPtr< SHAMapTreeNode > descendNoStore(SHAMapInnerNode &, int branch) const
Definition SHAMap.cpp:308
int walkSubTree(bool doWrite, NodeObjectType t)
Definition SHAMap.cpp:959
SHAMapAddNode addKnownNode(SHAMapNodeID const &nodeID, Slice const &rawNode, SHAMapSyncFilter *filter)
SHAMapHash getHash() const
Definition SHAMap.cpp:813
void visitNodes(std::function< bool(SHAMapTreeNode &)> const &function) const
Visit every node in this SHAMap.
bool delItem(uint256 const &id)
Definition SHAMap.cpp:653
SHAMapTreeNode * descendThrow(SHAMapInnerNode *, int branch) const
Definition SHAMap.cpp:254
intr_ptr::SharedPtr< SHAMapTreeNode > root_
Definition SHAMap.h:88
bool walkBranch(SHAMapTreeNode *node, boost::intrusive_ptr< SHAMapItem const > const &otherMapItem, bool isFirstMap, Delta &differences, int &maxCount) const
SHAMapLeafNode const * peekFirstItem(SharedPtrNodeStack &stack) const
Definition SHAMap.cpp:513
A shared intrusive pointer class that supports weak pointers.
An immutable linear range of bytes.
Definition Slice.h:26
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
@ pending
List will be valid in the future.
NodeObjectType
The types of node objects.
Definition NodeObject.h:12
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
Definition base_uint.h:557
bool operator!=(Buffer const &lhs, Buffer const &rhs) noexcept
Definition Buffer.h:209
SHAMapState
Describes the current state of a given SHAMap.
Definition SHAMap.h:27
@ Immutable
The map is set in stone and cannot be changed.
@ Invalid
The map is known to not be valid.
@ Synching
The map's hash is fixed but valid nodes may be missing and can be added.
@ Modifying
The map is in flux and objects can be added and removed.
std::condition_variable deferCondVar_
Definition SHAMap.h:505
std::map< SHAMapInnerNode *, SHAMapNodeID > resumes_
Definition SHAMap.h:510
std::vector< DeferredNode > finishedReads_
Definition SHAMap.h:506
MissingNodes & operator=(MissingNodes const &)=delete
std::tuple< SHAMapInnerNode *, SHAMapNodeID, int, int, bool > StackEntry
Definition SHAMap.h:487
std::set< SHAMapHash > missingHashes_
Definition SHAMap.h:479
std::vector< std::pair< SHAMapNodeID, uint256 > > missingNodes_
Definition SHAMap.h:478
MissingNodes(int max, SHAMapSyncFilter *filter, int maxDefer, std::uint32_t generation)
Definition SHAMap.h:512
MissingNodes(MissingNodes const &)=delete
std::stack< StackEntry, std::deque< StackEntry > > stack_
Definition SHAMap.h:494
SHAMapSyncFilter * filter_
Definition SHAMap.h:473
std::uint32_t generation_
Definition SHAMap.h:475