-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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!: beta-5
support
#1200
feat!: beta-5
support
#1200
Conversation
… hal3e/transaction-policies
… hal3e/transaction-policies
Co-authored-by: Ahmed Sagdati <37515857+segfault-magnet@users.noreply.github.com>
Adding to @iqdecay's
Think of "transaction policies" as the new domain language here. This is coming from upstream (fuel-core), meaning that if we somehow wrap it around our own `TxParameters" language, we will be causing a lot of confusion in the future when this abstraction inevitably leaks. Sticking with one language is best for communicating. A lot of users will be talking about the configurations for transaction policies. If the SDK forces it to be called transaction parameters, it'll just be confusing! |
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.
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.
looking good! Thanks for your answers, it's clearer to me now. Left one formatting nit.
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.
LFG! 🚀
This PR adds sdk support for
beta-5
.BREAKING CHANGE:
TxParameters
are replaced withTxPolicies
GasPrice
andMaturity
fields are optionalTxPolicies
introduced new fields:WitnessLimit
- allows the limitation of the maximum size of witnesses in bytes.MaxFee
- allows the upper bound for the maximum fee that users agree to pay for the transaction.ScriptGasLimit
only limits the script execution. Previously, theScriptGasLimit
also limited the predicate execution time, but it is not valid anymore. So, it is not possible to use theScriptGasLimit
for transaction cost limitations. A newMaxFee
policy is a way to do that. TheGasLimit
field was removed from theCreate
transaction because it only relates to the script execution(which theCreate
transaction doesn't have).WhitnessLimit
also impacts themax_gas
andmax_fee
calculation along with theScriptGasLimit
(in the case ofCreate
transaction onlyWitnessLimit
affects themax_gas
andmax_fee
).GasPrice
policy.GasLimit
should be less than theMAX_GAS_PER_TX
constant. After removing this field from theCreate
transaction, it is impossible to require it. Instead, it requires thatmax_gas <= MAX_GAS_PER_TX
for any transaction. Consequently, anyScript
transaction that usesMAX_GAS_PER_TX
as aGasLimit
will always fail because of a new rule. Setting the estimated gas usage instead solves the problem.max_fee > policies.max_fee
, then transaction will be rejected.witnessses_size > policies.witness_limit
, then transaction will be rejected.get_message_proof
not usesNonce
instead of the message_idChainId
for address calculationmanual_blocks_enabled
is replaced withdebug
in local chain configfee_checked_from_tx
usesFeeParameters
fuel_tx::ConsensusParameters
were refactored - this also affects usBuildableTransacion
trait needs to be in scopeutxo_validation
andmanual_blocks
are enabled by default for test providerslocal_node
anymore usedefault
-let node_config = Config::default();
Thanks @MujkicA for updating the documentation.
Checklist