Proposal - Referendum #12: Adjust tokenomics params to reflect difference in block time

I just found a problem when generating the proposal preimage. I used call.toHex() to get the call data. However it turned out not a “raw” encoded call. It has some prefix added by polkadot.js. As a result, the prefixed call will not be recognized by the blockchain.

Now if you check the democracy page, it still shows an “Add Preimage” button, because under the hood the sdk tries to decode a raw call, rather than a prefixed call.

Here’s the prefixed call:

0x5d03045705508d976e1283c0aa0000000000000000fd7eb4062f0b000001000000000000000000000000000070080000000000000000000000000000003075000000000000255a8ed66500000000000000000000009d3473f8f34f030000000000000000000000000000000000000000000000000033333333333333330000000000000000140000003b1c318036762473000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000320000000000000000000000000000000100000000000000

By removing the prefix, we get the raw call:

0x5705508d976e1283c0aa0000000000000000fd7eb4062f0b000001000000000000000000000000000070080000000000000000000000000000003075000000000000255a8ed66500000000000000000000009d3473f8f34f030000000000000000000000000000000000000000000000000033333333333333330000000000000000140000003b1c318036762473000000000000000000000000000000000000000000000000000000000000008001000000000000000000000000000000320000000000000000000000000000000100000000000000

And we can get the correct call hash. Note even if you paste the prefixed version in “Decode Extrinsic” tool on Polkadot.js, you still get the correct hash as below. However if we submit the prefixed call to “notePreimage()”, we will get the hash of prefixed call (invalid), and thus doesn’t match the one as below:

0x1e6f17118958e5149fc6ac0a294f9c746fee4fa36364ed1c3031dfeb3680e94b

Here’s the pull request to fix the update-tokenomic tool: console.js: generate raw call for update-tokenomic by h4x3rotab · Pull Request #589 · Phala-Network/phala-blockchain · GitHub

Solution: We should create another proposal to replace the current one, and get more seconds than the current proposal to get proceed to the referendum. We have to do it as soon as possible since it’s just hours to the next voting period.

1 Like