Skip to content

Commit

Permalink
Add size encoded key note to the readme (#642)
Browse files Browse the repository at this point in the history
* Add note about size encoded keys

Signed-off-by: David Boehm <[email protected]>

* Better phrasing

Signed-off-by: David Boehm <[email protected]>

---------

Signed-off-by: David Boehm <[email protected]>
  • Loading branch information
dboehm-avalabs authored Dec 8, 2023
1 parent 5ac878f commit 6c3c1d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ To compute the maximum amount of storage units that a transaction could use,
it must be possible to determine how much data a particular key can read/write
from/to state. The `hypersdk` requires that all state keys are suffixed with
a big-endian encoded `uint16` of the number of "chunks" (each chunk is 64 bytes)
that can be read/stored to satisfy this requirement.
that can be read/stored to satisfy this requirement. This appended size suffix is part of the key,
so the same key with different size suffixes would be considered distinct keys.

This constraint is equivalent to deciding whether to use a `uint8`, `uint16`, `uint32`,
`uint64`, etc. when storing an unsigned integer value in memory. The tighter a
Expand Down

0 comments on commit 6c3c1d9

Please sign in to comment.