Skip to content

Optimize gas refund receipts #15951

Description

@jancionear

Description

Since NEP-642 gas is purchased at a price that is higher then the price at which it's burnt, and because of this every receipt generates a gas refund receipt to reimburse the user for the price difference. Those refund receipts cause extra load on the network and increase transaction latency. It would be nice to reduce the number of refund receipts.

Potential improvements:

  • Instead of sending a refund immediately, delay it until the last receipt in the promise chain. This way we won't be sending a refund after each receipt, only after the last one, which helps reduce their number.
  • Eliminate gas refunds when the amount of gas that will be burnt is known ahead of time. For transactions like a simple transfer between two named accounts we know exactly how much gas will be burned and we can remove the price difference logic and avoid any refunds. This would improve throughput and latency of simple token transfers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-transaction-runtimeArea: transaction runtime (transaction and receipts processing, state transition, etc)C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions