Merge branch 'v1.2.5-beta-candidate' into shivam/upstream-geth-1.13.5

This commit is contained in:
Shivam Sharma 2024-02-12 16:33:55 +05:30
commit 01740e47de
16 changed files with 48 additions and 37 deletions

View file

@ -14,6 +14,7 @@
"berlinBlock": 13996000, "berlinBlock": 13996000,
"londonBlock": 22640000, "londonBlock": 22640000,
"shanghaiBlock": 41874000, "shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor": { "bor": {
"jaipurBlock": 22770000, "jaipurBlock": 22770000,
"delhiBlock": 29638656, "delhiBlock": 29638656,

View file

@ -15,7 +15,8 @@
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. // along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// bootnode runs a bootstrap node for the Ethereum Discovery Protocol. // bootnode runs a bootstrap node for the Ethereum Discovery Protocol.
package main // Keep package as bootnode during upstram merge.
package bootnode
import ( import (
"crypto/ecdsa" "crypto/ecdsa"
@ -34,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/netutil" "github.com/ethereum/go-ethereum/p2p/netutil"
) )
// nolint
func main() { func main() {
var ( var (
listenAddr = flag.String("addr", ":30301", "listen address") listenAddr = flag.String("addr", ":30301", "listen address")
@ -213,3 +215,12 @@ func doPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) *
return extaddr return extaddr
} }
// Implemented separate functions so that there are minimal conflicts during upstream merge
func PrintNotice(nodeKey *ecdsa.PublicKey, addr net.UDPAddr) {
printNotice(nodeKey, addr)
}
func DoPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) *net.UDPAddr {
return doPortMapping(natm, ln, addr)
}

View file

@ -37,6 +37,8 @@ var (
rewindLengthMeter = metrics.NewRegisteredMeter("chain/autorewind/length", nil) rewindLengthMeter = metrics.NewRegisteredMeter("chain/autorewind/length", nil)
) )
const maxRewindLen uint64 = 126
type borVerifier struct { type borVerifier struct {
verify func(ctx context.Context, eth *Ethereum, handler *ethHandler, start uint64, end uint64, hash string, isCheckpoint bool) (string, error) verify func(ctx context.Context, eth *Ethereum, handler *ethHandler, start uint64, end uint64, hash string, isCheckpoint bool) (string, error)
} }
@ -117,8 +119,8 @@ func borVerify(ctx context.Context, eth *Ethereum, handler *ethHandler, start ui
} }
} }
if head-rewindTo > 255 { if head-rewindTo > maxRewindLen {
rewindTo = head - 255 rewindTo = head - maxRewindLen
} }
if isCheckpoint { if isCheckpoint {

View file

@ -13,6 +13,7 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/ethereum/go-ethereum/cmd/bootnode"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/cli/flagset" "github.com/ethereum/go-ethereum/internal/cli/flagset"
@ -213,33 +214,25 @@ func (b *BootnodeCommand) Run(args []string) int {
} }
conn, err := net.ListenUDP("udp", addr) conn, err := net.ListenUDP("udp", addr)
if err != nil { if err != nil {
b.UI.Error(fmt.Sprintf("failed to listen udp addr '%s': %v", b.listenAddr, err)) b.UI.Error(fmt.Sprintf("failed to listen udp addr '%s': %v", b.listenAddr, err))
return 1 return 1
} }
defer conn.Close()
realaddr := conn.LocalAddr().(*net.UDPAddr)
if natm != nil {
if !realaddr.IP.IsLoopback() {
go nat.Map(natm, nil, "udp", realaddr.Port, realaddr.Port, "ethereum discovery")
}
if ext, err := natm.ExternalIP(); err == nil {
// nolint: govet
realaddr = &net.UDPAddr{IP: ext, Port: realaddr.Port}
}
}
n := enode.NewV4(&nodeKey.PublicKey, addr.IP, addr.Port, addr.Port)
b.UI.Info(n.String())
if b.dryRun {
return 0
}
db, _ := enode.OpenDB("") db, _ := enode.OpenDB("")
ln := enode.NewLocalNode(db, nodeKey) ln := enode.NewLocalNode(db, nodeKey)
listenerAddr := conn.LocalAddr().(*net.UDPAddr)
if natm != nil {
natAddr := bootnode.DoPortMapping(natm, ln, listenerAddr)
if natAddr != nil {
listenerAddr = natAddr
}
}
bootnode.PrintNotice(&nodeKey.PublicKey, *listenerAddr)
cfg := discover.Config{ cfg := discover.Config{
PrivateKey: nodeKey, PrivateKey: nodeKey,
Log: log.Root(), Log: log.Root(),

View file

@ -28,6 +28,7 @@ var mumbaiTestnet = &Chain{
BerlinBlock: big.NewInt(13996000), BerlinBlock: big.NewInt(13996000),
LondonBlock: big.NewInt(22640000), LondonBlock: big.NewInt(22640000),
ShanghaiBlock: big.NewInt(41874000), ShanghaiBlock: big.NewInt(41874000),
CancunBlock: big.NewInt(45648608),
Bor: &params.BorConfig{ Bor: &params.BorConfig{
JaipurBlock: big.NewInt(22770000), JaipurBlock: big.NewInt(22770000),
DelhiBlock: big.NewInt(29638656), DelhiBlock: big.NewInt(29638656),

View file

@ -15,6 +15,7 @@
"berlinBlock": 13996000, "berlinBlock": 13996000,
"londonBlock": 13996000, "londonBlock": 13996000,
"shanghaiBlock": 41874000, "shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor": { "bor": {
"period": { "period": {
"0": 2, "0": 2,

View file

@ -17,6 +17,7 @@
"berlinBlock":13996000, "berlinBlock":13996000,
"londonBlock":13996000, "londonBlock":13996000,
"shanghaiBlock": 41874000, "shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor":{ "bor":{
"period":{ "period":{
"0":2, "0":2,

View file

@ -925,7 +925,7 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
EnableMVHashMap := w.chainConfig.IsCancun(env.header.Number) EnableMVHashMap := w.chainConfig.IsCancun(env.header.Number)
// create and add empty mvHashMap in statedb // create and add empty mvHashMap in statedb
if EnableMVHashMap { if EnableMVHashMap && w.IsRunning() {
deps = map[int]map[int]bool{} deps = map[int]map[int]bool{}
chDeps = make(chan blockstm.TxDep) chDeps = make(chan blockstm.TxDep)
@ -961,7 +961,7 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
mainloop: mainloop:
for { for {
if interruptCtx != nil { if interruptCtx != nil {
if EnableMVHashMap { if EnableMVHashMap && w.IsRunning() {
env.state.AddEmptyMVHashMap() env.state.AddEmptyMVHashMap()
} }
@ -1070,7 +1070,7 @@ mainloop:
coalescedLogs = append(coalescedLogs, logs...) coalescedLogs = append(coalescedLogs, logs...)
env.tcount++ env.tcount++
if EnableMVHashMap { if EnableMVHashMap && w.IsRunning() {
env.depsMVFullWriteList = append(env.depsMVFullWriteList, env.state.MVFullWriteList()) env.depsMVFullWriteList = append(env.depsMVFullWriteList, env.state.MVFullWriteList())
env.mvReadMapList = append(env.mvReadMapList, env.state.MVReadMap()) env.mvReadMapList = append(env.mvReadMapList, env.state.MVReadMap())
@ -1100,7 +1100,7 @@ mainloop:
txs.Pop() txs.Pop()
} }
if EnableMVHashMap { if EnableMVHashMap && w.IsRunning() {
env.state.ClearReadMap() env.state.ClearReadMap()
env.state.ClearWriteMap() env.state.ClearWriteMap()
} }

View file

@ -1,5 +1,5 @@
Source: bor Source: bor
Version: 1.2.3 Version: 1.2.5-beta
Section: develop Section: develop
Priority: standard Priority: standard
Maintainer: Polygon <release-team@polygon.technology> Maintainer: Polygon <release-team@polygon.technology>

View file

@ -1,5 +1,5 @@
Source: bor Source: bor
Version: 1.2.3 Version: 1.2.5-beta
Section: develop Section: develop
Priority: standard Priority: standard
Maintainer: Polygon <release-team@polygon.technology> Maintainer: Polygon <release-team@polygon.technology>

View file

@ -1,5 +1,5 @@
Source: bor-profile Source: bor-profile
Version: 1.2.3 Version: 1.2.5-beta
Section: develop Section: develop
Priority: standard Priority: standard
Maintainer: Polygon <release-team@polygon.technology> Maintainer: Polygon <release-team@polygon.technology>

View file

@ -1,5 +1,5 @@
Source: bor-profile Source: bor-profile
Version: 1.2.3 Version: 1.2.5-beta
Section: develop Section: develop
Priority: standard Priority: standard
Maintainer: Polygon <release-team@polygon.technology> Maintainer: Polygon <release-team@polygon.technology>

View file

@ -1,5 +1,5 @@
Source: bor-profile Source: bor-profile
Version: 1.2.3 Version: 1.2.5-beta
Section: develop Section: develop
Priority: standard Priority: standard
Maintainer: Polygon <release-team@polygon.technology> Maintainer: Polygon <release-team@polygon.technology>

View file

@ -1,5 +1,5 @@
Source: bor-profile Source: bor-profile
Version: 1.2.3 Version: 1.2.5-beta
Section: develop Section: develop
Priority: standard Priority: standard
Maintainer: Polygon <release-team@polygon.technology> Maintainer: Polygon <release-team@polygon.technology>

View file

@ -199,6 +199,7 @@ var (
BerlinBlock: big.NewInt(13996000), BerlinBlock: big.NewInt(13996000),
LondonBlock: big.NewInt(22640000), LondonBlock: big.NewInt(22640000),
ShanghaiBlock: big.NewInt(41874000), ShanghaiBlock: big.NewInt(41874000),
CancunBlock: big.NewInt(45648608),
Bor: &BorConfig{ Bor: &BorConfig{
JaipurBlock: big.NewInt(22770000), JaipurBlock: big.NewInt(22770000),
DelhiBlock: big.NewInt(29638656), DelhiBlock: big.NewInt(29638656),

View file

@ -23,8 +23,8 @@ import (
const ( const (
VersionMajor = 1 // Major version component of the current release VersionMajor = 1 // Major version component of the current release
VersionMinor = 2 // Minor version component of the current release VersionMinor = 2 // Minor version component of the current release
VersionPatch = 3 // Patch version component of the current release VersionPatch = 5 // Patch version component of the current release
VersionMeta = "" // Version metadata to append to the version string VersionMeta = "beta" // Version metadata to append to the version string
) )
var GitCommit string var GitCommit string