-
Notifications
You must be signed in to change notification settings - Fork 95
/
params.go
63 lines (54 loc) · 2.74 KB
/
params.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package vm
import (
"github.com/vitelabs/go-vite/common/helper"
"github.com/vitelabs/go-vite/vm/util"
"math/big"
)
const (
quickStepGas uint64 = 2
fastestStepGas uint64 = 3
fastStepGas uint64 = 5
midStepGas uint64 = 8
slowStepGas uint64 = 10
extStepGas uint64 = 20
extCodeSizeGas uint64 = 700
extCodeCopyGas uint64 = 700
balanceGas uint64 = 400
sLoadGas uint64 = 200
expByteGas uint64 = 50
quadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation.
logGas uint64 = 375 // Per LOG* operation.
logTopicGas uint64 = 375 // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas.
logDataGas uint64 = 8 // Per byte in a LOG* operation's data.
blake2bGas uint64 = 30 // Once per Blake2b operation.
blake2bWordGas uint64 = 6 // Once per word of the Blake2b operation's data.
sstoreSetGas uint64 = 20000 // Once per SSTORE operation
sstoreResetGas uint64 = 5000 // Once per SSTORE operation if the zeroness changes from zero.
sstoreClearGas uint64 = 5000 // Once per SSTORE operation if the zeroness doesn't change.
sstoreRefundGas uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero.
sstoreNoopGas uint64 = 200
sstoreInitGas uint64 = 20000
sstoreCleanGas uint64 = 5000
sstoreDirtyGas uint64 = 200
sstoreClearRefundGas uint64 = 15000
sstoreResetClearRefundGas uint64 = 19800
sstoreResetRefundGas uint64 = 4800
jumpdestGas uint64 = 1 // Jumpdest gas cost.
callGas uint64 = 700 // Once per DELEGATECALL operation & message call transaction.
contractCodeGas uint64 = 200 // Per byte in contract code
copyGas uint64 = 3 //
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.
callDepth uint64 = 512 // Maximum Depth of call.
stackLimit uint64 = 1024 // Maximum size of VM stack allowed.
getBlockByHeightLimit uint64 = 256
getAccountBlockByHeightLimit uint64 = 256
//CallValueTransferGas uint64 = 9000 // Paid for CALL when the amount transfer is non-zero.
//CallNewAccountGas uint64 = 25000 // Paid for CALL when the destination address didn't exist prior.
//CallStipend uint64 = 2300 // Free gas given at beginning of call.
MaxCodeSize = 24575 // Maximum bytecode to permit for a contract
outOfQuotaRetryTime = 2 // Retry 3 times when a contract receive block runs out of quota
offChainReaderGas = 1000000
)
var (
createContractFee = new(big.Int).Mul(helper.Big10, util.AttovPerVite)
)