Skip to content

Conversation

@michaeldiamant
Copy link

Proposes an optional change to add more context to Box error messages considered while reviewing algorand#4001.

To aid developers debugging Box extract and replace operations, the PR adds the box length to the out-of-bounds error message.

If it's preferable to keep as is, feel welcomed to close the PR. I don't feel strongly.

jannotti and others added 4 commits May 17, 2022 16:23
At least three four left to consider, as well as extensive testing.

1. It has no LRU cache for the reads and writes.  I expect sqlite to
do a fine job caching kv pairs, and there's not savings from skipping
msgpack serialization. But sqlite has a page cache, not a row cache,
so maybe it's worth it.

2. There is no loop around the sql read with round number test.

3. There's is no locking of au.accountsMu.  This is clearly wrong,
need to learn more about the rules that govern when the other lookup
routines are _not_ taking lock.

4. Need to think through limits on total boxes read/written, and how
boxes can be "named" for access by new apps.
Still need to think about the total size of boxes accessible to a txn,
but that check must happen later, as it requires using state.

Two options: A static limit on accessible stuff, or a dynamic limit on
the sum of the size of boxes actually touched.  Probbaly the static
limit is better, since we may wish to prefetch.
@michaeldiamant
Copy link
Author

Closing - Feedback brought in via algorand@a0c19b8.

@michaeldiamant michaeldiamant deleted the avm_box_error_len branch May 27, 2022 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants