Skip to content

Conversation

@j-rafique
Copy link
Contributor

Problem

Uploads were failing with "layout signature verification failed" because WASM and Go RaptorQ libraries generate different JSON formats for the same layout.

Root Causes

1. encoder_parameters Format Mismatch

  • WASM: [0,0,0,0,1,0,255,248,1,0,1,8] (JSON array)
  • Go: "AAAAAAEA//gBAAEI" (base64 string - Go's default for []byte)

2. Whitespace Differences (Fixed in JS-SDK)

  • WASM: 752 bytes (pretty-printed)
  • Go: 501 bytes (compact)

Since supernodes regenerate layouts and verify signatures against them, different JSON formatting causes verification to fail.

Example Layouts

WASM - 1B File

{
  "blocks": [
    {
      "block_id": 0,
      "encoder_parameters": [
        0, 0, 0, 0, 1, 0, 255, 248, 1, 0, 1, 8
      ],
      "original_offset": 0,
      "size": 1,
      "symbols": [
        "Fdk1UZD5oqoWEv2i9TCV9sbbgD2vayPWWVqh6ZfnT1cB",
        "DySR4dZ3cScEaUXsBnDY9YkeokwhSHPwyJGHWiehhzjK",
        "D7yQgEBzxGqW9jVMCTjsgf5iX5bCivdmWgMT1tEjH2Fn",
        "Z7pwhLmPqXAXYMVHRwJzei9oe5diCSGPDmAVkTR4Y28",
        "6crCpzcSsGErHT7oyMDZyeuG9xqmUY1ydcP8HUsy4ZN2",
        "Ee25jTZ85wNCTE7ypaYW7zERtETtdcKm2YosbYAJzXrj",
        "G2Ere33Rq8aaxW5vrUQbjjdXizKiw24aDz7htB7ApY21"
      ],
      "hash": "43ZQtVuQEyYertQiuVtKAhgQ9PKgBQiaXFCbK5gpkYWW"
    }
  ]
}

Go RQ - 1B File

{
  "blocks": [
    {
      "block_id": 0,
      "encoder_parameters": "AAAAAAEA//gBAAEI",
      "original_offset": 0,
      "size": 1,
      "symbols": [
        "Fdk1UZD5oqoWEv2i9TCV9sbbgD2vayPWWVqh6ZfnT1cB",
        "DySR4dZ3cScEaUXsBnDY9YkeokwhSHPwyJGHWiehhzjK",
        "D7yQgEBzxGqW9jVMCTjsgf5iX5bCivdmWgMT1tEjH2Fn",
        "Z7pwhLmPqXAXYMVHRwJzei9oe5diCSGPDmAVkTR4Y28",
        "6crCpzcSsGErHT7oyMDZyeuG9xqmUY1ydcP8HUsy4ZN2",
        "Ee25jTZ85wNCTE7ypaYW7zERtETtdcKm2YosbYAJzXrj",
        "G2Ere33Rq8aaxW5vrUQbjjdXizKiw24aDz7htB7ApY21"
      ],
      "hash": "43ZQtVuQEyYertQiuVtKAhgQ9PKgBQiaXFCbK5gpkYWW"
    }
  ]
}

@mateeullahmalik mateeullahmalik merged commit d25f34b into master Nov 18, 2025
7 checks passed
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.

3 participants