Skip to content

Optimize context field access in internal receivers (msg_sender_addr, msg_value, etc.) #3328

Description

@Gusarich

Currently, context fields like msg_sender_addr, msg_value, msg_bounceable, and cs are compiled into accesses to global variables, involving unnecessary unpacking operations and increased gas usage—even in internal receivers, where these values are already present locally.

Optimization Task:

  • For internal receivers, eliminate global variable fetching for context fields (msg_sender_addr, msg_value, msg_bounceable, cs).
  • Directly reuse existing local receiver context variables, removing redundant unpacking steps.

Impact:
This optimization reduces gas usage per internal message significantly by removing unnecessary global access and unpacking operations, thus improving the performance and efficiency of internal receivers.

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