This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
Term userdata is confusing #2761
Closed
Description
Problem
Solana's use of the term userdata
comes from Lua and BREW, and isn't too meaningful without that historical context. Also, we use userdata
to mean [at least] two different things. We use it to pass "arguments" to instructions, and we use it to store arbitrary data in program accounts. In both cases, the userdata
can only be interpreted by a single program, but the error produced is ambiguous InvalidUserdata
. They ought to have different, more precise names and unique error codes.
Proposed Solution
- Rename
Instruction::userdata
toInstruction::argdata
- Rename
Account::userdata
toAccount::data
- Split
ProgramError::InvalidUserdata
intoInvalidArgdata
andInvalidData
. It shouldn't be possible to ever seeInvalidData
; that'd be a program bug, not a bad transaction.
Metadata
Assignees
Labels
No labels
Activity