mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
* feat(rollup): sync finalized batches from L1 * tweak * address comments * address comments * tweak * address comments * Update rollup/eventwatcher/eventwatcher.go Co-authored-by: Péter Garamvölgyi <peter@scroll.io> * address comments * address comments * address comments * add s.rollupSyncService.Stop() * add block chunk batch tests * fix goimports-lint * address comments * address comments * remove * add TestUnpackLog test * add decodeChunkRanges tests * add commit batch version check * fix goimport & golint * tweak * fixes * add TestRollupSyncServiceStartAndStop * add TestGetChunkRanges * address comments * add TestValidateBatch * add TestCalculateFinalizedBatchMeta * address comments * address comments * fix * address comments * address comments * fix * tweak log * fix * tweak logs * increase wait time * add --rollup.verify flag * add flag check in s.rollupSyncService.Stop() * bump version * refactor * tweak configs * tweak * refactor getLocalInfoForBatch * use syscall.Kill(os.Getpid(), syscall.SIGTERM) to shutdown * refactor decodeChunkBlockRanges * nit * address comments * address comments * add WithdrawRoot and StateRoot in FinalizedBatchMeta * address comments * address comments * add ctx.Err() check in retry * add configs in gen_config.go * bump version * fix goimport & golint * try to fix goimport * revert change * fix goimport & golint * tweak * bump version * add l2 block -> batch index mapping * bump version * add mainnet config * bump version * address comments * rename some vars * feat: add more detailed logs in crash case (#547) add more detailed logs in crash case * trigger ci * re-add batch finalization progress log * remove block number -> batch index mapping --------- Co-authored-by: Péter Garamvölgyi <peter@scroll.io> Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
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 = 1 // Minor version component of the current release
|
|
VersionPatch = 0 // 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 ""
|
|
}()
|