-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: Charge for Create
metadata
#618
Conversation
…ttps://github.com/FuelLabs/fuel-vm into bvrooman/feat/charge-for-input-signature-recovery
…ttps://github.com/FuelLabs/fuel-vm into bvrooman/feat/charge-for-input-signature-recovery
Update contract is_empty
1780190
to
8c1ab35
Compare
Create
metadata
let state_root_length = storage_slots.len() as Word; | ||
let state_root_gas = gas_costs.state_root.resolve(state_root_length); | ||
|
||
let contract_id_gas = gas_costs.contract_id; |
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.
contract_id
calculation is simply the calling of the hash functions. You can use dependent cost for hash function instead
|
||
let contract: Option<Contract> = witnesses | ||
.get(*bytecode_witness_index as usize) | ||
.map(|c| c.as_ref().into()); |
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.
Should we just get the len here? Based on the type annotation above is seems like we're creating an owned copy of the contract which is going to add a lot more overhead to the gas calculation.
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.
Yep, I can update that in follow up PR.
Related Issues:
Create
transaction forContractId
calculate and validation #600This PR extends the gas costs to include costs for contract state root and contract id.
The gas costs are not final and will need to be calculated by running benchmarks on a dedicated instance.