New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

DApps ain’t easy by Santiago Palladino (Devcon5)

DevconFri, Oct 9, 2020, 12:00 AM

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more. https://archive.devcon.org/archive/watch/5/dapps-aint-easy Along with my job at OpenZeppelin, I spent the last year writing a book on Ethereum for traditional web developers new to the space. While writing, I found that many things that we take for granted when coding on Ethereum are much more difficult to get right than we think. On this lightning talk, we will briefly present overlooked challenges on gas estimations, handling reorganizations, and even managing subscriptions. Though there will be no silver bullet solution to close, we will discuss what we can do as an ecosystem to mitigate these problems. Speaker(s): Santiago Palladino Skill level: Intermediate Track: Developer Infrastructure Keywords: technical Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon 5 was held in Osaka, Japan on Oct 8 - 11, 2019. Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

Transcript

[Applause] you know what works okay everyone thank you for being here thanks for coming specially on the face of a negative phone coming out of way later my name is Santa Bernardino I'm a software developer at opens up we commence Emily we perform security audits for these Android systems and we also build open-source content libraries and even for tools but I'm not here today to share our work here or does have a great work it's a space showing that we have to talk about the personal project and have took over a year ago I wrote a book to more web 2.0 developers to the space and how to develop decentralized applications with this code get it the thing is when working on this person I think that one of the best ways to learn something is to try to teach it I also managed to squeeze support attachment which is the best way to learn something is to actually try to research it try to teach and share it with others and one of the biggest things I got from the book is tablets are actually much more tricky than they see there are many things that we take for granted that we assume that they're easy to develop I mean when you start thinking you you start to realize that it's not exactly that way and to share that with you I want to presented short challenge basically some very very simple obligation and showing the North achieve of tokens over specific riders and see how it's not become actually tricky pretty soon we'll go with it about minutes not many it's everything to her throat so bear with me but the idea will be just to get the great office of the Year ceremony open new ones that's it something to write well assuming we have two building blocks this is an oversimplification of the standard example something that lets us know okay give another is as these tokens and and eventually something new ones step one listing the grant organs should be Feliz right the user has received two na two can be we just ask for the current tokens forget that is with both right but what we don't yet is when we receive there are those no that's when they were located below the particular address for instance so can be good have received last blow which means it's not confirmed it's subject to being removed and it's not information actually gets so if we want to do a picture we need to a query the state a couple of blocks back let's say half a dozen one dozen blocks depending on how much confirmations but now we have a gap on the past six blocks which natural to feel maybe getting the past events bowling or something to see something has changed okay let's clear that out for a second try to focus on the second problem how we subscribe called how is he for new targets this is probably easy actually we have it what's of information do you know not all notes expose one we can just issue some time with also from the current block onwards we're notification on all opinion transfers of the events when your job instance the user receives well hopefully from different one disappear from a get install nature but that's yet another problem so okay let's a subscription the user receives two tokens attempted an alpha to committer we get events for that pretty severely need to display them user interface this is a reorder the subscription will also take care of this for us and will let us know you know talking metals remove user organization token Delta at the earth instead but this requires a change the subscription to be allowed subscription something that runs over worth of it and HD the connection ribbon connections break they may actually break while the really stay in place which instead no losses ability this is the state of what information has been sending us and what should we do struck that the reorganization happens and we end up with a spurious version of a client side so we may that we may end up displaying false information to the user again this is a pretty edge case but connections break witness connectivity there we're screwed we can go on another approach we can go back to basics just polling them go with a simple algorithm that just requires checking block cache is continuously seeing if they have changed a dividend rate changing the block cache in Surrey org we can react to that it means going to undo all the produce event so we also need to give a mapping from block to from block to events again don't want to go in depth but it's a bit cumbersome it's not definitely not as easy as installing a subscription actually using this approach we can also soap a six month window and a few other things but since I only have my five minutes that the point I want you to compare to share with you is that these things are more difficult than you think and if we start digging and we start looking for edge cases for unstable connections reorganizations for stuff that for the stuff that is outside happy path things get very pretty quickly we need to be looking for this we need to do more work to have better plans and libraries better support for travel for having this big shout out to the various blocks during library out there which has exactly this case and by the way hardly anyone uses it and especially when you put your testing tools I mean it's really difficult to code application that's going to be resilient to these situations if you cannot test it there is no way for us to test our organization there are cognitive tools for testing sporty connections racially develop assuming that we'll have a great differences type of Soviet women we don't always - so bring to make sure that our testing framework that distinct tools we use are commonly for support in all of these cases so going back to the challenge is a couple minutes before and so we're just you know knowing how you will calculate I've created an internal forum it would be great if you to join share your thoughts there I mean the politic approaches shared is only one option and I'm super interesting to know on how you guys would solve it so that's it thank you so much [Applause]

Automatic transcript — names and jargon may be misspelled.