Skip to content

Commit

Permalink
Merge pull request ethereum#93 from mdehoog/merge
Browse files Browse the repository at this point in the history
Merge with latest upstream
  • Loading branch information
roberto-bayardo authored Jan 20, 2023
2 parents db177b8 + 2fb9c3c commit 845a510
Show file tree
Hide file tree
Showing 36 changed files with 504 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
- sdkmanager "platform-tools" "platforms;android-15" "platforms;android-19" "platforms;android-24" "ndk-bundle"

# Install Go to allow building with
- curl https://dl.google.com/go/go1.18.linux-amd64.tar.gz | tar -xz
- curl https://dl.google.com/go/go1.19.5.linux-amd64.tar.gz | tar -xz
- export PATH=`pwd`/go/bin:$PATH
- export GOROOT=`pwd`/go
- export GOPATH=$HOME/go
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ archives are published at https://geth.ethereum.org/downloads/.

## Building the source

For prerequisites and detailed build instructions please read the [Installation Instructions](https://geth.ethereum.org/docs/install-and-build/installing-geth).
For prerequisites and detailed build instructions please read the [Installation Instructions](https://geth.ethereum.org/docs/getting-started/installing-geth).

Building `geth` requires both a Go (version 1.18 or later) and a C compiler. You can install
them using your favourite package manager. Once the dependencies are installed, run
Expand Down
28 changes: 14 additions & 14 deletions build/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# This file contains sha256 checksums of optional build dependencies.

eda74db4ac494800a3e66ee784e495bfbb9b8e535df924a8b01b1a8028b7f368 go1.19.4.src.tar.gz
44894862d996eec96ef2a39878e4e1fce4d05423fc18bdc1cbba745ebfa41253 go1.19.4.darwin-amd64.tar.gz
bb3bc5d7655b9637cfe2b5e90055dee93b0ead50e2ffd091df320d1af1ca853f go1.19.4.darwin-arm64.tar.gz
dd6c401cc6d0692995ed9b0f37482a724b5b9d9c1119d620862766c60708630f go1.19.4.freebsd-386.tar.gz
84489ebb63f1757b79574d7345c647bd40bc6414cecb868c93e24476c2d2b9b6 go1.19.4.freebsd-amd64.tar.gz
e5f0b0551e120bf3d1246cb960ec58032d7ca69e1adcf0fdb91c07da620e0c61 go1.19.4.linux-386.tar.gz
c9c08f783325c4cf840a94333159cc937f05f75d36a8b307951d5bd959cf2ab8 go1.19.4.linux-amd64.tar.gz
9df122d6baf6f2275270306b92af3b09d7973fb1259257e284dba33c0db14f1b go1.19.4.linux-arm64.tar.gz
7a51dae4f3a52d2dfeaf59367cc0b8a296deddc87e95aa619bf87d24661d2370 go1.19.4.linux-armv6l.tar.gz
fbc6c7d1d169bbdc82223d861d2fadc6add01c126533d3efbba3fdca9b362035 go1.19.4.linux-ppc64le.tar.gz
4b8d25acbdca8010c31ea8c5fd4aba93471ff6ada7a8b4fb04b935baee873dc8 go1.19.4.linux-s390x.tar.gz
51d8d895deb9883aa2daa291572f483fead69f577bf4e7cf8381c8001e37778e go1.19.4.windows-386.zip
ada490e188bfb57c7388da7c5eba7565390992b6496204d30e710d37755956b0 go1.19.4.windows-amd64.zip
66cfa12f408806c0fabfc10726a57b090c0c3ef3efddd944400af678ff10b851 go1.19.4.windows-arm64.zip
8e486e8e85a281fc5ce3f0bedc5b9d2dbf6276d7db0b25d3ec034f313da0375f go1.19.5.src.tar.gz
23d22bb6571bbd60197bee8aaa10e702f9802786c2e2ddce5c84527e86b66aa0 go1.19.5.darwin-amd64.tar.gz
4a67f2bf0601afe2177eb58f825adf83509511d77ab79174db0712dc9efa16c8 go1.19.5.darwin-arm64.tar.gz
b18a5e1e60130003896e1d1c8a9e142c7cccf6f5063d52c55dd42006434419c1 go1.19.5.freebsd-386.tar.gz
317996f7427691ff3a7ffd1b6aa089b9c66cd76f32e9107443f2f6aad1bb568a go1.19.5.freebsd-amd64.tar.gz
f68331aa7458a3598060595f5601d5731fd452bb2c62ff23095ddad68854e510 go1.19.5.linux-386.tar.gz
36519702ae2fd573c9869461990ae550c8c0d955cd28d2827a6b159fda81ff95 go1.19.5.linux-amd64.tar.gz
fc0aa29c933cec8d76f5435d859aaf42249aa08c74eb2d154689ae44c08d23b3 go1.19.5.linux-arm64.tar.gz
ec14f04bdaf4a62bdcf8b55b9b6434cc27c2df7d214d0bb7076a7597283b026a go1.19.5.linux-armv6l.tar.gz
e4032e7c52ebc48bad5c58ba8de0759b6091d9b1e59581a8a521c8c9d88dbe93 go1.19.5.linux-ppc64le.tar.gz
764871cbca841a99a24e239b63c68a4aaff4104658e3165e9ca450cac1fcbea3 go1.19.5.linux-s390x.tar.gz
8873f5871d996106b701febd979c5af022e6ea58bdbbb3817a28ab948b22c286 go1.19.5.windows-386.zip
167db91a2e40aeb453d3e59d213ecab06f62e1c4a84d13a06ccda1d999961caa go1.19.5.windows-amd64.zip
85a75555e82d8aa6f486d8d29491c593389682acce9f0c270090d5938eee30ef go1.19.5.windows-arm64.zip

20cd1215e0420db8cfa94a6cd3c9d325f7b39c07f2415a02d111568d8bc9e271 golangci-lint-1.49.0-darwin-amd64.tar.gz
cabb1a4c35fe1dadbe5a81550a00871281a331e7660cd85ae16e936a7f0f6cfc golangci-lint-1.49.0-darwin-arm64.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ var (
// This is the version of go that will be downloaded by
//
// go run ci.go install -dlgo
dlgoVersion = "1.19.4"
dlgoVersion = "1.19.5"
)

var GOBIN, _ = filepath.Abs(filepath.Join("build", "bin"))
Expand Down
2 changes: 1 addition & 1 deletion cmd/bootnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func main() {
writeAddr = flag.Bool("writeaddress", false, "write out the node's public key and quit")
nodeKeyFile = flag.String("nodekey", "", "private key filename")
nodeKeyHex = flag.String("nodekeyhex", "", "private key as hex (for testing)")
natdesc = flag.String("nat", "none", "port mapping mechanism (any|none|upnp|pmp|extip:<IP>)")
natdesc = flag.String("nat", "none", "port mapping mechanism (any|none|upnp|pmp|pmp:<IP>|extip:<IP>)")
netrestrict = flag.String("netrestrict", "", "restrict network communication to the given IP networks (CIDR masks)")
runv5 = flag.Bool("v5", false, "run a v5 topic discovery bootnode")
verbosity = flag.Int("verbosity", int(log.LvlInfo), "log verbosity (0-5)")
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ type Txs []string

#### `clique`

The `clique` object provides the neccesary information to complete a clique
The `clique` object provides the necessary information to complete a clique
seal of the block.

```go=
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/transition-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ type Txs []string
#### `clique`
The `clique` object provides the neccesary information to complete a clique
The `clique` object provides the necessary information to complete a clique
seal of the block.
```go=
Expand Down
12 changes: 2 additions & 10 deletions cmd/geth/dbcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,16 +551,8 @@ func freezerInspect(ctx *cli.Context) error {
return err
}
stack, _ := makeConfigNode(ctx)
defer stack.Close()

db := utils.MakeChainDatabase(ctx, stack, true)
defer db.Close()

ancient, err := db.AncientDatadir()
if err != nil {
log.Info("Failed to retrieve ancient root", "err", err)
return err
}
ancient := stack.ResolveAncient("chaindata", ctx.String(utils.AncientFlag.Name))
stack.Close()
return rawdb.InspectFreezerTable(ancient, freezer, table, start, end)
}

Expand Down
4 changes: 0 additions & 4 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ func prepare(ctx *cli.Context) {
case ctx.IsSet(utils.SepoliaFlag.Name):
log.Info("Starting Geth on Sepolia testnet...")

case ctx.IsSet(utils.KilnFlag.Name):
log.Info("Starting Geth on Kiln testnet...")

case ctx.IsSet(utils.Eip4844Flag.Name):
log.Info("Starting Geth on EIP4844 testnet...")

Expand Down Expand Up @@ -319,7 +316,6 @@ func prepare(ctx *cli.Context) {
!ctx.IsSet(utils.SepoliaFlag.Name) &&
!ctx.IsSet(utils.RinkebyFlag.Name) &&
!ctx.IsSet(utils.GoerliFlag.Name) &&
!ctx.IsSet(utils.KilnFlag.Name) &&
!ctx.IsSet(utils.Eip4844Flag.Name) &&
!ctx.IsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
Expand Down
31 changes: 5 additions & 26 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ var (
Usage: "Sepolia network: pre-configured proof-of-work test network",
Category: flags.EthCategory,
}
KilnFlag = &cli.BoolFlag{
Name: "kiln",
Usage: "Kiln network: pre-configured proof-of-work to proof-of-stake test network",
Category: flags.EthCategory,
}
Eip4844Flag = &cli.BoolFlag{
Name: "eip4844",
Usage: "EIP-4844 (proto-danksharding) network: pre-configured proof-of-authority to proof-of-stake test network",
Expand Down Expand Up @@ -833,7 +828,7 @@ var (
}
NATFlag = &cli.StringFlag{
Name: "nat",
Usage: "NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)",
Usage: "NAT port mapping mechanism (any|none|upnp|pmp|pmp:<IP>|extip:<IP>)",
Value: "any",
Category: flags.NetworkingCategory,
}
Expand Down Expand Up @@ -1007,7 +1002,6 @@ var (
RinkebyFlag,
GoerliFlag,
SepoliaFlag,
KilnFlag,
Eip4844Flag,
}
// NetworkFlags is the flag group of all built-in supported networks.
Expand Down Expand Up @@ -1041,9 +1035,6 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.Bool(SepoliaFlag.Name) {
return filepath.Join(path, "sepolia")
}
if ctx.Bool(KilnFlag.Name) {
return filepath.Join(path, "kiln")
}
if ctx.Bool(Eip4844Flag.Name) {
return filepath.Join(path, "eip4844")
}
Expand Down Expand Up @@ -1101,8 +1092,6 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.RinkebyBootnodes
case ctx.Bool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case ctx.Bool(KilnFlag.Name):
urls = params.KilnBootnodes
case ctx.Bool(Eip4844Flag.Name):
urls = params.Eip4844Bootnodes
}
Expand Down Expand Up @@ -1561,8 +1550,6 @@ func SetDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli")
case ctx.Bool(SepoliaFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia")
case ctx.Bool(KilnFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "kiln")
case ctx.Bool(Eip4844Flag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "eip4844")
}
Expand Down Expand Up @@ -1755,7 +1742,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
// Avoid conflicting network flags
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, KilnFlag, Eip4844Flag)
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, Eip4844Flag)
CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
if ctx.String(GCModeFlag.Name) == "archive" && ctx.Uint64(TxLookupLimitFlag.Name) != 0 {
Expand Down Expand Up @@ -1912,9 +1899,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
log.Warn("")
log.Warn("--------------------------------------------------------------------------------")
log.Warn("Please note, Rinkeby has been deprecated. It will still work for the time being,")
log.Warn("but there will be no further hard-forks shipped for it. Eventually the network")
log.Warn("will be permanently halted after the other networks transition through the merge")
log.Warn("and prove stable enough. For the most future proof testnet, choose Sepolia as")
log.Warn("but there will be no further hard-forks shipped for it.")
log.Warn("The network will be permanently halted in Q2/Q3 of 2023.")
log.Warn("For the most future proof testnet, choose Sepolia as")
log.Warn("your replacement environment (--sepolia instead of --rinkeby).")
log.Warn("--------------------------------------------------------------------------------")
log.Warn("")
Expand All @@ -1930,12 +1917,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
cfg.Genesis = core.DefaultGoerliGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash)
case ctx.Bool(KilnFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337802
}
cfg.Genesis = core.DefaultKilnGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.KilnGenesisHash)
case ctx.Bool(Eip4844Flag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1331
Expand Down Expand Up @@ -2249,8 +2230,6 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultRinkebyGenesisBlock()
case ctx.Bool(GoerliFlag.Name):
genesis = core.DefaultGoerliGenesisBlock()
case ctx.Bool(KilnFlag.Name):
genesis = core.DefaultKilnGenesisBlock()
case ctx.Bool(Eip4844Flag.Name):
genesis = core.DefaultEIP4844GenesisBlock()
case ctx.Bool(DeveloperFlag.Name):
Expand Down
8 changes: 2 additions & 6 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,8 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str
start := pos - 1
for ; start > 0; start-- {
// Skip all methods and namespaces (i.e. including the dot)
if line[start] == '.' || (line[start] >= 'a' && line[start] <= 'z') || (line[start] >= 'A' && line[start] <= 'Z') {
continue
}
// Handle web3 in a special way (i.e. other numbers aren't auto completed)
if start >= 3 && line[start-3:start] == "web3" {
start -= 3
c := line[start]
if c == '.' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '1' && c <= '9') {
continue
}
// We've hit an unexpected character, autocomplete form here
Expand Down
10 changes: 5 additions & 5 deletions core/forkid/forkid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,21 +387,21 @@ func TestValidation(t *testing.T) {
// TODO(karalabe): Enable this when Cancun is specced, update local head and time, next timestamp
//{&timestampedConfig, 21123456, 1678123456, ID{Hash: checksumToBytes(0x71147644), Next: 1678000000}, nil},

// Local is mainnet Osaka, remote announces Shanghai + knowledge about Cancun. Remote
// is definitely out of sync. It may or may not need the Osaka update, we don't know yet.
// Local is mainnet Prague, remote announces Shanghai + knowledge about Cancun. Remote
// is definitely out of sync. It may or may not need the Prague update, we don't know yet.
//
// TODO(karalabe): Enable this when Cancun **and** Osaka is specced, update all the numbers
// TODO(karalabe): Enable this when Cancun **and** Prague is specced, update all the numbers
//{&timestampedConfig, 0, 0, ID{Hash: checksumToBytes(0x3edd5b10), Next: 4370000}, nil},

// Local is mainnet Shanghai, remote announces Cancun. Local is out of sync, accept.
//
// TODO(karalabe): Enable this when Cancun is specced, update remote checksum
//{&timestampedConfig, 21000000, 1678000000, ID{Hash: checksumToBytes(0x00000000), Next: 0}, nil},

// Local is mainnet Shanghai, remote announces Cancun, but is not aware of Osaka. Local
// Local is mainnet Shanghai, remote announces Cancun, but is not aware of Prague. Local
// out of sync. Local also knows about a future fork, but that is uncertain yet.
//
// TODO(karalabe): Enable this when Cancun **and** Osaka is specced, update remote checksum
// TODO(karalabe): Enable this when Cancun **and** Prague is specced, update remote checksum
//{&timestampedConfig, 21000000, 1678000000, ID{Hash: checksumToBytes(0x00000000), Next: 0}, nil},

// Local is mainnet Cancun. remote announces Shanghai but is not aware of further forks.
Expand Down
12 changes: 0 additions & 12 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,6 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.RinkebyChainConfig
case ghash == params.GoerliGenesisHash:
return params.GoerliChainConfig
case ghash == params.KilnGenesisHash:
return DefaultKilnGenesisBlock().Config
default:
return params.AllEthashProtocolChanges
}
Expand Down Expand Up @@ -592,16 +590,6 @@ func DefaultSepoliaGenesisBlock() *Genesis {
}
}

// DefaultKilnGenesisBlock returns the kiln network genesis block.
func DefaultKilnGenesisBlock() *Genesis {
g := new(Genesis)
reader := strings.NewReader(KilnAllocData)
if err := json.NewDecoder(reader).Decode(g); err != nil {
panic(err)
}
return g
}

// DefaultSepoliaGenesisBlock returns the Sepolia network genesis block.
func DefaultEIP4844GenesisBlock() *Genesis {
g := new(Genesis)
Expand Down
7 changes: 3 additions & 4 deletions core/rawdb/chain_freezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ func newChainFreezer(datadir string, namespace string, readonly bool, maxTableSi

// Close closes the chain freezer instance and terminates the background thread.
func (f *chainFreezer) Close() error {
err := f.Freezer.Close()
select {
case <-f.quit:
default:
close(f.quit)
}
f.wg.Wait()
return err
return f.Freezer.Close()
}

// freeze is a background thread that periodically checks the blockchain for any
Expand All @@ -86,14 +85,14 @@ func (f *chainFreezer) Close() error {
// This functionality is deliberately broken off from block importing to avoid
// incurring additional data shuffling delays on block propagation.
func (f *chainFreezer) freeze(db ethdb.KeyValueStore) {
nfdb := &nofreezedb{KeyValueStore: db}

var (
backoff bool
triggered chan struct{} // Used in tests
nfdb = &nofreezedb{KeyValueStore: db}
)
timer := time.NewTimer(freezerRecheckInterval)
defer timer.Stop()

for {
select {
case <-f.quit:
Expand Down
Loading

0 comments on commit 845a510

Please sign in to comment.