Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
701d60c8
Unverified
Commit
701d60c8
authored
Sep 14, 2017
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
params: enable Byzantium on Ropsten/tests, fix failures
parent
9be07de5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
18 deletions
+26
-18
blockchain_test.go
core/blockchain_test.go
+1
-1
dao_test.go
core/dao_test.go
+22
-14
config.go
params/config.go
+3
-3
No files found.
core/blockchain_test.go
View file @
701d60c8
...
@@ -928,7 +928,7 @@ func TestReorgSideEvent(t *testing.T) {
...
@@ -928,7 +928,7 @@ func TestReorgSideEvent(t *testing.T) {
replacementBlocks
,
_
:=
GenerateChain
(
gspec
.
Config
,
genesis
,
db
,
4
,
func
(
i
int
,
gen
*
BlockGen
)
{
replacementBlocks
,
_
:=
GenerateChain
(
gspec
.
Config
,
genesis
,
db
,
4
,
func
(
i
int
,
gen
*
BlockGen
)
{
tx
,
err
:=
types
.
SignTx
(
types
.
NewContractCreation
(
gen
.
TxNonce
(
addr1
),
new
(
big
.
Int
),
big
.
NewInt
(
1000000
),
new
(
big
.
Int
),
nil
),
signer
,
key1
)
tx
,
err
:=
types
.
SignTx
(
types
.
NewContractCreation
(
gen
.
TxNonce
(
addr1
),
new
(
big
.
Int
),
big
.
NewInt
(
1000000
),
new
(
big
.
Int
),
nil
),
signer
,
key1
)
if
i
==
2
{
if
i
==
2
{
gen
.
OffsetTime
(
-
1
)
gen
.
OffsetTime
(
-
9
)
}
}
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"failed to create tx: %v"
,
err
)
t
.
Fatalf
(
"failed to create tx: %v"
,
err
)
...
...
core/dao_test.go
View file @
701d60c8
...
@@ -40,14 +40,22 @@ func TestDAOForkRangeExtradata(t *testing.T) {
...
@@ -40,14 +40,22 @@ func TestDAOForkRangeExtradata(t *testing.T) {
// Create the concurrent, conflicting two nodes
// Create the concurrent, conflicting two nodes
proDb
,
_
:=
ethdb
.
NewMemDatabase
()
proDb
,
_
:=
ethdb
.
NewMemDatabase
()
gspec
.
MustCommit
(
proDb
)
gspec
.
MustCommit
(
proDb
)
proConf
:=
&
params
.
ChainConfig
{
HomesteadBlock
:
big
.
NewInt
(
0
),
DAOForkBlock
:
forkBlock
,
DAOForkSupport
:
true
}
proBc
,
_
:=
NewBlockChain
(
proDb
,
proConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
proConf
:=
*
params
.
TestChainConfig
proConf
.
DAOForkBlock
=
forkBlock
proConf
.
DAOForkSupport
=
true
proBc
,
_
:=
NewBlockChain
(
proDb
,
&
proConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
defer
proBc
.
Stop
()
defer
proBc
.
Stop
()
conDb
,
_
:=
ethdb
.
NewMemDatabase
()
conDb
,
_
:=
ethdb
.
NewMemDatabase
()
gspec
.
MustCommit
(
conDb
)
gspec
.
MustCommit
(
conDb
)
conConf
:=
&
params
.
ChainConfig
{
HomesteadBlock
:
big
.
NewInt
(
0
),
DAOForkBlock
:
forkBlock
,
DAOForkSupport
:
false
}
conBc
,
_
:=
NewBlockChain
(
conDb
,
conConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
conConf
:=
*
params
.
TestChainConfig
conConf
.
DAOForkBlock
=
forkBlock
conConf
.
DAOForkSupport
=
false
conBc
,
_
:=
NewBlockChain
(
conDb
,
&
conConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
defer
conBc
.
Stop
()
defer
conBc
.
Stop
()
if
_
,
err
:=
proBc
.
InsertChain
(
prefix
);
err
!=
nil
{
if
_
,
err
:=
proBc
.
InsertChain
(
prefix
);
err
!=
nil
{
...
@@ -61,7 +69,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
...
@@ -61,7 +69,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
// Create a pro-fork block, and try to feed into the no-fork chain
// Create a pro-fork block, and try to feed into the no-fork chain
db
,
_
=
ethdb
.
NewMemDatabase
()
db
,
_
=
ethdb
.
NewMemDatabase
()
gspec
.
MustCommit
(
db
)
gspec
.
MustCommit
(
db
)
bc
,
_
:=
NewBlockChain
(
db
,
conConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
bc
,
_
:=
NewBlockChain
(
db
,
&
conConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
defer
bc
.
Stop
()
defer
bc
.
Stop
()
blocks
:=
conBc
.
GetBlocksFromHash
(
conBc
.
CurrentBlock
()
.
Hash
(),
int
(
conBc
.
CurrentBlock
()
.
NumberU64
()))
blocks
:=
conBc
.
GetBlocksFromHash
(
conBc
.
CurrentBlock
()
.
Hash
(),
int
(
conBc
.
CurrentBlock
()
.
NumberU64
()))
...
@@ -71,19 +79,19 @@ func TestDAOForkRangeExtradata(t *testing.T) {
...
@@ -71,19 +79,19 @@ func TestDAOForkRangeExtradata(t *testing.T) {
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"failed to import contra-fork chain for expansion: %v"
,
err
)
t
.
Fatalf
(
"failed to import contra-fork chain for expansion: %v"
,
err
)
}
}
blocks
,
_
=
GenerateChain
(
proConf
,
conBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
blocks
,
_
=
GenerateChain
(
&
proConf
,
conBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
if
_
,
err
:=
conBc
.
InsertChain
(
blocks
);
err
==
nil
{
if
_
,
err
:=
conBc
.
InsertChain
(
blocks
);
err
==
nil
{
t
.
Fatalf
(
"contra-fork chain accepted pro-fork block: %v"
,
blocks
[
0
])
t
.
Fatalf
(
"contra-fork chain accepted pro-fork block: %v"
,
blocks
[
0
])
}
}
// Create a proper no-fork block for the contra-forker
// Create a proper no-fork block for the contra-forker
blocks
,
_
=
GenerateChain
(
conConf
,
conBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
blocks
,
_
=
GenerateChain
(
&
conConf
,
conBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
if
_
,
err
:=
conBc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
conBc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"contra-fork chain didn't accepted no-fork block: %v"
,
err
)
t
.
Fatalf
(
"contra-fork chain didn't accepted no-fork block: %v"
,
err
)
}
}
// Create a no-fork block, and try to feed into the pro-fork chain
// Create a no-fork block, and try to feed into the pro-fork chain
db
,
_
=
ethdb
.
NewMemDatabase
()
db
,
_
=
ethdb
.
NewMemDatabase
()
gspec
.
MustCommit
(
db
)
gspec
.
MustCommit
(
db
)
bc
,
_
=
NewBlockChain
(
db
,
proConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
bc
,
_
=
NewBlockChain
(
db
,
&
proConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
defer
bc
.
Stop
()
defer
bc
.
Stop
()
blocks
=
proBc
.
GetBlocksFromHash
(
proBc
.
CurrentBlock
()
.
Hash
(),
int
(
proBc
.
CurrentBlock
()
.
NumberU64
()))
blocks
=
proBc
.
GetBlocksFromHash
(
proBc
.
CurrentBlock
()
.
Hash
(),
int
(
proBc
.
CurrentBlock
()
.
NumberU64
()))
...
@@ -93,12 +101,12 @@ func TestDAOForkRangeExtradata(t *testing.T) {
...
@@ -93,12 +101,12 @@ func TestDAOForkRangeExtradata(t *testing.T) {
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"failed to import pro-fork chain for expansion: %v"
,
err
)
t
.
Fatalf
(
"failed to import pro-fork chain for expansion: %v"
,
err
)
}
}
blocks
,
_
=
GenerateChain
(
conConf
,
proBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
blocks
,
_
=
GenerateChain
(
&
conConf
,
proBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
if
_
,
err
:=
proBc
.
InsertChain
(
blocks
);
err
==
nil
{
if
_
,
err
:=
proBc
.
InsertChain
(
blocks
);
err
==
nil
{
t
.
Fatalf
(
"pro-fork chain accepted contra-fork block: %v"
,
blocks
[
0
])
t
.
Fatalf
(
"pro-fork chain accepted contra-fork block: %v"
,
blocks
[
0
])
}
}
// Create a proper pro-fork block for the pro-forker
// Create a proper pro-fork block for the pro-forker
blocks
,
_
=
GenerateChain
(
proConf
,
proBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
blocks
,
_
=
GenerateChain
(
&
proConf
,
proBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
if
_
,
err
:=
proBc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
proBc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"pro-fork chain didn't accepted pro-fork block: %v"
,
err
)
t
.
Fatalf
(
"pro-fork chain didn't accepted pro-fork block: %v"
,
err
)
}
}
...
@@ -106,7 +114,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
...
@@ -106,7 +114,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
// Verify that contra-forkers accept pro-fork extra-datas after forking finishes
// Verify that contra-forkers accept pro-fork extra-datas after forking finishes
db
,
_
=
ethdb
.
NewMemDatabase
()
db
,
_
=
ethdb
.
NewMemDatabase
()
gspec
.
MustCommit
(
db
)
gspec
.
MustCommit
(
db
)
bc
,
_
:=
NewBlockChain
(
db
,
conConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
bc
,
_
:=
NewBlockChain
(
db
,
&
conConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
defer
bc
.
Stop
()
defer
bc
.
Stop
()
blocks
:=
conBc
.
GetBlocksFromHash
(
conBc
.
CurrentBlock
()
.
Hash
(),
int
(
conBc
.
CurrentBlock
()
.
NumberU64
()))
blocks
:=
conBc
.
GetBlocksFromHash
(
conBc
.
CurrentBlock
()
.
Hash
(),
int
(
conBc
.
CurrentBlock
()
.
NumberU64
()))
...
@@ -116,14 +124,14 @@ func TestDAOForkRangeExtradata(t *testing.T) {
...
@@ -116,14 +124,14 @@ func TestDAOForkRangeExtradata(t *testing.T) {
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"failed to import contra-fork chain for expansion: %v"
,
err
)
t
.
Fatalf
(
"failed to import contra-fork chain for expansion: %v"
,
err
)
}
}
blocks
,
_
=
GenerateChain
(
proConf
,
conBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
blocks
,
_
=
GenerateChain
(
&
proConf
,
conBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
if
_
,
err
:=
conBc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
conBc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"contra-fork chain didn't accept pro-fork block post-fork: %v"
,
err
)
t
.
Fatalf
(
"contra-fork chain didn't accept pro-fork block post-fork: %v"
,
err
)
}
}
// Verify that pro-forkers accept contra-fork extra-datas after forking finishes
// Verify that pro-forkers accept contra-fork extra-datas after forking finishes
db
,
_
=
ethdb
.
NewMemDatabase
()
db
,
_
=
ethdb
.
NewMemDatabase
()
gspec
.
MustCommit
(
db
)
gspec
.
MustCommit
(
db
)
bc
,
_
=
NewBlockChain
(
db
,
proConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
bc
,
_
=
NewBlockChain
(
db
,
&
proConf
,
ethash
.
NewFaker
(),
vm
.
Config
{})
defer
bc
.
Stop
()
defer
bc
.
Stop
()
blocks
=
proBc
.
GetBlocksFromHash
(
proBc
.
CurrentBlock
()
.
Hash
(),
int
(
proBc
.
CurrentBlock
()
.
NumberU64
()))
blocks
=
proBc
.
GetBlocksFromHash
(
proBc
.
CurrentBlock
()
.
Hash
(),
int
(
proBc
.
CurrentBlock
()
.
NumberU64
()))
...
@@ -133,7 +141,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
...
@@ -133,7 +141,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
bc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"failed to import pro-fork chain for expansion: %v"
,
err
)
t
.
Fatalf
(
"failed to import pro-fork chain for expansion: %v"
,
err
)
}
}
blocks
,
_
=
GenerateChain
(
conConf
,
proBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
blocks
,
_
=
GenerateChain
(
&
conConf
,
proBc
.
CurrentBlock
(),
db
,
1
,
func
(
i
int
,
gen
*
BlockGen
)
{})
if
_
,
err
:=
proBc
.
InsertChain
(
blocks
);
err
!=
nil
{
if
_
,
err
:=
proBc
.
InsertChain
(
blocks
);
err
!=
nil
{
t
.
Fatalf
(
"pro-fork chain didn't accept contra-fork block post-fork: %v"
,
err
)
t
.
Fatalf
(
"pro-fork chain didn't accept contra-fork block post-fork: %v"
,
err
)
}
}
...
...
params/config.go
View file @
701d60c8
...
@@ -55,7 +55,7 @@ var (
...
@@ -55,7 +55,7 @@ var (
EIP150Hash
:
common
.
HexToHash
(
"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"
),
EIP150Hash
:
common
.
HexToHash
(
"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"
),
EIP155Block
:
big
.
NewInt
(
10
),
EIP155Block
:
big
.
NewInt
(
10
),
EIP158Block
:
big
.
NewInt
(
10
),
EIP158Block
:
big
.
NewInt
(
10
),
ByzantiumBlock
:
big
.
NewInt
(
math
.
MaxInt64
),
// Don't enable yet
ByzantiumBlock
:
big
.
NewInt
(
1700000
),
Ethash
:
new
(
EthashConfig
),
Ethash
:
new
(
EthashConfig
),
}
}
...
@@ -86,8 +86,8 @@ var (
...
@@ -86,8 +86,8 @@ var (
// means that all fields must be set at all times. This forces
// means that all fields must be set at all times. This forces
// anyone adding flags to the config to also have to set these
// anyone adding flags to the config to also have to set these
// fields.
// fields.
AllProtocolChanges
=
&
ChainConfig
{
big
.
NewInt
(
1337
),
big
.
NewInt
(
0
),
nil
,
false
,
big
.
NewInt
(
0
),
common
.
Hash
{},
big
.
NewInt
(
0
),
big
.
NewInt
(
0
),
big
.
NewInt
(
math
.
MaxInt64
)
/*disabled*/
,
new
(
EthashConfig
),
nil
}
AllProtocolChanges
=
&
ChainConfig
{
big
.
NewInt
(
1337
),
big
.
NewInt
(
0
),
nil
,
false
,
big
.
NewInt
(
0
),
common
.
Hash
{},
big
.
NewInt
(
0
),
big
.
NewInt
(
0
),
big
.
NewInt
(
0
)
,
new
(
EthashConfig
),
nil
}
TestChainConfig
=
&
ChainConfig
{
big
.
NewInt
(
1
),
big
.
NewInt
(
0
),
nil
,
false
,
big
.
NewInt
(
0
),
common
.
Hash
{},
big
.
NewInt
(
0
),
big
.
NewInt
(
0
),
nil
,
new
(
EthashConfig
),
nil
}
TestChainConfig
=
&
ChainConfig
{
big
.
NewInt
(
1
),
big
.
NewInt
(
0
),
nil
,
false
,
big
.
NewInt
(
0
),
common
.
Hash
{},
big
.
NewInt
(
0
),
big
.
NewInt
(
0
),
big
.
NewInt
(
0
)
,
new
(
EthashConfig
),
nil
}
TestRules
=
TestChainConfig
.
Rules
(
new
(
big
.
Int
))
TestRules
=
TestChainConfig
.
Rules
(
new
(
big
.
Int
))
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment