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

feat(gas): do not store self-code in dictionary of child contract codes #1213

Merged
merged 6 commits into from
Dec 24, 2024

Conversation

anton-trunov
Copy link
Member

This should reduce forward fees for Jettons, for instance.

Another possible optimization would be to remove the child contract dictionary for the common case when there are just one or very few child contracts and use cell references to store the child contract codes. But let's do it as a separate PR so we can check its impact too.

Issue

Closes #1012.

Checklist

  • I have updated CHANGELOG.md
  • I have added tests to demonstrate the contribution is correctly implemented: it reduces gas consumption for the common cases, makes storage improvements, etc. and does not have too much negative impact for the rest of the use-cases
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

This should reduce forward fees for Jettons, for instance
@anton-trunov anton-trunov added this to the v1.6.0 milestone Dec 18, 2024
@anton-trunov anton-trunov requested a review from a team as a code owner December 18, 2024 22:43
@anton-trunov anton-trunov self-assigned this Dec 18, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
Gusarich
Gusarich previously approved these changes Dec 19, 2024
Copy link
Member

@Gusarich Gusarich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but for some reason it increases fees for some transactions in initof tests 🤔 we definetely need to benchmark this with https://github.com/tact-lang/jetton

@anton-trunov
Copy link
Member Author

for some reason it increases fees for some transactions in initof tests

do you still have the exact numbers?

because it definitely decreased gas in the benchmarks: image

@anton-trunov
Copy link
Member Author

Nice results! Let's merge

image

@anton-trunov anton-trunov merged commit 616d1bd into main Dec 24, 2024
17 checks passed
@anton-trunov anton-trunov deleted the do-not-store-self-code-in-contracts-dict branch December 24, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not store self smart-contract code: use MYCODE asm instruction instead
3 participants