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
66c0c4e5
Unverified
Commit
66c0c4e5
authored
Apr 26, 2023
by
Péter Szilágyi
Committed by
GitHub
Apr 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd, eth, les: replace Shanghai override flag with Cancun (#27171)
parent
306d1774
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
21 deletions
+21
-21
config.go
cmd/geth/config.go
+3
-3
main.go
cmd/geth/main.go
+1
-1
flags.go
cmd/utils/flags.go
+3
-3
genesis.go
core/genesis.go
+3
-3
backend.go
eth/backend.go
+2
-2
config.go
eth/ethconfig/config.go
+2
-2
gen_config.go
eth/ethconfig/gen_config.go
+5
-5
client.go
les/client.go
+2
-2
No files found.
cmd/geth/config.go
View file @
66c0c4e5
...
...
@@ -158,9 +158,9 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
// makeFullNode loads geth configuration and creates the Ethereum backend.
func
makeFullNode
(
ctx
*
cli
.
Context
)
(
*
node
.
Node
,
ethapi
.
Backend
)
{
stack
,
cfg
:=
makeConfigNode
(
ctx
)
if
ctx
.
IsSet
(
utils
.
Override
Shanghai
.
Name
)
{
v
:=
ctx
.
Uint64
(
utils
.
Override
Shanghai
.
Name
)
cfg
.
Eth
.
Override
Shanghai
=
&
v
if
ctx
.
IsSet
(
utils
.
Override
Cancun
.
Name
)
{
v
:=
ctx
.
Uint64
(
utils
.
Override
Cancun
.
Name
)
cfg
.
Eth
.
Override
Cancun
=
&
v
}
backend
,
eth
:=
utils
.
RegisterEthService
(
stack
,
&
cfg
.
Eth
)
...
...
cmd/geth/main.go
View file @
66c0c4e5
...
...
@@ -64,7 +64,7 @@ var (
utils
.
NoUSBFlag
,
utils
.
USBFlag
,
utils
.
SmartCardDaemonPathFlag
,
utils
.
Override
Shanghai
,
utils
.
Override
Cancun
,
utils
.
EnablePersonal
,
utils
.
EthashCacheDirFlag
,
utils
.
EthashCachesInMemoryFlag
,
...
...
cmd/utils/flags.go
View file @
66c0c4e5
...
...
@@ -268,9 +268,9 @@ var (
Value
:
2048
,
Category
:
flags
.
EthCategory
,
}
Override
Shanghai
=
&
cli
.
Uint64Flag
{
Name
:
"override.
shanghai
"
,
Usage
:
"Manually specify the
Shanghai
fork timestamp, overriding the bundled setting"
,
Override
Cancun
=
&
cli
.
Uint64Flag
{
Name
:
"override.
cancun
"
,
Usage
:
"Manually specify the
Cancun
fork timestamp, overriding the bundled setting"
,
Category
:
flags
.
EthCategory
,
}
// Light server and client settings
...
...
core/genesis.go
View file @
66c0c4e5
...
...
@@ -267,7 +267,7 @@ func (e *GenesisMismatchError) Error() string {
// ChainOverrides contains the changes to chain config.
type
ChainOverrides
struct
{
Override
Shanghai
*
uint64
Override
Cancun
*
uint64
}
// SetupGenesisBlock writes or updates the genesis block in db.
...
...
@@ -293,8 +293,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
}
applyOverrides
:=
func
(
config
*
params
.
ChainConfig
)
{
if
config
!=
nil
{
if
overrides
!=
nil
&&
overrides
.
Override
Shanghai
!=
nil
{
config
.
ShanghaiTime
=
overrides
.
OverrideShanghai
if
overrides
!=
nil
&&
overrides
.
Override
Cancun
!=
nil
{
config
.
CancunTime
=
overrides
.
OverrideCancun
}
}
}
...
...
eth/backend.go
View file @
66c0c4e5
...
...
@@ -194,8 +194,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
)
// Override the chain config with provided settings.
var
overrides
core
.
ChainOverrides
if
config
.
Override
Shanghai
!=
nil
{
overrides
.
Override
Shanghai
=
config
.
OverrideShanghai
if
config
.
Override
Cancun
!=
nil
{
overrides
.
Override
Cancun
=
config
.
OverrideCancun
}
eth
.
blockchain
,
err
=
core
.
NewBlockChain
(
chainDb
,
cacheConfig
,
config
.
Genesis
,
&
overrides
,
eth
.
engine
,
vmConfig
,
eth
.
shouldPreserve
,
&
config
.
TxLookupLimit
)
if
err
!=
nil
{
...
...
eth/ethconfig/config.go
View file @
66c0c4e5
...
...
@@ -198,8 +198,8 @@ type Config struct {
// send-transaction variants. The unit is ether.
RPCTxFeeCap
float64
// Override
Shanghai
(TODO: remove after the fork)
Override
Shanghai
*
uint64
`toml:",omitempty"`
// Override
Cancun
(TODO: remove after the fork)
Override
Cancun
*
uint64
`toml:",omitempty"`
}
// CreateConsensusEngine creates a consensus engine for the given chain configuration.
...
...
eth/ethconfig/gen_config.go
View file @
66c0c4e5
...
...
@@ -56,7 +56,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
RPCGasCap
uint64
RPCEVMTimeout
time
.
Duration
RPCTxFeeCap
float64
Override
Shanghai
*
uint64
`toml:",omitempty"`
Override
Cancun
*
uint64
`toml:",omitempty"`
}
var
enc
Config
enc
.
Genesis
=
c
.
Genesis
...
...
@@ -98,7 +98,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc
.
RPCGasCap
=
c
.
RPCGasCap
enc
.
RPCEVMTimeout
=
c
.
RPCEVMTimeout
enc
.
RPCTxFeeCap
=
c
.
RPCTxFeeCap
enc
.
Override
Shanghai
=
c
.
OverrideShanghai
enc
.
Override
Cancun
=
c
.
OverrideCancun
return
&
enc
,
nil
}
...
...
@@ -144,7 +144,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
RPCGasCap
*
uint64
RPCEVMTimeout
*
time
.
Duration
RPCTxFeeCap
*
float64
Override
Shanghai
*
uint64
`toml:",omitempty"`
Override
Cancun
*
uint64
`toml:",omitempty"`
}
var
dec
Config
if
err
:=
unmarshal
(
&
dec
);
err
!=
nil
{
...
...
@@ -267,8 +267,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if
dec
.
RPCTxFeeCap
!=
nil
{
c
.
RPCTxFeeCap
=
*
dec
.
RPCTxFeeCap
}
if
dec
.
Override
Shanghai
!=
nil
{
c
.
Override
Shanghai
=
dec
.
OverrideShanghai
if
dec
.
Override
Cancun
!=
nil
{
c
.
Override
Cancun
=
dec
.
OverrideCancun
}
return
nil
}
les/client.go
View file @
66c0c4e5
...
...
@@ -94,8 +94,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*LightEthereum, error) {
return
nil
,
err
}
var
overrides
core
.
ChainOverrides
if
config
.
Override
Shanghai
!=
nil
{
overrides
.
Override
Shanghai
=
config
.
OverrideShanghai
if
config
.
Override
Cancun
!=
nil
{
overrides
.
Override
Cancun
=
config
.
OverrideCancun
}
chainConfig
,
genesisHash
,
genesisErr
:=
core
.
SetupGenesisBlockWithOverride
(
chainDb
,
trie
.
NewDatabase
(
chainDb
),
config
.
Genesis
,
&
overrides
)
if
_
,
isCompat
:=
genesisErr
.
(
*
params
.
ConfigCompatError
);
genesisErr
!=
nil
&&
!
isCompat
{
...
...
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