sui icon indicating copy to clipboard operation
sui copied to clipboard

crypto: Add get_transaction_with_auth_signers

Open joyqvq opened this issue 3 years ago • 2 comments

https://github.com/MystenLabs/sui/issues/4880

  • Added authorities truncated pubkey to the signature page
  • Added a new JSONRPC endpoint get_transaction_with_auth_signers. since get_transaction and its SuiTransactionResponse is used for all frontend, adding a new endpoint just for explorer to load extra auth signers array.

on localnet: image

on mock data: image

joyqvq avatar Nov 23 '22 03:11 joyqvq

💳 Wallet Extension has been built, you can download the packaged extension here: https://github.com/MystenLabs/sui/actions/runs/3535077012#artifacts

github-actions[bot] avatar Nov 23 '22 03:11 github-actions[bot]

@666lcz im not an expert on React, but from what i see, this TransactionResult() is called exactly once when the url for /transaction/:id is loaded and all TxState are loaded with the RPC endpoint result from TransactionResultAPI regardless of which tab the user is viewing (with all the data, all frontend components for the tx are rendered from: function TransactionView({ txdata }: { txdata: DataType })).

while I can make a separate getAuthorityNames endpoint, it will be called the same amount of times along with the getTransaction endpoint (so 2x the load) when populating the DataType..

I also do not see there is no other place for getTransaction used in explorer, which makes me think extending the current getTransaction endpoint is OK without increasing the number of rpc calls but just increasing the payload.

Is there a way to optionally load a react component based on which tab the user is viewing? Would appreciate some help on how to refactor the code here.

image
    if (checkIsString(id)) {
        return IS_STATIC_ENV ? (
            <TransactionResultStatic id={id} />
        ) : (
            <TransactionResultAPI id={id} />
        );
    }

joyqvq avatar Nov 26 '22 22:11 joyqvq

another idea is we can make "aggregated signature" a clickable redirects that loads its auth signatures.

joyqvq avatar Nov 26 '22 22:11 joyqvq

Is there a way to optionally load a react component based on which tab the user is viewing? Would appreciate some help on how to refactor the code here.

cc @Jordan-Mysten could you help @joyqvq with this? I am also fine with just having an extended getTransaction endpoint if the frontend refactoring is too much work.

666lcz avatar Nov 28 '22 04:11 666lcz

discussed with @Jordan-Mysten offline, we would use 2) to make a separate RPC call to load auth signers, this PR just adds the endpoint, @Jordan-Mysten will work on the pure UI PR separately.

I realized the getCommitteeInfo endpoint is not as flexible mapping what the roaring bitmap to the committee authorities. @Jordan-Mysten I added the getTransactionAuthSigners endpoint in this PR to let rust handle the get authority by index logic. You can use this endpoint from UI to load the auth signers (with version gate)

joyqvq avatar Nov 29 '22 18:11 joyqvq