
despite everything it is still you, prev devops/fs @openmarket_xyz @patlytics https://xitter.cf/t.co/eCnrpd82Sa | https://xitter.cf/t.co/CDutmMxVYo
Joined November 2022
- Tweets1K
- Following481
- Followers217
- Likes47.9K
Day 4/90 of Rust, Solana and DeFi
The past few days have been focused on shipping a lot of new and exciting product updates for SDP :) More on that later this week, but i've also added a new update to rust.visualization.sh 🔧
Pretty random! But because of one of the rektoff quizzes, i've learnt that the compiler will pad out structs to ensure data is properly aligned in memory, and Rust may reorder struct fields to save bytes!
Turns out it is very relevant to how zero-copy deserialization in Solana programs work, and require #[repr(C)], all just to achieve predictable, and stable memory layout.
These few days would probably be focusing less on Rust, but more on Solana and DeFi. I've also been stepping through Kora, the Foundation's official Fee Relayer implementation, which i'd say give a good overview on what concepts i'm missing!
Day 3/90 Days of Learning Rust
Today was rather slow, I'm trying to figure out how to make this work while juggling a full time, lots of corporate research and IRL commitments.
So, today I decided to just complete my Rust Visualizer under an umbrella visualization.sh site.
You can probably see where this is going after I snagged off the domain. We are starting off with rust.visualization.sh and it will now be my playground for anything new I'm learning!
Enjoy :)
Replying to @bashtwigs @rektoff_xyz
Score check - 9/10 for Quiz 2 part 1, and 28/30 for Quiz 2 part 2. i should really recheck my work more, losing easy marks.
Day 2/90 of Learning Rust, Solana and DeFi
I've finally finished @rektoff_xyz's Quiz 2. The approach of using ownership sets to understand aliasing xor mutability by identifying "frozen", "shared" or "free" variables definitely helped a lot with my intuition, at least the simpler cases.
What gave it completeness was also researching about RFC 2094 which discusses support for Non-Lexical Lifetimes. Understanding how a mutably borrowed reference can eventually be immutably borrowed helped me reason about memory ownership instead of accepting the rules as is.
𝚕𝚎𝚝 𝚖𝚞𝚝 𝚡 = 𝟻;
// {𝚡: 𝚏𝚛𝚎𝚎}
𝚕𝚎𝚝 𝚛𝟷 = &𝚖𝚞𝚝 𝚡;
// {𝚡: 𝚏𝚛𝚘𝚣𝚎𝚗}
*𝚛𝟷 += 𝟷;
// 𝚛𝟷'𝚜 𝚕𝚊𝚜𝚝 𝚞𝚜𝚎 𝚠𝚊𝚜 𝚊𝚋𝚘𝚟𝚎
// 𝚜𝚘 𝙽𝙻𝙻 𝚕𝚎𝚝𝚜 𝚝𝚑𝚎 𝚋𝚘𝚛𝚛𝚘𝚠 𝚎𝚗𝚍 𝚑𝚎𝚛𝚎
𝚕𝚎𝚝 𝚛𝟸 = &𝚡;
// {𝚡: 𝚜𝚑𝚊𝚛𝚎𝚍} 𝚗𝚘𝚠 𝚜𝚊𝚏𝚎, 𝚛𝟷 𝚒𝚜 "𝚍𝚎𝚊𝚍"
What really helped was sketching out the pointers, and all the variables of who owned what from the stack to the heap, which is why i've made a quick tool exactly for this purpose :)
I think with this it should be sufficient to dive into some Solana technicals, and I'd want to approach this from a barebones way where I start with something more low-level like Pinocchio, then come back to Anchor. I want to be able to trace every byte of a simple program and understand intuitively what it is.
Well, if I lack any other Rust fundamentals that I don't intuitively understand yet I'll just go back to that chapter again! Maybe I was reading the book wrong :P
recently ive been tasked with understanding the world state of defi so i've built a thing that let's me quickly understand institutional policies for each country!!!
• refreshes daily, digs deep into public law documents, reports from banks/issuers
• full timeline on progression, historical context matters!!
• links back tokenization concepts to tradfi infrastructure
keep up to date with literally anything defi related anywhere :p
i have around 20 pr issues that are low hanging fruits to fix, designed a framework for fable 5 to orchestrate codex instances, we’ll loop it out to see how well fable does
now that i have more time, i've joined @rektoff_xyz cohort 5 and just ended the first lecture on rust static memory, heap and stack, oddly reminiscent of my uni days, thanks for the lesson!




