solana-labs/governance-ui

Update Token Metadata can be proposed, voted on, and then fails on execute

SvenDowideit opened this issue · 0 comments

presumably because the token metadata doesn't yet exist :)

sadly, this means the user has staked 0.0028?SOL, used fees, and possibly annoyed a quorum of Realm members

The UX is also way too developer specific - you get a toast that says

error executing instruction Error: Transaction failed: panicked at 'index out of bounds: the len is 0 but the index is 0', program/src/utils.rs:834:6

which of course isn't in any Solana-labs repo, its actually in the metaplex repo

which is more obvious if the user is a developer and looks in the console:

simulate resultlogs 
Array(11) [ "Program GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw invoke [1]", "Program log: VERSION:\"2.2.5\"", "Program log: GOVERNANCE-INSTRUCTION: ExecuteTransaction", "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [2]", "Program log: Instruction: Update Metadata Accounts v2", "Program log: panicked at 'index out of bounds: the len is 0 but the index is 0', program/src/utils.rs:834:6", "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 5019 of 173344 compute units", "Program failed to complete: BPF program panicked", "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: Program failed to complete", "Program GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw consumed 31675 of 200000 compute units", … ]
​
0: "Program GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw invoke [1]"
​1: "Program log: VERSION:\"2.2.5\""
​2: "Program log: GOVERNANCE-INSTRUCTION: ExecuteTransaction"
​3: "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [2]"
​4: "Program log: Instruction: Update Metadata Accounts v2"
​5: "Program log: panicked at 'index out of bounds: the len is 0 but the index is 0', program/src/utils.rs:834:6"
​6: "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 5019 of 173344 compute units"
​7: "Program failed to complete: BPF program panicked"
​8: "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: Program failed to complete"
​9: "Program GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw consumed 31675 of 200000 compute units"
​10: "Program GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw failed: Program failed to complete"
​length: 11
​
<prototype>: Array []

long term, ideal UI?

I suspect there's a bunch of things needed at some point - a simulation pre-program that can test program pre-conditions, and return a user facing error message, which can be run at the proposal stage, and creates a "this won't work, because of X, are you sure you want to SENDIT?"

and something like onchain anchor IDL, that requires devs to create on-chain, i18n translateable error messages for users, so composing programs in the way governance-ui needs to isn't going to be full of code resembling expect script like "when you see a panic like this" tell the user "a specific user actionable suggestion"

Proposed Minimum change?

in the short term, I guess this project could probably write code to gate the "Add proposal" button based on testing what is on-chain (in this case, confirm that the user wants to make a proposal that will fail until some other proposal creates the metadata)?