Commit dd140beb authored by Jeffrey Wilcke's avatar Jeffrey Wilcke

Merge pull request #1443 from Gustav-Simonsson/core_uint64_ts

Core uint64 ts
parents 06afabb6 5d6d40f3
...@@ -386,7 +386,7 @@ func ValidateHeader(pow pow.PoW, block *types.Header, parent *types.Block, check ...@@ -386,7 +386,7 @@ func ValidateHeader(pow pow.PoW, block *types.Header, parent *types.Block, check
return BlockEqualTSErr return BlockEqualTSErr
} }
expd := CalcDifficulty(int64(block.Time), int64(parent.Time()), parent.Difficulty()) expd := CalcDifficulty(block.Time, parent.Time(), parent.Difficulty())
if expd.Cmp(block.Difficulty) != 0 { if expd.Cmp(block.Difficulty) != 0 {
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Difficulty, expd) return fmt.Errorf("Difficulty check failed for block %v, %v", block.Difficulty, expd)
} }
......
...@@ -171,7 +171,7 @@ func makeHeader(parent *types.Block, state *state.StateDB) *types.Header { ...@@ -171,7 +171,7 @@ func makeHeader(parent *types.Block, state *state.StateDB) *types.Header {
Root: state.Root(), Root: state.Root(),
ParentHash: parent.Hash(), ParentHash: parent.Hash(),
Coinbase: parent.Coinbase(), Coinbase: parent.Coinbase(),
Difficulty: CalcDifficulty(int64(time), int64(parent.Time()), parent.Difficulty()), Difficulty: CalcDifficulty(time, parent.Time(), parent.Difficulty()),
GasLimit: CalcGasLimit(parent), GasLimit: CalcGasLimit(parent),
GasUsed: new(big.Int), GasUsed: new(big.Int),
Number: new(big.Int).Add(parent.Number(), common.Big1), Number: new(big.Int).Add(parent.Number(), common.Big1),
......
...@@ -611,7 +611,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) { ...@@ -611,7 +611,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
// Allow up to MaxFuture second in the future blocks. If this limit // Allow up to MaxFuture second in the future blocks. If this limit
// is exceeded the chain is discarded and processed at a later time // is exceeded the chain is discarded and processed at a later time
// if given. // if given.
if max := time.Now().Unix() + maxTimeFutureBlocks; int64(block.Time()) > max { if max := uint64(time.Now().Unix()) + maxTimeFutureBlocks; block.Time() > max {
return i, fmt.Errorf("%v: BlockFutureErr, %v > %v", BlockFutureErr, block.Time(), max) return i, fmt.Errorf("%v: BlockFutureErr, %v > %v", BlockFutureErr, block.Time(), max)
} }
......
...@@ -31,10 +31,16 @@ import ( ...@@ -31,10 +31,16 @@ import (
// CalcDifficulty is the difficulty adjustment algorithm. It returns // CalcDifficulty is the difficulty adjustment algorithm. It returns
// the difficulty that a new block b should have when created at time // the difficulty that a new block b should have when created at time
// given the parent block's time and difficulty. // given the parent block's time and difficulty.
func CalcDifficulty(time int64, parentTime int64, parentDiff *big.Int) *big.Int { func CalcDifficulty(time, parentTime uint64, parentDiff *big.Int) *big.Int {
diff := new(big.Int) diff := new(big.Int)
adjust := new(big.Int).Div(parentDiff, params.DifficultyBoundDivisor) adjust := new(big.Int).Div(parentDiff, params.DifficultyBoundDivisor)
if big.NewInt(time-parentTime).Cmp(params.DurationLimit) < 0 { bigTime := new(big.Int)
bigParentTime := new(big.Int)
bigTime.SetUint64(time)
bigParentTime.SetUint64(parentTime)
if bigTime.Sub(bigTime, bigParentTime).Cmp(params.DurationLimit) < 0 {
diff.Add(parentDiff, adjust) diff.Add(parentDiff, adjust)
} else { } else {
diff.Sub(parentDiff, adjust) diff.Sub(parentDiff, adjust)
......
...@@ -427,7 +427,7 @@ func (self *worker) commitNewWork() { ...@@ -427,7 +427,7 @@ func (self *worker) commitNewWork() {
header := &types.Header{ header := &types.Header{
ParentHash: parent.Hash(), ParentHash: parent.Hash(),
Number: num.Add(num, common.Big1), Number: num.Add(num, common.Big1),
Difficulty: core.CalcDifficulty(int64(tstamp), int64(parent.Time()), parent.Difficulty()), Difficulty: core.CalcDifficulty(uint64(tstamp), parent.Time(), parent.Difficulty()),
GasLimit: core.CalcGasLimit(parent), GasLimit: core.CalcGasLimit(parent),
GasUsed: new(big.Int), GasUsed: new(big.Int),
Coinbase: self.coinbase, Coinbase: self.coinbase,
......
...@@ -94,3 +94,11 @@ func TestBcGasPricer(t *testing.T) { ...@@ -94,3 +94,11 @@ func TestBcGasPricer(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
} }
// TODO: iterate over files once we got more than a few
func TestBcRandom(t *testing.T) {
err := RunBlockTest(filepath.Join(blockTestDir, "RandomTests/bl201507071825GO.json"), BlockSkipTests)
if err != nil {
t.Fatal(err)
}
}
...@@ -208,10 +208,22 @@ func (t *BlockTest) InsertPreState(ethereum *eth.Ethereum) (*state.StateDB, erro ...@@ -208,10 +208,22 @@ func (t *BlockTest) InsertPreState(ethereum *eth.Ethereum) (*state.StateDB, erro
db := ethereum.StateDb() db := ethereum.StateDb()
statedb := state.New(common.Hash{}, db) statedb := state.New(common.Hash{}, db)
for addrString, acct := range t.preAccounts { for addrString, acct := range t.preAccounts {
addr, _ := hex.DecodeString(addrString) addr, err := hex.DecodeString(addrString)
code, _ := hex.DecodeString(strings.TrimPrefix(acct.Code, "0x")) if err != nil {
balance, _ := new(big.Int).SetString(acct.Balance, 0) return nil, err
nonce, _ := strconv.ParseUint(acct.Nonce, 16, 64) }
code, err := hex.DecodeString(strings.TrimPrefix(acct.Code, "0x"))
if err != nil {
return nil, err
}
balance, ok := new(big.Int).SetString(acct.Balance, 0)
if !ok {
return nil, err
}
nonce, err := strconv.ParseUint(prepInt(16, acct.Nonce), 16, 64)
if err != nil {
return nil, err
}
if acct.PrivateKey != "" { if acct.PrivateKey != "" {
privkey, err := hex.DecodeString(strings.TrimPrefix(acct.PrivateKey, "0x")) privkey, err := hex.DecodeString(strings.TrimPrefix(acct.PrivateKey, "0x"))
...@@ -365,10 +377,22 @@ func (s *BlockTest) validateBlockHeader(h *btHeader, h2 *types.Header) error { ...@@ -365,10 +377,22 @@ func (s *BlockTest) validateBlockHeader(h *btHeader, h2 *types.Header) error {
func (t *BlockTest) ValidatePostState(statedb *state.StateDB) error { func (t *BlockTest) ValidatePostState(statedb *state.StateDB) error {
for addrString, acct := range t.preAccounts { for addrString, acct := range t.preAccounts {
// XXX: is is worth it checking for errors here? // XXX: is is worth it checking for errors here?
addr, _ := hex.DecodeString(addrString) addr, err := hex.DecodeString(addrString)
code, _ := hex.DecodeString(strings.TrimPrefix(acct.Code, "0x")) if err != nil {
balance, _ := new(big.Int).SetString(acct.Balance, 0) return err
nonce, _ := strconv.ParseUint(acct.Nonce, 16, 64) }
code, err := hex.DecodeString(strings.TrimPrefix(acct.Code, "0x"))
if err != nil {
return err
}
balance, ok := new(big.Int).SetString(acct.Balance, 0)
if !ok {
return err
}
nonce, err := strconv.ParseUint(prepInt(16, acct.Nonce), 16, 64)
if err != nil {
return err
}
// address is indirectly verified by the other fields, as it's the db key // address is indirectly verified by the other fields, as it's the db key
code2 := statedb.GetCode(common.BytesToAddress(addr)) code2 := statedb.GetCode(common.BytesToAddress(addr))
......
{
"randomBlockTest" : {
"blocks" : [
{
"rlp" : "0xf90200f901fba02f6b2f4abf04038f851128f127ce83d21003487102c7276af6cbe8a48b93cbbfa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479484c14767a434cf1ac572ab0852c2254e4e64399fa07d8fad01557373365967bfffd34ceee8bfef2b11ed23aa4d5df15b6b3588b0cda056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302004001832fefd88088f332233a811f07bf80a04fb868837384a546941f355fe83aaf1a931e0c5bb22a4452a62c3eba5a9ecae08868bc5a38e3f02565c0c0"
}
],
"genesisBlockHeader" : {
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "84c14767a434cf1ac572ab0852c2254e4e64399f",
"difficulty" : "0x020000",
"extraData" : "0x",
"gasLimit" : "0x2fefd8",
"gasUsed" : "0x00",
"hash" : "2f6b2f4abf04038f851128f127ce83d21003487102c7276af6cbe8a48b93cbbf",
"mixHash" : "857afac057efaa7e1f89663d0b672b263449b72dc5020fe323a190bac09ed5db",
"nonce" : "46701876a4d4ec53",
"number" : "0x00",
"parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
"receiptTrie" : "ce3fe73c3c6c026099f72ec7fadd76ad197d88bcfaa63f7382df548652478eb5",
"stateRoot" : "bba90a92c15bad8d48a14174ca1841c490a4f947faa3d6f24f981e25fdcd00e3",
"timestamp" : "0xf332233a811f07be",
"transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
"genesisRLP" : "0xf90200f901fba00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479484c14767a434cf1ac572ab0852c2254e4e64399fa0bba90a92c15bad8d48a14174ca1841c490a4f947faa3d6f24f981e25fdcd00e3a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0ce3fe73c3c6c026099f72ec7fadd76ad197d88bcfaa63f7382df548652478eb5b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd88088f332233a811f07be80a0857afac057efaa7e1f89663d0b672b263449b72dc5020fe323a190bac09ed5db8846701876a4d4ec53c0c0",
"lastblockhash" : "2f6b2f4abf04038f851128f127ce83d21003487102c7276af6cbe8a48b93cbbf",
"postState" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x2ae0e538",
"code" : "0x60076008600f5f601c6012601960196019601f983873d3aaa5c6ca8b5cf34e0718e20743b752e75b1731649d08ca20c368b19777f2852275ecd2695ac2dde8ad14dd1ebe726e5c3091e3c1ccbe14777b86620c65886f6ed37757749bc2e3f7d230f9a35ac6957df2d8c828b180843a6a74d261aa7ffc2adf034304254347303ca0298c73616969f140933964d758c58e62df54666c87f9e93670be8ea7ef72b8fd8d68edad39f5f6ea82e166783955dcd67a4cafc4b1dc75c8e5371f3305159ce31041090f35753c503bf35417fa0bae261d28993348837f70f89b26676e3c7a5d84bf2b92170e1064730ee171675071a61b0240be019d6cea31689f3ecf69588c90d33610652ce06ff1b296036004601a601260176002601a600e60056010600f6003600460176010600c600c60139f",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x4f4102",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x2ae0e538",
"code" : "0x60076008600f5f601c6012601960196019601f983873d3aaa5c6ca8b5cf34e0718e20743b752e75b1731649d08ca20c368b19777f2852275ecd2695ac2dde8ad14dd1ebe726e5c3091e3c1ccbe14777b86620c65886f6ed37757749bc2e3f7d230f9a35ac6957df2d8c828b180843a6a74d261aa7ffc2adf034304254347303ca0298c73616969f140933964d758c58e62df54666c87f9e93670be8ea7ef72b8fd8d68edad39f5f6ea82e166783955dcd67a4cafc4b1dc75c8e5371f3305159ce31041090f35753c503bf35417fa0bae261d28993348837f70f89b26676e3c7a5d84bf2b92170e1064730ee171675071a61b0240be019d6cea31689f3ecf69588c90d33610652ce06ff1b296036004601a601260176002601a600e60056010600f6003600460176010600c600c60139f",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x4f4102",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"test1": {
"nonce": "0x0000000000000042",
"difficulty": "17179869184",
"alloc": {
"9ca0e998df92c5351cecbbb6dba82ac2266f7e0c": {
"code": "0x606060606060606060",
"storage": {
"0x03": "0x07"
}
},
"cd2a3d9f938e13cd947ec05abc7fe734df8dd826": {
"balance": "1234567000000000000000"
}
},
"result": "f901faf901f5a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0dd406a973a0a5a9826d00da276e996d28426d24f12b8fa683723e9db532b8c59a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000085040000000080832fefd8808080a00000000000000000000000000000000000000000000000000000000000000000880000000000000042c0c0"
},
"test2": {
"nonce": "0x0000000000000042",
"difficulty": "17179869184",
"alloc": {
"b9c015918bdaba24b4ff057a92a3873d6eb201be": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
},
"e4157b34ea9615cfbde6b4fda419828124b70c78": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
},
"0000000000000000000000000000000000000002": {
"wei": "1"
},
"0000000000000000000000000000000000000003": {
"wei": "1"
},
"0000000000000000000000000000000000000004": {
"wei": "1"
},
"6c386a4b26f73c802f34673f7248bb118f97424a": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
},
"dbdbdb2cbd23b783741e8d7fcf51e459b497e4a6": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
},
"cd2a3d9f938e13cd947ec05abc7fe734df8dd826": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
},
"2ef47100e0787b915105fd5e3f4ff6752079d5cb": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
},
"e6716f9544a56c530d868e4bfbacb172315bdead": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
},
"0000000000000000000000000000000000000001": {
"wei": "1"
},
"1a26338f0d905e295fccb71fa9ea849ffa12aaf4": {
"wei": "1606938044258990275541962092341162602522202993782792835301376"
}
},
"result": "f901faf901f5a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a09178d0f23c965d81f0834a4c72c6253ce6830f4022b1359aaebfc1ecba442d4ea056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000085040000000080832fefd8808080a00000000000000000000000000000000000000000000000000000000000000000880000000000000042c0c0"
},
"testempty": {
"nonce": "0x0000000000000042",
"difficulty": "17179869184",
"alloc": {},
"result": "f901faf901f5a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000085040000000080832fefd8808080a00000000000000000000000000000000000000000000000000000000000000000880000000000000042c0c0"
}
}
{ {
"listsoflists2": { "listsoflists2": {
"in": [ [], [[]], [ [], [[]] ] ], "in": "VALID",
"out": "c7c0c1c0c3c0c1c0" "out": "c7c0c1c0c3c0c1c0"
}, },
} }
...@@ -7,5 +7,5 @@ ...@@ -7,5 +7,5 @@
"int32Overflow2": { "int32Overflow2": {
"in": "INVALID", "in": "INVALID",
"out": "ff0f000000000000021111" "out": "ff0f000000000000021111"
}, }
} }
{
"emptystring": {
"in": "",
"out": "80"
},
"shortstring": {
"in": "dog",
"out": "83646f67"
},
"shortstring2": {
"in": "Lorem ipsum dolor sit amet, consectetur adipisicing eli",
"out": "b74c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c69"
},
"longstring": {
"in": "Lorem ipsum dolor sit amet, consectetur adipisicing elit",
"out": "b8384c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c6974"
},
"longstring2": {
"in": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mauris magna, suscipit sed vehicula non, iaculis faucibus tortor. Proin suscipit ultricies malesuada. Duis tortor elit, dictum quis tristique eu, ultrices at risus. Morbi a est imperdiet mi ullamcorper aliquet suscipit nec lorem. Aenean quis leo mollis, vulputate elit varius, consequat enim. Nulla ultrices turpis justo, et posuere urna consectetur nec. Proin non convallis metus. Donec tempor ipsum in mauris congue sollicitudin. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse convallis sem vel massa faucibus, eget lacinia lacus tempor. Nulla quis ultricies purus. Proin auctor rhoncus nibh condimentum mollis. Aliquam consequat enim at metus luctus, a eleifend purus egestas. Curabitur at nibh metus. Nam bibendum, neque at auctor tristique, lorem libero aliquet arcu, non interdum tellus lectus sit amet eros. Cras rhoncus, metus ac ornare cursus, dolor justo ultrices metus, at ullamcorper volutpat",
"out": "b904004c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742e20437572616269747572206d6175726973206d61676e612c20737573636970697420736564207665686963756c61206e6f6e2c20696163756c697320666175636962757320746f72746f722e2050726f696e20737573636970697420756c74726963696573206d616c6573756164612e204475697320746f72746f7220656c69742c2064696374756d2071756973207472697374697175652065752c20756c7472696365732061742072697375732e204d6f72626920612065737420696d70657264696574206d6920756c6c616d636f7270657220616c6971756574207375736369706974206e6563206c6f72656d2e2041656e65616e2071756973206c656f206d6f6c6c69732c2076756c70757461746520656c6974207661726975732c20636f6e73657175617420656e696d2e204e756c6c6120756c74726963657320747572706973206a7573746f2c20657420706f73756572652075726e6120636f6e7365637465747572206e65632e2050726f696e206e6f6e20636f6e76616c6c6973206d657475732e20446f6e65632074656d706f7220697073756d20696e206d617572697320636f6e67756520736f6c6c696369747564696e2e20566573746962756c756d20616e746520697073756d207072696d697320696e206661756369627573206f726369206c756374757320657420756c74726963657320706f737565726520637562696c69612043757261653b2053757370656e646973736520636f6e76616c6c69732073656d2076656c206d617373612066617563696275732c2065676574206c6163696e6961206c616375732074656d706f722e204e756c6c61207175697320756c747269636965732070757275732e2050726f696e20617563746f722072686f6e637573206e69626820636f6e64696d656e74756d206d6f6c6c69732e20416c697175616d20636f6e73657175617420656e696d206174206d65747573206c75637475732c206120656c656966656e6420707572757320656765737461732e20437572616269747572206174206e696268206d657475732e204e616d20626962656e64756d2c206e6571756520617420617563746f72207472697374697175652c206c6f72656d206c696265726f20616c697175657420617263752c206e6f6e20696e74657264756d2074656c6c7573206c65637475732073697420616d65742065726f732e20437261732072686f6e6375732c206d65747573206163206f726e617265206375727375732c20646f6c6f72206a7573746f20756c747269636573206d657475732c20617420756c6c616d636f7270657220766f6c7574706174"
},
"zero": {
"in": 0,
"out": "80"
},
"smallint": {
"in": 1,
"out": "01"
},
"smallint2": {
"in": 16,
"out": "10"
},
"smallint3": {
"in": 79,
"out": "4f"
},
"smallint4": {
"in": 127,
"out": "7f"
},
"mediumint1": {
"in": 128,
"out": "8180"
},
"mediumint2": {
"in": 1000,
"out": "8203e8"
},
"mediumint3": {
"in": 100000,
"out": "830186a0"
},
"mediumint4": {
"in": "#83729609699884896815286331701780722",
"out": "8F102030405060708090A0B0C0D0E0F2"
},
"mediumint5": {
"in": "#105315505618206987246253880190783558935785933862974822347068935681",
"out": "9C0100020003000400050006000700080009000A000B000C000D000E01"
},
"emptylist": {
"in": [],
"out": "c0"
},
"stringlist": {
"in": [ "dog", "god", "cat" ],
"out": "cc83646f6783676f6483636174"
},
"multilist": {
"in": [ "zw", [ 4 ], 1 ],
"out": "c6827a77c10401"
},
"shortListMax1": {
"in": [ "asdf", "qwer", "zxcv", "asdf","qwer", "zxcv", "asdf", "qwer", "zxcv", "asdf", "qwer"],
"out": "F784617364668471776572847a78637684617364668471776572847a78637684617364668471776572847a78637684617364668471776572"
},
"longList1" : {
"in" : [
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"]
],
"out": "F840CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376"
},
"longList2" : {
"in" : [
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"],
["asdf","qwer","zxcv"]
],
"out": "F90200CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376CF84617364668471776572847a786376"
},
"listsoflists": {
"in": [ [ [], [] ], [] ],
"out": "c4c2c0c0c0"
},
"listsoflists2": {
"in": [ [], [[]], [ [], [[]] ] ],
"out": "c7c0c1c0c3c0c1c0"
},
"dictTest1" : {
"in" : [
["key1", "val1"],
["key2", "val2"],
["key3", "val3"],
["key4", "val4"]
],
"out" : "ECCA846b6579318476616c31CA846b6579328476616c32CA846b6579338476616c33CA846b6579348476616c34"
},
"bigint": {
"in": "#115792089237316195423570985008687907853269984665640564039457584007913129639936",
"out": "a1010000000000000000000000000000000000000000000000000000000000000000"
}
}
{
"randomStatetest" : {
"env" : {
"currentCoinbase" : "b0085a57673c8f7d78fb870418f622e42fd686e4",
"currentDifficulty" : "0x4f4e83f92fe81c08",
"currentGasLimit" : "0x5c1948c7",
"currentNumber" : "0x1010db29",
"currentTimestamp" : "0x84d8d598bc8dae70",
"previousHash" : "b93e460c74488b6f2f57690e5fa535c88ad8db30408cad2d66e104795e8ac02e"
},
"logs" : [
],
"out" : "0x",
"post" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x03255f9a1b72d9ee",
"code" : "0x621da82575e942e4fd977abdb407069cf700116e02b4f9b25d866b6d13163fff2b8ef03cf8ab5d662afb7bb5c9e68462741090bc0976c9705b40411efe39e80c20b572c5e3d75f788f9be2f0981672b8de37f9e2d1515046cb77cc3ee74646fb096eadce98908499b6fd54725f3c6a725968761ba50494d1ecaf1e787db9a052952427c4f271c28d3e25728b2b76439a3166cd0ed37f30ec2421ed38ebd3b00b89ba9208391dc274e4eefa69161a37dfff7111756dd7971065f05aa9de4867609e7d847a290d0eeb08cde2ff294ae11dd16f8a3e32494d943fa0622cc04cd7476b6d2a1008e4ad1e2c33e2928e707c797f2a1a586bbf78658189bf58172ff77130be2ffc9bbf7f171939be260b30eb65b46a6cf107be1c9ed5c92c99d69fe0559389600e6013601c60096016601260016001600c6017016d200351654b9773409608aaa7db1f67b518d025727bdc6e0463b2bc334b658536d84dadc47a2288da62c36b9a35bf8934e3781a4c44e91637ce5c6b2f916d76706529d728b6f5ee076013601e601960086005601c6013601d96423568ce21a850c04a77ceb9",
"nonce" : "0x59",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2401ac5958344e85",
"code" : "0x",
"nonce" : "0x35",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x71e90493a9a98bcc",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
},
"b0085a57673c8f7d78fb870418f622e42fd686e4" : {
"balance" : "0x544ba0",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"postStateRoot" : "f62ef5d0c1e98204d9e8fb34174186d9491411d3641588097e9eb037429d4efb",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x03255f99de856501",
"code" : "0x621da82575e942e4fd977abdb407069cf700116e02b4f9b25d866b6d13163fff2b8ef03cf8ab5d662afb7bb5c9e68462741090bc0976c9705b40411efe39e80c20b572c5e3d75f788f9be2f0981672b8de37f9e2d1515046cb77cc3ee74646fb096eadce98908499b6fd54725f3c6a725968761ba50494d1ecaf1e787db9a052952427c4f271c28d3e25728b2b76439a3166cd0ed37f30ec2421ed38ebd3b00b89ba9208391dc274e4eefa69161a37dfff7111756dd7971065f05aa9de4867609e7d847a290d0eeb08cde2ff294ae11dd16f8a3e32494d943fa0622cc04cd7476b6d2a1008e4ad1e2c33e2928e707c797f2a1a586bbf78658189bf58172ff77130be2ffc9bbf7f171939be260b30eb65b46a6cf107be1c9ed5c92c99d69fe0559389600e6013601c60096016601260016001600c6017016d200351654b9773409608aaa7db1f67b518d025727bdc6e0463b2bc334b658536d84dadc47a2288da62c36b9a35bf8934e3781a4c44e91637ce5c6b2f916d76706529d728b6f5ee076013601e601960086005601c6013601d96423568ce21a850c04a77ceb9",
"nonce" : "0x59",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0x2401ac5958344e85",
"code" : "0x",
"nonce" : "0x35",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x71e90493e6eb4c59",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x166e31b12700cdefa7a0591398d415023175d1e5a1eca036986533972cab6625e976572ee91c150c",
"gasLimit" : "0x189cbf1c",
"gasPrice" : "0xe8",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x3ced74ed"
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"BadStateRootTx" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x02b8feb0",
"currentGasLimit" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"1baf27b88c48dd02b744999cf3522766929d2b2a" : {
"balance" : "0x03e8",
"code" : "0x600073a94f5374fce5edbc8e2a8697c15331677e6ebf0b3314156023573540602035145b15602e576040356000555b",
"nonce" : "0x00",
"storage" : {
}
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "0x5c55",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x1e282b",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "f8705795c59bf2298bf493132c473a02b63e64ee8d7d5661c7bc32fc18965cdf",
"pre" : {
"1baf27b88c48dd02b744999cf3522766929d2b2a" : {
"balance" : "0x03e8",
"code" : "0x600073a94f5374fce5edbc8e2a8697c15331677e6ebf0b3314156023573540602035145b15602e576040356000555b",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x1e8480",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "0x00000000000000000000000000000000000000000000000000000000000bc03712fac13c68425054e372b0861af05648614d69d32800fba9ad4522238d4b937a0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit" : "0x030d40",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "1baf27b88c48dd02b744999cf3522766929d2b2a",
"value" : "0x00"
}
},
"JUMPDEST_Attack" : { "JUMPDEST_Attack" : {
"env" : { "env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
......
...@@ -18435,6 +18435,54 @@ ...@@ -18435,6 +18435,54 @@
"value" : "0x0186a0" "value" : "0x0186a0"
} }
}, },
"suicideCoinbase" : {
"env" : {
"currentCoinbase" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x989680",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"logs" : [
],
"out" : "0x",
"post" : {
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x1bc16d674ec7d6fa",
"code" : "0x",
"nonce" : "0x01",
"storage" : {
}
}
},
"postStateRoot" : "d250e0dc5c48a99a23e6a7fbca13303df995c2f8a049aef6fc3afa0e34df4ed4",
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x73a94f5374fce5edbc8e2a8697c15331677e6ebf0bff",
"nonce" : "0x00",
"storage" : {
}
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x",
"nonce" : "0x00",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "0x0f4240",
"gasPrice" : "0x01",
"nonce" : "0x00",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "0x0186a0"
}
},
"suicideNotExistingAccount" : { "suicideNotExistingAccount" : {
"env" : { "env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
...@@ -37,11 +37,6 @@ var ( ...@@ -37,11 +37,6 @@ var (
vmTestDir = filepath.Join(baseDir, "VMTests") vmTestDir = filepath.Join(baseDir, "VMTests")
BlockSkipTests = []string{ BlockSkipTests = []string{
// Fails in InsertPreState with: computed state root does not
// match genesis block bba25a96 0d8f85c8 Christoph said it will be
// fixed eventually
"SimpleTx3",
// These tests are not valid, as they are out of scope for RLP and // These tests are not valid, as they are out of scope for RLP and
// the consensus protocol. // the consensus protocol.
"BLOCK__RandomByteAtTheEnd", "BLOCK__RandomByteAtTheEnd",
...@@ -50,7 +45,7 @@ var ( ...@@ -50,7 +45,7 @@ var (
"TRANSCT__ZeroByteAtTheEnd", "TRANSCT__ZeroByteAtTheEnd",
} }
/* Go does not support transaction (account) nonces above 2^64. This /* Go client does not support transaction (account) nonces above 2^64. This
technically breaks consensus but is regarded as "reasonable technically breaks consensus but is regarded as "reasonable
engineering constraint" as accounts cannot easily reach such high engineering constraint" as accounts cannot easily reach such high
nonce values in practice nonce values in practice
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment