Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api.derive.democracy.proposals() failed to get proposals #4896

Closed
JayJay1024 opened this issue Jun 6, 2022 · 10 comments
Closed

api.derive.democracy.proposals() failed to get proposals #4896

JayJay1024 opened this issue Jun 6, 2022 · 10 comments
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.

Comments

@JayJay1024
Copy link

const provider = new WsProvider('wss://darwinia-crab.api.onfinality.io/public-ws');

const proposals = await api.query.democracy?.publicProps();

proposals.forEach(([, ,proposer]) => {
  console.log(proposer.isEmpty, proposer.toHuman());
});

the proposer is not empty, but proposer.isEmpty is true , what could be the root cause

image

https://github.com/polkadot-js/api/blob/master/packages/api-derive/src/democracy/proposals.ts#L31

@AurevoirXavier
Copy link

AurevoirXavier commented Jun 6, 2022

I think they shield the 0x0...00 address intentionally.

@hackfisher
Copy link
Contributor

I think they shield the 0x0...01 address intentionally.

Yes, but to correct, because the proposer here is 0x00000...000.

@JayJay1024
Copy link
Author

In the above screenshot the proposer should be 5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM and 5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM

@jacogr
Copy link
Member

jacogr commented Jun 6, 2022

5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM is all-empty, i.e. 0x0000...0000

You can check in the JS dev console on apps,

console.log(hashing.decodeAddress('5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM'))

The 0x00...01 is the hash component from (u32, Hash, AccountId)

@hackfisher
Copy link
Contributor

@jacogr Maybe we should not shield 0x0...00 here, because the private key of 0x0...00 is known to public, anyone can reveal its keys and send extrinsic as 0x0...00.

Shielding this address in UI will prevent the governance participants from discovering these malicious proposals earlier.

@AurevoirXavier
Copy link

@jacogr Maybe we should not shield 0x0...00 here, because the private key of 0x0...00 is known to public, anyone can reveal its keys and send extrinsic as 0x0...00.

Shielding this address in UI will prevent the governance participants from discovering these malicious proposals earlier.

But this will also make the 'bug' more public.

@hackfisher
Copy link
Contributor

hackfisher commented Jun 6, 2022

But this will also make the 'bug' more public.

It is already public, and it is from crypto, not something can be hided/fixed in UI. We should have more people know this instead of only being known by malicious, making information asymmetry more severe.

@hackfisher
Copy link
Contributor

Related: paritytech/substrate#10413

@jacogr jacogr added the Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance. label Jun 20, 2022
@jacogr
Copy link
Member

jacogr commented Jul 6, 2022

Closing, nothing to be done API-wise.

@jacogr jacogr closed this as completed Jul 6, 2022
@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jul 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Projects
None yet
Development

No branches or pull requests

5 participants