Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimized changes for the merge #23761

Merged
merged 33 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
38eb641
all: work for eth1/2 transtition
rjl493456442 Jul 19, 2021
ed1c9ce
consensus/beacon, eth: change beacon difficulty to 0
rjl493456442 Jul 26, 2021
e234c25
eth: updates
rjl493456442 Jul 30, 2021
e3a3374
all: add terminalBlockDifficulty config, fix rebasing issues
rjl493456442 Jul 30, 2021
da9c5a4
eth: implemented merge interop spec
MariusVanDerWijden Sep 20, 2021
1037258
internal/ethapi: update to v1.0.0.alpha.2
MariusVanDerWijden Oct 1, 2021
6418972
all: sync polishes, other fixes + refactors
karalabe Oct 4, 2021
7727d0e
core, eth: correct semantics for LeavePoW, EnterPoS
MariusVanDerWijden Oct 20, 2021
0bc0bb2
core: fixed rebasing artifacts
MariusVanDerWijden Nov 2, 2021
16be60f
core: light: performance improvements
MariusVanDerWijden Nov 2, 2021
54c752a
core: use keyed field (f)
MariusVanDerWijden Nov 3, 2021
f7ce07b
Merge branch 'master' into test-branch
MariusVanDerWijden Nov 8, 2021
6963517
core: eth: fix compilation issues + tests
MariusVanDerWijden Nov 8, 2021
c0216eb
eth/catalyst: dbetter error codes
MariusVanDerWijden Nov 9, 2021
92fdcc4
all: move Merger to consensus/, remove reliance on it in bc
MariusVanDerWijden Nov 11, 2021
148f1fd
all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
MariusVanDerWijden Nov 11, 2021
c9a852d
core: make mergelogs a function
MariusVanDerWijden Nov 11, 2021
7f54690
core: use InsertChain instead of InsertBlock
MariusVanDerWijden Nov 11, 2021
e8ce790
les: drop merger from lightchain object
MariusVanDerWijden Nov 11, 2021
9304474
consensus: add merger
MariusVanDerWijden Nov 11, 2021
6ccb36c
core: recoverAncestors in catalyst mode
MariusVanDerWijden Nov 15, 2021
5b1c3cc
core: fix nitpick
MariusVanDerWijden Nov 15, 2021
75bc816
all: removed merger from beacon, use TTD, nitpicks
MariusVanDerWijden Nov 16, 2021
fe45669
consensus: eth: add docstring, removed unnecessary code duplication
MariusVanDerWijden Nov 16, 2021
9b78e1e
consensus/beacon: better comment
MariusVanDerWijden Nov 16, 2021
153d85f
all: easy to fix nitpicks by karalabe
MariusVanDerWijden Nov 17, 2021
87686a1
consensus/beacon: verify known headers to be sure
MariusVanDerWijden Nov 17, 2021
082d6a8
core: comments
MariusVanDerWijden Nov 17, 2021
3440375
core: eth: don't drop peers who advertise blocks, nitpicks
MariusVanDerWijden Nov 19, 2021
d4212be
core: never add beacon blocks to the future queue
MariusVanDerWijden Nov 19, 2021
237fadc
core: fixed nitpicks
MariusVanDerWijden Nov 22, 2021
1a92d4a
consensus/beacon: simplify IsTTDReached check
MariusVanDerWijden Nov 23, 2021
dd22e9a
consensus/beacon: correct IsTTDReached check
MariusVanDerWijden Nov 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/ethereum/go-ethereum/accounts/scwallet"
"github.com/ethereum/go-ethereum/accounts/usbwallet"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/eth/catalyst"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -159,17 +158,10 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
if ctx.GlobalIsSet(utils.OverrideArrowGlacierFlag.Name) {
cfg.Eth.OverrideArrowGlacier = new(big.Int).SetUint64(ctx.GlobalUint64(utils.OverrideArrowGlacierFlag.Name))
}
backend, eth := utils.RegisterEthService(stack, &cfg.Eth)

// Configure catalyst.
if ctx.GlobalBool(utils.CatalystFlag.Name) {
if eth == nil {
utils.Fatalf("Catalyst does not work in light client mode.")
}
if err := catalyst.Register(stack, eth); err != nil {
utils.Fatalf("%v", err)
}
if ctx.GlobalIsSet(utils.OverrideTerminalTotalDifficulty.Name) {
cfg.Eth.Genesis.Config.TerminalTotalDifficulty = new(big.Int).SetUint64(ctx.GlobalUint64(utils.OverrideTerminalTotalDifficulty.Name))
}
backend, _ := utils.RegisterEthService(stack, &cfg.Eth, ctx.GlobalBool(utils.CatalystFlag.Name))

// Configure GraphQL if requested
if ctx.GlobalIsSet(utils.GraphQLEnabledFlag.Name) {
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var (
utils.USBFlag,
utils.SmartCardDaemonPathFlag,
utils.OverrideArrowGlacierFlag,
utils.OverrideTerminalTotalDifficulty,
utils.EthashCacheDirFlag,
utils.EthashCachesInMemoryFlag,
utils.EthashCachesOnDiskFlag,
Expand Down
19 changes: 17 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import (
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/catalyst"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/eth/gasprice"
Expand Down Expand Up @@ -243,6 +244,10 @@ var (
Name: "override.arrowglacier",
Usage: "Manually specify Arrow Glacier fork-block, overriding the bundled setting",
}
OverrideTerminalTotalDifficulty = cli.Uint64Flag{
Name: "override.terminaltotaldifficulty",
Usage: "Manually specify TerminalTotalDifficulty, overriding the bundled setting",
}
// Light server and client settings
LightServeFlag = cli.IntFlag{
Name: "light.serve",
Expand Down Expand Up @@ -1191,7 +1196,7 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
cfg.NetRestrict = list
}

if ctx.GlobalBool(DeveloperFlag.Name) || ctx.GlobalBool(CatalystFlag.Name) {
if ctx.GlobalBool(DeveloperFlag.Name) {
// --dev mode can't use p2p networking.
cfg.MaxPeers = 0
cfg.ListenAddr = ""
Expand Down Expand Up @@ -1700,13 +1705,18 @@ func SetDNSDiscoveryDefaults(cfg *ethconfig.Config, genesis common.Hash) {
// RegisterEthService adds an Ethereum client to the stack.
// The second return value is the full node instance, which may be nil if the
// node is running as a light client.
func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (ethapi.Backend, *eth.Ethereum) {
func RegisterEthService(stack *node.Node, cfg *ethconfig.Config, isCatalyst bool) (ethapi.Backend, *eth.Ethereum) {
if cfg.SyncMode == downloader.LightSync {
backend, err := les.New(stack, cfg)
if err != nil {
Fatalf("Failed to register the Ethereum service: %v", err)
}
stack.RegisterAPIs(tracers.APIs(backend.ApiBackend))
if isCatalyst {
if err := catalyst.RegisterLight(stack, backend); err != nil {
Fatalf("Failed to register the catalyst service: %v", err)
}
}
return backend.ApiBackend, nil
}
backend, err := eth.New(stack, cfg)
Expand All @@ -1719,6 +1729,11 @@ func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (ethapi.Backend
Fatalf("Failed to create the LES server: %v", err)
}
}
if isCatalyst {
if err := catalyst.Register(stack, backend); err != nil {
Fatalf("Failed to register the catalyst service: %v", err)
}
}
stack.RegisterAPIs(tracers.APIs(backend.APIBackend))
return backend.APIBackend, backend
}
Expand Down
Loading