Skip to content

Add collections crate#182

Merged
febo merged 6 commits intosolana-program:mainfrom
febo:collections-crate
Mar 3, 2026
Merged

Add collections crate#182
febo merged 6 commits intosolana-program:mainfrom
febo:collections-crate

Conversation

@febo
Copy link
Contributor

@febo febo commented Feb 25, 2026

Problem

Client generation need custom types to support String and Vec to have different prefix length types – e.g., a String with a u8 length prefix or a Vec<Address> without a prefix that consumes the remaining available bytes.

Solution

Add a new crate to include custom String and Vec types with borsh and wincode serialization support.

@febo febo force-pushed the collections-crate branch 2 times, most recently from 693a279 to 83a6398 Compare February 25, 2026 18:42
@febo febo requested review from joncinque and lorisleiva February 25, 2026 18:43
@febo
Copy link
Contributor Author

febo commented Feb 25, 2026

The spl-collections name is experimental.

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.

Looks great overall! Mostly small points

@febo febo force-pushed the collections-crate branch from 6a5dc3b to c1d7548 Compare March 1, 2026 20:28
@febo febo requested a review from joncinque March 2, 2026 15:24
@febo
Copy link
Contributor Author

febo commented Mar 2, 2026

@joncinque Ready for a second review. About the name, the best I could come up was solana-account-containers.

@febo
Copy link
Contributor Author

febo commented Mar 2, 2026

@joncinque Ready for a second review. About the name, the best I could come up was solana-account-containers.

@lorisleiva seems to prefer solana-collections.

joncinque
joncinque previously approved these changes Mar 2, 2026
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.

Looks great! Just some nits that you can take or leave

@@ -0,0 +1,27 @@
[package]
name = "spl-collections"
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're good with the name, let's reserve it on crates.io!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lorisleiva has another suggestion: solana-wire-types

Copy link
Contributor

Choose a reason for hiding this comment

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

that would confuse with networking types though, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, let's keep it collections then.

@febo febo force-pushed the collections-crate branch from b7b9e55 to 023ee0c Compare March 3, 2026 13:34
@febo febo requested a review from joncinque March 3, 2026 13:34
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.

Looks great to me!

@febo febo merged commit ca5df3f into solana-program:main Mar 3, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants