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

Update Specs to Include Gas Price changes #546

Merged
merged 12 commits into from
Mar 13, 2024

Conversation

MitchTurner
Copy link
Member

@MitchTurner MitchTurner commented Feb 15, 2024

#546

This includes the changes for:

  • Removegas_price from tx
  • Include gas_price on Mint tx
  • Remove GasPrice policy
  • Add Tip policy
  • Make MaxFee mandatory

Since there is no concept of the client API in these specs, and also the implementation of tx checks, I didn't include:

  • Anything wrt to gas_price estimate or latest gas_price API endpoints
  • Anything wrt the metadata changes for Checked<Tx>

That's fine if we don't want the scope of the VM to include those sort of things, but it's not clear to me what these specs are constrained by.

@MitchTurner MitchTurner changed the title Make changes to policies Update Specs to Include Gas Price changes Feb 15, 2024
@MitchTurner MitchTurner self-assigned this Feb 19, 2024
src/tx-format/policy.md Outdated Show resolved Hide resolved
@@ -212,14 +212,14 @@ def max_gas(tx) -> int:
if tx.type == TransactionType.Script:
gas = gas + tx.gasLimit
return gas


def reserved_feeBalance(tx, assetId) -> int:
Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't find any function with this name in our code, and it sounds like max_fee, so I changed it. Might be wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, in the code analog is max_fee function=) Could you also update other places here(reserved_fee_balance), please?

@MitchTurner MitchTurner marked this pull request as ready for review March 4, 2024 21:19
@MitchTurner MitchTurner requested review from a team and Voxelot March 4, 2024 21:19
Dentosal
Dentosal previously approved these changes Mar 11, 2024
@@ -212,14 +212,14 @@ def max_gas(tx) -> int:
if tx.type == TransactionType.Script:
gas = gas + tx.gasLimit
return gas


def reserved_feeBalance(tx, assetId) -> int:
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, in the code analog is max_fee function=) Could you also update other places here(reserved_fee_balance), please?


Transaction is invalid if:

- `max_fee` is not set
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is better to move this check to where the gas price was.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I understand. Move this section to where the ## GasPrice section was? Which "gas price" are you referring to?

Copy link
Contributor

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

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

You also need to update unavailable_balance function to use max_fee policy instead of the maxFee(reserved_fee_balance) function

@MitchTurner MitchTurner enabled auto-merge (squash) March 13, 2024 18:27
@MitchTurner MitchTurner merged commit 3e23614 into master Mar 13, 2024
6 checks passed
@MitchTurner MitchTurner deleted the update-specs-with-gas-price-changes branch March 13, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants