aboutsummaryrefslogtreecommitdiffstats
path: root/params
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-09-21 19:16:18 +0800
committerGitHub <noreply@github.com>2018-09-21 19:16:18 +0800
commitee92bc537f159c2202058a33e015684cc2bca04c (patch)
tree8f89d2e71d98f26024069be193023ef5da2a0d3f /params
parent81080bf8cb7f60f59a68cf48998a29a1a2e10cb9 (diff)
parent360a72d54e9ea6fbf8ddb4872cc514d241ea2042 (diff)
downloaddexon-ee92bc537f159c2202058a33e015684cc2bca04c.tar
dexon-ee92bc537f159c2202058a33e015684cc2bca04c.tar.gz
dexon-ee92bc537f159c2202058a33e015684cc2bca04c.tar.bz2
dexon-ee92bc537f159c2202058a33e015684cc2bca04c.tar.lz
dexon-ee92bc537f159c2202058a33e015684cc2bca04c.tar.xz
dexon-ee92bc537f159c2202058a33e015684cc2bca04c.tar.zst
dexon-ee92bc537f159c2202058a33e015684cc2bca04c.zip
Merge pull request #17383 from holiman/eip1283
Eip1283
Diffstat (limited to 'params')
-rw-r--r--params/config.go12
-rw-r--r--params/protocol_params.go23
2 files changed, 27 insertions, 8 deletions
diff --git a/params/config.go b/params/config.go
index b0f6b7df1..a9e631cde 100644
--- a/params/config.go
+++ b/params/config.go
@@ -383,7 +383,7 @@ func (err *ConfigCompatError) Error() string {
type Rules struct {
ChainID *big.Int
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
- IsByzantium bool
+ IsByzantium, IsConstantinople bool
}
// Rules ensures c's ChainID is not nil.
@@ -392,5 +392,13 @@ func (c *ChainConfig) Rules(num *big.Int) Rules {
if chainID == nil {
chainID = new(big.Int)
}
- return Rules{ChainID: new(big.Int).Set(chainID), IsHomestead: c.IsHomestead(num), IsEIP150: c.IsEIP150(num), IsEIP155: c.IsEIP155(num), IsEIP158: c.IsEIP158(num), IsByzantium: c.IsByzantium(num)}
+ return Rules{
+ ChainID: new(big.Int).Set(chainID),
+ IsHomestead: c.IsHomestead(num),
+ IsEIP150: c.IsEIP150(num),
+ IsEIP155: c.IsEIP155(num),
+ IsEIP158: c.IsEIP158(num),
+ IsByzantium: c.IsByzantium(num),
+ IsConstantinople: c.IsConstantinople(num),
+ }
}
diff --git a/params/protocol_params.go b/params/protocol_params.go
index 4b53b3320..c8b6609af 100644
--- a/params/protocol_params.go
+++ b/params/protocol_params.go
@@ -32,15 +32,26 @@ const (
TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.
TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.
QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation.
- SstoreSetGas uint64 = 20000 // Once per SLOAD operation.
LogDataGas uint64 = 8 // Per byte in a LOG* operation's data.
CallStipend uint64 = 2300 // Free gas given at beginning of call.
- Sha3Gas uint64 = 30 // Once per SHA3 operation.
- Sha3WordGas uint64 = 6 // Once per word of the SHA3 operation's data.
- 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.
+ Sha3Gas uint64 = 30 // Once per SHA3 operation.
+ Sha3WordGas uint64 = 6 // Once per word of the SHA3 operation's data.
+
+ SstoreSetGas uint64 = 20000 // Once per SLOAD 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.
+
+ NetSstoreNoopGas uint64 = 200 // Once per SSTORE operation if the value doesn't change.
+ NetSstoreInitGas uint64 = 20000 // Once per SSTORE operation from clean zero.
+ NetSstoreCleanGas uint64 = 5000 // Once per SSTORE operation from clean non-zero.
+ NetSstoreDirtyGas uint64 = 200 // Once per SSTORE operation from dirty.
+
+ NetSstoreClearRefund uint64 = 15000 // Once per SSTORE operation for clearing an originally existing storage slot
+ NetSstoreResetRefund uint64 = 4800 // Once per SSTORE operation for resetting to the original non-zero value
+ NetSstoreResetClearRefund uint64 = 19800 // Once per SSTORE operation for resetting to the original zero value
+
JumpdestGas uint64 = 1 // Refunded gas, once per SSTORE operation if the zeroness changes to zero.
EpochDuration uint64 = 30000 // Duration between proof-of-work epochs.
CallGas uint64 = 40 // Once per CALL operation & message call transaction.