threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

A lot of errors appears in console while the DAO page is loading #838

Open A-Harby opened 1 year ago

A-Harby commented 1 year ago

Description

A lot of errors appears in console while the DAO page is loading

Logs/Alerts

image

0oM4R commented 1 year ago

As I discussed with @AhmedHanafy725 this is related to tfchain, please transfer it there

DylanVerstraete commented 1 year ago

@AhmedHanafy725 can you share your thoughts here?

xmonader commented 1 year ago

@AhmedHanafy725 @DylanVerstraete I assigned you both on the issue so it won't be forgotten

AhmedHanafy725 commented 1 year ago

when trying to get the proposals from the chain, it raises this error. not sure if it's related to the types or if the proposal itself has an issue on the chain

when tried to get them with Polkadot, some of them return objects and some are unknown image

these are some of the worked ones:

not worked ones:

DylanVerstraete commented 1 year ago

Probably these proposals contain types that aren't deserializable anymore with current runtime. I will close these proposals

DylanVerstraete commented 1 year ago

Seems these proposals that have <unknown> call cannot be closed with error: https://github.com/threefoldtech/tfchain/blob/0e20bc81b066c7c1a5915bee2441be081a1cbd3c/substrate-node/pallets/pallet-dao/src/dao.rs#L254

It seems that some of these proposals have votes and cannot be close because the call is not serializable. This should be addressed.

Also, it seems that proposals with an unmet threshold and expired end time can be closed and approved:

Example proposal: image

When trying to close this proposal, the outcome is approved because of this check https://github.com/threefoldtech/tfchain/blob/0e20bc81b066c7c1a5915bee2441be081a1cbd3c/substrate-node/pallets/pallet-dao/src/dao.rs#L207-L211

The end date is met but the threshold not, still it passes the above check.

DylanVerstraete commented 1 year ago

Will create seperate issues for the 2 above described cases

DylanVerstraete commented 1 year ago

@A-Harby since this issue actually belongs in the Tfgrid-TS-sdk repo I will move it there. https://github.com/threefoldtech/tfchain/issues/803 and https://github.com/threefoldtech/tfchain/issues/804 were created on this repo to track the needed runtime upgrades to clean up the remaining proposals

DylanVerstraete commented 1 year ago

Proposed solution: handle errors decoding proposals in the client