Skip to content

Optimize away unused optional globals (__tact_child_contract_codes, __tact_randomized) #3326

Description

@Gusarich

Currently, optional global variables __tact_child_contract_codes and __tact_randomized are always included in the generated FunC output, even when they're never used by the contract. These globals can be safely omitted when unused, leading to a minor gas-saving improvement per execution.

Task:

  • Detect whether __tact_child_contract_codes and __tact_randomized globals are actually used.
  • Omit these globals entirely from FunC output when not referenced.

Impact:
This optimization results in a slight improvement in gas usage (saving a few gas points per execution) and reduces contract byte size minimally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

scope: codegenCode generation, a.k.a. compiler backend (src/generator)

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions