diff options
author | Tsachi Herman <tsachi.herman@algorand.com> | 2022-02-24 10:34:30 -0500 |
---|---|---|
committer | Tsachi Herman <tsachi.herman@algorand.com> | 2022-02-24 10:34:30 -0500 |
commit | 4da56df86a646f5cb2bfc89abd4743eec4b5a62c (patch) | |
tree | e0ab768d646f2dba79c4659dbb45cd876896f0ad | |
parent | e8f5ececf8e6f9493fc0f35132839647048d1a33 (diff) |
update comment
-rw-r--r-- | ledger/ledgercore/statedelta.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ledger/ledgercore/statedelta.go b/ledger/ledgercore/statedelta.go index 628c557ca..7bea4e833 100644 --- a/ledger/ledgercore/statedelta.go +++ b/ledger/ledgercore/statedelta.go @@ -149,9 +149,14 @@ type AssetResourceRecord struct { } // AccountDeltas stores ordered accounts and allows fast lookup by address +// One key design aspect here was to ensure that we're able to access the written +// deltas in a deterministic order, while maintaining O(1) lookup. In order to +// do that, each of the arrays here is constructed as a pair of (slice, map). +// The map would point the address/address+creatable id onto the index of the +// element within the slice. type AccountDeltas struct { - // Actual data. If an account is deleted, `accts` contains a balance record - // with empty `AccountData`. + // Actual data. If an account is deleted, `accts` contains the NewBalanceRecord + // with an empty `AccountData` and a populated `Addr`. accts []NewBalanceRecord // cache for addr to deltas index resolution acctsCache map[basics.Address]int |