Repository navigation
test(manager): reproduce unbounded safe log capture from malformed gl_call - #85
Draft
MuncleUscles wants to merge 1 commit into
Draft
MuncleUscles wants to merge 1 commit into
MuncleUscles wants to merge 1 commit into
Conversation
A raw gl_call with an unknown 1 MiB field is rejected, but its decoder error is serialized into a 1 MiB user log record. The manager retains repeated records because its safe sink bounds entry count rather than bytes. The local test drives the real decoder, logger, pipe reader, and sink and fails at 6,292,536 captured bytes against a proposed 4 MiB budget. This is a red handoff; bound log lines while reading and cap total captured log bytes before accepting the test.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
GenVM PR actionsTick a box to run it (the box unticks itself when handled). Actions only run while the PR has the
Commands
|
Member
|
fix plan is to impose same payload limit on string as it is on bytes in logger + add a limit to total items we dump per log line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem and outcome
A contract can pass a malformed map to the raw
gl_callimport, catch the resultingSystemError, and continue. The executor'sdecode_obj::<gl_call::Message>error echoes an unknown field name. Its@user error:errlog capture serializes the entire field despite the 128-byte limit for byte captures. The manager reads each JSON log line without a byte limit, thensafecapture retains up to 128 entries without a total-byte limit.Repeated rejected calls can therefore amplify a modest reusable guest buffer into large, unmetered manager memory on nodes executing the transaction. This is a local memory-amplification reproduction, not proof that a live transaction crashes every testnet node. No testnet transaction was sent.
The node’s GenVM path requests output capture for transaction execution and maps it to manager
safe; the production executor config logs atinfo. That makes this path relevant to leader, validator, and sync runs, although the test has not demonstrated a live multi-node crash.Implementation and validation
This is a red handoff test. It generates the malformed
EmitEventrequest through the pinned GenVM calldata encoder, decodes it asgl_call::Message, serializes the real user log record, sends six copies through the real manager log pipe, and checks a proposed 4 MiB captured-log budget.v0.6-dev, the focused test fails:safe capture retained 6292536 log bytes, above the proposed 4 MiB log budget.cargo fmt --checkandgit diff --checkpass.Follow-up
Bound the log line while reading (before
lines().next_line()can allocate it), bound total retained log bytes in safe capture, and keep decoder/error logging bounded. Confirm a full GenVM contract can catch the invalid call and return, then run an isolated multi-node simulation before claiming fleet-wide impact.