-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define desirable runtime performance for Aurora contracts #4787
Comments
@joshuajbouw @ailisp said the following:
It means that we need to make Aurora contracts 10x cheaper. Can you confirm? CC @artob Will 3M EVM gas be sufficient for now or will it still be blocking Aurora? |
@nearmax It is not quite as simple as this because there is not a clean, linear mapping between EVM gas and NEAR gas. There are some 4M EVM gas transactions which we can execute today (they cost under 150 Tgas on NEAR). These are deploy transactions, so it points to storage costs being much lower on NEAR relative to Ethereum. However, there are also some 600k EVM gas transactions which we cannot execute today (they cost more than 200 Tgas on NEAR), for example some from uniswap contract. And even more extreme example is the In short, I do not think there is a meaningful measure of how much EVM gas is sufficient for Aurora because it does not translate into a NEAR gas limit. A blanket 10x improvement on the NEAR side will certainly be welcomed, but we may need to still target specific use cases with additional performance improvements, depending on the needs of partners. We are in the process of gathering specific examples from partners which do not work today so we can look into what specific performance improvements may help. |
The breakdown of uniswap is linked in the above comment; it is 86% wasm execution. The breakdown of a transaction calling
You can see it is 99.6% wasm execution. |
It looks like we have certainly hit the deploy target, especially considering the patch to the benchmark is incredibly promising that we have no issues there. Simply we have a problem with the gas cost with the runtime of a contract itself. That is a bit trickier as it there is no 1 to 1 translation from NEAR to ETH which is expected. For example, we could have one transaction that could be considerably lower in the equivalent in NEAR Tgas than ETH gas, and vice versa. The performance improvements that had been achieved so far are still substantial of course. @birchmd covered basically all those points already though above. We do know right now that we have more than enough gas for a deployment. As per runtime, that is considerably trickier. While we should have enough gas to unblock partners for execution. @birchmd has access to the partner's contract and is able to get more granular details about their particular methods gas costs. |
Generally as discussed, it looks like we are well beyond our deployment target which is awesome. However when it comes to execution, as described above, this gets tricky.
|
The only partner code I was given access to didn't actually have a gas limit problem; they were encountering a different error and not interpreting it correctly. The only measurable examples of we have exceeding the NEAR gas limit with Aurora transactions are the uniswap and |
@joshuajbouw what do you mean by "8x"? |
8x our current benchmark, which is what is possible right now. |
After talking with @bowenwang1996 concretely it was asked for 5 contracts to be benchmarked. This is going to be worked on as soon as we put out some fires on our end. @birchmd is going to put these together. |
Please see our new documentation on benchmarks: https://github.com/aurora-is-near/aurora-engine/blob/develop/doc/benchmarks.md I believe this document is sufficient to close this issue. Please reach out if more clarity is needed. |
Will take a closer look this week, but one concern I have is that the current setup of using |
Thanks @matklad . One solution to this problem could be to spin up a local near node for benchmarking instead of using it as a library. In this case you only need to recompile neard with new changes. However, this approach complicates the setup of the benchmarks on our end, so maybe isn't ideal. Another solution is for Aurora to strive to stay up to date with the nearcore libraries (resolving any API incompatibility along the way) so that only a change to the Cargo.toml is needed if someone from nearcore is experimenting with a new change. I personally prefer this option because it means our benchmark flow stays self-contained (it does not require a local node to be running in the background), and I think keeping Aurora up date with nearcore should not be too big of a burden on us. Let me know if you have other preferences or suggestions. |
@birchmd I read and follow https://github.com/aurora-is-near/aurora-engine/blob/develop/doc/benchmarks.md. All tests mentioned are pass or fail as documented and tests make sense and document is really well written! As for not use nearcore as a library, I think the gas benchmark can be obtained via treat nearcore as a rpc endpoint, but for the time benchmark - it's not possible. So Michael's solution sounds reasonable 🤔 |
We want EVM contract to be cheaper. However, without knowing how much cheaper we want it to be, it is hard to make decisions on which technical direction to pursue in medium and long term.
It would help if Aurora team gave us several examples of their use cases with current gas usage, minimum acceptable gas usage for these contracts, and degree of importance.
The text was updated successfully, but these errors were encountered: