Skip to content

Commit 5376615

Browse files
committed
Revert additional changes for stable v1.16.7 release
1 parent f46f771 commit 5376615

File tree

5 files changed

+12
-21
lines changed

5 files changed

+12
-21
lines changed

cmd/bera-geth/config.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
"github.com/ethereum/go-ethereum/beacon/blsync"
3636
"github.com/ethereum/go-ethereum/cmd/utils"
3737
"github.com/ethereum/go-ethereum/common"
38+
"github.com/ethereum/go-ethereum/common/hexutil"
3839
"github.com/ethereum/go-ethereum/crypto"
3940
"github.com/ethereum/go-ethereum/eth/catalyst"
4041
"github.com/ethereum/go-ethereum/eth/ethconfig"
@@ -278,11 +279,11 @@ func makeFullNode(ctx *cli.Context) *node.Node {
278279
// Configure synchronization override service
279280
var synctarget common.Hash
280281
if ctx.IsSet(utils.SyncTargetFlag.Name) {
281-
target := ctx.String(utils.SyncTargetFlag.Name)
282-
if !common.IsHexHash(target) {
283-
utils.Fatalf("sync target hash is not a valid hex hash: %s", target)
282+
hex := hexutil.MustDecode(ctx.String(utils.SyncTargetFlag.Name))
283+
if len(hex) != common.HashLength {
284+
utils.Fatalf("invalid sync target length: have %d, want %d", len(hex), common.HashLength)
284285
}
285-
synctarget = common.HexToHash(target)
286+
synctarget = common.BytesToHash(hex)
286287
}
287288
utils.RegisterSyncOverrideService(stack, eth, synctarget, ctx.Bool(utils.ExitWhenSyncedFlag.Name))
288289

cmd/bera-geth/snapshot.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,11 +639,11 @@ func snapshotExportPreimages(ctx *cli.Context) error {
639639

640640
var root common.Hash
641641
if ctx.NArg() > 1 {
642-
hash := ctx.Args().Get(1)
643-
if !common.IsHexHash(hash) {
642+
rootBytes := common.FromHex(ctx.Args().Get(1))
643+
if len(rootBytes) != common.HashLength {
644644
return fmt.Errorf("invalid hash: %s", ctx.Args().Get(1))
645645
}
646-
root = common.HexToHash(hash)
646+
root = common.BytesToHash(rootBytes)
647647
} else {
648648
headBlock := rawdb.ReadHeadBlock(chaindb)
649649
if headBlock == nil {

common/types.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,6 @@ func BigToHash(b *big.Int) Hash { return BytesToHash(b.Bytes()) }
7676
// If b is larger than len(h), b will be cropped from the left.
7777
func HexToHash(s string) Hash { return BytesToHash(FromHex(s)) }
7878

79-
// IsHexHash verifies whether a string can represent a valid hex-encoded
80-
// Ethereum hash or not.
81-
func IsHexHash(s string) bool {
82-
if has0xPrefix(s) {
83-
s = s[2:]
84-
}
85-
return len(s) == 2*HashLength && isHex(s)
86-
}
87-
8879
// Cmp compares two hashes.
8980
func (h Hash) Cmp(other Hash) int {
9081
return bytes.Compare(h[:], other[:])

core/rawdb/database.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ func Open(db ethdb.KeyValueStore, opts OpenOptions) (ethdb.Database, error) {
330330
}()
331331
}
332332
return &freezerdb{
333-
readOnly: opts.ReadOnly,
334333
ancientRoot: opts.Ancient,
335334
KeyValueStore: db,
336335
chainFreezer: frdb,

version/version.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package version
1818

1919
const (
20-
Major = 1 // Major version component of the current release
21-
Minor = 16 // Minor version component of the current release
22-
Patch = 8 // Patch version component of the current release
23-
Meta = "unstable" // Version metadata to append to the version string
20+
Major = 1 // Major version component of the current release
21+
Minor = 16 // Minor version component of the current release
22+
Patch = 7 // Patch version component of the current release
23+
Meta = "stable" // Version metadata to append to the version string
2424
)

0 commit comments

Comments
 (0)