Merge pull request #15028 from karalabe/metropolis-iceage

consensus, core, tests: implement Metropolis EIP 649
This commit is contained in:
Péter Szilágyi
2017-08-25 11:00:51 +03:00
committed by GitHub
8 changed files with 50 additions and 129 deletions

View File

@ -179,7 +179,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, db ethdb.Dat
if gen != nil {
gen(i, b)
}
ethash.AccumulateRewards(statedb, h, b.uncles)
ethash.AccumulateRewards(config, statedb, h, b.uncles)
root, err := statedb.CommitTo(db, config.IsEIP158(h.Number))
if err != nil {
panic(fmt.Sprintf("state write error: %v", err))

View File

@ -128,18 +128,14 @@ func (l *StructLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost ui
}
// capture SSTORE opcodes and determine the changed value and store
// it in the local storage container. NOTE: we do not need to do any
// range checks here because that's already handler prior to calling
// this function.
switch op {
case SSTORE:
// it in the local storage container.
if op == SSTORE && stack.len() >= 2 {
var (
value = common.BigToHash(stack.data[stack.len()-2])
address = common.BigToHash(stack.data[stack.len()-1])
)
l.changedValues[contract.Address()][address] = value
}
// copy a snapstot of the current memory state to a new buffer
var mem []byte
if !l.cfg.DisableMemory {