-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix Argument Buffer Corruption #118
Comments
Additional info: Original problem was the PolynomialDegreeTooLarge error from a call to prove into Plonk - during an execution n0=6391469573278971418 After the note returned from the contract, x coordinate looked as follows: n0=0 It turns out that already wasm code inside contract received the Note in this form, so the Note was corrupted Here is what was sent to the contract: and here is what the contract has seen upon entry: push_note(&mut self, block_height: u64, note: Note) declare it as follows: push_note(&mut self, block_height: u64, gap: [u8;32], note: Note) Adding an extra parameter gap pushes the note further away from the corruptible area of the arg buffer. |
Closing as N/A anymore |
Describe the bug
When called by transfer contract and stage contract, contract methods receive argument buffer with initial 32 bytes set to zero.
To Reproduce
Run transfer contract test or stake contract test in Rusk
Expected behaviour
Arguments should be received by contracts in a non corrupted form, esp. not set to zero.
Logs/Screenshot
Here is what was sent to the contract:
[00, 00, 00, 00, 00, 00, 00, 00, 1A, B6, 02, A4, B6, 0F, B3, 58, 3B, F6, CB, F6, 66, C4, 57, D2, 42, 51, 84, 3A, A1, 90, B2, B4, 52, 3B, 68, 8D, 3B, B2, 4F, 61, D0, D9, 70, ... more same bytes]
and here is what the contract has seen upon entry:
[00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 52, 3B, 68, 8D, 3B, B2, 4F, 61, D0, D9, 70, ... more same bytes]
Additional context
This problem could not be easily reproduced in Piecrust tests.
transfer and stake contracts in Rusk seem to be the only ones where this problem occurs,
reproducing this problem in Piecrust test is be part of this issue
The text was updated successfully, but these errors were encountered: