dusk_vm/execute/config.rs
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4//
5// Copyright (c) DUSK NETWORK. All rights reserved.
6
7/// Configuration for the execution of a transaction.
8#[derive(Debug, Clone)]
9pub struct Config {
10 /// The amount of gas points charged for each byte in a contract-deployment
11 /// bytecode.
12 pub gas_per_deploy_byte: u64,
13 /// The amount of gas points charged for each blob in a transaction.
14 pub gas_per_blob: u64,
15 /// The minimum gas points charged for a contract deployment.
16 pub min_deploy_points: u64,
17 /// The minimum gas price set for a contract deployment
18 pub min_deploy_gas_price: u64,
19 /// Enable the public sender metadata in the transaction.
20 ///
21 /// This field may be deprecated after the feature rollout.
22 pub with_public_sender: bool,
23
24 /// Enable the blob processing by the VM
25 pub with_blob: bool,
26
27 /// Disable deployment of Wasm64 contracts
28 pub disable_wasm64: bool,
29
30 /// Disable deployment of Wasm32 contracts
31 pub disable_wasm32: bool,
32
33 /// Disable calls to 3rd party contracts
34 pub disable_3rd_party: bool,
35
36 /// Enforce phoenix fee refund stealth address matches change note
37 pub phoenix_refund_check: bool,
38}
39
40impl Default for Config {
41 fn default() -> Self {
42 Self::DEFAULT
43 }
44}
45
46impl Config {
47 /// Create a config with all values to default
48 pub const DEFAULT: Config = Config {
49 gas_per_deploy_byte: 0,
50 gas_per_blob: 0,
51 min_deploy_points: 0,
52 min_deploy_gas_price: 0,
53 with_public_sender: false,
54 with_blob: false,
55 disable_wasm64: false,
56 disable_wasm32: false,
57 disable_3rd_party: false,
58 phoenix_refund_check: false,
59 };
60}