aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-09-14 15:07:31 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-09-14 15:10:46 +0800
commit5bbd7fb390a539a7183bccc5f2b75b4e564ed398 (patch)
tree1c13d07970c559b460e83d686ce71cbb484de2ab /core
parent79b11121a7e4beef0d0297894289200b9842c36c (diff)
downloaddexon-5bbd7fb390a539a7183bccc5f2b75b4e564ed398.tar
dexon-5bbd7fb390a539a7183bccc5f2b75b4e564ed398.tar.gz
dexon-5bbd7fb390a539a7183bccc5f2b75b4e564ed398.tar.bz2
dexon-5bbd7fb390a539a7183bccc5f2b75b4e564ed398.tar.lz
dexon-5bbd7fb390a539a7183bccc5f2b75b4e564ed398.tar.xz
dexon-5bbd7fb390a539a7183bccc5f2b75b4e564ed398.tar.zst
dexon-5bbd7fb390a539a7183bccc5f2b75b4e564ed398.zip
consensus, core, params: rebrand Metro to Byzantium
Diffstat (limited to 'core')
-rw-r--r--core/state_processor.go2
-rw-r--r--core/types/receipt.go2
-rw-r--r--core/vm/contracts.go6
-rw-r--r--core/vm/contracts_test.go4
-rw-r--r--core/vm/evm.go8
-rw-r--r--core/vm/gas_table.go2
-rw-r--r--core/vm/interpreter.go6
-rw-r--r--core/vm/jump_table.go12
8 files changed, 21 insertions, 21 deletions
diff --git a/core/state_processor.go b/core/state_processor.go
index 4115eab8c..689c83785 100644
--- a/core/state_processor.go
+++ b/core/state_processor.go
@@ -105,7 +105,7 @@ func ApplyTransaction(config *params.ChainConfig, bc *BlockChain, author *common
// Update the state with pending changes
var root []byte
- if config.IsMetropolis(header.Number) {
+ if config.IsByzantium(header.Number) {
statedb.Finalise(true)
} else {
root = statedb.IntermediateRoot(config.IsEIP158(header.Number)).Bytes()
diff --git a/core/types/receipt.go b/core/types/receipt.go
index 4f3b7357e..e179fe0cf 100644
--- a/core/types/receipt.go
+++ b/core/types/receipt.go
@@ -79,7 +79,7 @@ func NewReceipt(root []byte, failed bool, cumulativeGasUsed *big.Int) *Receipt {
}
// EncodeRLP implements rlp.Encoder, and flattens the consensus fields of a receipt
-// into an RLP stream. If no post state is present, metropolis fork is assumed.
+// into an RLP stream. If no post state is present, byzantium fork is assumed.
func (r *Receipt) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, &receiptRLP{r.statusEncoding(), r.CumulativeGasUsed, r.Bloom, r.Logs})
}
diff --git a/core/vm/contracts.go b/core/vm/contracts.go
index 790d42bbe..7344b6043 100644
--- a/core/vm/contracts.go
+++ b/core/vm/contracts.go
@@ -46,9 +46,9 @@ var PrecompiledContractsHomestead = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{4}): &dataCopy{},
}
-// PrecompiledContractsMetropolis contains the default set of pre-compiled Ethereum
-// contracts used in the Metropolis release.
-var PrecompiledContractsMetropolis = map[common.Address]PrecompiledContract{
+// PrecompiledContractsByzantium contains the default set of pre-compiled Ethereum
+// contracts used in the Byzantium release.
+var PrecompiledContractsByzantium = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{1}): &ecrecover{},
common.BytesToAddress([]byte{2}): &sha256hash{},
common.BytesToAddress([]byte{3}): &ripemd160hash{},
diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go
index 880d7324a..513651835 100644
--- a/core/vm/contracts_test.go
+++ b/core/vm/contracts_test.go
@@ -321,7 +321,7 @@ var bn256PairingTests = []precompiledTest{
}
func testPrecompiled(addr string, test precompiledTest, t *testing.T) {
- p := PrecompiledContractsMetropolis[common.HexToAddress(addr)]
+ p := PrecompiledContractsByzantium[common.HexToAddress(addr)]
in := common.Hex2Bytes(test.input)
contract := NewContract(AccountRef(common.HexToAddress("1337")),
nil, new(big.Int), p.RequiredGas(in))
@@ -338,7 +338,7 @@ func benchmarkPrecompiled(addr string, test precompiledTest, bench *testing.B) {
if test.noBenchmark {
return
}
- p := PrecompiledContractsMetropolis[common.HexToAddress(addr)]
+ p := PrecompiledContractsByzantium[common.HexToAddress(addr)]
in := common.Hex2Bytes(test.input)
reqGas := p.RequiredGas(in)
contract := NewContract(AccountRef(common.HexToAddress("1337")),
diff --git a/core/vm/evm.go b/core/vm/evm.go
index 495d9beea..b0a6f3d26 100644
--- a/core/vm/evm.go
+++ b/core/vm/evm.go
@@ -41,8 +41,8 @@ type (
func run(evm *EVM, snapshot int, contract *Contract, input []byte) ([]byte, error) {
if contract.CodeAddr != nil {
precompiles := PrecompiledContractsHomestead
- if evm.ChainConfig().IsMetropolis(evm.BlockNumber) {
- precompiles = PrecompiledContractsMetropolis
+ if evm.ChainConfig().IsByzantium(evm.BlockNumber) {
+ precompiles = PrecompiledContractsByzantium
}
if p := precompiles[*contract.CodeAddr]; p != nil {
return RunPrecompiledContract(p, input, contract)
@@ -151,8 +151,8 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
)
if !evm.StateDB.Exist(addr) {
precompiles := PrecompiledContractsHomestead
- if evm.ChainConfig().IsMetropolis(evm.BlockNumber) {
- precompiles = PrecompiledContractsMetropolis
+ if evm.ChainConfig().IsByzantium(evm.BlockNumber) {
+ precompiles = PrecompiledContractsByzantium
}
if precompiles[addr] == nil && evm.ChainConfig().IsEIP158(evm.BlockNumber) && value.Sign() == 0 {
return nil, gas, nil
diff --git a/core/vm/gas_table.go b/core/vm/gas_table.go
index 13712295c..0d8e295a5 100644
--- a/core/vm/gas_table.go
+++ b/core/vm/gas_table.go
@@ -324,7 +324,7 @@ func gasCall(gt params.GasTable, evm *EVM, contract *Contract, stack *Stack, mem
eip158 = evm.ChainConfig().IsEIP158(evm.BlockNumber)
)
if eip158 {
- if transfersValue && evm.StateDB.Empty(address) {
+ if transfersValue && evm.StateDB.Empty(address) {
gas += params.CallNewAccountGas
}
} else if !evm.StateDB.Exist(address) {
diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go
index d3e24a7a4..b0d796a44 100644
--- a/core/vm/interpreter.go
+++ b/core/vm/interpreter.go
@@ -70,8 +70,8 @@ func NewInterpreter(evm *EVM, cfg Config) *Interpreter {
// we'll set the default jump table.
if !cfg.JumpTable[STOP].valid {
switch {
- case evm.ChainConfig().IsMetropolis(evm.BlockNumber):
- cfg.JumpTable = metropolisInstructionSet
+ case evm.ChainConfig().IsByzantium(evm.BlockNumber):
+ cfg.JumpTable = byzantiumInstructionSet
case evm.ChainConfig().IsHomestead(evm.BlockNumber):
cfg.JumpTable = homesteadInstructionSet
default:
@@ -88,7 +88,7 @@ func NewInterpreter(evm *EVM, cfg Config) *Interpreter {
}
func (in *Interpreter) enforceRestrictions(op OpCode, operation operation, stack *Stack) error {
- if in.evm.chainRules.IsMetropolis {
+ if in.evm.chainRules.IsByzantium {
if in.readOnly {
// If the interpreter is operating in readonly mode, make sure no
// state-modifying operation is performed. The 3rd stack item
diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go
index f0a922912..9ef192fdf 100644
--- a/core/vm/jump_table.go
+++ b/core/vm/jump_table.go
@@ -51,14 +51,14 @@ type operation struct {
}
var (
- frontierInstructionSet = NewFrontierInstructionSet()
- homesteadInstructionSet = NewHomesteadInstructionSet()
- metropolisInstructionSet = NewMetropolisInstructionSet()
+ frontierInstructionSet = NewFrontierInstructionSet()
+ homesteadInstructionSet = NewHomesteadInstructionSet()
+ byzantiumInstructionSet = NewByzantiumInstructionSet()
)
-// NewMetropolisInstructionSet returns the frontier, homestead and
-// metropolis instructions.
-func NewMetropolisInstructionSet() [256]operation {
+// NewByzantiumInstructionSet returns the frontier, homestead and
+// byzantium instructions.
+func NewByzantiumInstructionSet() [256]operation {
// instructions that can be executed during the homestead phase.
instructionSet := NewHomesteadInstructionSet()
instructionSet[STATICCALL] = operation{