Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d0f5d72
all: work for eth1/2 transtition
rjl493456442 Jul 19, 2021
f682cec
consensus/beacon, eth: change beacon difficulty to 0
rjl493456442 Jul 26, 2021
7647a20
eth: updates
rjl493456442 Jul 30, 2021
9c69610
all: add terminalBlockDifficulty config
rjl493456442 Jul 30, 2021
7dc1182
miner/stress/beacon: fix stress test
rjl493456442 Jul 30, 2021
ec05f08
core: rebased on master
MariusVanDerWijden Sep 20, 2021
30f3db6
eth: implemented merge interop spec
MariusVanDerWijden Sep 20, 2021
f2dc9d2
eth: fix tests, remove unused methods
MariusVanDerWijden Sep 22, 2021
d3069c1
eth: fix stress-test
MariusVanDerWijden Sep 22, 2021
5866bda
eth/catalyst: regenerate api types
MariusVanDerWijden Sep 22, 2021
5b0bccc
eth, core: remove unusued code, fix typos
MariusVanDerWijden Sep 23, 2021
89ccd54
eth: added api for exporting and importing blocks
MariusVanDerWijden Sep 23, 2021
c6c28b0
core: updated stale comment
MariusVanDerWijden Sep 23, 2021
cfa82b1
eth/catalyst: better types, testing, first working protype
MariusVanDerWijden Sep 28, 2021
d363f05
eth/catalyst: added terminal difficulty check
MariusVanDerWijden Sep 28, 2021
8d7c937
eth/catalyst: use custom errors
MariusVanDerWijden Sep 28, 2021
1b563fe
eth/catalyst: renamed api types, better adherence to spec
MariusVanDerWijden Sep 29, 2021
d6b0490
eth/catalyst: fix random in payload, payloadid as hexutil
MariusVanDerWijden Sep 29, 2021
f476231
eth/catalyst: forkChoiceUpdated -> forkchoiceUpdated
MariusVanDerWijden Sep 30, 2021
718c4e1
internal/ethapi: update to v1.0.0.alpha.2
MariusVanDerWijden Oct 1, 2021
3a19008
eth/catalyst: properly set extradata
MariusVanDerWijden Oct 1, 2021
037f5ef
eth/catalyst: fix basefee setting
MariusVanDerWijden Oct 1, 2021
7a9d76b
eth: overhaul downloader to support beacon chain mode
karalabe Jul 5, 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
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type SimulatedBackend struct {
func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.GenesisAlloc, gasLimit uint64) *SimulatedBackend {
genesis := core.Genesis{Config: params.AllEthashProtocolChanges, GasLimit: gasLimit, Alloc: alloc}
genesis.MustCommit(database)
blockchain, _ := core.NewBlockChain(database, nil, genesis.Config, ethash.NewFaker(), vm.Config{}, nil, nil)
blockchain, _ := core.NewBlockChain(database, nil, genesis.Config, ethash.NewFaker(), vm.Config{}, nil, nil, core.NewMerger(database))

backend := &SimulatedBackend{
database: database,
Expand Down
13 changes: 1 addition & 12 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,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
if ctx.GlobalIsSet(utils.OverrideLondonFlag.Name) {
cfg.Eth.OverrideLondon = new(big.Int).SetUint64(ctx.GlobalUint64(utils.OverrideLondonFlag.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)
}
}
backend, _ := utils.RegisterEthService(stack, &cfg.Eth, ctx.GlobalBool(utils.CatalystFlag.Name))

// Configure GraphQL if requested
if ctx.GlobalIsSet(utils.GraphQLEnabledFlag.Name) {
Expand Down
19 changes: 15 additions & 4 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 @@ -205,7 +206,7 @@ var (
defaultSyncMode = ethconfig.Defaults.SyncMode
SyncModeFlag = TextMarshalerFlag{
Name: "syncmode",
Usage: `Blockchain sync mode ("fast", "full", "snap" or "light")`,
Usage: `Blockchain sync mode ("snap", "full" or "light")`,
Value: &defaultSyncMode,
}
GCModeFlag = cli.StringFlag{
Expand Down Expand Up @@ -1177,7 +1178,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 @@ -1675,13 +1676,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 @@ -1694,6 +1700,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 Expand Up @@ -1883,7 +1894,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai

// TODO(rjl493456442) disable snapshot generation/wiping if the chain is read only.
// Disable transaction indexing/unindexing by default.
chain, err = core.NewBlockChain(chainDb, cache, config, engine, vmcfg, nil, nil)
chain, err = core.NewBlockChain(chainDb, cache, config, engine, vmcfg, nil, nil, core.NewMerger(chainDb))
if err != nil {
Fatalf("Can't create BlockChain: %v", err)
}
Expand Down
Loading