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

Contract profiler #93

Closed
2 of 3 tasks
ProgramCrafter opened this issue Dec 14, 2022 · 6 comments
Closed
2 of 3 tasks

Contract profiler #93

ProgramCrafter opened this issue Dec 14, 2022 · 6 comments
Labels
Closing Soon as Not planning Proposal awaiting a response and automatically closes after 2 weeks of inactivity. Developer Tool Related to tools or utilities used by developers

Comments

@ProgramCrafter
Copy link
Contributor

ProgramCrafter commented Dec 14, 2022

Summary

Contract emulator that can show number of times each instruction is ran and how much gas does it cost.

Context

Such tool would be useful for optimizing gas usage and therefore would cut down on contract fees.

Goals

Create crossplatform profiler for TON contracts.

Deliverables

  • Creating program that is able to locally execute transactions and run tests meanwhile measuring gas usage and execution count for each instruction
  • Making this program crossplatform
    preferably without Docker, as Docker claims not to work in nested virtualization, and sometimes TON-related programs have to be ran in a VM

Definition of Done

  • Profiler can execute a transaction locally when FunC/Fift/TVM code of contract and transaction data is provided
  • Program can measure gas usage while running contract tests (as toncli new-tests mode)
  • Profiler becomes available on all platforms: Windows, Linux, macOS (preferably without Docker)

Reward

  • Standard TON Footstep NFT
  • 3500$ in TON equivalent
@ProgramCrafter ProgramCrafter added the footstep This is a TON Footstep issue label Dec 14, 2022
@Gusarich
Copy link
Contributor

@ProgramCrafter Are you sure it will be really useful to just show how many times each TVM instruction had been called?
Anyway, I think it'll be a lot easier to implement using ton-contract-executor or sandbox without any dockers and without compiling binaries.

@ProgramCrafter
Copy link
Contributor Author

Both of these have VM implemented as WASM blob, so it's not obvious how to patch them:

@ProgramCrafter
Copy link
Contributor Author

Features set can be extended and balanced with the reward, for sure 😀
For example, profiler could dump information in some standartized format.

@delovoyhomie delovoyhomie added Developer Tool Related to tools or utilities used by developers and removed footstep This is a TON Footstep issue labels Oct 7, 2023
@delovoyhomie
Copy link
Collaborator

Indeed, the idea is quite commendable. @ProgramCrafter, the discussion is still pending. If the topic remains relevant, let's push to fine-tune it, or we will be compelled to close the discussion after two weeks.

@ProgramCrafter, what do you think?

@ProgramCrafter
Copy link
Contributor Author

@delovoyhomie It turns out that there is already such a tool for Fift! https://github.com/tact-lang/ton-coverage

изображение
(example from the repository)

It would be nice, then, to add support of higher-level languages!

@delovoyhomie delovoyhomie added Closing Soon as Not planning Proposal awaiting a response and automatically closes after 2 weeks of inactivity. and removed Closing Soon as Not planning Proposal awaiting a response and automatically closes after 2 weeks of inactivity. labels Nov 22, 2023
@delovoyhomie
Copy link
Collaborator

This issue has been automatically closed due to 14 days of inactivity and lack of the additional information requested.
Please feel free to reopen it if you wish to provide further details or require assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closing Soon as Not planning Proposal awaiting a response and automatically closes after 2 weeks of inactivity. Developer Tool Related to tools or utilities used by developers
Projects
None yet
Development

No branches or pull requests

3 participants