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

Update TVM Whitepaper: Correct Serialization Instruction for F4A6_ #1336

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zqy-691001
Copy link

@zqy-691001 zqy-691001 commented Oct 30, 2024

Hello Team,

I've noticed a discrepancy in the TVM whitepaper regarding the serialization instruction for the opcode F4A6_. The current text states that "the instruction can be obtained by first serializing F4A8," which appears to be an error.

Upon reviewing the binary representation, F4A6 in binary is 11110100101001. It's not possible to append bits to this sequence to form F4A8, as the latter would require a different binary pattern. Instead, the correct subsequent serialization that matches the expected pattern is 1111010010100100, which corresponds to F4A4.

I have conducted experiments and confirmed that the compiled FIFT code for the contract indeed results in the opcode F4A4, not F4A8. This change is crucial for maintaining the accuracy and consistency of the whitepaper with the actual behavior of the TVM.

Proposed Changes:

  • Change "instruction can be obtained by first serializing F4A8" to "instruction can be obtained by first serializing F4A4" in the TVM whitepaper.

This adjustment will ensure that the documentation accurately reflects the serialization process and avoids any confusion for developers working with the TVM.

Additional Notes:

  • I have attached the binary representations and the results of my experiments as proof of this correction.
  • I recommend a review of related sections in the whitepaper to ensure there are no other discrepancies that may have been overlooked.
"Asm.fif" include
// automatically generated from `/home/zqy/tonlearn/my_first_contract/contracts/main.fc` incl:`/home/zqy/tonlearn/my_first_contract/contracts/stdlib.fc` 
PROGRAM{
  DECLPROC recv_internal

  recv_internal PROC:<{
  
  }>


}END>s dup  csr.  runvmcode .s 

// x{FF00F4A413F4BCF2C80B}
// x{D3}
// execute SETCP 0
// execute DICTPUSHCONST 19 (xC_,1)
// execute DICTIGETJMPZ

Thank you for considering this important update. I believe it will greatly benefit the community by providing a more reliable and accurate resource.

Best regards,

@zqy-691001 zqy-691001 changed the title Document operation instructions tvm Update TVM Whitepaper: Correct Serialization Instruction for F4A6 Oct 30, 2024
@zqy-691001 zqy-691001 changed the title Update TVM Whitepaper: Correct Serialization Instruction for F4A6 Update TVM Whitepaper: Correct Serialization Instruction for F4A6_ Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant