You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I get error Failed to parse payload: recursive reference of cells when deserializing stateinit from mytonwallet (ton connect).
Error occurs on the call cell.FromBOC.
I believe this is a bug, because I was able to successfully parse this stateinit using tongo library as shown in the example.
Tonutils version: v1.8.9
Example:
package main
import (
"encoding/base64"
"fmt"
"log"
"github.com/tonkeeper/tongo/tonconnect"
"github.com/xssnick/tonutils-go/tvm/cell"
)
func main() {
// address
// UQBe7yULTjbWZszDK2d8LOePumy9ZtGzwQgrXXfqjR1yM2fy
// stateInit from mytonwallet
stateInit := "te6ccsECFgEAAwQAAAAABQAwAD0AQgDEAMsBAwE9AXYBewGAAa8BtAG/AcQByQHYAecCCAJ/AsYCATQCAQBRAAAAACmpoxf4lk0qBZddWkKNjjqmudjY6QDlccYne0gS9zCGDH3x2kABFP8A9KQT9LzyyAsDAgEgCQQE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8IBwYFAAr0AMntVABsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBu0gf6ANTUIvkABcjKBxXL/8nQd3SAGMjLBcsCIs8WUAX6AhTLaxLMzMlz+wDIQBSBAQj0UfKnAgIBSBMKAgEgDAsAWb0kK29qJoQICga5D6AhhHDUCAhHpJN9KZEM5pA+n/mDeBKAG3gQFImHFZ8xhAIBIA4NABG4yX7UTQ1wsfgCAVgSDwIBIBEQABmvHfaiaEAQa5DrhY/AABmtznaiaEAga5Drhf/AAD2ynftRNCBAUDXIfQEMALIygfL/8nQAYEBCPQKb6ExgAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNFRQAilAEgQEI9Fkw7UTQgQFA1yDIAc8W9ADJ7VQBcrCOI4IQZHN0coMesXCAGFAFywVQA88WI/oCE8tqyx/LP8mAQPsAkl8D4gB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGdYbenA=="
_, err := tonconnect.ParseStateInit(stateInit)
if err != nil {
log.Fatal(err)
}
// ok
fmt.Println("parsed 1")
stateInitBytes, err := base64.StdEncoding.DecodeString(stateInit)
if err != nil {
log.Fatal(err)
}
_, err = cell.FromBOC(stateInitBytes)
if err != nil {
log.Fatal(err) // failed to parse payload: recursive reference of cells
}
fmt.Println("parsed 2")
}
The text was updated successfully, but these errors were encountered:
Hi, this is corrupted BoC with recursive reference (reference to itself and infinity depth), it must not work, so it is probably a bug in tongo.
For example this is TON Node output of trying to deserealize this boc: Unexpected Status [Error : 0 : invalid bag-of-cells failed to deserialize cell #20 [Error : 0 : bag-of-cells error: reference #1 of cell #20 is to cell #20 with smaller index]]
Hello. I get error
Failed to parse payload: recursive reference of cells
when deserializing stateinit from mytonwallet (ton connect).Error occurs on the call
cell.FromBOC
.I believe this is a bug, because I was able to successfully parse this stateinit using tongo library as shown in the example.
Tonutils version: v1.8.9
Example:
The text was updated successfully, but these errors were encountered: