aptos-labs / aptos-labs/script-composer-sdk
PartialVMError: bytecode version 9 unsupported when composing a transaction calling a third-party module
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
`BuildScriptComposerTransaction` fails with the following error when composing a script that calls a function on a published third-party module on Aptos mainnet:
```
PartialVMError with status UNKNOWN_VERSION and message 'bytecode version 9 unsupported'
```
### Target module
Mainnet: `0x1c3206329806286fd2223647c9f9b130e66baeb6d7224a18c1f642ffe48f3b4c::panora_swap`
### Bytecode header
The published module's bytecode header (first 8 bytes) is:
```
magic = 0xa11ceb0b
version = 0x0A000009 (u32 LE = 167772169)
```
Reproduced with:
```bash
curl -s "https://api.mainnet.aptoslabs.com/v1/accounts/0x1c3206329806286fd2223647c9f9b130e66baeb6d7224a18c1f642ffe48f3b4c/module/panora_swap" \
| jq -r '.bytecode' \
| python3 -c "import sys; b=bytes.fromhex(sys.stdin.read().strip()[2:]); print(f'magic={b[:4].hex()} version=0x{int.from_bytes(b[4:8],\"little\"):08x}')"
```
The SDK appears to interpret the low 16/32 bits of the header as version `9` and reject it; whether the upper bits (`0x0A...`) are a Move bytecode "flavor" marker that the SDK needs to handle, or whether the header is being parsed incorrectly, is for the maintainers to determine.
### Environment
- `@aptos-labs/script-composer-sdk`: 0.3.2
- `@aptos-labs/ts-sdk`: 5.2.1
- Network: Aptos mainnet
### Ask
Either support this bytecode header format in the composer, or document the maximum supported header value so callers can detect and avoid composing scripts that target modules with newer headers.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the BuildScriptComposerTransaction entry point and trace how the SDK parses and validates the bytecode header. Reproduce the failure with the supplied Aptos mainnet module and curl/Python command. Done means the composer handles the reported header format or clearly documents the maximum supported value so callers can detect it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100