Skip to content

Commit

Permalink
chore(swingset): clarify collection max key size
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Jun 2, 2022
1 parent 960ebe7 commit 35e40e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/SwingSet/src/liveslots/collectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ import { Far, passStyleOf } from '@endo/marshal';
import { decodeToJustin } from '@endo/marshal/src/marshal-justin.js';
import { parseVatSlot } from '../lib/parseVatSlots.js';

// The maximum length of an LMDB key is 254 characters, which puts an upper
// bound on the post-encoding size of keys than can be used to index entries in
// The maximum length of an LMDB key used to be 511 bytes which corresponded to
// 254 UTF-16 code units when using JS strings directly as keys. While we now
// have larger key sizes and use a different unicode encoding, the prior
// collections key constraints remain the same. They put an upper bound on the
// post-encoding (stringified) size of keys than can be used to index entries in
// collections. In addition to the encoding of the collection entry key, the
// storage key will also be prefixed with additional indexing information that
// includes the collection ID (an integer that will grow over time as more
Expand Down

0 comments on commit 35e40e3

Please sign in to comment.