 Hello everyone. Today I'm presenting about my Hyperledger mentorship project. That quick introduction, my name is Lucas Stoianago. I'm located in joint in Brazil. My university is the Aeronautics Institute of Technology in São José dos Campos, Brazil. My mentor is Shan Yang. And the Hyperledger project I was working for is the Solang Solidity Compiler. The project description, Solang is a Solidity Compiler that uses LLVM as the back end. It is written in Rust and it allows for many optimizations considering the context of the Solidity language. So besides the optimizations that the LLVM provides, Solidity also implements its own optimizations considering some specific points of the Solidity language. And the main challenge of this project was to apply compiler theory to optimize the intermediate representation of Solidity contracts. So the project has three main objectives. The first one is to detect and remove unused variables. So an unused variable is just like here on the right. There's a box. The variable V is unused. And I should be detecting this and removing. Let me see if I can have a pointer gesture. So variable V is unused. I was supposed to detect this and remove. The second objective is raise warnings for undefined variables. So here in this example, P is undefined and it continues to be undefined when we reach this line. So I should be detecting that P might not have a valid value when we read P. And remove common sub expressions. So A times B appears many times throughout this code here and here in the return statement. And I'm supposed to detect this that A times B is used many times here and exchanges this expression by a temporary variable that saves A times B. So the project deliverables are the first one is a code. So the project has five code deliverables. The first one is a code for detecting unused variables and raising warnings for them. So when I detect that V is unused, the compiler emits a warning to inform whoever is using something about that. Then the second deliverable goes eliminating this unused variable. So in the intermediate representation, we remove V because we don't use V for nothing, this function. The third deliverable was undefined variable warning. So here P is undefined as we may reach this statement without having a valid value for P. So I raise a warning about that because we don't want undefined behavior in our solute contract. And the fourth deliverable is available expressions analysis. So I implemented a code that analyzes which expressions are common in the contract and which expresses appear more than once. And the fifth deliverable is the commons of expression elimination in which I use the available expression analysis to detect the expressions that are repeated and exchange them by a temporary. So here a temporary will save the value of A times B and I'll exchange A times B by this temporary throughout this code. And the last deliverable was a documentation deliverable. I wrote a documentation about this optimization passes and so on. And my project execution and accomplishments. Luckily I have finished all deliverables in time. The main challenges were that there were so many edge cases for each implementation. Compilers in general have many edge cases and I spent a long time writing tests for every pull request and was very time consuming because so much cases had to be considered me. And all cases should be extensively considered in a compiler and there is no way to generalize instructions and expressions in a compiler. I had to write specific code for each one and frequently my pull request got very long because of that. But I'm proud of that I implemented commons of expression elimination which is a really complex compiler optimization to implement in design. So recommendations for future work regarding Solang's Solang compiler. Solang's existing optimization analysis implementation should be improved because we can detect the usage of storage variables. So storage variables are variables that are saved in a Soliti contract outside functions. And the commons of expression elimination does not work for storage variables as well because of this limitation of existing Solang optimizations. And Solang has complex instructions that should be broken down. When we have these complex instructions some of the optimizations I wrote the work for them. So one best practice is to break down those complex instructions in simple ones. And for my continued involvement with the project I plan to make contributions during my free time. I really like working Solang and compilers in general. And I'll be creating an article containing a detailed design of my implementation. So here I left some links to my request the Solang docs and my the week of my project. I'll be writing a million words for during this week. And here's a quick demo. So if we have this function inside a contract and we run a Solang on this function force it generates this warning telling me that variable V has been assigned but it has never been read. And here it said line eight is this variable and used. And this is the Solang's intermediate representation for this contract. We can see here that the variable V has been eliminated. It is not in this presentation. And eight times B which is a common expression has been saved first this temporary variable CSD10. And we exchange eight times B for this temporary whenever it appears from the code. So here X is the temporary minus five. And inside this if condition we see that X assumes the temporary minus 19. And also at the last return statement we see X plus eight times B. And here it is X plus the temporary. So inside scammed I got a very better knowledge of compiler optimizations as this is what my project was mainly about. And open source code can have impact many other projects. So my contribution is to be impactful. And right now there are there are many users Solang compilers and I know that they will be very glad to have their contracts run faster on the blockchain. And my advice is for new mentees is to make a project plan and make a schedule for your for your code and implementation. And talk to your mentors early and understand what they're expecting from you. And get to know code styles and available tools beforehand to avoid back and forth. Because back and forth can get very time consuming if you don't know exactly these points. And this is it. Thank you. Thank you Lucas for the presentation. And I really like your insight about you know open source code is used by many people. So you know your contribution is really impactful. So that's really awesome. And I see your mentor Sean Young on Zoom. Sean do you have anything to comment on your mentees work? Sean? Can you hear us? Oh sorry. Common sub-expression elimination pass is really quite complex. And it's very impressive work from Lucas. Also this works is very useful. And the compiler is definitely more it's much easier to use. So the developer experience is much better now that it tells you when you use a variable without when it doesn't have a value. And it tells you when variables aren't used at all. So it's improved the developer experience. So it really is great work. And on a blockchain executing smart contracts costs real money. So any optimizations make a real difference. And I'm sure anyone using Solang will be happy that their contracts will now run for less. So I'm very grateful. Thank you. That's great. And it's so good to see the momentum for the Solang project. I know it's currently still in the Hyperledger Labs but I'm just glad to see you know Sean your dedication and also just getting more developers into your project as well. So this is great work. Thank you.