-
Notifications
You must be signed in to change notification settings - Fork 711
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
Introduce intrinsic fees for transaction validation beyond script & byte costs #529
Conversation
add gtf args for policies pad gtf args to avoid conflicts
Co-authored-by: Green Baneling <[email protected]>
segregate predicateGasUsed from tx.gasLimit
# Conflicts: # src/tx-format/constants.md
Co-authored-by: Green Baneling <[email protected]>
… type. other misc feedback.
Co-authored-by: Hannes Karppila <[email protected]>
src/protocol/tx-validity.md
Outdated
|
||
```py | ||
min_gas = min_gas(tx) | ||
max_gas = min_gas + tx.gasLimit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The maxWitness - witnessSize(tx)
also affects the maximum gas=)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by how max gas is now calculated.
I see in the trait definition of max_gas()
is:
fn max_gas(&self, gas_costs: &GasCosts, fee: &FeeParameters) -> Word {
let remaining_allowed_witness_gas = self
.witness_limit()
.saturating_sub(self.witnesses().size_dynamic() as u64)
.saturating_mul(fee.gas_per_byte);
self.min_gas(gas_costs, fee)
.saturating_add(remaining_allowed_witness_gas)
}
This means:
In this case, there's no mention of gas limit.
In some checked_transaction
tests (e.g. fee_multiple_signed_inputs
):
...
let max_fee = fee.max_fee();
let expected_max_fee = expected_min_fee + gas_limit * gas_price;
assert_eq!(max_fee, expected_max_fee);
This means:
In this case, there's no mention of witnesses.
Is there a connection between gas limit and witnesses now? I.e.,
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/protocol/tx-validity.md
Outdated
return fees | ||
|
||
|
||
def gas_balance(tx) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gas_balance
sound strange=) Maybe max_gas
would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function (if I understand correctly) is meant to calculate how much the user owes (AKA the balance) after transaction execution. I can update the comment to reflect this (because currently it is misleading).
In contrast, max_gas
is the maximum gas that the user is willing to spend.
Edit: It looks like this is meant to be the max_gas
, and we are later converting max_gas
to a balance (reserved_fee_balance
). It sounds like we reserve the max gas. We don't actually specify the formula for the actual cost here (which is fine).
…/fuel-specs into Voxelot/intrinsic-costs
Co-authored-by: Green Baneling <[email protected]>
…/fuel-specs into Voxelot/intrinsic-costs
closes: #461
Increases the granularity of how the base fee for a transaction is computed. These base fee components are referred to as intrinsic costs, which are intended to cover the overhead of operations such as: