Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.5 candidate #1161

Closed
wants to merge 11 commits into from
1 change: 1 addition & 0 deletions builder/files/genesis-testnet-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"berlinBlock": 13996000,
"londonBlock": 22640000,
"shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor": {
"jaipurBlock": 22770000,
"delhiBlock": 29638656,
Expand Down
13 changes: 12 additions & 1 deletion cmd/bootnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.

// bootnode runs a bootstrap node for the Ethereum Discovery Protocol.
package main
// Keep package as bootnode during upstram merge.
package bootnode

import (
"crypto/ecdsa"
Expand All @@ -34,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/netutil"
)

// nolint
func main() {
var (
listenAddr = flag.String("addr", ":30301", "listen address")
Expand Down Expand Up @@ -213,3 +215,12 @@ func doPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) *

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)
}
14 changes: 7 additions & 7 deletions core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,29 +373,29 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
itx.BlobHashes = dec.BlobVersionedHashes

// signature R
var ok bool
var overflow bool
if dec.R == nil {
return errors.New("missing required field 'r' in transaction")
}
itx.R, ok = uint256.FromBig((*big.Int)(dec.R))
if !ok {
itx.R, overflow = uint256.FromBig((*big.Int)(dec.R))
if overflow {
return errors.New("'r' value overflows uint256")
}
// signature S
if dec.S == nil {
return errors.New("missing required field 's' in transaction")
}
itx.S, ok = uint256.FromBig((*big.Int)(dec.S))
if !ok {
itx.S, overflow = uint256.FromBig((*big.Int)(dec.S))
if overflow {
return errors.New("'s' value overflows uint256")
}
// signature V
vbig, err := dec.yParityValue()
if err != nil {
return err
}
itx.V, ok = uint256.FromBig(vbig)
if !ok {
itx.V, overflow = uint256.FromBig(vbig)
if overflow {
return errors.New("'v' value overflows uint256")
}
if itx.V.Sign() != 0 || itx.R.Sign() != 0 || itx.S.Sign() != 0 {
Expand Down
6 changes: 4 additions & 2 deletions eth/bor_checkpoint_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ var (
rewindLengthMeter = metrics.NewRegisteredMeter("chain/autorewind/length", nil)
)

const maxRewindLen uint64 = 126

type borVerifier struct {
verify func(ctx context.Context, eth *Ethereum, handler *ethHandler, start uint64, end uint64, hash string, isCheckpoint bool) (string, error)
}
Expand Down Expand Up @@ -117,8 +119,8 @@ func borVerify(ctx context.Context, eth *Ethereum, handler *ethHandler, start ui
}
}

if head-rewindTo > 255 {
rewindTo = head - 255
if head-rewindTo > maxRewindLen {
rewindTo = head - maxRewindLen
}

if isCheckpoint {
Expand Down
27 changes: 10 additions & 17 deletions internal/cli/bootnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"syscall"
"time"

"github.com/ethereum/go-ethereum/cmd/bootnode"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/cli/flagset"
Expand Down Expand Up @@ -213,33 +214,25 @@ func (b *BootnodeCommand) Run(args []string) int {
}

conn, err := net.ListenUDP("udp", addr)

if err != nil {
b.UI.Error(fmt.Sprintf("failed to listen udp addr '%s': %v", b.listenAddr, err))
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")
}
db, _ := enode.OpenDB("")
ln := enode.NewLocalNode(db, nodeKey)

if ext, err := natm.ExternalIP(); err == nil {
// nolint: govet
realaddr = &net.UDPAddr{IP: ext, Port: realaddr.Port}
listenerAddr := conn.LocalAddr().(*net.UDPAddr)
if natm != nil {
natAddr := bootnode.DoPortMapping(natm, ln, listenerAddr)
if natAddr != nil {
listenerAddr = natAddr
}
}

n := enode.NewV4(&nodeKey.PublicKey, addr.IP, addr.Port, addr.Port)
b.UI.Info(n.String())

if b.dryRun {
return 0
}
bootnode.PrintNotice(&nodeKey.PublicKey, *listenerAddr)

db, _ := enode.OpenDB("")
ln := enode.NewLocalNode(db, nodeKey)
cfg := discover.Config{
PrivateKey: nodeKey,
Log: log.Root(),
Expand Down
1 change: 1 addition & 0 deletions internal/cli/server/chains/mumbai.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var mumbaiTestnet = &Chain{
BerlinBlock: big.NewInt(13996000),
LondonBlock: big.NewInt(22640000),
ShanghaiBlock: big.NewInt(41874000),
CancunBlock: big.NewInt(45648608),
Bor: &params.BorConfig{
JaipurBlock: big.NewInt(22770000),
DelhiBlock: big.NewInt(29638656),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"berlinBlock": 13996000,
"londonBlock": 13996000,
"shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor": {
"period": {
"0": 2,
Expand Down
1 change: 1 addition & 0 deletions internal/cli/server/chains/test_files/chain_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"berlinBlock":13996000,
"londonBlock":13996000,
"shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor":{
"period":{
"0":2,
Expand Down
8 changes: 4 additions & 4 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
EnableMVHashMap := w.chainConfig.IsCancun(env.header.Number)

// create and add empty mvHashMap in statedb
if EnableMVHashMap {
if EnableMVHashMap && w.IsRunning() {
deps = map[int]map[int]bool{}

chDeps = make(chan blockstm.TxDep)
Expand Down Expand Up @@ -956,7 +956,7 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
mainloop:
for {
if interruptCtx != nil {
if EnableMVHashMap {
if EnableMVHashMap && w.IsRunning() {
env.state.AddEmptyMVHashMap()
}

Expand Down Expand Up @@ -1055,7 +1055,7 @@ mainloop:
coalescedLogs = append(coalescedLogs, logs...)
env.tcount++

if EnableMVHashMap {
if EnableMVHashMap && w.IsRunning() {
env.depsMVFullWriteList = append(env.depsMVFullWriteList, env.state.MVFullWriteList())
env.mvReadMapList = append(env.mvReadMapList, env.state.MVReadMap())

Expand Down Expand Up @@ -1085,7 +1085,7 @@ mainloop:
txs.Pop()
}

if EnableMVHashMap {
if EnableMVHashMap && w.IsRunning() {
env.state.ClearReadMap()
env.state.ClearWriteMap()
}
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor
Version: 1.2.3
Version: 1.2.5
Section: develop
Priority: standard
Maintainer: Polygon <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor
Version: 1.2.3
Version: 1.2.5
Section: develop
Priority: standard
Maintainer: Polygon <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.profile.amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.5
Section: develop
Priority: standard
Maintainer: Polygon <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.profile.arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.5
Section: develop
Priority: standard
Maintainer: Polygon <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.validator
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.5
Section: develop
Priority: standard
Maintainer: Polygon <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.5
Section: develop
Priority: standard
Maintainer: Polygon <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ var (
BerlinBlock: big.NewInt(13996000),
LondonBlock: big.NewInt(22640000),
ShanghaiBlock: big.NewInt(41874000),
CancunBlock: big.NewInt(45648608),
Bor: &BorConfig{
JaipurBlock: big.NewInt(22770000),
DelhiBlock: big.NewInt(29638656),
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const (
VersionMajor = 1 // Major 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
)

Expand Down
Loading