-
Notifications
You must be signed in to change notification settings - Fork 0
ContextualEnoteRecords
SNeedlewoods edited this page Jan 8, 2024
·
4 revisions
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
andenote_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)
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 ¹ |
- LegacyContextualBasicEnoteRecordV1
- LegacyContextualIntermediateEnoteRecordV1
- LegacyContextualEnoteRecordV1
- SpContextualBasicEnoteRecordV1
- SpContextualIntermediateEnoteRecordV1
- SpContextualEnoteRecordV1
using ContextualBasicRecordVariant = tools::variant<LegacyContextualBasicEnoteRecordV1, SpContextualBasicEnoteRecordV1>;
using ContextualRecordVariant = tools::variant<LegacyContextualEnoteRecordV1, SpContextualEnoteRecordV1>;
(Note: there is no variant for (Legacy/Sp)ContextualIntermediateEnoteRecordV1)
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> |
¹ 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