Repository navigation
fix(direct): resolve SDK modules from the current genlayer.py layout - #114
Open
HusseinAdeiza wants to merge 1 commit into
Open
HusseinAdeiza wants to merge 1 commit into
HusseinAdeiza wants to merge 1 commit into
Conversation
The SDK moved its Python-side modules under `genlayer.py` (v0.6+), but
`import_calldata`/`import_types` still imported them from the package
root. On a 0.6 runner that raised ImportError, which
`_inject_message_to_fd0` swallowed, so the encoded message was never
written to fd 0 and the SDK decoded real stdin instead:
ImportError: Failed to load contract: unexpected end of memory
Import from the current location first and fall back to the legacy
path so older pinned runners keep working.
Fixes genlayerlabs#113
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This branch has not been deployed
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.
What
gltest/direct/sdk_compat.pyimported the SDK's calldata and types modules from the package root:The SDK moved both under
genlayer.pyin 0.6. On a 0.6 runner those imports raiseImportError, and_inject_message_to_fd0swallows it:So the encoded message is never written to fd 0, and the SDK decodes real stdin at import time instead — surfacing as a decode error against a contract that never got its context:
Not specific to
Addressconstructor argsI reproduced on 0.30.0rc2 / 0.19.0rc2 and the failure covers every constructor shape I tried, no-arg included:
()(a: u256)(a: Address)(a: Address, b: Address)(a: DynArray[str])The two-
Addressconstructor is just the smallest case, which is likely why it read as type-specific.Fix
Import from the current location, falling back to the legacy one so older pinned runners keep resolving:
Testing
tests/gltest_direct: 58 passed (52 before, plus 6 new).tests/examplesandtests/test_bug_hunt_v030.py, identical before and after.The reporter's related question about cross-contract calls in direct mode is untouched here — that path needs a
_gl_call_hookand is a separate question.Fixes #113