The 7 Bytes That Weren't in the IDL: How #[repr(C)] Padding Breaks a Borsh Client
A single u64 added seven bytes of padding the compiler knew about and the client didn't. Here is why, and how to predict it for any #[repr(C)] struct. The failure I added one field to an instruction-a
Jul 15, 202617 min read36
![The 7 Bytes That Weren't in the IDL: How #[repr(C)] Padding Breaks a Borsh Client](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fuploads%2Fcovers%2F601c00e01054fa16dadd5fd8%2F52d82ddb-8edb-4943-b525-ef2b3ca8aaaf.jpg&w=3840&q=75)