Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Fix: replace USE_ALL_GAS_FLAG constant with OUTGOING_TRANSFER_GAS_LIMIT#137

Closed
almndbtr wants to merge 2 commits intoourzora:reserve-auctionfrom
almndbtr:reserve-auction__gas-limit-constant
Closed

Fix: replace USE_ALL_GAS_FLAG constant with OUTGOING_TRANSFER_GAS_LIMIT#137
almndbtr wants to merge 2 commits intoourzora:reserve-auctionfrom
almndbtr:reserve-auction__gas-limit-constant

Conversation

@almndbtr
Copy link
Contributor

@almndbtr almndbtr commented Feb 12, 2022

Description

Towards #122

This replaces the USE_ALL_GAS_FLAG constant with a new constant, OUTGOING_TRANSFER_GAS_LIMIT.

Motivation and Context

This addresses two points:

  • @tbtstl's callout of an unused var ([feat] Reserve Auction v1.0 #122 (comment))
  • 5511daf introduced a new hardcoded gas limit on handling all outgoing transfers. This is moved into its own constant for changeability/readability/reusability for other modules.

How has this been tested?

No tests since these are private constants.

Checklist:

  • The module includes tests written for Foundry
  • The module is documented with NATSPEC
  • The documentation includes UML Diagrams for external and public functions
  • The module is a Hyperstructure

ourzora@5511daf introduced temp gas limit for payouts.

This defines a new constant for the outgoing transfer's gas limit given its repeated use.
@almndbtr almndbtr mentioned this pull request Feb 12, 2022
4 tasks
contract ReserveAuctionV1 is ReentrancyGuard, UniversalExchangeEventV1, IncomingTransferSupportV1, FeePayoutSupportV1, ModuleNamingSupportV1 {
/// @dev The indicator to pass all remaining gas when paying out royalties
uint256 private constant USE_ALL_GAS_FLAG = 0;
uint256 private constant OUTGOING_TRANSFER_GAS_LIMIT = 30000;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kulkarohan - When this was originally written in 5511daf, was 30000 chosen for a particular reason over another number? I also wonder about the gas limit for handling a royalty payout being set at 200000.

Here to learn! 💭

Copy link
Contributor

Choose a reason for hiding this comment

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

hey @almndbtr, the numbers are rough estimates based on the gas usages tested for _handleOutgoingTransfer and _handleRoyaltyPayout. we're bumping both up to be safe, as its difficult to predict every edge-case ahead of time. a PR will be incoming soon taking care of this and removing the variable, so feel free to close this. but thanks for bringing it up!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! Will close now ✌🏽

@almndbtr almndbtr closed this Feb 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants