{"id":"f-b0LWxhO18","title":"Handling Peak Loads: Scaling Past Congestion","description":"Join NEAR's community:\nWebsite: https://near.org/\nReddit:   / nearprotocol  \nDiscord: https://near.chat/\nMedium:   / nearprotocol  \nBlog: https://near.org/blog/\nTwitter:   / nearprotocol  \nGitHub: https://github.com/near  https://github.com/nearprotocol\nDev Docs: https://docs.near.org/\nCreate a wallet: https://wallet.near.org/create\nApps on NEAR: https://awesomenear.com/\nLearn to Build On NEAR: https://www.near.university/\nGrants & Funding: https://near.org/grants/\n#Blockchain #FutureisNEAR #NEAR #nearprotocol\n#nft #dao","channel_name":"NEAR Protocol","published_at":"2023-07-23T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/f-b0LWxhO18/hqdefault.jpg","transcript_text":"foreign this presentation is going to be very different from Elio's presentation it's going to be more technical I hope I'm not going to put everyone to sleep and some people still find it interesting um so yeah I'm going to talk about the protocol and how it handles uh conjunction so if we know blockchains all have some kind of capacity limit today and it is fundamentally a supply and demand relationship it's a pretty simple if more people want to use the blockchain than what you can handle then we have a congestion problem so what's what are the actual problems when there is congestion there are quite a few ones that transactions may become more expensive depending on how the underlying blockchain handles gas price change and things like this and also the user's experience would be great because when there are more transactions then the blockchain can handle then it's natural to think that some transaction will take longer than they would have taken otherwise and also it might create uh instability of the network uh degrade on the network performance blocks become slower and also in some extreme cases the chain might even install okay so what are the some of the ideas to address this problem uh one kind of a natural line of thinking is to say well if there is not enough capacity how about we just add more capacity and this is um I think a lot of uh what different blockchains are working on uh and and sharding is one way to do this as well so in nearest model the capacity of the network scales roughly with the number of shorts that we have in the network so essentially the thinking is that if there is more more demand than what the network can handle at any given moment in time then there should be more shards created to to handle that load okay that sounds very promising um but there is this new problem in a network with A Single Shard it's very easy to think about transactions and when they reach this limit or like when they reach the capacity of the blockchain if there are too many transactions we can just stop taking them so that they don't overflow the network but with many shards uh it's going to get a bit more complicated and I'll talk about why that's the case uh so let's imagine we have uh somehow 100 charts and there's just one chart that hosts the near social contract uh which is essentially what what's behind all the uh boss stuff that Elia just talked about um and because it's very popular um everyone wants to use it once we interact with it so there are users on different charts from short one to shower 99 and they're all interested in using this contract and even though in each of those short the users are not actually exceeding the capacity or they may even be only utilizing a fraction of the capacity what will happen they will send some transaction from their chart to the short zero and internally we call transaction between two short a receipt and what happened is that because uh all of those receipts are all coming in from short one to start 99 into short zero even though each of them have to not exceed the limit of the chart they would create a huge burden because it's now multiply by 99 and then short zero gets screwed yeah so to recap um we can assume that each chart has a fixed capacity and the capacity is actually the same across different shards um and it's possible to initiate cross-drawal transactions that will spend a little gas in the origin chart and a lot of cash in the destination chart so even though each chart can locally control the influx of transactions so that they locally don't exceed the limit globally you can still have very very heavy congestion on a hot chart because of those Crossroad transactions so a kind of simple idea is to say we just don't allow that to happen right Whenever there is a congestion on a short we just say that all the receipts coming from other chart or would stop and and would essentially fail them it definitely solves the problem but it creates some other or maybe even bigger problems which is and now it makes the life of developers while it's user is very difficult for developers you need to think about the case where some some of their transactions just just randomly fail in the middle so let's think about the example right let's say there is a tipping widget on near social where if you like some posts you can give it a tip let's say some amount of near and then like users um users are taking advantage of this feature and then someone like look at uh posts you like they decide to give them like one year tip uh it all works very well until this uh near social contract or like The Shard it lives on because it's very contrasted and then uh some users tape would fail and then the receipt just like stopping the middle uh now it becomes a problem because the user might just lose um that one year if the uh if the failure is not handled properly and also the for the users and it's also a big problem because now they can just see their transactions randomly failing from time to time without actually understanding what happened uh and as I said before they may also even get into some very undesirable state where there is potential monetary loss so overall this is not ideal solution another idea uh that's more promising is what we call limit ingestion rate so if we think about what actually happens in the previous case the short got very overloaded because it's trying to essentially hold all the requests from other shards on the chart itself but obviously it has some kind of limit on itself so it cannot hold this request indefinitely forever and at some point it will get get overloaded uh so what we want to do is I want to say Well when The Shard itself start to get overloaded it should tell other chart that I'm reaching some limit so the other chart will stop sending um receipt to them and then this kind of pressure eventually but but propagates to the end users and the user would at some point know that while the networks contrasted I cannot send transactions anymore this is much better than user like not knowing what happened send their transaction and it failed in the middle and then they might end up in a very undesirable state so more concretely what happens is that if Shard will have an outgoing buffer uh with limited capacity C and once the capacity of the buffer is reached the chart will stop accepting uh transactions or receipts and then this process continues on until the pressure propagates to the users at some point okay so let's look at example um oh I guess the animation doesn't work here um but I don't think that really matters so let's say we have this uh hash chart which near social contract and then there may be manage charging the system uh but for the sake of this example let's just say there we just look at a few other charts so let's say the user is sending some transaction to Chart 2 to call some construct the contract generate a receipt you can sync it with another transaction to to Sharp one that caused some other contract and then the other contract eventually caused the near social contract potentially to update some user information there and what happens when the short zero gets very congested is that the short one will know that Charlotte leaders getting contrasted so it's going to put the receipt uh in the outgoing buffer and when the buffer becomes full the chart two will know that short once buffer is full so it is going to stop sending receipt there and the accumulation Zone buffer and eventually the is its own buffer will become full and the user will know that the blockchain is congested so I cannot send more transactions yeah so to recover the idea is basically to only process incoming transactions or receipt when there is space left in the outgoing buffer okay that sounds very nice but we actually have another problem uh which is deadlocking so let's consider the following case uh let's say there is a system with only two charts uh chart 0 and chart one and they're both full and in order to make progress let's say there's only one contract on each chart and what the contract does is essentially to call the other contract right so the contract on charge zero would basically cause chart one and counter gunshot one called short zero and to make progress uh they each will need to prop uh process some receipts but every single receipt the process will generate a new receipt to the other chart but now there's a problem because when they're both full you cannot actually make progress because each of them is waiting for the other chart to free up some capacity so that you can process a receipt and generally new receipt that goes to the chart there are a few ideas on how to address this problem and I'll talk about uh one of the ideas here so this idea is called cross short capacity lending so if we think about what actually happens in the previous case essentially it's because um your credit is possible to create the cycle where your your contract on short zero there's another contract on chart one they call each other they essentially form this Loop and then and releasing nearest model is possible for one receipt to generate multiple receipt as a result of execution so if you if we look at if we quantify congestion from the point of view of number of receipts and that's just not a very good metric because you can create this this like essentially infinite Loop there uh and and the idea behind this uh solution is to say we want to break the cycle by introducing something that's monotonically decreasing throughout the execution so that even if you have this like cycle of contract calling each other what will happen is that this quantity would essentially start to decrease over time and like every time you run through the cycle this quantity would decrease and eventually to reach zero and cannot actually form uh this like infinite cycle that caused you to have the stat locking problem unfortunately cash is such a uh a function that is monotonically decreasing throughout the execution what that means is that let's say you attach some amount of gas to your transaction and after it starts executing uh no matter how many steps it take on at every single step of the execution it would consume a non-zero amount of gas so even if let's say you have two receipts generated as a result of processing one receipt the sum of that cash attached to both of those receipts will be less than the gas attached to the original one so and then there's what that what this idea does is that it decrease the buffer of the origin Shard and then increase the buffer of the destination chart according to the amount of gas attached to the receipt that is generated through the execution and of course the capacity would be returned back to the origin Shard after the receipt is process so that might sound very abstract so let's look at the example let's say there's two short short zero and short one uh and then there's uh there's outgoing receipt from short zero to Shard one as a result of processing some uh some other receipts uh with James Sharp zero and and the carries x amount of cash so when this happens what will happen is that the buffer of charge zero would decrease by X and then the capacity of the buffer um in short one would increase by X and here the buffer capacity is measured in gas um so we have to recap basically the core ideas after processing a receipt the sum of the attached cache of child receipt is strictly less than the attach gas of the pattern receipt and then by construction the system is guaranteed to make progress okay that all sounds very nice but there is a another important problem that we haven't touched on which is uh priority of transactions so some users would prefer to catch a to pay a higher price to get their transactions in even if there is heavy congestion the reason is that what they can gain from doing that transaction um the or the value they can extract from the transaction week where exceeds the amount of money they need to pay for transaction fee so they essentially don't mind uh and then examples including people running Arbitrage Bots liquidation and or like transferring like large amount of value and Etc but it's also a very difficult problem to solve right so um we thought about building a mechanism to interact higher priority transactions or receipt um into the into the protocol but that would actually make it extremely complex and hard to reason about uh there are several reasons for that one is that by doing that we essentially lose any kind of theoretical guarantees on the latency of the transactions this is because for any given transaction it is possible that someone would inject transaction with higher priority by paying more and and as a result you cannot really say like well how long this transaction will take at most to be processed and then answer questions like those and also along the same line you you actually need to figure out how to store the the lower priority transactions or receipt um because the the higher because in the middle of the execution uh some transactional receipt can be injected um so because you have limited capacity you cannot process all of them so some of them would be left there you need to figure out what to do with them and likely the solution is to put them in the state so that everyone actually agrees on what are the receipts that are not executed uh but storage State uh stuff in in the state is not free and especially because you don't actually know how long uh it would be it would take for um for the network to actually process those lower priority transactions um essentially you need to figure out a way to charge users and how that actually works is also very complex and there's another question which is that what if people want to change their priority uh Midway through the execution because the observed congestion that happened after their transaction started and now you you're drawing to this funny problem where like in order to bump the priority of some other receipt you actually need to send a transaction and that in turn I would generate some receipt to pump the receipt and you need to figure out the relative priority of those two types of receipts and how they interact with each other and now that's not a problem that we want to be solving uh because it just involves too many moving pieces and it makes things very complex so the idea we have in status to say uh well we want to move some of that complexity off chain and actually Auction Block space instead uh so the idea is that uh we want the protocol to define a way to to auction part of the the block space um as a fast link or a priority link so that people can use that to submit transactions and then get get their transactions in relatively quickly uh by by paying more and then uh biot users or sort of third-party service providers can essentially run the auction for the block space and then provide a service to users who want to utilize those uh prioritized block space so uh one of the thinking behind this idea is that uh off-chain transaction prioritization is in a way inevitable because with the Mev stuff um as we all know that it's already happening and there's essentially no way to actually stop it so the idea is to say well we just increase that and also this would allow us to simplify the protocol design compared to the solution where we actually need to implement some auction on the transaction level and actually moves the more complex part of chain okay to recap um the congestion problem is much more complex in Uncharted blockchain than a non-shorted blockchain and also the transaction priority Problem uh it's also difficult and we think it's better to handle some of that of chain and for the future work um so I talked about some of the ongoing work that we're doing not all of them are fully implemented and in the future we'll focus more on understanding the economic implications of contraction and how to prioritize transaction better yeah that's it for my talk thanks everyone","transcript_synced_at":"2026-11-04T03:46:52.928Z","segments":[{"start_seconds":4,"text":"foreign this presentation is going to be very different from Elio's presentation it's","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=4s"},{"start_seconds":13,"text":"going to be more technical I hope I'm not going to put everyone to sleep and some people still find it interesting","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=13s"},{"start_seconds":20,"text":"um so yeah I'm going to talk about the protocol and how it handles uh conjunction so if we know blockchains all have some","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=20s"},{"start_seconds":29,"text":"kind of capacity limit today and it is fundamentally a supply and demand relationship it's a pretty simple if","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=29s"},{"start_seconds":37,"text":"more people want to use the blockchain than what you can handle then we have a congestion problem","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=37s"},{"start_seconds":45,"text":"so what's what are the actual problems when there is congestion there are quite a few ones that transactions may become","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=45s"},{"start_seconds":52,"text":"more expensive depending on how the underlying blockchain handles gas price change and things like this and also the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=52s"},{"start_seconds":61,"text":"user's experience would be great because when there are more transactions then the blockchain can handle then it's natural to think that some transaction","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=61s"},{"start_seconds":69,"text":"will take longer than they would have taken otherwise and also it might create uh instability of the network uh degrade","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=69s"},{"start_seconds":77,"text":"on the network performance blocks become slower and also in some extreme cases the chain might even install","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=77s"},{"start_seconds":87,"text":"okay so what are the some of the ideas to address this problem uh one kind of a natural line of thinking is to say well","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=87s"},{"start_seconds":95,"text":"if there is not enough capacity how about we just add more capacity and this is um I think a lot of uh what different","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=95s"},{"start_seconds":105,"text":"blockchains are working on uh and and sharding is one way to do this as well so in nearest model the capacity of the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=105s"},{"start_seconds":112,"text":"network scales roughly with the number of shorts that we have in the network so essentially the thinking is that if","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=112s"},{"start_seconds":120,"text":"there is more more demand than what the network can handle at any given moment in time then there should be more shards","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=120s"},{"start_seconds":127,"text":"created to to handle that load okay that sounds very promising um but there is this new problem","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=127s"},{"start_seconds":134,"text":"in a network with A Single Shard it's very easy to think about transactions and when they reach this limit or like","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=134s"},{"start_seconds":142,"text":"when they reach the capacity of the blockchain if there are too many transactions we can just stop taking them so that they don't overflow the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=142s"},{"start_seconds":150,"text":"network but with many shards uh it's going to get a bit more complicated and I'll talk about why that's the case","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=150s"},{"start_seconds":159,"text":"uh so let's imagine we have uh somehow 100 charts and there's just one chart","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=159s"},{"start_seconds":165,"text":"that hosts the near social contract uh which is essentially what what's behind all the uh boss stuff that Elia just","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=165s"},{"start_seconds":174,"text":"talked about um and because it's very popular um everyone wants to use it once we","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=174s"},{"start_seconds":181,"text":"interact with it so there are users on different charts from short one to shower 99 and they're all interested in using this","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=181s"},{"start_seconds":189,"text":"contract and even though in each of those short the users are not actually exceeding the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=189s"},{"start_seconds":196,"text":"capacity or they may even be only utilizing a fraction of the capacity what will happen they will send some","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=196s"},{"start_seconds":204,"text":"transaction from their chart to the short zero and internally we call transaction between two short a receipt","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=204s"},{"start_seconds":213,"text":"and what happened is that because uh all of those receipts are all coming in from short one to start 99 into short zero","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=213s"},{"start_seconds":221,"text":"even though each of them have to not exceed the limit of the chart they would","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=221s"},{"start_seconds":228,"text":"create a huge burden because it's now multiply by 99 and then short zero gets screwed","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=228s"},{"start_seconds":236,"text":"yeah so to recap um we can assume that each chart has a fixed capacity and the capacity is actually the same across different shards","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=236s"},{"start_seconds":244,"text":"um and it's possible to initiate cross-drawal transactions that will spend a little gas in the origin chart","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=244s"},{"start_seconds":251,"text":"and a lot of cash in the destination chart so even though each chart can locally control the influx of transactions so","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=251s"},{"start_seconds":260,"text":"that they locally don't exceed the limit globally you can still have very very heavy congestion on a hot chart because","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=260s"},{"start_seconds":268,"text":"of those Crossroad transactions so a kind of simple idea is to say we just don't allow that to happen right","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=268s"},{"start_seconds":276,"text":"Whenever there is a congestion on a short we just say that all the receipts coming from other chart or would stop","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=276s"},{"start_seconds":284,"text":"and and would essentially fail them it definitely solves the problem but it creates some other or maybe even bigger","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=284s"},{"start_seconds":292,"text":"problems which is and now it makes the life of developers while it's user is very difficult for developers you need","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=292s"},{"start_seconds":300,"text":"to think about the case where some some of their transactions just just randomly fail in the middle so let's think about","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=300s"},{"start_seconds":307,"text":"the example right let's say there is a tipping widget on near social where if you like some posts you can give it a","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=307s"},{"start_seconds":315,"text":"tip let's say some amount of near and then like users um users are taking advantage of this feature and then someone like look at uh posts you like","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=315s"},{"start_seconds":323,"text":"they decide to give them like one year tip uh it all works very well until this uh near social contract or like The Shard","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=323s"},{"start_seconds":332,"text":"it lives on because it's very contrasted and then uh some users tape would fail and then the receipt just like stopping","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=332s"},{"start_seconds":339,"text":"the middle uh now it becomes a problem because the user might just lose um that one year if the uh if the failure is not","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=339s"},{"start_seconds":348,"text":"handled properly and also the for the users and it's also a big problem because now they can just see their transactions randomly failing from time","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=348s"},{"start_seconds":356,"text":"to time without actually understanding what happened uh and as I said before they may also even get into some very","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=356s"},{"start_seconds":362,"text":"undesirable state where there is potential monetary loss so overall this is not ideal solution","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=362s"},{"start_seconds":372,"text":"another idea uh that's more promising is what we call limit ingestion rate so if we think about what actually happens in","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=372s"},{"start_seconds":379,"text":"the previous case the short got very overloaded because it's trying to essentially hold all the requests from","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=379s"},{"start_seconds":387,"text":"other shards on the chart itself but obviously it has some kind of limit on itself so it cannot hold this request","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=387s"},{"start_seconds":395,"text":"indefinitely forever and at some point it will get get overloaded uh so what we want to do is I want to say Well when","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=395s"},{"start_seconds":402,"text":"The Shard itself start to get overloaded it should tell other chart that I'm reaching some limit so the other chart will stop sending um receipt to them and","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=402s"},{"start_seconds":411,"text":"then this kind of pressure eventually but but propagates to the end users and the user would at some point know that while the networks contrasted I cannot","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=411s"},{"start_seconds":420,"text":"send transactions anymore this is much better than user like not knowing what happened send their transaction and it failed in the middle and then they might","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=420s"},{"start_seconds":428,"text":"end up in a very undesirable state so more concretely what happens is that if Shard will have an outgoing buffer uh","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=428s"},{"start_seconds":436,"text":"with limited capacity C and once the capacity of the buffer is reached the chart will stop accepting uh","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=436s"},{"start_seconds":443,"text":"transactions or receipts and then this process continues on until the pressure propagates to the users at some point","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=443s"},{"start_seconds":454,"text":"okay so let's look at example um oh I guess the animation doesn't work here um but I don't think that really matters","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=454s"},{"start_seconds":461,"text":"so let's say we have this uh hash chart which near social contract and then there may be manage charging the system","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=461s"},{"start_seconds":469,"text":"uh but for the sake of this example let's just say there we just look at a few other charts so let's say the user is sending some transaction to Chart 2","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=469s"},{"start_seconds":477,"text":"to call some construct the contract generate a receipt you can sync it with another transaction to to Sharp one that","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=477s"},{"start_seconds":485,"text":"caused some other contract and then the other contract eventually caused the near social contract potentially to update some user information there","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=485s"},{"start_seconds":493,"text":"and what happens when the short zero gets very congested is that the short one will know that Charlotte leaders getting contrasted so it's going to put","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=493s"},{"start_seconds":502,"text":"the receipt uh in the outgoing buffer and when the buffer becomes full the chart two will know that short once buffer is full so it is going to stop","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=502s"},{"start_seconds":511,"text":"sending receipt there and the accumulation Zone buffer and eventually the is its own buffer will become full and the user will know that the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=511s"},{"start_seconds":519,"text":"blockchain is congested so I cannot send more transactions yeah so to recover the idea is basically","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=519s"},{"start_seconds":526,"text":"to only process incoming transactions or receipt when there is space left in the outgoing buffer","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=526s"},{"start_seconds":533,"text":"okay that sounds very nice but we actually have another problem uh which is deadlocking so let's consider the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=533s"},{"start_seconds":540,"text":"following case uh let's say there is a system with only two charts uh chart 0 and chart one and they're both full","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=540s"},{"start_seconds":548,"text":"and in order to make progress let's say there's only one contract on each chart and what the contract does is essentially to call the other contract","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=548s"},{"start_seconds":557,"text":"right so the contract on charge zero would basically cause chart one and counter gunshot one called short zero","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=557s"},{"start_seconds":563,"text":"and to make progress uh they each will need to prop uh process some receipts but every single receipt the process","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=563s"},{"start_seconds":572,"text":"will generate a new receipt to the other chart but now there's a problem because when they're both full you cannot actually make progress because each of","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=572s"},{"start_seconds":580,"text":"them is waiting for the other chart to free up some capacity so that you can process a receipt and generally new","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=580s"},{"start_seconds":588,"text":"receipt that goes to the chart there are a few ideas on how to address","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=588s"},{"start_seconds":596,"text":"this problem and I'll talk about uh one of the ideas here so this idea is called cross short capacity lending so if we","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=596s"},{"start_seconds":605,"text":"think about what actually happens in the previous case essentially it's because um your credit is possible to create the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=605s"},{"start_seconds":612,"text":"cycle where your your contract on short zero there's another contract on chart one they call each other they essentially form this Loop and then and","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=612s"},{"start_seconds":621,"text":"releasing nearest model is possible for one receipt to generate multiple receipt as a result of execution so if you if we","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=621s"},{"start_seconds":630,"text":"look at if we quantify congestion from the point of view of number of receipts and that's just not a very good metric because you can create this this like","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=630s"},{"start_seconds":639,"text":"essentially infinite Loop there uh and and the idea behind this uh solution is to say we want to break the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=639s"},{"start_seconds":647,"text":"cycle by introducing something that's monotonically decreasing throughout the execution so that even if you have this","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=647s"},{"start_seconds":654,"text":"like cycle of contract calling each other what will happen is that this quantity would essentially start to","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=654s"},{"start_seconds":661,"text":"decrease over time and like every time you run through the cycle this quantity would decrease and eventually to reach","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=661s"},{"start_seconds":669,"text":"zero and cannot actually form uh this like infinite cycle that caused you to have the stat locking problem","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=669s"},{"start_seconds":676,"text":"unfortunately cash is such a uh a function that is monotonically decreasing throughout the execution","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=676s"},{"start_seconds":685,"text":"what that means is that let's say you attach some amount of gas to your transaction and after it starts","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=685s"},{"start_seconds":691,"text":"executing uh no matter how many steps it take on at every single step of the execution it would consume a non-zero","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=691s"},{"start_seconds":699,"text":"amount of gas so even if let's say you have two receipts generated as a result of processing one receipt the sum of","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=699s"},{"start_seconds":708,"text":"that cash attached to both of those receipts will be less than the gas attached to the original one","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=708s"},{"start_seconds":716,"text":"so and then there's what that what this idea does is that it decrease the buffer of the origin Shard and then increase","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=716s"},{"start_seconds":724,"text":"the buffer of the destination chart according to the amount of gas attached to the receipt that is generated through","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=724s"},{"start_seconds":731,"text":"the execution and of course the capacity would be returned back to the origin Shard after the receipt is process","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=731s"},{"start_seconds":740,"text":"so that might sound very abstract so let's look at the example let's say there's two short short zero and short","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=740s"},{"start_seconds":748,"text":"one uh and then there's uh there's outgoing receipt from short zero to Shard one as a result of processing some","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=748s"},{"start_seconds":756,"text":"uh some other receipts uh with James Sharp zero and and the carries x amount of cash so when this happens what will","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=756s"},{"start_seconds":763,"text":"happen is that the buffer of charge zero would decrease by X and then the capacity of the buffer","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=763s"},{"start_seconds":770,"text":"um in short one would increase by X and here the buffer capacity is measured in gas","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=770s"},{"start_seconds":778,"text":"um so we have to recap basically the core ideas after processing a receipt the sum of the attached cache of child","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=778s"},{"start_seconds":785,"text":"receipt is strictly less than the attach gas of the pattern receipt and then by construction the system is guaranteed to make progress","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=785s"},{"start_seconds":796,"text":"okay that all sounds very nice but there is a another important problem that we haven't touched on which is uh priority","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=796s"},{"start_seconds":803,"text":"of transactions so some users would prefer to catch a to pay a higher price to get their transactions in even if","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=803s"},{"start_seconds":812,"text":"there is heavy congestion the reason is that what they can gain from doing that transaction um the or the value they can extract","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=812s"},{"start_seconds":819,"text":"from the transaction week where exceeds the amount of money they need to pay for transaction fee so they essentially don't mind","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=819s"},{"start_seconds":827,"text":"uh and then examples including people running Arbitrage Bots liquidation and or like transferring like large amount","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=827s"},{"start_seconds":835,"text":"of value and Etc but it's also a very difficult problem","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=835s"},{"start_seconds":843,"text":"to solve right so um we thought about building a mechanism to interact higher priority transactions or receipt","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=843s"},{"start_seconds":852,"text":"um into the into the protocol but that would actually make it extremely complex and hard to reason about uh there are","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=852s"},{"start_seconds":860,"text":"several reasons for that one is that by doing that we essentially lose any kind of theoretical guarantees on the latency","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=860s"},{"start_seconds":868,"text":"of the transactions this is because for any given transaction it is possible that someone would inject transaction with higher priority by","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=868s"},{"start_seconds":876,"text":"paying more and and as a result you cannot really say like well how long this transaction will take at most to be","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=876s"},{"start_seconds":884,"text":"processed and then answer questions like those and also along the same line you you actually need to figure out how to store","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=884s"},{"start_seconds":892,"text":"the the lower priority transactions or receipt um because the the higher because in the middle of the execution uh some","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=892s"},{"start_seconds":900,"text":"transactional receipt can be injected um so because you have limited capacity you cannot process all of them so some of them would be left there you need to","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=900s"},{"start_seconds":907,"text":"figure out what to do with them and likely the solution is to put them in the state so that everyone actually agrees on what are the receipts that are not executed","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=907s"},{"start_seconds":916,"text":"uh but storage State uh stuff in in the state is not free and especially because you don't actually know how long uh it","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=916s"},{"start_seconds":924,"text":"would be it would take for um for the network to actually process those lower priority transactions um essentially you need to figure out a","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=924s"},{"start_seconds":932,"text":"way to charge users and how that actually works is also very complex and there's another question which is that what if people want to change their","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=932s"},{"start_seconds":939,"text":"priority uh Midway through the execution because the observed congestion that happened after their transaction started","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=939s"},{"start_seconds":946,"text":"and now you you're drawing to this funny problem where like in order to bump the priority of some other receipt you actually need to send a transaction and","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=946s"},{"start_seconds":955,"text":"that in turn I would generate some receipt to pump the receipt and you need to figure out the relative priority of those two types of receipts and how they","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=955s"},{"start_seconds":964,"text":"interact with each other and now that's not a problem that we want to be solving uh because it just involves too many","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=964s"},{"start_seconds":972,"text":"moving pieces and it makes things very complex so the idea we have in status to say uh","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=972s"},{"start_seconds":980,"text":"well we want to move some of that complexity off chain and actually Auction Block space instead uh so the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=980s"},{"start_seconds":987,"text":"idea is that uh we want the protocol to define a way to to auction part of the the block space","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=987s"},{"start_seconds":994,"text":"um as a fast link or a priority link so that people can use that to submit","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=994s"},{"start_seconds":1001,"text":"transactions and then get get their transactions in relatively quickly uh by by paying more and then uh biot users or sort of","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1001s"},{"start_seconds":1010,"text":"third-party service providers can essentially run the auction for the block space and then provide a service","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1010s"},{"start_seconds":1017,"text":"to users who want to utilize those uh prioritized block space","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1017s"},{"start_seconds":1025,"text":"so uh one of the thinking behind this idea is that uh off-chain transaction prioritization is in a way inevitable","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1025s"},{"start_seconds":1033,"text":"because with the Mev stuff um as we all know that it's already happening and there's essentially no way","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1033s"},{"start_seconds":1041,"text":"to actually stop it so the idea is to say well we just increase that and also this would allow us to simplify the","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1041s"},{"start_seconds":1048,"text":"protocol design compared to the solution where we actually need to implement some auction on the transaction level and actually moves the more complex part of","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1048s"},{"start_seconds":1056,"text":"chain okay to recap um the congestion problem is much more","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1056s"},{"start_seconds":1064,"text":"complex in Uncharted blockchain than a non-shorted blockchain and also the transaction priority Problem uh it's","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1064s"},{"start_seconds":1071,"text":"also difficult and we think it's better to handle some of that of chain and for the future work um so I talked","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1071s"},{"start_seconds":1078,"text":"about some of the ongoing work that we're doing not all of them are fully implemented and in the future we'll focus more on understanding the economic","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1078s"},{"start_seconds":1087,"text":"implications of contraction and how to prioritize transaction better yeah that's it for my talk thanks everyone","url":"https://www.youtube.com/watch?v=f-b0LWxhO18&t=1087s"}],"youtube_url":"https://youtube.com/watch?v=f-b0LWxhO18","url":"https://near-pedia.xyz/videos/f-b0LWxhO18"}