Skip to content

ContextualEnoteRecords

SNeedlewoods edited this page Jan 8, 2024 · 4 revisions

ContextualEnoteRecords

General

ContextualEnoteRecords ¹ are EnoteRecords with context about their origin and their spent status.
In the context of this documentation the term:

  • ContextualEnoteRecord refers to all possible types
    (Legacy/Sp)Contextual(Basic/Intermediate/"Full")EnoteRecordV1
    (Note: word "Full" is omitted)
  • Legacy refers to pre-seraphis-fork (cryptonote/ringct)
  • Sp refers to post-seraphis-fork
  • Basic means the EnoteVariant in the EnoteRecord is identified as owned (Legacy: view-key scanned) or possibly owned (Sp: passed view-tag check)
  • Intermediate means the EnoteRecord contains some more information (amount, amount_blinding_factor and enote_view_extension/input_context (Legacy/Sp))
    (Sp: jamtis non-selfsend enote type only)
  • "Full" means the EnoteRecord contains all information (Legacy: view-key scanned + key-image computed; Sp: fully view-scanned with a jamtis view-balance key)

Content

Legacy Sp
Basic struct LegacyBasicEnoteRecord ²
struct LegacyEnoteOriginContext ¹
struct SpBasicEnoteRecordV1 ²
struct SpEnoteOriginContextV1 ¹
Intermediate struct LegacyIntermediateEnoteRecord ²
struct LegacyEnoteOriginContext ¹
struct SpIntermediateEnoteRecordV1 ²
struct SpEnoteOriginContextV1 ¹
"Full" struct LegacyEnoteRecord ²
struct LegacyEnoteOriginContext ¹
struct SpEnoteSpentContextV1 ¹
struct SpEnoteRecordV1 ²
struct SpEnoteOriginContextV1 ¹
struct SpEnoteSpentContextV1 ¹

All ContextualEnoteRecord Types

  1. LegacyContextualBasicEnoteRecordV1
  2. LegacyContextualIntermediateEnoteRecordV1
  3. LegacyContextualEnoteRecordV1
  4. SpContextualBasicEnoteRecordV1
  5. SpContextualIntermediateEnoteRecordV1
  6. SpContextualEnoteRecordV1

All ContextualEnoteRecord-Variants

using ContextualBasicRecordVariant = tools::variant<LegacyContextualBasicEnoteRecordV1, SpContextualBasicEnoteRecordV1>;
using ContextualRecordVariant = tools::variant<LegacyContextualEnoteRecordV1, SpContextualEnoteRecordV1>;

(Note: there is no variant for (Legacy/Sp)ContextualIntermediateEnoteRecordV1)


Correlation between all ContextualEnoteRecords

ID Input Function Calls Output
1.1 tx details try_find_legacy_enotes_in_tx ³ try_view_scan_legacy_enote_v1 std::list<LegacyContextualBasicEnoteRecordV1>
1.2 enote details try_view_scan_legacy_enote_v1 ³ LegacyContextualBasicEnoteRecordV1
-
2.1 LegacyContextualBasicEnoteRecordV1 process_chunk_intermediate_legacy ³ update_with_new_intermediate_record_legacy std::unordered_map<rct::key, LegacyContextualIntermediateEnoteRecordV1>
2.2 LegacyIntermediateEnoteRecordV1 update_with_new_intermediate_record_legacy ³ std::unordered_map<rct::key, LegacyContextualIntermediateEnoteRecordV1>
-
3.1 LegacyContextualBasicEnoteRecordV1 process_chunk_full_legacy ³ update_with_new_record_legacy std::unordered_map<rct::key, LegacyContextualEnoteRecordV1>
3.2 LegacyContextualIntermediateEnoteRecordV1 SpEnoteStore::add_record LegacyContextualEnoteRecordV1 in enote_store
3.3 LegacyEnoteRecord update_with_new_record_legacy ³ std::unordered_map<rct::key, LegacyContextualEnoteRecordV1>
-
-
4.1 tx details try_find_sp_enotes_in_tx ³ std::list<SpContextualBasicEnoteRecordV1>
-
5.1 SpContextualBasicEnoteRecordV1 process_chunk_intermediate_sp ³ update_with_new_intermediate_record_sp std::unordered_map<rct::key, SpContextualIntermediateEnoteRecordV1>
5.2 chunk_data.basic_records_per_tx ChunkConsumerMockSpIntermediate::
consume_onchain_chunk
& consume_nonledger_chunk
SpContextualIntermediateEnoteRecordV1 in enote_store
5.3 SpIntermediateEnoteRecordV1 update_with_new_intermediate_record_sp ³ std::unordered_map<rct::key, SpContextualIntermediateEnoteRecordV1>
-
6.1 SpContextualBasicEnoteRecordV1 process_chunk_sp_selfsend_pass
& process_chunk_full_sp ³
update_with_new_record_sp std::unordered_map<crypto::key_image, SpContextualEnoteRecordV1>
6.2 chunk_data.basic_records_per_tx ChunkConsumerMockSp::
consume_onchain_chunk & consume_nonledger_chunk
SpContextualEnoteRecordV1 in enote_store
6.3 SpEnoteRecordV1 update_with_new_record_sp ³ std::unordered_map<crypto::key_image, SpContextualEnoteRecordV1>

Source files

¹ src/seraphis_main/contextual_enote_record_types.h [view]
² src/seraphis_main/enote_record_types.h [view]
³ src/seraphis_main/scan_balance_recovery_utils.cpp [view]
src/seraphis_impl/enote_store.cpp [view]
src/seraphis_mock/scan_chunk_consumer_mocks.cpp [view]


back to Documentation

Clone this wiki locally