-
Notifications
You must be signed in to change notification settings - Fork 87
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
A new Upload
transaction to upload the huge bytecode on the chain
#720
Conversation
Reduced default `MAX_SIZE` to be 110kb. Reduced default `MAX_CONTRACT_SIZE` to be 100kb.
# Conflicts: # CHANGELOG.md # fuel-tx/src/builder.rs # fuel-tx/src/tests/valid_cases/transaction.rs # fuel-tx/src/transaction/consensus_parameters.rs # fuel-vm/src/checked_transaction.rs # fuel-vm/src/tests/limits.rs # fuel-vm/src/tests/validation.rs
…ed by all chargeable transactions
…ction # Conflicts: # fuel-tx/src/transaction/consensus_parameters.rs
# Conflicts: # fuel-tx/src/transaction/consensus_parameters.rs # fuel-vm/src/tests/validation.rs
…ansaction # Conflicts: # fuel-tx/src/transaction/types/script.rs # fuel-vm/src/interpreter.rs
… into feature/upload-transaction
Co-authored-by: Mitchell Turner <james.mitchell.turner@gmail.com>
Co-authored-by: Mitchell Turner <james.mitchell.turner@gmail.com>
… into feature/upload-transaction
Upload
transaction to upload the huge bytecode on the chain
… into feature/upload-transaction
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.
Tangentially related:
Something I've said before, and I still think would be good is instead of Upload
and Script
and Create
, etc, we should have our transactions named UploadTx
and ScriptTx
and CreateTx
, etc. I know the context is in the namespace, but it is never with it's namespace, so unless you understand the context well, you have to make couple clicks before you understand what they are.
Event then, it's far from obvious that Script
would be a type of transaction, to me Script
suggests that it is the code run by smart contracts, and never what you'd use for a simple transfer (but it is what you'd use). So even ScriptTx
probably isn't clear enough.
@@ -32,6 +32,15 @@ fn to_from_str() { | |||
|
|||
assert_eq!(tx, tx_p); | |||
}); | |||
TransactionFactory::<_, Upload>::from_seed(1295) |
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 was gonna suggest maybe drying this up a little with a shared function:
fn transaction_round_trip_serde<T>()
where
TransactionFactory<StdRng, T>: Iterator,
T: Into<Transaction>
{
TransactionFactory::<_, Upgrade>::from_seed(1295)
.take(20)
.for_each(|(tx, _)| {
// given
let tx: Transaction = tx.into();
// when
let tx_p = tx.to_json();
let tx_p = Transaction::from_json(tx_p).expect("failed to restore tx");
// then
assert_eq!(tx, tx_p);
}
I don't know if this is much better with all the generics.
I think the name to_from_str
could be a little clearer either way though.
…570) Corresponding implementation: FuelLabs/fuel-vm#720 The change adds a new `Upload` transaction that allows uploading huge byte code on chain subsection by subsection. The `Upload` transaction is chargeable and is twice as expensive as the `Create` transaction. Anyone can submit this transaction. The specification contains more description about the flow.
Related FuelLabs/fuel-core#1754 and FuelLabs/fuel-specs#570
The change adds a new
Upload
transaction that allows uploading huge byte code on chain subsection by subsection.The
Upload
transaction is chargeable and is twice as expensive as theCreate
transaction. Anyone can submit this transaction.Before requesting review