github.com/theQRL/go-zond@v0.2.1/params/protocol_params.go (about) 1 // Copyright 2015 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package params 18 19 const ( 20 GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations. 21 MinGasLimit uint64 = 5000 // Minimum the gas limit may ever be. 22 MaxGasLimit uint64 = 20000000 // Maximum the gas limit 23 GenesisGasLimit uint64 = 4712388 // Gas limit of the Genesis block. 24 25 MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis. 26 SloadGas uint64 = 50 // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added. 27 CallValueTransferGas uint64 = 9000 // Paid for CALL when the value transfer is non-zero. 28 CallNewAccountGas uint64 = 25000 // Paid for CALL when the destination address didn't exist prior. 29 TxGas uint64 = 21000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. 30 TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions. 31 TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. 32 QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation. 33 LogDataGas uint64 = 8 // Per byte in a LOG* operation's data. 34 CallStipend uint64 = 2300 // Free gas given at beginning of call. 35 36 Keccak256Gas uint64 = 30 // Once per KECCAK256 operation. 37 Keccak256WordGas uint64 = 6 // Once per word of the KECCAK256 operation's data. 38 InitCodeWordGas uint64 = 2 // Once per word of the init code when creating a contract. 39 40 SstoreSentryGasEIP2200 uint64 = 2300 // Minimum gas required to be present for an SSTORE call, not consumed 41 SstoreSetGasEIP2200 uint64 = 20000 // Once per SSTORE operation from clean zero to non-zero 42 SstoreResetGasEIP2200 uint64 = 5000 // Once per SSTORE operation from clean non-zero to something else 43 SstoreClearsScheduleRefundEIP2200 uint64 = 15000 // Once per SSTORE operation for clearing an originally existing storage slot 44 45 ColdAccountAccessCostEIP2929 = uint64(2600) // COLD_ACCOUNT_ACCESS_COST 46 ColdSloadCostEIP2929 = uint64(2100) // COLD_SLOAD_COST 47 WarmStorageReadCostEIP2929 = uint64(100) // WARM_STORAGE_READ_COST 48 49 // In EIP-2200: SstoreResetGas was 5000. 50 // In EIP-2929: SstoreResetGas was changed to '5000 - COLD_SLOAD_COST'. 51 // In EIP-3529: SSTORE_CLEARS_SCHEDULE is defined as SSTORE_RESET_GAS + ACCESS_LIST_STORAGE_KEY_COST 52 // Which becomes: 5000 - 2100 + 1900 = 4800 53 SstoreClearsScheduleRefundEIP3529 uint64 = SstoreResetGasEIP2200 - ColdSloadCostEIP2929 + TxAccessListStorageKeyGas 54 55 JumpdestGas uint64 = 1 // Once per JUMPDEST operation. 56 57 CreateDataGas uint64 = 200 // 58 CallCreateDepth uint64 = 1024 // Maximum depth of call/create stack. 59 ExpGas uint64 = 10 // Once per EXP instruction 60 LogGas uint64 = 375 // Per LOG* operation. 61 CopyGas uint64 = 3 // 62 StackLimit uint64 = 1024 // Maximum size of VM stack allowed. 63 LogTopicGas uint64 = 375 // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas. 64 CreateGas uint64 = 32000 // Once per CREATE operation & contract-creation transaction. 65 Create2Gas uint64 = 32000 // Once per CREATE2 operation 66 MemoryGas uint64 = 3 // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL. 67 68 TxDataNonZeroGasEIP2028 uint64 = 16 // Per byte of non zero data attached to a transaction after EIP 2028 69 TxAccessListAddressGas uint64 = 2400 // Per address specified in EIP 2930 access list 70 TxAccessListStorageKeyGas uint64 = 1900 // Per storage key specified in EIP 2930 access list 71 72 // These have been changed during the course of the chain 73 SloadGasEIP2200 uint64 = 800 // Cost of SLOAD 74 75 // EXP has a dynamic portion depending on the size of the exponent 76 ExpByteEIP158 uint64 = 50 // was raised to 50 during Eip158 77 78 DefaultBaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks. 79 DefaultElasticityMultiplier = 2 // Bounds the maximum gas limit a block may have. 80 InitialBaseFee = 1000000000 // Initial base fee. 81 82 MaxCodeSize = 24576 // Maximum bytecode to permit for a contract 83 MaxInitCodeSize = 2 * MaxCodeSize // Maximum initcode to permit in a creation transaction and create instructions 84 85 // Precompiled contract gas prices 86 DepositrootGas uint64 = 3000 // Deposit root operation gas price 87 Sha256BaseGas uint64 = 60 // Base price for a SHA256 operation 88 Sha256PerWordGas uint64 = 12 // Per-word price for a SHA256 operation 89 IdentityBaseGas uint64 = 15 // Base price for a data copy operation 90 IdentityPerWordGas uint64 = 3 // Per-work price for a data copy operation 91 92 Bn256AddGasIstanbul uint64 = 150 // Gas needed for an elliptic curve addition 93 Bn256ScalarMulGasIstanbul uint64 = 6000 // Gas needed for an elliptic curve scalar multiplication 94 Bn256PairingBaseGasIstanbul uint64 = 45000 // Base price for an elliptic curve pairing check 95 Bn256PairingPerPointGasIstanbul uint64 = 34000 // Per-point price for an elliptic curve pairing check 96 97 // The Refund Quotient is the cap on how much of the used gas can be refunded. Before EIP-3529, 98 // up to half the consumed gas could be refunded. Redefined as 1/5th in EIP-3529 99 RefundQuotient uint64 = 2 100 RefundQuotientEIP3529 uint64 = 5 101 )