Skip to content
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

Eth BLOCK_GAS_LIMIT Optimizations #853

Merged
merged 9 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/test/Dex/Dex.TxCosts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe("Dex Gas Estimation", function () {

after(async () => {
saveTxGas(allCosts, "Dex/TxCosts.md", "Dex Precompiles");
saveTxFees(allTxFeeCosts, "Dex/TxCosts.md", "ERC20 Precompiles");
saveTxFees(allTxFeeCosts, "Dex/TxCosts.md", "Dex Precompiles");
await node.stop();
});

Expand Down
26 changes: 13 additions & 13 deletions e2e/test/Dex/TxCosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
|:-------------------------|:------------:|:--------------:|:-------------------------:|
| addLiquidity | 217853 | 122103 | 52139 |
| removeLiquidity | 183441 | 86009 | 34620 |
| swapExactTokensForTokens | 150598 | 70507 | 26392 |
| swapTokensForExactTokens | 150743 | 71568 | 27375 |
| quote | 23716 | 22377 | 0 |
| getAmountOut | 26047 | 22447 | 0 |
| getAmountsOut | 43843 | 42619 | 0 |
| getAmountsIn | 44058 | 42611 | 0 |
| addLiquidity | 198248 | 89797 | 52137 |
| removeLiquidity | 171138 | 69284 | 34619 |
| swapExactTokensForTokens | 134389 | 52657 | 26391 |
| swapTokensForExactTokens | 134532 | 53269 | 27374 |
| quote | 44688 | 22377 | 0 |
| getAmountOut | 44688 | 22423 | 0 |
| getAmountsOut | 120661 | 34893 | 0 |
| getAmountsIn | 120661 | 34886 | 0 |


## Generated tx costs(fees) for ERC20 Precompiles
## Generated tx costs(fees) for Dex Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
|:-------------------------|:---------------------:|:-----------------------:|:----------------------:|
| addLiquidity | 1484456 | 904088 | 391044 |
| removeLiquidity | 1182769 | 630493 | 259652 |
| swapExactTokensForTokens | 1092758 | 492668 | 197943 |
| swapTokensForExactTokens | 1093921 | 502105 | 205316 |
| addLiquidity | 1341853 | 664167 | 391030 |
| removeLiquidity | 1074942 | 481791 | 259644 |
| swapExactTokensForTokens | 971294 | 390258 | 197937 |
| swapTokensForExactTokens | 972456 | 396791 | 205309 |
34 changes: 17 additions & 17 deletions e2e/test/ERC1155/TxCosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
|:----------------------|:------------:|:--------------:|:-------------------------:|
| uri | 27560 | 22400 | 0 |
| balanceOf | 25957 | 22433 | 0 |
| balanceOfBatch | 32585 | 24106 | 0 |
| setApprovalForAll | 47025 | 27501 | 0 |
| isApprovedForAll | 26076 | 23184 | 0 |
| safeTransferFrom | 59163 | 32160 | 10552 |
| safeBatchTransferFrom | 50205 | 35812 | 13298 |
| mint | 33152 | 32245 | 11374 |
| mintBatch | 42210 | 32633 | 12307 |
| burn | 32581 | 27608 | 9631 |
| burnBatch | 38043 | 31828 | 10564 |
| uri | 27560 | 22377 | 0 |
| balanceOf | 25957 | 22409 | 0 |
| balanceOfBatch | 32585 | 23723 | 0 |
| setApprovalForAll | 47025 | 26244 | 0 |
| isApprovedForAll | 26076 | 22433 | 0 |
| safeTransferFrom | 74307 | 28902 | 10552 |
| safeBatchTransferFrom | 75516 | 32865 | 13298 |
| mint | 74473 | 28847 | 11374 |
| mintBatch | 75540 | 31515 | 12307 |
| burn | 32581 | 26154 | 9630 |
| burnBatch | 38043 | 28483 | 10564 |


## Generated tx costs(fees) for ERC1155 Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
|:----------------------|:---------------------:|:-----------------------:|:----------------------:|
| safeTransferFrom | 440278 | 231113 | 79145 |
| safeBatchTransferFrom | 364092 | 268013 | 99741 |
| mint | 247001 | 232478 | 85307 |
| mintBatch | 294958 | 238690 | 92307 |
| burn | 237850 | 203613 | 72233 |
| burnBatch | 284644 | 225810 | 79233 |
| safeTransferFrom | 440278 | 215698 | 79144 |
| safeBatchTransferFrom | 364092 | 242395 | 99740 |
| mint | 247001 | 214572 | 85306 |
| mintBatch | 294958 | 220784 | 92306 |
| burn | 237850 | 189997 | 72232 |
| burnBatch | 284644 | 212194 | 79232 |
22 changes: 11 additions & 11 deletions e2e/test/ERC20/TxCosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
|:--------------|:------------:|:--------------:|:-------------------------:|
| totalSupply | 23717 | 22388 | 0 |
| balanceOf | 25860 | 23974 | 0 |
| totalSupply | 23717 | 22365 | 0 |
| balanceOf | 25860 | 23694 | 0 |
| allowance | 26064 | 23273 | 0 |
| approval | 47152 | 26470 | 11782 |
| transfer | 52698 | 43641 | 15507 |
| transferFrom | 44716 | 51726 | 18731 |
| name | 25926 | 22388 | 0 |
| decimals | 22354 | 22388 | 0 |
| symbol | 25945 | 22388 | 0 |
| approval | 47152 | 26142 | 11782 |
| transfer | 52698 | 35599 | 15506 |
| transferFrom | 44716 | 43768 | 18731 |
| name | 25926 | 22365 | 0 |
| decimals | 22354 | 22365 | 0 |
| symbol | 25945 | 22365 | 0 |


## Generated tx costs(fees) for ERC20 Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
|:--------------|:---------------------:|:-----------------------:|:----------------------:|
| approval | 351452 | 198422 | 88369 |
| transfer | 390700 | 311427 | 116305 |
| transferFrom | 323614 | 380276 | 140487 |
| approval | 351452 | 189675 | 88368 |
| transfer | 390700 | 265015 | 116302 |
| transferFrom | 323614 | 312725 | 140484 |
46 changes: 23 additions & 23 deletions e2e/test/ERC721/TxCosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
|:------------------|:------------:|:--------------:|:-------------------------:|
| balanceOf | 25895 | 23274 | 0 |
| ownerOf | 25847 | 23242 | 0 |
| getApproved | 27395 | 23242 | 0 |
| isApprovedForAll | 26082 | 23973 | 0 |
| mint | 53193 | 31731 | 9216 |
| burn | 37870 | 35731 | 10523 |
| approve | 50740 | 28884 | 10852 |
| setApprovalForAll | 47011 | 26467 | 9700 |
| safetransferFrom | 67181 | 36625 | 0 |
| transferFrom | 66839 | 35560 | 11585 |
| name | 25932 | 22388 | 0 |
| symbol | 25938 | 22388 | 0 |
| tokenURI | 25964 | 23242 | 0 |
| owner | 23728 | 22388 | 0 |
| transferOwnership | 29147 | 28498 | 9501 |
| renounceOwnership | 30272 | 28372 | 9455 |
| balanceOf | 25895 | 23239 | 0 |
| ownerOf | 25847 | 23207 | 0 |
| getApproved | 27395 | 23207 | 0 |
| isApprovedForAll | 26082 | 23734 | 0 |
| mint | 81095 | 27752 | 9216 |
| burn | 37870 | 32480 | 10523 |
| approve | 50740 | 27489 | 10852 |
| setApprovalForAll | 47011 | 26139 | 9700 |
| safetransferFrom | 77443 | 32663 | 0 |
| transferFrom | 66839 | 32429 | 11585 |
| name | 25932 | 22365 | 0 |
| symbol | 25938 | 22365 | 0 |
| tokenURI | 25964 | 23207 | 0 |
| owner | 23728 | 22365 | 0 |
| transferOwnership | 29147 | 27434 | 9501 |
| renounceOwnership | 30272 | 26415 | 9454 |


## Generated tx costs(fees) for ERC721 Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
|:------------------|:---------------------:|:-----------------------:|:----------------------:|
| mint | 395981 | 224249 | 69126 |
| burn | 245366 | 266850 | 78929 |
| approve | 369808 | 215338 | 81394 |
| setApprovalForAll | 349839 | 198339 | 72754 |
| transferFrom | 442288 | 264345 | 86893 |
| transferOwnership | 218098 | 212502 | 71263 |
| renounceOwnership | 176172 | 209831 | 70913 |
| mint | 395981 | 206891 | 69125 |
| burn | 245366 | 236244 | 78928 |
| approve | 369808 | 200890 | 81393 |
| setApprovalForAll | 349839 | 189592 | 72754 |
| transferFrom | 442288 | 235419 | 86892 |
| transferOwnership | 218098 | 199622 | 71262 |
| renounceOwnership | 176172 | 196951 | 70912 |
20 changes: 10 additions & 10 deletions e2e/test/Futurepass/TxCosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
|:------------------------------|:------------:|:--------------:|:-------------------------:|
| create | 0 | 45155 | 16355 |
| registerDelegateWithSignature | 0 | 46056 | 20190 |
| unregisterDelegate | 0 | 43622 | 16203 |
| transferOwnership | 0 | 52086 | 20410 |
| proxyCall | 0 | 65694 | 21155 |
| create | 0 | 37062 | 16354 |
| registerDelegateWithSignature | 0 | 38495 | 20190 |
| unregisterDelegate | 0 | 35566 | 16202 |
| transferOwnership | 0 | 43883 | 20410 |
| proxyCall | 0 | 65262 | 21155 |


## Generated tx costs(fees) for Futurepass Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
|:------------------------------|:---------------------:|:-----------------------:|:----------------------:|
| create | 0 | 328633 | 122663 |
| registerDelegateWithSignature | 0 | 338932 | 151432 |
| unregisterDelegate | 0 | 311102 | 121523 |
| transferOwnership | 0 | 384166 | 153079 |
| proxyCall | 0 | 449872 | 158668 |
| create | 0 | 276040 | 122660 |
| registerDelegateWithSignature | 0 | 288305 | 151429 |
| unregisterDelegate | 0 | 264442 | 121520 |
| transferOwnership | 0 | 314095 | 153075 |
| proxyCall | 0 | 446031 | 158664 |
40 changes: 20 additions & 20 deletions e2e/test/MarketPlace/TxCosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
|:--------------------|:------------:|:--------------:|:-------------------------:|
| registerMarketplace | 0 | 32307 | 10843 |
| sellNft | 0 | 55445 | 22404 |
| auctionNft | 0 | 55709 | 21416 |
| makeSimpleOffer | 0 | 60972 | 37599 |
| buy | 0 | 50424 | 151674 |
| bid | 0 | 61632 | 1358014 |
| cancelSale | 0 | 38090 | 13321 |
| updateFixedPrice | 0 | 29163 | 9867 |
| acceptOffer | 0 | 74959 | 27394 |
| cancelOffer | 0 | 56308 | 20784 |
| registerMarketplace | 0 | 28523 | 10843 |
| sellNft | 0 | 45619 | 22404 |
| auctionNft | 0 | 45698 | 21415 |
| makeSimpleOffer | 0 | 49994 | 37598 |
| buy | 0 | 42799 | 151674 |
| bid | 0 | 50373 | 1358013 |
| cancelSale | 0 | 33131 | 13321 |
| updateFixedPrice | 0 | 27601 | 9867 |
| acceptOffer | 0 | 55842 | 27393 |
| cancelOffer | 0 | 45669 | 20784 |


## Generated tx costs(fees) for Marketplace Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
|:--------------------|:---------------------:|:-----------------------:|:----------------------:|
| registerMarketplace | 0 | 233484 | 81325 |
| sellNft | 0 | 408156 | 168036 |
| auctionNft | 0 | 410872 | 160620 |
| makeSimpleOffer | 0 | 555461 | 281997 |
| buy | 0 | 1366440 | 1137559 |
| bid | 0 | 10462114 | 10185109 |
| cancelSale | 0 | 285289 | 99912 |
| updateFixedPrice | 0 | 218406 | 74004 |
| acceptOffer | 0 | 532153 | 205460 |
| cancelOffer | 0 | 416953 | 155886 |
| registerMarketplace | 0 | 213050 | 81324 |
| sellNft | 0 | 333944 | 168032 |
| auctionNft | 0 | 334836 | 160616 |
| makeSimpleOffer | 0 | 461842 | 281992 |
| buy | 0 | 1301702 | 1137556 |
| bid | 0 | 10365893 | 10185104 |
| cancelSale | 0 | 246664 | 99910 |
| updateFixedPrice | 0 | 203425 | 74003 |
| acceptOffer | 0 | 412144 | 205453 |
| cancelOffer | 0 | 334406 | 155882 |
Loading