fix(pass-style): better byteArray support #2843
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #XXXX
Refs: #2248
Description
While working on #2248, I ran into previously undetected bugs due to confusion between
'bytes'
and'byteArray'
as the name for passable Immutable ArrayBuffers. This PR is extracted from the portions of #2248 in which I fix this and test the fix.Security & Scaling Considerations
The bug manifested in trying to test the pattern-based limits enforcement for byteArrays. The inability to enforce those limits create both security and scaling hazards. This PR fixes those hazards.
Documentation Considerations
M.bytes()
should no longer appear in any docs. UseM.byteArray()
instead.Testing Considerations
Had previous PRs tested the limits enforcement, this bug would have been found and fixed earlier. Mea culpa. This PR does add those tests.
Compatibility Considerations
If there was previous code using
".
M.bytes()
, or storing the matcher object it produces, then we'd have a compat problem. As long as we merge this PR before the next big agoric-sdk sync, we should avoid any such compat problem. Hence, I'm labeling this as "Upgrade Considerations
As long as nothing previously used
M.bytes()
or stored the matcher it creates, none.