Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect opcodes being executed after contract call #16

Closed
sezna opened this issue Aug 23, 2021 · 0 comments · Fixed by #17
Closed

Incorrect opcodes being executed after contract call #16

sezna opened this issue Aug 23, 2021 · 0 comments · Fixed by #17
Assignees
Labels
bug Something isn't working fuel-vm Related to the `fuel-vm` crate.

Comments

@sezna
Copy link

sezna commented Aug 23, 2021

This was originally surfaced by FuelLabs/sway#135 when testing contract calls.

The two transactions below describe a contract deployment and then calling that contract (to the address provided by the seed in both the VM testing and Sway's test suite). While the contract is successfully located, it is found to have a program of all null bytes, resulting in Undefined opcode errors.

Contract deploy bytes:

[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 39, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 95, 241, 169, 232, 11, 103, 33, 18, 196, 97, 138, 125, 107, 66, 162, 19, 18, 18, 63, 44, 175, 173, 97, 21, 67, 224, 38, 93, 137, 241, 194, 182, 0, 0, 0, 0, 0, 0, 0, 5, 161, 61, 115, 13, 198, 248, 9, 193, 241, 242, 212, 52, 230, 24, 126, 237, 15, 87, 50, 233, 32, 190, 40, 39, 252, 222, 86, 15, 152, 198, 140, 204, 0, 0, 0, 0, 0, 0, 0, 12, 92, 0, 0, 0, 240, 0, 0, 0, 52, 64, 0, 0, 0, 0, 0, 0]

Contract call bytes:

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 39, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 4, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 67, 184, 192, 1, 16, 186, 227, 0, 67, 66, 224, 13, 16, 65, 3, 0, 67, 70, 224, 4, 67, 74, 224, 5, 67, 78, 224, 6, 67, 82, 224, 7, 31, 85, 0, 0, 67, 66, 224, 14, 16, 65, 3, 0, 31, 88, 80, 0, 64, 0, 0, 48, 67, 94, 224, 12, 71, 89, 5, 192, 74, 89, 16, 4, 74, 89, 32, 5, 83, 89, 69, 83, 52, 64, 0, 0, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 0, 0, 0, 0, 253, 49, 221, 178, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 161, 61, 115, 13, 198, 248, 9, 193, 241, 242, 212, 52, 230, 24, 126, 237, 15, 87, 50, 233, 32, 190, 40, 39, 252, 222, 86, 15, 152, 198, 140, 204, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 161, 61, 115, 13, 198, 248, 9, 193, 241, 242, 212, 52, 230, 24, 126, 237, 15, 87, 50, 233, 32, 190, 40, 39, 252, 222, 86, 15, 152, 198, 140, 204, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
@sezna sezna added the bug Something isn't working label Aug 23, 2021
vlopes11 added a commit that referenced this issue Aug 23, 2021
The program counter is being set relative to the $fp instead of
appending to $sp and incrementing both $sp and $ssp

Resolves #16
vlopes11 added a commit that referenced this issue Aug 23, 2021
The program counter is being set relative to the $fp instead of
appending to $sp and incrementing both $sp and $ssp

Resolves #16
ControlCplusControlV pushed a commit that referenced this issue Nov 24, 2022
* Change type alias of keys to wrapper of bytes

Convert key types to concrete wrapper types and use Deref/DerefMut as
coercion resolver.

This way, the compiler type resolution will be deterministic and will
facilitate complex traits generic type resolution.

* Use random keys for test cases
ControlCplusControlV pushed a commit that referenced this issue Nov 24, 2022
ControlCplusControlV pushed a commit that referenced this issue Nov 29, 2022
ControlCplusControlV pushed a commit that referenced this issue Dec 1, 2022
* Change type alias of keys to wrapper of bytes

Convert key types to concrete wrapper types and use Deref/DerefMut as
coercion resolver.

This way, the compiler type resolution will be deterministic and will
facilitate complex traits generic type resolution.

* Use random keys for test cases
mitchmindtree pushed a commit that referenced this issue Dec 5, 2022
@mitchmindtree mitchmindtree added the fuel-vm Related to the `fuel-vm` crate. label Dec 9, 2022
xgreenx added a commit that referenced this issue Dec 20, 2022
xgreenx pushed a commit that referenced this issue Dec 20, 2022
* Change type alias of keys to wrapper of bytes

Convert key types to concrete wrapper types and use Deref/DerefMut as
coercion resolver.

This way, the compiler type resolution will be deterministic and will
facilitate complex traits generic type resolution.

* Use random keys for test cases
xgreenx pushed a commit that referenced this issue Dec 20, 2022
xgreenx added a commit that referenced this issue Dec 20, 2022
xgreenx pushed a commit that referenced this issue Dec 20, 2022
* Change type alias of keys to wrapper of bytes

Convert key types to concrete wrapper types and use Deref/DerefMut as
coercion resolver.

This way, the compiler type resolution will be deterministic and will
facilitate complex traits generic type resolution.

* Use random keys for test cases
xgreenx pushed a commit that referenced this issue Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fuel-vm Related to the `fuel-vm` crate.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants