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

[Upgrade] Go-Ethereum release v1.9.19 #1146

Merged
merged 77 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
8e7bee9
params: begin v1.9.19 release cycle
karalabe Jul 27, 2020
79ce553
signer/storage: fix a badly ordered error check (#21379)
6543 Jul 28, 2020
93da0cf
cmd, core, eth, light, trie: dump clean cache periodically (#20391)
rjl493456442 Jul 28, 2020
c47052a
core: sort txs at the same gas price by received time
hendrikhofstadt Jul 22, 2020
298a19b
core: API-less transaction time sorting
karalabe Jul 28, 2020
28c5a8a
les: implement new les fetcher (#20692)
rjl493456442 Jul 28, 2020
37564ce
miner: refactor helper functions in worker.go (#21044)
robert-zaremba Jul 28, 2020
350a049
les: fix unittest (#21382)
rjl493456442 Jul 29, 2020
1976bb3
eth/downloader: remove eth62 (#21378)
renaynay Jul 29, 2020
abf2d7d
build: use -trimpath flag when building executables (#21374)
jyap808 Jul 29, 2020
9e04c5e
core/bloombits: use single channel for shutdown (#20878)
ucwong Jul 29, 2020
ff90894
core/rawdb: convert some comments to godoc convention (#21384)
meowsbits Jul 29, 2020
a00dc50
Merge pull request #21358 from hendrikhofstadt/fix/tx-sort-time
karalabe Jul 30, 2020
9c2ac6f
rpc: remove silly use of ReadVarint in subscription ID generator (#21…
fjl Jul 31, 2020
290d6bd
rpc: add SetHeader method to Client (#21392)
renaynay Aug 3, 2020
b2b14e6
signer/core: EIP-712 encoded data should not reject a Domain without …
natsukagami Aug 3, 2020
c0c0161
node: refactor package node (#21105)
renaynay Aug 3, 2020
90dedea
signer: EIP 712, parse `bytes` and `bytesX` as hex strings + correct …
natsukagami Aug 3, 2020
e24e05d
cmd/devp2p: print enode:// URL in enrdump (#21270)
adamschmideg Aug 4, 2020
b35e4fc
core: avoid modification of accountSet cache in tx_pool (#21159)
duanhao0814 Aug 4, 2020
82a9e11
ethstats: avoid concurrent write on websocket (#21404)
holiman Aug 4, 2020
8ead45c
core/vm: avoid map lookups for accessing jumpdest analysis
holiman Aug 4, 2020
1d25039
p2p/nat: limit UPNP request concurrency (#21390)
fjl Aug 5, 2020
5a88a7c
core: use errors.Is for consensus errors check (#21095)
robert-zaremba Aug 5, 2020
2de37f2
downloader: add eth65 tests (#21383)
renaynay Aug 5, 2020
4a04127
cmd/geth: fix import / export issues related to DB unavailability (#2…
renaynay Aug 6, 2020
4fde0ca
Merge pull request #21411 from holiman/fix_codelookup
karalabe Aug 6, 2020
d21303f
cmd/geth: fixes db unavailability for chain commands (#21415)
renaynay Aug 6, 2020
5d4512b
eth: use maxQueuedTxAnns for to limit the number of transactions anno…
timcooijmans Aug 6, 2020
68754f3
cmd/utils: grant snapshot cache to trie if disabled (#21416)
karalabe Aug 6, 2020
983cb25
les: update checktime even if check fails
holiman Aug 7, 2020
3bb8a4e
Merge pull request #21425 from holiman/leslock
karalabe Aug 7, 2020
4b9c0ea
eth/downloader: save the correct delivery time for state sync
karalabe Aug 7, 2020
8f24097
Merge pull request #21427 from karalabe/fix-statesync-delivery-time
karalabe Aug 7, 2020
6a53ce2
ethstats: overwrite old errors
holiman Aug 7, 2020
e401f5f
les: close all connected les-server when shutdown (#21426)
rjl493456442 Aug 7, 2020
9fea1a5
eth/downloader: set deliverytime on drops and timeouts too
holiman Aug 7, 2020
06125bf
Merge pull request #21429 from holiman/timerfix
karalabe Aug 7, 2020
48b484c
Merge pull request #21428 from holiman/ethstats_moar
karalabe Aug 7, 2020
7cee250
eth/downloader: allow all timers to exit
holiman Aug 10, 2020
cbbc54c
Merge pull request #21433 from holiman/statsync_exiter
karalabe Aug 10, 2020
9f45d6e
ethstats: split read and write lock, otherwise they'll lock up
karalabe Aug 10, 2020
4baa574
Merge pull request #21434 from karalabe/ethstats-split-rwlock
karalabe Aug 10, 2020
c28fd9c
tests: add Berlin-definition identical to YOLOv1 (#21435)
holiman Aug 10, 2020
7afdf79
params: update CHTs for v1.9.19
karalabe Aug 11, 2020
74925e5
Merge pull request #21437 from karalabe/cht-1.9.19
karalabe Aug 11, 2020
3e06419
params: release Geth v1.9.19
karalabe Aug 11, 2020
16c8aea
Merge branch 'public_master' into upgrade/go-ethereum/v1.9.19-2021301…
ricardolyn Mar 1, 2021
f5d6259
fix: change all error and refactor the code to make the project compile
ricardolyn Mar 1, 2021
e084eca
fix: add missing method to get security objects
ricardolyn Mar 1, 2021
d620314
fix: fix refactor of the http/ws configuration to include security co…
ricardolyn Mar 1, 2021
80f354c
Merge branch 'public_master' into upgrade/go-ethereum/v1.9.19-2021301…
ricardolyn Mar 1, 2021
6a83500
fix: freezer unit test
ricardolyn Mar 1, 2021
92a5647
fix: missing implementation on Stub
ricardolyn Mar 1, 2021
61c336c
fix: adding new missing arguments for unit tests
ricardolyn Mar 1, 2021
a3fd0db
fix: raft unit tests to make sure we are using the right references …
ricardolyn Mar 1, 2021
ae23e01
clenaup: todo done
ricardolyn Mar 1, 2021
de5c5a2
fix: unit tests fixed and all passed
ricardolyn Mar 2, 2021
4cc26c0
lint: fix all lint issues
ricardolyn Mar 2, 2021
3a30fa7
fix: issue with PluginManager not have been Started before the networ…
ricardolyn Mar 3, 2021
30938f7
improvement: code tidy up and added todos
ricardolyn Mar 5, 2021
0c3d951
fix: Extension service initialisation. Now we need to initialise at t…
ricardolyn Mar 8, 2021
d8a4f0d
tidy: add better error message
ricardolyn Mar 8, 2021
abcf629
improvement: use same approach for copyReceipts
ricardolyn Mar 8, 2021
dc35c65
improvement: adapted code to new Node architecture (except PluginMana…
ricardolyn Mar 8, 2021
a7c8c6b
fix: add missing code to get contract auth provider function from LES
ricardolyn Mar 8, 2021
f7ff6cb
fix: lint issues
ricardolyn Mar 8, 2021
041aafa
tidy: remove todos
ricardolyn Mar 8, 2021
51e0e0c
tidy: tidy up comments
ricardolyn Mar 8, 2021
e5fbf36
fix: lint issues
ricardolyn Mar 9, 2021
4ddb5ff
fix: comments from PR
ricardolyn Mar 10, 2021
96bac7e
fix: typo
ricardolyn Mar 10, 2021
2a9d55f
fix: imports
ricardolyn Mar 10, 2021
4c934b1
fix: lint issues
ricardolyn Mar 10, 2021
fdaccee
fix: comment typo
ricardolyn Mar 10, 2021
512cd42
fix: use Store instad of Add for atomic int
ricardolyn Mar 10, 2021
1b3a6b5
Merge branch 'master' into upgrade/go-ethereum/v1.9.19-2021301114425
ricardolyn Mar 10, 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
6 changes: 4 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ func doInstall(cmdline []string) {
var minor int
fmt.Sscanf(strings.TrimPrefix(runtime.Version(), "go1."), "%d", &minor)

if minor < 11 {
if minor < 13 {
log.Println("You have Go version", runtime.Version())
log.Println("go-ethereum requires at least Go version 1.11 and cannot")
log.Println("go-ethereum requires at least Go version 1.13 and cannot")
log.Println("be compiled with an earlier version. Please upgrade your Go installation.")
os.Exit(1)
}
Expand All @@ -233,6 +233,7 @@ func doInstall(cmdline []string) {
if runtime.GOARCH == "arm64" {
goinstall.Args = append(goinstall.Args, "-p", "1")
}
goinstall.Args = append(goinstall.Args, "-trimpath")
goinstall.Args = append(goinstall.Args, "-v")
goinstall.Args = append(goinstall.Args, packages...)
build.MustRun(goinstall)
Expand All @@ -241,6 +242,7 @@ func doInstall(cmdline []string) {

// Seems we are cross compiling, work around forbidden GOBIN
goinstall := goToolArch(*arch, *cc, "install", buildFlags(env)...)
goinstall.Args = append(goinstall.Args, "-trimpath")
goinstall.Args = append(goinstall.Args, "-v")
goinstall.Args = append(goinstall.Args, []string{"-buildmode", "archive"}...)
goinstall.Args = append(goinstall.Args, packages...)
Expand Down
2 changes: 1 addition & 1 deletion cmd/clef/docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ with minimal requirements.
On the `client` qube, we need to create a listener which will receive the request from the Dapp, and proxy it.


[qubes-client.py](qubes/client/qubes-client.py):
[qubes-client.py](qubes/qubes-client.py):

```python

Expand Down
2 changes: 1 addition & 1 deletion cmd/clef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ func startPluginManager(c *cli.Context) (*plugin.PluginManager, *plugin.Settings
if err != nil {
return nil, nil, err
}
if err := pm.Start(nil); err != nil {
if err := pm.Start(); err != nil {
return nil, nil, err
}
return pm, pluginConf, nil
Expand Down
19 changes: 14 additions & 5 deletions cmd/devp2p/enrcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/base64"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"net"
"os"
Expand Down Expand Up @@ -69,22 +70,30 @@ func enrdump(ctx *cli.Context) error {
if err != nil {
return fmt.Errorf("INVALID: %v", err)
}
fmt.Print(dumpRecord(r))
dumpRecord(os.Stdout, r)
return nil
}

// dumpRecord creates a human-readable description of the given node record.
func dumpRecord(r *enr.Record) string {
out := new(bytes.Buffer)
if n, err := enode.New(enode.ValidSchemes, r); err != nil {
func dumpRecord(out io.Writer, r *enr.Record) {
n, err := enode.New(enode.ValidSchemes, r)
if err != nil {
fmt.Fprintf(out, "INVALID: %v\n", err)
} else {
fmt.Fprintf(out, "Node ID: %v\n", n.ID())
dumpNodeURL(out, n)
}
kv := r.AppendElements(nil)[1:]
fmt.Fprintf(out, "Record has sequence number %d and %d key/value pairs.\n", r.Seq(), len(kv)/2)
fmt.Fprint(out, dumpRecordKV(kv, 2))
return out.String()
}

func dumpNodeURL(out io.Writer, n *enode.Node) {
var key enode.Secp256k1
if n.Load(&key) != nil {
return // no secp256k1 public key
}
fmt.Fprintf(out, "URLv4: %s\n", n.URLv4())
}

func dumpRecordKV(kv []interface{}, indent int) string {
Expand Down
25 changes: 11 additions & 14 deletions cmd/faucet/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,20 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network u
if err != nil {
return nil, err
}

// Assemble the Ethereum light client protocol
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
cfg := eth.DefaultConfig
cfg.SyncMode = downloader.LightSync
cfg.NetworkId = network
cfg.Genesis = genesis
return les.New(ctx, &cfg)
}); err != nil {
return nil, err
cfg := eth.DefaultConfig
cfg.SyncMode = downloader.LightSync
cfg.NetworkId = network
cfg.Genesis = genesis
lesBackend, err := les.New(stack, &cfg)
if err != nil {
return nil, fmt.Errorf("Failed to register the Ethereum service: %w", err)
}

// Assemble the ethstats monitoring and reporting service'
if stats != "" {
if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
var serv *les.LightEthereum
ctx.Service(&serv)
return ethstats.New(stats, nil, serv)
}); err != nil {
if err := ethstats.New(stack, lesBackend.ApiBackend, lesBackend.Engine(), stats); err != nil {
return nil, err
}
}
Expand All @@ -270,7 +267,7 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network u
// Attach to the client and retrieve and interesting metadatas
api, err := stack.Attach()
if err != nil {
stack.Stop()
stack.Close()
return nil, err
}
client := ethclient.NewClient(api)
Expand Down
2 changes: 1 addition & 1 deletion cmd/faucet/faucet.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1 style="text-align: center;"><i class="fa fa-bath" aria-hidden="true"></i> {{
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<div class="input-group">
<input id="url" name="url" type="text" class="form-control" placeholder="Social network URL containing your Ethereum address...">
<input id="url" name="url" type="text" class="form-control" placeholder="Social network URL containing your Ethereum address..."/>
<span class="input-group-btn">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Give me Ether <i class="fa fa-caret-down" aria-hidden="true"></i></button>
<ul class="dropdown-menu dropdown-menu-right">{{range $idx, $amount := .Amounts}}
Expand Down
2 changes: 1 addition & 1 deletion cmd/geth/accountcmd_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func setupAccountPluginForCLI(ctx *cli.Context) (*accountPlugin, error) {
if err != nil {
return nil, fmt.Errorf("unable to create plugin manager: %v", err)
}
if err := pm.Start(nil); err != nil {
if err := pm.Start(); err != nil {
return nil, fmt.Errorf("unable to start plugin manager: %v", err)
}

Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/accountcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ Password: {{.InputLine "foobar"}}
}
}

// TODO ricardlyn: add test to check if RAFT shutsdown well

func TestGethDoesntStartWithoutConfiguredConsensus(t *testing.T) {
defer SetResetPrivateConfig("ignore")()

Expand Down
22 changes: 14 additions & 8 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func initGenesis(ctx *cli.Context) error {
utils.Fatalf("invalid genesis file: %v", err)
}

// Quorum
file.Seek(0, 0)
genesis.Config.IsQuorum = getIsQuorum(file)

Expand All @@ -268,9 +269,10 @@ func initGenesis(ctx *cli.Context) error {
if err != nil {
utils.Fatalf("maxCodeSize data invalid: %v", err)
}
// End Quorum

// Open an initialise both full and light databases
stack := makeFullNode(ctx)
// Open and initialise both full and light databases
stack, _ := makeConfigNode(ctx)
defer stack.Close()

for _, name := range []string{"chaindata", "lightchaindata"} {
Expand Down Expand Up @@ -307,7 +309,8 @@ func importChain(ctx *cli.Context) error {
utils.SetupMetrics(ctx)
// Start system runtime metrics collection
go metrics.CollectProcessMetrics(3 * time.Second)
stack := makeFullNode(ctx)

stack, _ := makeConfigNode(ctx)
defer stack.Close()

chain, db := utils.MakeChain(ctx, stack, false, true)
Expand Down Expand Up @@ -401,7 +404,8 @@ func exportChain(ctx *cli.Context) error {
if len(ctx.Args()) < 1 {
utils.Fatalf("This command requires an argument.")
}
stack := makeFullNode(ctx)

stack, _ := makeConfigNode(ctx)
defer stack.Close()

chain, _ := utils.MakeChain(ctx, stack, true, true)
Expand Down Expand Up @@ -436,7 +440,8 @@ func importPreimages(ctx *cli.Context) error {
if len(ctx.Args()) < 1 {
utils.Fatalf("This command requires an argument.")
}
stack := makeFullNode(ctx)

stack, _ := makeConfigNode(ctx)
defer stack.Close()

db := utils.MakeChainDatabase(ctx, stack)
Expand All @@ -454,7 +459,8 @@ func exportPreimages(ctx *cli.Context) error {
if len(ctx.Args()) < 1 {
utils.Fatalf("This command requires an argument.")
}
stack := makeFullNode(ctx)

stack, _ := makeConfigNode(ctx)
defer stack.Close()

db := utils.MakeChainDatabase(ctx, stack)
Expand All @@ -476,7 +482,7 @@ func copyDb(ctx *cli.Context) error {
utils.Fatalf("Source ancient chain directory path argument missing")
}
// Initialize a new chain for the running node to sync into
stack := makeFullNode(ctx)
stack, _ := makeConfigNode(ctx)
defer stack.Close()

chain, chainDb := utils.MakeChain(ctx, stack, false, false)
Expand Down Expand Up @@ -584,7 +590,7 @@ func confirmAndRemoveDB(database string, kind string) {
}

func dump(ctx *cli.Context) error {
stack := makeFullNode(ctx)
stack, _ := makeConfigNode(ctx)
defer stack.Close()

chain, chainDb := utils.MakeChain(ctx, stack, true, false)
Expand Down
23 changes: 15 additions & 8 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common/http"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params"
Expand Down Expand Up @@ -107,6 +108,7 @@ func defaultNodeConfig() node.Config {
return cfg
}

// makeConfigNode loads geth configuration and creates a blank node instance.
func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
// Load defaults.
cfg := gethConfig{
Expand Down Expand Up @@ -147,10 +149,14 @@ func enableWhisper(ctx *cli.Context) bool {
return false
}

func makeFullNode(ctx *cli.Context) *node.Node {
// makeFullNode loads geth configuration and creates the Ethereum backend.
func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
stack, cfg := makeConfigNode(ctx)
ethChan := utils.RegisterEthService(stack, &cfg.Eth)

// Quorum - returning `ethService` too for the Raft and extension service
backend, ethService := utils.RegisterEthService(stack, &cfg.Eth)

// Quorum
// plugin service must be after eth service so that eth service will be stopped gradually if any of the plugin
// fails to start
if cfg.Node.Plugins != nil {
Expand All @@ -162,12 +168,13 @@ func makeFullNode(ctx *cli.Context) *node.Node {
}

if ctx.GlobalBool(utils.RaftModeFlag.Name) {
utils.RegisterRaftService(stack, ctx, &cfg.Node, ethChan)
utils.RegisterRaftService(stack, ctx, &cfg.Node, ethService)
}

if private.IsQuorumPrivacyEnabled() {
utils.RegisterExtensionService(stack, ethChan)
utils.RegisterExtensionService(stack, ethService)
}
// End Quorum

// Whisper must be explicitly enabled by specifying at least 1 whisper flag or in dev mode
shhEnabled := enableWhisper(ctx)
Expand All @@ -186,13 +193,13 @@ func makeFullNode(ctx *cli.Context) *node.Node {
}
// Configure GraphQL if requested
if ctx.GlobalIsSet(utils.GraphQLEnabledFlag.Name) {
utils.RegisterGraphQLService(stack, cfg.Node.GraphQLEndpoint(), cfg.Node.GraphQLCors, cfg.Node.GraphQLVirtualHosts, cfg.Node.HTTPTimeouts)
utils.RegisterGraphQLService(stack, backend, cfg.Node)
}
// Add the Ethereum Stats daemon if requested.
if cfg.Ethstats.URL != "" {
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
utils.RegisterEthStatsService(stack, backend, cfg.Ethstats.URL)
}
return stack
return stack, backend
}

// dumpConfig is the dumpconfig command.
Expand Down Expand Up @@ -228,7 +235,7 @@ func dumpConfig(ctx *cli.Context) error {
func quorumValidateEthService(stack *node.Node, isRaft bool) {
var ethereum *eth.Ethereum

err := stack.Service(&ethereum)
err := stack.Lifecycle(&ethereum)
if err != nil {
utils.Fatalf("Error retrieving Ethereum service: %v", err)
}
Expand Down
16 changes: 8 additions & 8 deletions cmd/geth/consolecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ func readTLSClientConfig(endpoint string, ctx *cli.Context) (*tls.Config, bool,
func localConsole(ctx *cli.Context) error {
// Create and start the node based on the CLI flags
prepare(ctx)
node := makeFullNode(ctx)
startNode(ctx, node)
defer node.Close()
stack, backend := makeFullNode(ctx)
startNode(ctx, stack, backend)
defer stack.Close()

// Attach to the newly started node and start the JavaScript console
client, err := node.Attach()
client, err := stack.Attach()
if err != nil {
utils.Fatalf("Failed to attach to the inproc geth: %v", err)
}
Expand Down Expand Up @@ -311,12 +311,12 @@ func dialRPC(endpoint string, ctx *cli.Context) (*rpc.Client, error) {
// everything down.
func ephemeralConsole(ctx *cli.Context) error {
// Create and start the node based on the CLI flags
node := makeFullNode(ctx)
startNode(ctx, node)
defer node.Close()
stack, backend := makeFullNode(ctx)
startNode(ctx, stack, backend)
defer stack.Close()

// Attach to the newly started node and start the JavaScript console
client, err := node.Attach()
client, err := stack.Attach()
if err != nil {
utils.Fatalf("Failed to attach to the inproc geth: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/geth/dao_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ func testDAOForkBlockNewChain(t *testing.T, test int, genesis string, expectBloc
} else {
// Force chain initialization
args := []string{"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--ipcdisable", "--datadir", datadir}
geth := runGeth(t, append(args, []string{"--exec", "2+2", "console"}...)...)
geth.WaitExit()
runGeth(t, append(args, []string{"--exec", "2+2", "console"}...)...).WaitExit()
}
// Retrieve the DAO config flag from the database
path := filepath.Join(datadir, "geth", "chaindata")
Expand Down
Loading