0


I would like to subscribe to the beefy justification stream on Rococo. The rpc for getFinalizedHead works fine, but I also require the justifications themselves.

When I try to subscribe to the justifications using (in the polkadot-apps-ui/Developer/Javascript section):

const unsub = await api.rpc.beefy.subscribeJustifications((header) => {
     console.log(`The last block has a timestamp of ${header}`);
});

I get the following error (when a new header is finalized):

h@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:76373
createTypeUnsafe@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:163502
_formatOutput@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:5692
_formatResult@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:3182
d@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:4503
21899/y/this.__internal__onSocketMessageSubscribe@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:24109
21899/y/this.__internal__onSocketMessage@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:23088

How can I get this to work?

Any help is much appreciated
Please and thank you

1 Answer 1

1

Thank you for reporting this !

Looks like the definition of beefy::subscribeJustifications() from polkadot-js/api is outdated. Published a PR that should fix it: https://github.com/polkadot-js/api/pull/5740 . The change will take effect after polkadot-js/apps is redeployed. Not sure exactly when this will happen, but will keep an eye on it.

2
  • Thank you addressing this issue!! Oct 19, 2023 at 8:46
  • I tried the lastest polkadot beta release and the issue persists. "@polkadot/api": "^8.14.2-12" DRR: createType(BeefySignedCommitment):: decodeU8a: failed at 0x01046d6880a430184b7172679dd2cb91… on commitment (index 0/2): {"payload":"BeefyPayload","blockNumber":"BlockNumber","validatorSetId":"ValidatorSetId"}:: decodeU8a: failed at 0x01046d6880a430184b7172679dd2cb91… on payload (index 0/3): Vec<(BeefyPayloadId,Bytes)>:: decodeU8a: failed at 0xbe1473009332000000000000387edaf5… ... Oct 19, 2023 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.