Timeline for Recommended serialization library for dynamically sized objects
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 26, 2022 at 14:42 | vote | accept | Ripleys 0x | ||
Nov 22, 2022 at 14:44 | answer | added | Nick Garfield | timeline score: 4 | |
Nov 21, 2022 at 14:48 | comment | added | Ripleys 0x | see: github.com/solendprotocol/solana-program-library/blob/mainnet/… | |
Nov 21, 2022 at 14:47 | comment | added | Ripleys 0x | I have a struct called Obligation, which manages a user's deposits and borrows. The amount of deposits and borrows is dynamic. Currently, we have the size hardcoded so the amount of deposits and borrows can't exceed 10. I would like to remove this constraint, especially since re-alloc lets us do dynamic resizing. | |
Nov 20, 2022 at 22:12 | comment | added | Frank C. | Can you add more context to your question? What are you storing in the vector, how often will it grow? What is the general use case? | |
Nov 20, 2022 at 22:10 | comment | added | Frank C. |
Borsh is fine and I've used it for variable size objects (like vec ). However; if you are trying to manage a large vector or it's growth can potentially be large you may want to consider using PDA for whatever info you would store in the vec . Any serialization is going to consume more CU and that may be prohibitive.
|
|
Nov 20, 2022 at 19:43 | history | edited | Ripleys 0x | CC BY-SA 4.0 |
edited title
|
Nov 20, 2022 at 16:47 | comment | added | Ripleys 0x | I took a quick look at borsh and bincode and I don't think they satisfy this requirement. | |
Nov 20, 2022 at 16:47 | history | asked | Ripleys 0x | CC BY-SA 4.0 |