mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-03 18:43:46 +00:00
* feat: add system config consensus to deprecate poa * fix: check extra field lens * Finish implementation with one signer only * Implement unit tests * Only check signature if block not requested * Remove Extra from rlp encoding (and hashing) * Implement UpgradableEngine as middleware for Clique/SystemContract * Use isEuclid, add json tag to Requested, make go idiomatic * Changes post integration test * Remove comment * Address comments * Merge * New field BlockSignature (not used in hashing/JSON) * Enforce .Extra to be an empty slice * replace header.Requested for header.IsNewBlock * mark new block as IsNewBlock * Make new RLP optional fields always default for legacy/reth compatibility * Placing new fields as last non-zero rlp:optional values used by Scroll * Penalize nodes that send non-zero Euclid V2 header field values * Bring back .Requested to downloader instead of .IsNewBlock * Replace IsNewBlock for Requested * Address comments * merge * prevent timing issues in tests * fix ci * chore: auto version bump [bot] * Update consensus/system_contract/consensus.go Co-authored-by: Morty <70688412+yiweichi@users.noreply.github.com> * chore: auto version bump [bot] * Update consensus/system_contract/consensus.go Co-authored-by: Jonas Theis <4181434+jonastheis@users.noreply.github.com> * Remove whitespaces and merge version number * chore: auto version bump [bot] * validate that the read address from L1 is not empty and improved error handling when fetching address * Fix indentation issue * Fix test * goimports fix * goimports --------- Co-authored-by: Alejandro Ranchal-Pedrosa <a.ranchalpedrosa@gmail.com> Co-authored-by: jonastheis <4181434+jonastheis@users.noreply.github.com> Co-authored-by: jonastheis <jonastheis@users.noreply.github.com> Co-authored-by: ranchalp <ranchalp@users.noreply.github.com> Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
80 lines
2.3 KiB
Go
80 lines
2.3 KiB
Go
// Copyright 2016 The go-ethereum Authors
|
|
// This file is part of the go-ethereum library.
|
|
//
|
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
package params
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime/debug"
|
|
)
|
|
|
|
const (
|
|
VersionMajor = 5 // Major version component of the current release
|
|
VersionMinor = 8 // Minor version component of the current release
|
|
VersionPatch = 14 // Patch version component of the current release
|
|
VersionMeta = "mainnet" // Version metadata to append to the version string
|
|
)
|
|
|
|
// Version holds the textual version string.
|
|
var Version = func() string {
|
|
return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
|
|
}()
|
|
|
|
// VersionWithMeta holds the textual version string including the metadata.
|
|
var VersionWithMeta = func() string {
|
|
v := Version
|
|
if VersionMeta != "" {
|
|
v += "-" + VersionMeta
|
|
}
|
|
return v
|
|
}()
|
|
|
|
// ArchiveVersion holds the textual version string used for Geth archives.
|
|
// e.g. "1.8.11-dea1ce05" for stable releases, or
|
|
//
|
|
// "1.8.13-unstable-21c059b6" for unstable releases
|
|
func ArchiveVersion(gitCommit string) string {
|
|
vsn := Version
|
|
if VersionMeta != "stable" {
|
|
vsn += "-" + VersionMeta
|
|
}
|
|
if len(gitCommit) >= 8 {
|
|
vsn += "-" + gitCommit[:8]
|
|
}
|
|
return vsn
|
|
}
|
|
|
|
func VersionWithCommit(gitCommit, gitDate string) string {
|
|
vsn := VersionWithMeta
|
|
if len(gitCommit) >= 8 {
|
|
vsn += "-" + gitCommit[:8]
|
|
}
|
|
if (VersionMeta != "stable") && (gitDate != "") {
|
|
vsn += "-" + gitDate
|
|
}
|
|
return vsn
|
|
}
|
|
|
|
var CommitHash = func() string {
|
|
if info, ok := debug.ReadBuildInfo(); ok {
|
|
for _, setting := range info.Settings {
|
|
if setting.Key == "vcs.revision" {
|
|
return setting.Value
|
|
}
|
|
}
|
|
}
|
|
return ""
|
|
}()
|