Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

[spl-record] Remove Data type from RecordData type #6062

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

samkim-crypto
Copy link
Contributor

@samkim-crypto samkim-crypto commented Jan 5, 2024

Problem

The record program uses the struct RecordData to represent record data in accounts.

pub struct RecordData {
    pub version: u8,
    pub authority: Pubkey,
    pub data: Data,
}

The Data type is an array of fixed size 8. It seems like this struct was added just for initial testing. The logic to support arbitrary length record data already exists in the processor logic.

By removing Data from the RecordData type and using it just as a header for data, we should be able to support arbitrary length record data.

Summary of changes

Removed the Data struct from state and updated the record program to support arbitrary length data.

This is a follow-up to #6054 (comment).

@samkim-crypto samkim-crypto added WIP Work in progress and removed WIP Work in progress labels Jan 5, 2024
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks for improving this!

@samkim-crypto samkim-crypto merged commit ddbb3d8 into solana-labs:master Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants