Skip to content
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
Closed
@garious

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 to Instruction::argdata
  • Rename Account::userdata to Account::data
  • Split ProgramError::InvalidUserdata into InvalidArgdata and InvalidData. It shouldn't be possible to ever see InvalidData; that'd be a program bug, not a bad transaction.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions