Skip to content

Commit 98f4c93

Browse files
committed
Merge branch 'release/0.9.38'
2 parents 423c2f4 + 344277d commit 98f4c93

37 files changed

+1433
-1935
lines changed

.mailmap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Nick Savers <[email protected]>
1111

1212
Maran Hidskes <[email protected]>
1313

14+
Taylor Gerring <[email protected]>
1415
1516

1617
Bas van Kervel <[email protected]>
@@ -57,4 +58,4 @@ Jason Carver <[email protected]>
5758
5859

5960
Joseph Chow <[email protected]>
60-
Joseph Chow <[email protected]> ethers <TODO>
61+
Joseph Chow <[email protected]> ethers <TODO>

accounts/account_manager.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,5 @@ func (am *Manager) ImportPreSaleKey(keyJSON []byte, password string) (acc Accoun
228228
if err != nil {
229229
return
230230
}
231-
if err = am.keyStore.StoreKey(key, password); err != nil {
232-
return
233-
}
234231
return Account{Address: key.Address}, nil
235232
}

cmd/geth/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import (
4949

5050
const (
5151
ClientIdentifier = "Geth"
52-
Version = "0.9.36"
52+
Version = "0.9.38"
5353
)
5454

5555
var (

core/block_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func ValidateHeader(pow pow.PoW, block *types.Header, parent *types.Block, check
386386
return BlockEqualTSErr
387387
}
388388

389-
expd := CalcDifficulty(int64(block.Time), int64(parent.Time()), parent.Difficulty())
389+
expd := CalcDifficulty(block.Time, parent.Time(), parent.Difficulty())
390390
if expd.Cmp(block.Difficulty) != 0 {
391391
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Difficulty, expd)
392392
}

core/chain_makers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func makeHeader(parent *types.Block, state *state.StateDB) *types.Header {
171171
Root: state.Root(),
172172
ParentHash: parent.Hash(),
173173
Coinbase: parent.Coinbase(),
174-
Difficulty: CalcDifficulty(int64(time), int64(parent.Time()), parent.Difficulty()),
174+
Difficulty: CalcDifficulty(time, parent.Time(), parent.Difficulty()),
175175
GasLimit: CalcGasLimit(parent),
176176
GasUsed: new(big.Int),
177177
Number: new(big.Int).Add(parent.Number(), common.Big1),

core/chain_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
611611
// Allow up to MaxFuture second in the future blocks. If this limit
612612
// is exceeded the chain is discarded and processed at a later time
613613
// if given.
614-
if max := time.Now().Unix() + maxTimeFutureBlocks; int64(block.Time()) > max {
614+
if max := uint64(time.Now().Unix()) + maxTimeFutureBlocks; block.Time() > max {
615615
return i, fmt.Errorf("%v: BlockFutureErr, %v > %v", BlockFutureErr, block.Time(), max)
616616
}
617617

core/chain_util.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ import (
3131
// CalcDifficulty is the difficulty adjustment algorithm. It returns
3232
// the difficulty that a new block b should have when created at time
3333
// given the parent block's time and difficulty.
34-
func CalcDifficulty(time int64, parentTime int64, parentDiff *big.Int) *big.Int {
34+
func CalcDifficulty(time, parentTime uint64, parentDiff *big.Int) *big.Int {
3535
diff := new(big.Int)
3636
adjust := new(big.Int).Div(parentDiff, params.DifficultyBoundDivisor)
37-
if big.NewInt(time-parentTime).Cmp(params.DurationLimit) < 0 {
37+
bigTime := new(big.Int)
38+
bigParentTime := new(big.Int)
39+
40+
bigTime.SetUint64(time)
41+
bigParentTime.SetUint64(parentTime)
42+
43+
if bigTime.Sub(bigTime, bigParentTime).Cmp(params.DurationLimit) < 0 {
3844
diff.Add(parentDiff, adjust)
3945
} else {
4046
diff.Sub(parentDiff, adjust)

core/filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ done:
9999
switch {
100100
case block.NumberU64() == 0:
101101
break done
102-
case block.NumberU64() == earliestBlockNo:
102+
case block.NumberU64() < earliestBlockNo:
103103
break done
104104
case self.max <= len(logs):
105105
break done

core/vm/opcodes.go

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,139 @@ func (o OpCode) String() string {
348348

349349
return str
350350
}
351+
352+
var stringToOp = map[string]OpCode{
353+
"STOP": STOP,
354+
"ADD": ADD,
355+
"MUL": MUL,
356+
"SUB": SUB,
357+
"DIV": DIV,
358+
"SDIV": SDIV,
359+
"MOD": MOD,
360+
"SMOD": SMOD,
361+
"EXP": EXP,
362+
"NOT": NOT,
363+
"LT": LT,
364+
"GT": GT,
365+
"SLT": SLT,
366+
"SGT": SGT,
367+
"EQ": EQ,
368+
"ISZERO": ISZERO,
369+
"SIGNEXTEND": SIGNEXTEND,
370+
"AND": AND,
371+
"OR": OR,
372+
"XOR": XOR,
373+
"BYTE": BYTE,
374+
"ADDMOD": ADDMOD,
375+
"MULMOD": MULMOD,
376+
"SHA3": SHA3,
377+
"ADDRESS": ADDRESS,
378+
"BALANCE": BALANCE,
379+
"ORIGIN": ORIGIN,
380+
"CALLER": CALLER,
381+
"CALLVALUE": CALLVALUE,
382+
"CALLDATALOAD": CALLDATALOAD,
383+
"CALLDATASIZE": CALLDATASIZE,
384+
"CALLDATACOPY": CALLDATACOPY,
385+
"CODESIZE": CODESIZE,
386+
"CODECOPY": CODECOPY,
387+
"GASPRICE": GASPRICE,
388+
"BLOCKHASH": BLOCKHASH,
389+
"COINBASE": COINBASE,
390+
"TIMESTAMP": TIMESTAMP,
391+
"NUMBER": NUMBER,
392+
"DIFFICULTY": DIFFICULTY,
393+
"GASLIMIT": GASLIMIT,
394+
"EXTCODESIZE": EXTCODESIZE,
395+
"EXTCODECOPY": EXTCODECOPY,
396+
"POP": POP,
397+
"MLOAD": MLOAD,
398+
"MSTORE": MSTORE,
399+
"MSTORE8": MSTORE8,
400+
"SLOAD": SLOAD,
401+
"SSTORE": SSTORE,
402+
"JUMP": JUMP,
403+
"JUMPI": JUMPI,
404+
"PC": PC,
405+
"MSIZE": MSIZE,
406+
"GAS": GAS,
407+
"JUMPDEST": JUMPDEST,
408+
"PUSH1": PUSH1,
409+
"PUSH2": PUSH2,
410+
"PUSH3": PUSH3,
411+
"PUSH4": PUSH4,
412+
"PUSH5": PUSH5,
413+
"PUSH6": PUSH6,
414+
"PUSH7": PUSH7,
415+
"PUSH8": PUSH8,
416+
"PUSH9": PUSH9,
417+
"PUSH10": PUSH10,
418+
"PUSH11": PUSH11,
419+
"PUSH12": PUSH12,
420+
"PUSH13": PUSH13,
421+
"PUSH14": PUSH14,
422+
"PUSH15": PUSH15,
423+
"PUSH16": PUSH16,
424+
"PUSH17": PUSH17,
425+
"PUSH18": PUSH18,
426+
"PUSH19": PUSH19,
427+
"PUSH20": PUSH20,
428+
"PUSH21": PUSH21,
429+
"PUSH22": PUSH22,
430+
"PUSH23": PUSH23,
431+
"PUSH24": PUSH24,
432+
"PUSH25": PUSH25,
433+
"PUSH26": PUSH26,
434+
"PUSH27": PUSH27,
435+
"PUSH28": PUSH28,
436+
"PUSH29": PUSH29,
437+
"PUSH30": PUSH30,
438+
"PUSH31": PUSH31,
439+
"PUSH32": PUSH32,
440+
"DUP1": DUP1,
441+
"DUP2": DUP2,
442+
"DUP3": DUP3,
443+
"DUP4": DUP4,
444+
"DUP5": DUP5,
445+
"DUP6": DUP6,
446+
"DUP7": DUP7,
447+
"DUP8": DUP8,
448+
"DUP9": DUP9,
449+
"DUP10": DUP10,
450+
"DUP11": DUP11,
451+
"DUP12": DUP12,
452+
"DUP13": DUP13,
453+
"DUP14": DUP14,
454+
"DUP15": DUP15,
455+
"DUP16": DUP16,
456+
"SWAP1": SWAP1,
457+
"SWAP2": SWAP2,
458+
"SWAP3": SWAP3,
459+
"SWAP4": SWAP4,
460+
"SWAP5": SWAP5,
461+
"SWAP6": SWAP6,
462+
"SWAP7": SWAP7,
463+
"SWAP8": SWAP8,
464+
"SWAP9": SWAP9,
465+
"SWAP10": SWAP10,
466+
"SWAP11": SWAP11,
467+
"SWAP12": SWAP12,
468+
"SWAP13": SWAP13,
469+
"SWAP14": SWAP14,
470+
"SWAP15": SWAP15,
471+
"SWAP16": SWAP16,
472+
"LOG0": LOG0,
473+
"LOG1": LOG1,
474+
"LOG2": LOG2,
475+
"LOG3": LOG3,
476+
"LOG4": LOG4,
477+
"CREATE": CREATE,
478+
"CALL": CALL,
479+
"RETURN": RETURN,
480+
"CALLCODE": CALLCODE,
481+
"SUICIDE": SUICIDE,
482+
}
483+
484+
func StringToOp(str string) OpCode {
485+
return stringToOp[str]
486+
}

crypto/key_store_plain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func toISO8601(t time.Time) string {
189189
} else {
190190
tz = fmt.Sprintf("%03d00", offset/3600)
191191
}
192-
return fmt.Sprintf("%04d-%02d-%02dT%02d:%02d:%02d.%09d%s", t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), tz)
192+
return fmt.Sprintf("%04d-%02d-%02dT%02d-%02d-%02d.%09d%s", t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), tz)
193193
}
194194

195195
func getKeyAddresses(keysDirPath string) (addresses []common.Address, err error) {

0 commit comments

Comments
 (0)