good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
64359c94
Commit
64359c94
authored
Nov 15, 2016
by
Péter Szilágyi
Committed by
Felix Lange
Nov 15, 2016
Browse files
Options
Downloads
Patches
Plain Diff
cmd/utils, mobile, params: set the correct field on testnet EIP 155 (#3272)
parent
5a3853f8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmd/utils/flags.go
+28
-49
28 additions, 49 deletions
cmd/utils/flags.go
mobile/geth.go
+1
-0
1 addition, 0 deletions
mobile/geth.go
mobile/params.go
+4
-1
4 additions, 1 deletion
mobile/params.go
params/config.go
+2
-0
2 additions, 0 deletions
params/config.go
with
35 additions
and
50 deletions
cmd/utils/flags.go
+
28
−
49
View file @
64359c94
...
...
@@ -847,61 +847,40 @@ func MakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *params.ChainCon
(
genesis
.
Hash
()
==
params
.
MainNetGenesisHash
&&
!
ctx
.
GlobalBool
(
TestNetFlag
.
Name
))
||
(
genesis
.
Hash
()
==
params
.
TestNetGenesisHash
&&
ctx
.
GlobalBool
(
TestNetFlag
.
Name
))
// Set any missing chainConfig fields due to them being unset or system upgrade
if
defaults
{
if
config
.
HomesteadBlock
==
nil
{
// Homestead fork
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
config
.
HomesteadBlock
=
params
.
TestNetHomesteadBlock
}
else
{
config
.
HomesteadBlock
=
params
.
MainNetHomesteadBlock
}
}
if
config
.
DAOForkBlock
==
nil
{
// DAO fork
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
config
.
DAOForkBlock
=
params
.
TestNetDAOForkBlock
}
else
{
config
.
DAOForkBlock
=
params
.
MainNetDAOForkBlock
}
config
.
DAOForkSupport
=
true
}
if
config
.
EIP150Block
==
nil
{
// DoS reprice fork
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
config
.
EIP150Block
=
params
.
TestNetHomesteadGasRepriceBlock
}
else
{
config
.
EIP150Block
=
params
.
MainNetHomesteadGasRepriceBlock
}
}
if
config
.
EIP150Hash
==
(
common
.
Hash
{})
{
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
config
.
EIP150Hash
=
params
.
TestNetHomesteadGasRepriceHash
}
else
{
config
.
EIP150Block
=
params
.
MainNetHomesteadGasRepriceBlock
config
.
EIP150Hash
=
params
.
MainNetHomesteadGasRepriceHash
}
}
if
config
.
EIP155Block
==
nil
{
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
config
.
EIP150Block
=
params
.
TestNetSpuriousDragon
}
else
{
config
.
EIP155Block
=
params
.
MainNetSpuriousDragon
}
}
if
config
.
EIP158Block
==
nil
{
// DoS state cleanup fork
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
config
.
EIP155Block
=
params
.
TestNetSpuriousDragon
config
.
EIP158Block
=
params
.
TestNetSpuriousDragon
}
else
{
config
.
EIP158Block
=
params
.
MainNetSpuriousDragon
}
}
if
config
.
ChainId
.
BitLen
()
==
0
{
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
config
.
ChainId
=
params
.
TestNetChainID
}
else
{
config
.
EIP155Block
=
params
.
MainNetSpuriousDragon
config
.
EIP158Block
=
params
.
MainNetSpuriousDragon
config
.
ChainId
=
params
.
MainNetChainID
}
}
config
.
DAOForkSupport
=
true
}
// Force override any existing configs if explicitly requested
switch
{
case
ctx
.
GlobalBool
(
SupportDAOFork
.
Name
)
:
...
...
This diff is collapsed.
Click to expand it.
mobile/geth.go
+
1
−
0
View file @
64359c94
...
...
@@ -130,6 +130,7 @@ func NewNode(datadir string, config *NodeConfig) (*Node, error) {
if
config
.
EthereumEnabled
{
ethConf
:=
&
eth
.
Config
{
ChainConfig
:
&
params
.
ChainConfig
{
ChainId
:
big
.
NewInt
(
config
.
EthereumChainConfig
.
ChainID
),
HomesteadBlock
:
big
.
NewInt
(
config
.
EthereumChainConfig
.
HomesteadBlock
),
DAOForkBlock
:
big
.
NewInt
(
config
.
EthereumChainConfig
.
DAOForkBlock
),
DAOForkSupport
:
config
.
EthereumChainConfig
.
DAOForkSupport
,
...
...
This diff is collapsed.
Click to expand it.
mobile/params.go
+
4
−
1
View file @
64359c94
...
...
@@ -27,6 +27,7 @@ import (
// MainnetChainConfig returns the chain configurations for the main Ethereum network.
func
MainnetChainConfig
()
*
ChainConfig
{
return
&
ChainConfig
{
ChainID
:
params
.
MainNetChainID
.
Int64
(),
HomesteadBlock
:
params
.
MainNetHomesteadBlock
.
Int64
(),
DAOForkBlock
:
params
.
MainNetDAOForkBlock
.
Int64
(),
DAOForkSupport
:
true
,
...
...
@@ -46,9 +47,10 @@ func MainnetGenesis() string {
// TestnetChainConfig returns the chain configurations for the Ethereum test network.
func
TestnetChainConfig
()
*
ChainConfig
{
return
&
ChainConfig
{
ChainID
:
params
.
TestNetChainID
.
Int64
(),
HomesteadBlock
:
params
.
TestNetHomesteadBlock
.
Int64
(),
DAOForkBlock
:
0
,
DAOForkSupport
:
fals
e
,
DAOForkSupport
:
tru
e
,
EIP150Block
:
params
.
TestNetHomesteadGasRepriceBlock
.
Int64
(),
EIP150Hash
:
Hash
{
params
.
TestNetHomesteadGasRepriceHash
},
EIP155Block
:
params
.
TestNetSpuriousDragon
.
Int64
(),
...
...
@@ -63,6 +65,7 @@ func TestnetGenesis() string {
// ChainConfig is the core config which determines the blockchain settings.
type
ChainConfig
struct
{
ChainID
int64
// Chain ID for replay protection
HomesteadBlock
int64
// Homestead switch block
DAOForkBlock
int64
// TheDAO hard-fork switch block
DAOForkSupport
bool
// Whether the nodes supports or opposes the DAO hard-fork
...
...
This diff is collapsed.
Click to expand it.
params/config.go
+
2
−
0
View file @
64359c94
...
...
@@ -24,6 +24,7 @@ import (
// MainnetChainConfig is the chain parameters to run a node on the main network.
var
MainnetChainConfig
=
&
ChainConfig
{
ChainId
:
MainNetChainID
,
HomesteadBlock
:
MainNetHomesteadBlock
,
DAOForkBlock
:
MainNetDAOForkBlock
,
DAOForkSupport
:
true
,
...
...
@@ -35,6 +36,7 @@ var MainnetChainConfig = &ChainConfig{
// TestnetChainConfig is the chain parameters to run a node on the test network.
var
TestnetChainConfig
=
&
ChainConfig
{
ChainId
:
TestNetChainID
,
HomesteadBlock
:
TestNetHomesteadBlock
,
DAOForkBlock
:
TestNetDAOForkBlock
,
DAOForkSupport
:
false
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment